Changeset 94937 in vbox
- Timestamp:
- May 9, 2022 9:10:16 AM (3 years ago)
- svn:sync-xref-src-repo-rev:
- 151345
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/HGCM.cpp
r93444 r94937 357 357 RTErrInfoInitStatic(&ErrInfo); 358 358 359 int rc;359 int vrc; 360 360 361 361 if (RTPathHasPath(m_pszSvcLibrary)) 362 rc = SUPR3HardenedLdrLoadPlugIn(m_pszSvcLibrary, &m_hLdrMod, &ErrInfo.Core);362 vrc = SUPR3HardenedLdrLoadPlugIn(m_pszSvcLibrary, &m_hLdrMod, &ErrInfo.Core); 363 363 else 364 rc = SUPR3HardenedLdrLoadAppPriv(m_pszSvcLibrary, &m_hLdrMod, RTLDRLOAD_FLAGS_LOCAL, &ErrInfo.Core);365 366 if (RT_SUCCESS( rc))364 vrc = SUPR3HardenedLdrLoadAppPriv(m_pszSvcLibrary, &m_hLdrMod, RTLDRLOAD_FLAGS_LOCAL, &ErrInfo.Core); 365 366 if (RT_SUCCESS(vrc)) 367 367 { 368 368 LogFlowFunc(("successfully loaded the library.\n")); … … 370 370 m_pfnLoad = NULL; 371 371 372 rc = RTLdrGetSymbol(m_hLdrMod, VBOX_HGCM_SVCLOAD_NAME, (void**)&m_pfnLoad);373 374 if (RT_FAILURE( rc) || !m_pfnLoad)375 { 376 Log(("HGCMService::loadServiceDLL: Error resolving the service entry point %s, rc = %d, m_pfnLoad = %p\n",377 VBOX_HGCM_SVCLOAD_NAME, rc, m_pfnLoad));378 379 if (RT_SUCCESS( rc))372 vrc = RTLdrGetSymbol(m_hLdrMod, VBOX_HGCM_SVCLOAD_NAME, (void**)&m_pfnLoad); 373 374 if (RT_FAILURE(vrc) || !m_pfnLoad) 375 { 376 Log(("HGCMService::loadServiceDLL: Error resolving the service entry point %s, vrc = %Rrc, m_pfnLoad = %p\n", 377 VBOX_HGCM_SVCLOAD_NAME, vrc, m_pfnLoad)); 378 379 if (RT_SUCCESS(vrc)) 380 380 { 381 381 /* m_pfnLoad was NULL */ 382 rc = VERR_SYMBOL_NOT_FOUND;382 vrc = VERR_SYMBOL_NOT_FOUND; 383 383 } 384 384 } 385 385 386 if (RT_SUCCESS( rc))386 if (RT_SUCCESS(vrc)) 387 387 { 388 388 RT_ZERO(m_fntable); … … 402 402 /** @todo provide way to configure different values via extra data. */ 403 403 404 rc = m_pfnLoad(&m_fntable);405 406 LogFlowFunc(("m_pfnLoad rc = %Rrc\n",rc));407 408 if (RT_SUCCESS( rc))404 vrc = m_pfnLoad(&m_fntable); 405 406 LogFlowFunc(("m_pfnLoad vrc = %Rrc\n", vrc)); 407 408 if (RT_SUCCESS(vrc)) 409 409 { 410 410 if ( m_fntable.pfnUnload != NULL … … 434 434 Log(("HGCMService::loadServiceDLL: at least one of function pointers is NULL\n")); 435 435 436 rc = VERR_INVALID_PARAMETER;436 vrc = VERR_INVALID_PARAMETER; 437 437 438 438 if (m_fntable.pfnUnload) … … 446 446 else 447 447 { 448 LogRel(("HGCM: Failed to load the service library: [%s], rc = %Rrc - %s. The service will be not available.\n",449 m_pszSvcLibrary, rc, ErrInfo.Core.pszMsg));448 LogRel(("HGCM: Failed to load the service library: [%s], vrc = %Rrc - %s. The service will be not available.\n", 449 m_pszSvcLibrary, vrc, ErrInfo.Core.pszMsg)); 450 450 m_hLdrMod = NIL_RTLDRMOD; 451 451 } 452 452 453 if (RT_FAILURE( rc))453 if (RT_FAILURE(vrc)) 454 454 { 455 455 unloadServiceDLL(); 456 456 } 457 457 458 return rc;458 return vrc; 459 459 } 460 460 … … 672 672 { 673 673 HGCMMsgCore *pMsgCore; 674 int rc = hgcmMsgGet(pThread, &pMsgCore);675 676 if (RT_FAILURE( rc))674 int vrc = hgcmMsgGet(pThread, &pMsgCore); 675 676 if (RT_FAILURE(vrc)) 677 677 { 678 678 /* The error means some serious unrecoverable problem in the hgcmMsg/hgcmThread layer. */ 679 AssertMsgFailed(("%Rrc\n", rc));679 AssertMsgFailed(("%Rrc\n", vrc)); 680 680 break; 681 681 } … … 691 691 { 692 692 LogFlowFunc(("SVC_MSG_LOAD\n")); 693 rc = pSvc->loadServiceDLL();693 vrc = pSvc->loadServiceDLL(); 694 694 } break; 695 695 … … 717 717 { 718 718 pSvc->m_fInConnectOrDisconnect = true; 719 rc = pSvc->m_fntable.pfnConnect(pSvc->m_fntable.pvService, pMsg->u32ClientId,720 HGCM_CLIENT_DATA(pSvc, pClient),721 pMsg->fRequestor, pMsg->fRestoring);719 vrc = pSvc->m_fntable.pfnConnect(pSvc->m_fntable.pvService, pMsg->u32ClientId, 720 HGCM_CLIENT_DATA(pSvc, pClient), 721 pMsg->fRequestor, pMsg->fRestoring); 722 722 pSvc->m_fInConnectOrDisconnect = false; 723 723 … … 726 726 else 727 727 { 728 rc = VERR_HGCM_INVALID_CLIENT_ID;728 vrc = VERR_HGCM_INVALID_CLIENT_ID; 729 729 } 730 730 } break; … … 739 739 { 740 740 pSvc->m_fInConnectOrDisconnect = true; 741 rc = pSvc->m_fntable.pfnDisconnect(pSvc->m_fntable.pvService, pMsg->u32ClientId,742 HGCM_CLIENT_DATA(pSvc, pMsg->pClient));741 vrc = pSvc->m_fntable.pfnDisconnect(pSvc->m_fntable.pvService, pMsg->u32ClientId, 742 HGCM_CLIENT_DATA(pSvc, pMsg->pClient)); 743 743 pSvc->m_fInConnectOrDisconnect = false; 744 744 } 745 745 else 746 746 { 747 rc = VERR_HGCM_INVALID_CLIENT_ID;747 vrc = VERR_HGCM_INVALID_CLIENT_ID; 748 748 } 749 749 } break; … … 768 768 else 769 769 { 770 rc = VERR_HGCM_INVALID_CLIENT_ID;770 vrc = VERR_HGCM_INVALID_CLIENT_ID; 771 771 } 772 772 } break; … … 788 788 else 789 789 { 790 rc = VERR_HGCM_INVALID_CLIENT_ID;790 vrc = VERR_HGCM_INVALID_CLIENT_ID; 791 791 } 792 792 } break; … … 799 799 pMsg->u32Function, pMsg->cParms, pMsg->paParms)); 800 800 801 rc = pSvc->m_fntable.pfnHostCall(pSvc->m_fntable.pvService, pMsg->u32Function, pMsg->cParms, pMsg->paParms);801 vrc = pSvc->m_fntable.pfnHostCall(pSvc->m_fntable.pvService, pMsg->u32Function, pMsg->cParms, pMsg->paParms); 802 802 } break; 803 803 … … 815 815 bool fHaveClientState = pSvc->m_fntable.pfnLoadState != NULL; 816 816 if (pMsg->uVersion > HGCM_SAVED_STATE_VERSION_V2) 817 rc = pMsg->pVMM->pfnSSMR3GetBool(pMsg->pSSM, &fHaveClientState);817 vrc = pMsg->pVMM->pfnSSMR3GetBool(pMsg->pSSM, &fHaveClientState); 818 818 else 819 rc = VINF_SUCCESS;820 if (RT_SUCCESS( rc) )819 vrc = VINF_SUCCESS; 820 if (RT_SUCCESS(vrc) ) 821 821 { 822 822 if (pSvc->m_fntable.pfnLoadState) 823 rc = pSvc->m_fntable.pfnLoadState(pSvc->m_fntable.pvService, pMsg->u32ClientId,824 HGCM_CLIENT_DATA(pSvc, pClient), pMsg->pSSM, pMsg->pVMM,825 fHaveClientState ? pMsg->uVersion : 0);823 vrc = pSvc->m_fntable.pfnLoadState(pSvc->m_fntable.pvService, pMsg->u32ClientId, 824 HGCM_CLIENT_DATA(pSvc, pClient), pMsg->pSSM, pMsg->pVMM, 825 fHaveClientState ? pMsg->uVersion : 0); 826 826 else 827 AssertLogRelStmt(!fHaveClientState, rc = VERR_INTERNAL_ERROR_5);827 AssertLogRelStmt(!fHaveClientState, vrc = VERR_INTERNAL_ERROR_5); 828 828 } 829 829 hgcmObjDereference(pClient); … … 831 831 else 832 832 { 833 rc = VERR_HGCM_INVALID_CLIENT_ID;833 vrc = VERR_HGCM_INVALID_CLIENT_ID; 834 834 } 835 835 } break; … … 843 843 HGCMClient *pClient = HGCMClient::ReferenceByHandle(pMsg->u32ClientId); 844 844 845 rc = VINF_SUCCESS;845 vrc = VINF_SUCCESS; 846 846 847 847 if (pClient) 848 848 { 849 849 pMsg->pVMM->pfnSSMR3PutU32(pMsg->pSSM, pClient->fRequestor); /* Quicker to save this here than in the message sender. */ 850 rc = pMsg->pVMM->pfnSSMR3PutBool(pMsg->pSSM, pSvc->m_fntable.pfnSaveState != NULL);851 if (RT_SUCCESS( rc) && pSvc->m_fntable.pfnSaveState)850 vrc = pMsg->pVMM->pfnSSMR3PutBool(pMsg->pSSM, pSvc->m_fntable.pfnSaveState != NULL); 851 if (RT_SUCCESS(vrc) && pSvc->m_fntable.pfnSaveState) 852 852 { 853 853 g_fSaveState = true; 854 rc = pSvc->m_fntable.pfnSaveState(pSvc->m_fntable.pvService, pMsg->u32ClientId,855 HGCM_CLIENT_DATA(pSvc, pClient), pMsg->pSSM, pMsg->pVMM);854 vrc = pSvc->m_fntable.pfnSaveState(pSvc->m_fntable.pvService, pMsg->u32ClientId, 855 HGCM_CLIENT_DATA(pSvc, pClient), pMsg->pSSM, pMsg->pVMM); 856 856 g_fSaveState = false; 857 857 } … … 861 861 else 862 862 { 863 rc = VERR_HGCM_INVALID_CLIENT_ID;863 vrc = VERR_HGCM_INVALID_CLIENT_ID; 864 864 } 865 865 } break; … … 873 873 if (pSvc->m_hExtension) 874 874 { 875 rc = VERR_NOT_SUPPORTED;875 vrc = VERR_NOT_SUPPORTED; 876 876 } 877 877 else … … 879 879 if (pSvc->m_fntable.pfnRegisterExtension) 880 880 { 881 rc = pSvc->m_fntable.pfnRegisterExtension(pSvc->m_fntable.pvService, pMsg->pfnExtension,882 pMsg->pvExtension);881 vrc = pSvc->m_fntable.pfnRegisterExtension(pSvc->m_fntable.pvService, pMsg->pfnExtension, 882 pMsg->pvExtension); 883 883 } 884 884 else 885 885 { 886 rc = VERR_NOT_SUPPORTED;886 vrc = VERR_NOT_SUPPORTED; 887 887 } 888 888 889 if (RT_SUCCESS( rc))889 if (RT_SUCCESS(vrc)) 890 890 { 891 891 pSvc->m_hExtension = pMsg->handle; … … 902 902 if (pSvc->m_hExtension != pMsg->handle) 903 903 { 904 rc = VERR_NOT_SUPPORTED;904 vrc = VERR_NOT_SUPPORTED; 905 905 } 906 906 else … … 908 908 if (pSvc->m_fntable.pfnRegisterExtension) 909 909 { 910 rc = pSvc->m_fntable.pfnRegisterExtension(pSvc->m_fntable.pvService, NULL, NULL);910 vrc = pSvc->m_fntable.pfnRegisterExtension(pSvc->m_fntable.pvService, NULL, NULL); 911 911 } 912 912 else 913 913 { 914 rc = VERR_NOT_SUPPORTED;914 vrc = VERR_NOT_SUPPORTED; 915 915 } 916 916 … … 931 931 { 932 932 AssertMsgFailed(("hgcmServiceThread::Unsupported message number %08X\n", u32MsgId)); 933 rc = VERR_NOT_SUPPORTED;933 vrc = VERR_NOT_SUPPORTED; 934 934 } break; 935 935 } … … 940 940 * Other messages have to be completed here. 941 941 */ 942 hgcmMsgComplete (pMsgCore, rc);942 hgcmMsgComplete (pMsgCore, vrc); 943 943 } 944 944 STAM_REL_PROFILE_STOP(&pSvc->m_StatHandleMsg, a); … … 976 976 /* Resolve the client ID and verify that it belongs to this service before 977 977 trying to disconnect it. */ 978 int rc = VERR_NOT_FOUND;978 int vrc = VERR_NOT_FOUND; 979 979 HGCMClient * const pClient = HGCMClient::ReferenceByHandle(idClient); 980 980 if (pClient) 981 981 { 982 982 if (pClient->pService == pService) 983 rc = pService->DisconnectClient(idClient, true, pClient);983 vrc = pService->DisconnectClient(idClient, true, pClient); 984 984 hgcmObjDereference(pClient); 985 985 } 986 return rc;986 return vrc; 987 987 } 988 988 … … 1143 1143 RTStrCopy(szThreadName, sizeof(szThreadName), pszServiceName); 1144 1144 1145 int rc = hgcmThreadCreate(&m_pThread, szThreadName, hgcmServiceThread, this, pszServiceName, pUVM, pVMM);1146 if (RT_SUCCESS( rc))1145 int vrc = hgcmThreadCreate(&m_pThread, szThreadName, hgcmServiceThread, this, pszServiceName, pUVM, pVMM); 1146 if (RT_SUCCESS(vrc)) 1147 1147 { 1148 1148 m_pszSvcName = RTStrDup(pszServiceName); … … 1157 1157 m_pszSvcName = NULL; 1158 1158 1159 rc = VERR_NO_MEMORY;1159 vrc = VERR_NO_MEMORY; 1160 1160 } 1161 1161 else … … 1182 1182 /* Execute the load request on the service thread. */ 1183 1183 HGCMMsgCore *pCoreMsg; 1184 rc = hgcmMsgAlloc(m_pThread, &pCoreMsg, SVC_MSG_LOAD, hgcmMessageAllocSvc);1185 1186 if (RT_SUCCESS( rc))1184 vrc = hgcmMsgAlloc(m_pThread, &pCoreMsg, SVC_MSG_LOAD, hgcmMessageAllocSvc); 1185 1186 if (RT_SUCCESS(vrc)) 1187 1187 { 1188 1188 HGCMMsgSvcLoad *pMsg = (HGCMMsgSvcLoad *)pCoreMsg; … … 1190 1190 pMsg->pUVM = pUVM; 1191 1191 1192 rc = hgcmMsgSend(pMsg);1192 vrc = hgcmMsgSend(pMsg); 1193 1193 } 1194 1194 } 1195 1195 } 1196 1196 1197 if (RT_FAILURE( rc))1197 if (RT_FAILURE(vrc)) 1198 1198 { 1199 1199 instanceDestroy(); 1200 1200 } 1201 1201 1202 LogFlowFunc((" rc = %Rrc\n",rc));1203 return rc;1202 LogFlowFunc(("vrc = %Rrc\n", vrc)); 1203 return vrc; 1204 1204 } 1205 1205 … … 1242 1242 1243 1243 HGCMMsgCore *pMsg; 1244 int rc = hgcmMsgAlloc(m_pThread, &pMsg, SVC_MSG_UNLOAD, hgcmMessageAllocSvc);1245 1246 if (RT_SUCCESS( rc))1247 { 1248 rc = hgcmMsgSend(pMsg);1249 1250 if (RT_SUCCESS( rc))1244 int vrc = hgcmMsgAlloc(m_pThread, &pMsg, SVC_MSG_UNLOAD, hgcmMessageAllocSvc); 1245 1246 if (RT_SUCCESS(vrc)) 1247 { 1248 vrc = hgcmMsgSend(pMsg); 1249 1250 if (RT_SUCCESS(vrc)) 1251 1251 hgcmThreadWait(m_pThread); 1252 1252 } … … 1275 1275 1276 1276 HGCMMsgCore *pCoreMsg; 1277 int rc = hgcmMsgAlloc(m_pThread, &pCoreMsg, SVC_MSG_SAVESTATE, hgcmMessageAllocSvc);1278 1279 if (RT_SUCCESS( rc))1277 int vrc = hgcmMsgAlloc(m_pThread, &pCoreMsg, SVC_MSG_SAVESTATE, hgcmMessageAllocSvc); 1278 1279 if (RT_SUCCESS(vrc)) 1280 1280 { 1281 1281 HGCMMsgLoadSaveStateClient *pMsg = (HGCMMsgLoadSaveStateClient *)pCoreMsg; … … 1285 1285 pMsg->pVMM = pVMM; 1286 1286 1287 rc = hgcmMsgSend(pMsg);1288 } 1289 1290 LogFlowFunc((" rc = %Rrc\n",rc));1291 return rc;1287 vrc = hgcmMsgSend(pMsg); 1288 } 1289 1290 LogFlowFunc(("vrc = %Rrc\n", vrc)); 1291 return vrc; 1292 1292 } 1293 1293 … … 1297 1297 1298 1298 HGCMMsgCore *pCoreMsg; 1299 int rc = hgcmMsgAlloc(m_pThread, &pCoreMsg, SVC_MSG_LOADSTATE, hgcmMessageAllocSvc);1300 1301 if (RT_SUCCESS( rc))1299 int vrc = hgcmMsgAlloc(m_pThread, &pCoreMsg, SVC_MSG_LOADSTATE, hgcmMessageAllocSvc); 1300 1301 if (RT_SUCCESS(vrc)) 1302 1302 { 1303 1303 HGCMMsgLoadSaveStateClient *pMsg = (HGCMMsgLoadSaveStateClient *)pCoreMsg; … … 1308 1308 pMsg->u32ClientId = u32ClientId; 1309 1309 1310 rc = hgcmMsgSend(pMsg);1311 } 1312 1313 LogFlowFunc((" rc = %Rrc\n",rc));1314 return rc;1310 vrc = hgcmMsgSend(pMsg); 1311 } 1312 1313 LogFlowFunc(("vrc = %Rrc\n", vrc)); 1314 return vrc; 1315 1315 } 1316 1316 … … 1335 1335 1336 1336 HGCMService *pSvc; 1337 int rc = HGCMService::ResolveService(&pSvc, pszServiceName);1338 1339 if (RT_SUCCESS( rc))1337 int vrc = HGCMService::ResolveService(&pSvc, pszServiceName); 1338 1339 if (RT_SUCCESS(vrc)) 1340 1340 { 1341 1341 /* The service is already loaded. */ 1342 1342 pSvc->ReleaseService(); 1343 rc = VERR_HGCM_SERVICE_EXISTS;1343 vrc = VERR_HGCM_SERVICE_EXISTS; 1344 1344 } 1345 1345 else … … 1350 1350 if (!pSvc) 1351 1351 { 1352 rc = VERR_NO_MEMORY;1352 vrc = VERR_NO_MEMORY; 1353 1353 } 1354 1354 else 1355 1355 { 1356 1356 /* Load the library and call the initialization entry point. */ 1357 rc = pSvc->instanceCreate(pszServiceLibrary, pszServiceName, pUVM, pVMM, pHgcmPort);1358 if (RT_SUCCESS( rc))1357 vrc = pSvc->instanceCreate(pszServiceLibrary, pszServiceName, pUVM, pVMM, pHgcmPort); 1358 if (RT_SUCCESS(vrc)) 1359 1359 { 1360 1360 /* Insert the just created service to list for future references. */ … … 1380 1380 } 1381 1381 1382 LogFlowFunc((" rc = %Rrc\n",rc));1383 return rc;1382 LogFlowFunc(("vrc = %Rrc\n", vrc)); 1383 return vrc; 1384 1384 } 1385 1385 … … 1555 1555 { 1556 1556 /* Save the current handle count and restore afterwards to avoid client id conflicts. */ 1557 int rc = pVMM->pfnSSMR3PutU32(pSSM, hgcmObjQueryHandleCount());1558 AssertRCReturn( rc,rc);1557 int vrc = pVMM->pfnSSMR3PutU32(pSSM, hgcmObjQueryHandleCount()); 1558 AssertRCReturn(vrc, vrc); 1559 1559 1560 1560 LogFlowFunc(("%d services to be saved:\n", sm_cServices)); 1561 1561 1562 1562 /* Save number of services. */ 1563 rc = pVMM->pfnSSMR3PutU32(pSSM, sm_cServices);1564 AssertRCReturn( rc,rc);1563 vrc = pVMM->pfnSSMR3PutU32(pSSM, sm_cServices); 1564 AssertRCReturn(vrc, vrc); 1565 1565 1566 1566 /* Save every service. */ … … 1572 1572 1573 1573 /* Save the length of the service name. */ 1574 rc = pVMM->pfnSSMR3PutU32(pSSM, (uint32_t) strlen(pSvc->m_pszSvcName) + 1);1575 AssertRCReturn( rc,rc);1574 vrc = pVMM->pfnSSMR3PutU32(pSSM, (uint32_t) strlen(pSvc->m_pszSvcName) + 1); 1575 AssertRCReturn(vrc, vrc); 1576 1576 1577 1577 /* Save the name of the service. */ 1578 rc = pVMM->pfnSSMR3PutStrZ(pSSM, pSvc->m_pszSvcName);1579 AssertRCReturn( rc,rc);1578 vrc = pVMM->pfnSSMR3PutStrZ(pSSM, pSvc->m_pszSvcName); 1579 AssertRCReturn(vrc, vrc); 1580 1580 1581 1581 /* Save the number of clients. */ 1582 rc = pVMM->pfnSSMR3PutU32(pSSM, pSvc->m_cClients);1583 AssertRCReturn( rc,rc);1582 vrc = pVMM->pfnSSMR3PutU32(pSSM, pSvc->m_cClients); 1583 AssertRCReturn(vrc, vrc); 1584 1584 1585 1585 /* Call the service for every client. Normally a service must not have … … 1596 1596 1597 1597 /* Save the client id. (fRequestor is saved via SVC_MSG_SAVESTATE for convenience.) */ 1598 rc = pVMM->pfnSSMR3PutU32(pSSM, u32ClientId);1599 AssertRCReturn( rc,rc);1598 vrc = pVMM->pfnSSMR3PutU32(pSSM, u32ClientId); 1599 AssertRCReturn(vrc, vrc); 1600 1600 1601 1601 /* Call the service, so the operation is executed by the service thread. */ 1602 rc = pSvc->saveClientState(u32ClientId, pSSM, pVMM);1603 AssertRCReturn( rc,rc);1602 vrc = pSvc->saveClientState(u32ClientId, pSSM, pVMM); 1603 AssertRCReturn(vrc, vrc); 1604 1604 } 1605 1605 … … 1623 1623 uint32_t u32; 1624 1624 1625 int rc = pVMM->pfnSSMR3GetU32(pSSM, &u32);1626 AssertRCReturn( rc,rc);1625 int vrc = pVMM->pfnSSMR3GetU32(pSSM, &u32); 1626 AssertRCReturn(vrc, vrc); 1627 1627 1628 1628 hgcmObjSetHandleCount(u32); … … 1631 1631 uint32_t cServices; 1632 1632 1633 rc = pVMM->pfnSSMR3GetU32(pSSM, &cServices);1634 AssertRCReturn( rc,rc);1633 vrc = pVMM->pfnSSMR3GetU32(pSSM, &cServices); 1634 AssertRCReturn(vrc, vrc); 1635 1635 1636 1636 LogFlowFunc(("%d services to be restored:\n", cServices)); … … 1639 1639 { 1640 1640 /* Get the length of the service name. */ 1641 rc = pVMM->pfnSSMR3GetU32(pSSM, &u32);1642 AssertRCReturn( rc,rc);1641 vrc = pVMM->pfnSSMR3GetU32(pSSM, &u32); 1642 AssertRCReturn(vrc, vrc); 1643 1643 AssertReturn(u32 <= VBOX_HGCM_SVC_NAME_MAX_BYTES, VERR_SSM_UNEXPECTED_DATA); 1644 1644 1645 1645 /* Get the service name. */ 1646 1646 char szServiceName[VBOX_HGCM_SVC_NAME_MAX_BYTES]; 1647 rc = pVMM->pfnSSMR3GetStrZ(pSSM, szServiceName, u32);1648 AssertRCReturn( rc,rc);1647 vrc = pVMM->pfnSSMR3GetStrZ(pSSM, szServiceName, u32); 1648 AssertRCReturn(vrc, vrc); 1649 1649 1650 1650 LogRel(("HGCM: Restoring [%s]\n", szServiceName)); … … 1652 1652 /* Resolve the service instance. */ 1653 1653 HGCMService *pSvc; 1654 rc = ResolveService(&pSvc, szServiceName);1655 AssertLogRelMsgReturn(pSvc, (" rc=%Rrc, %s\n",rc, szServiceName), VERR_SSM_UNEXPECTED_DATA);1654 vrc = ResolveService(&pSvc, szServiceName); 1655 AssertLogRelMsgReturn(pSvc, ("vrc=%Rrc, %s\n", vrc, szServiceName), VERR_SSM_UNEXPECTED_DATA); 1656 1656 1657 1657 /* Get the number of clients. */ 1658 1658 uint32_t cClients; 1659 rc = pVMM->pfnSSMR3GetU32(pSSM, &cClients);1660 if (RT_FAILURE( rc))1659 vrc = pVMM->pfnSSMR3GetU32(pSSM, &cClients); 1660 if (RT_FAILURE(vrc)) 1661 1661 { 1662 1662 pSvc->ReleaseService(); 1663 1663 AssertFailed(); 1664 return rc;1664 return vrc; 1665 1665 } 1666 1666 … … 1670 1670 but restored here in time for calling CreateAndConnectClient). */ 1671 1671 uint32_t u32ClientId; 1672 rc = pVMM->pfnSSMR3GetU32(pSSM, &u32ClientId);1672 vrc = pVMM->pfnSSMR3GetU32(pSSM, &u32ClientId); 1673 1673 uint32_t fRequestor = VMMDEV_REQUESTOR_LEGACY; 1674 if (RT_SUCCESS( rc) && uVersion > HGCM_SAVED_STATE_VERSION_V2)1675 rc = pVMM->pfnSSMR3GetU32(pSSM, &fRequestor);1676 AssertLogRelMsgRCReturnStmt( rc, ("rc=%Rrc, %s\n", rc, szServiceName), pSvc->ReleaseService(),rc);1674 if (RT_SUCCESS(vrc) && uVersion > HGCM_SAVED_STATE_VERSION_V2) 1675 vrc = pVMM->pfnSSMR3GetU32(pSSM, &fRequestor); 1676 AssertLogRelMsgRCReturnStmt(vrc, ("vrc=%Rrc, %s\n", vrc, szServiceName), pSvc->ReleaseService(), vrc); 1677 1677 1678 1678 /* Connect the client. */ 1679 rc = pSvc->CreateAndConnectClient(NULL, u32ClientId, fRequestor, true /*fRestoring*/);1680 AssertLogRelMsgRCReturnStmt( rc, ("rc=%Rrc, %s\n", rc, szServiceName), pSvc->ReleaseService(),rc);1679 vrc = pSvc->CreateAndConnectClient(NULL, u32ClientId, fRequestor, true /*fRestoring*/); 1680 AssertLogRelMsgRCReturnStmt(vrc, ("vrc=%Rrc, %s\n", vrc, szServiceName), pSvc->ReleaseService(), vrc); 1681 1681 1682 1682 /* Call the service, so the operation is executed by the service thread. */ 1683 rc = pSvc->loadClientState(u32ClientId, pSSM, pVMM, uVersion);1684 AssertLogRelMsgRCReturnStmt( rc, ("rc=%Rrc, %s\n", rc, szServiceName), pSvc->ReleaseService(),rc);1683 vrc = pSvc->loadClientState(u32ClientId, pSSM, pVMM, uVersion); 1684 AssertLogRelMsgRCReturnStmt(vrc, ("vrc=%Rrc, %s\n", vrc, szServiceName), pSvc->ReleaseService(), vrc); 1685 1685 } 1686 1686 … … 1767 1767 1768 1768 /* Initialize the HGCM part of the client. */ 1769 int rc = pClient->Init(this);1770 1771 if (RT_SUCCESS( rc))1769 int vrc = pClient->Init(this); 1770 1771 if (RT_SUCCESS(vrc)) 1772 1772 { 1773 1773 /* Call the service. */ 1774 1774 HGCMMsgCore *pCoreMsg; 1775 1775 1776 rc = hgcmMsgAlloc(m_pThread, &pCoreMsg, SVC_MSG_CONNECT, hgcmMessageAllocSvc);1777 1778 if (RT_SUCCESS( rc))1776 vrc = hgcmMsgAlloc(m_pThread, &pCoreMsg, SVC_MSG_CONNECT, hgcmMessageAllocSvc); 1777 1778 if (RT_SUCCESS(vrc)) 1779 1779 { 1780 1780 HGCMMsgSvcConnect *pMsg = (HGCMMsgSvcConnect *)pCoreMsg; … … 1784 1784 pMsg->fRestoring = fRestoring; 1785 1785 1786 rc = hgcmMsgSend(pMsg);1787 1788 if (RT_SUCCESS( rc))1786 vrc = hgcmMsgSend(pMsg); 1787 1788 if (RT_SUCCESS(vrc)) 1789 1789 { 1790 1790 /* Add the client Id to the array. */ … … 1809 1809 else 1810 1810 { 1811 rc = VERR_NO_MEMORY;1811 vrc = VERR_NO_MEMORY; 1812 1812 } 1813 1813 } 1814 1814 else 1815 1815 { 1816 rc = VERR_NO_MEMORY;1816 vrc = VERR_NO_MEMORY; 1817 1817 } 1818 1818 } 1819 1819 1820 if (RT_SUCCESS( rc))1820 if (RT_SUCCESS(vrc)) 1821 1821 { 1822 1822 m_paClientIds[m_cClients] = handle; … … 1830 1830 } 1831 1831 1832 if (RT_SUCCESS( rc))1832 if (RT_SUCCESS(vrc)) 1833 1833 { 1834 1834 if (pu32ClientIdOut != NULL) … … 1847 1847 } 1848 1848 1849 LogFlowFunc((" rc = %Rrc\n",rc));1850 return rc;1849 LogFlowFunc(("vrc = %Rrc\n", vrc)); 1850 return vrc; 1851 1851 } 1852 1852 … … 1874 1874 1875 1875 bool fReleaseService = false; 1876 int rc= VERR_NOT_FOUND;1876 int vrc = VERR_NOT_FOUND; 1877 1877 for (uint32_t i = 0; i < m_cClients; i++) 1878 1878 { … … 1891 1891 fReleaseService = true; 1892 1892 1893 rc = VINF_SUCCESS;1893 vrc = VINF_SUCCESS; 1894 1894 break; 1895 1895 } … … 1897 1897 1898 1898 /* Some paranoia wrt to not trusting the client ID array. */ 1899 Assert( rc == VINF_SUCCESS || fFromService);1900 if ( rc == VERR_NOT_FOUND && !fFromService)1899 Assert(vrc == VINF_SUCCESS || fFromService); 1900 if (vrc == VERR_NOT_FOUND && !fFromService) 1901 1901 { 1902 1902 if (m_acClients[pClient->idxCategory] > 0) … … 1908 1908 1909 1909 LogFunc(("idClient=%u m_cClients=%u m_acClients[%u]=%u %s (cPendingCalls=%u) rc=%Rrc\n", u32ClientId, m_cClients, 1910 pClient->idxCategory, m_acClients[pClient->idxCategory], m_pszSvcName, pClient->cPendingCalls, rc));1910 pClient->idxCategory, m_acClients[pClient->idxCategory], m_pszSvcName, pClient->cPendingCalls, vrc)); 1911 1911 1912 1912 /* … … 1918 1918 HGCMMsgCore *pCoreMsg; 1919 1919 1920 rc = hgcmMsgAlloc(m_pThread, &pCoreMsg, SVC_MSG_DISCONNECT, hgcmMessageAllocSvc);1921 1922 if (RT_SUCCESS( rc))1920 vrc = hgcmMsgAlloc(m_pThread, &pCoreMsg, SVC_MSG_DISCONNECT, hgcmMessageAllocSvc); 1921 1922 if (RT_SUCCESS(vrc)) 1923 1923 { 1924 1924 HGCMMsgSvcDisconnect *pMsg = (HGCMMsgSvcDisconnect *)pCoreMsg; … … 1927 1927 pMsg->pClient = pClient; 1928 1928 1929 rc = hgcmMsgSend(pMsg);1929 vrc = hgcmMsgSend(pMsg); 1930 1930 } 1931 1931 else 1932 1932 { 1933 1933 LogRel(("(%d, %d) [%s] hgcmMsgAlloc(%p, SVC_MSG_DISCONNECT) failed %Rrc\n", 1934 u32ClientId, fFromService, RT_VALID_PTR(m_pszSvcName)? m_pszSvcName: "", m_pThread, rc));1934 u32ClientId, fFromService, RT_VALID_PTR(m_pszSvcName)? m_pszSvcName: "", m_pThread, vrc)); 1935 1935 } 1936 1936 } … … 1943 1943 ReleaseService(); 1944 1944 1945 LogFlowFunc((" rc = %Rrc\n",rc));1946 return rc;1945 LogFlowFunc(("vrc = %Rrc\n", vrc)); 1946 return vrc; 1947 1947 } 1948 1948 … … 1955 1955 /* Forward the message to the service thread. */ 1956 1956 HGCMMsgCore *pCoreMsg; 1957 int rc = hgcmMsgAlloc(m_pThread, &pCoreMsg, SVC_MSG_REGEXT, hgcmMessageAllocSvc);1958 1959 if (RT_SUCCESS( rc))1957 int vrc = hgcmMsgAlloc(m_pThread, &pCoreMsg, SVC_MSG_REGEXT, hgcmMessageAllocSvc); 1958 1959 if (RT_SUCCESS(vrc)) 1960 1960 { 1961 1961 HGCMMsgSvcRegisterExtension *pMsg = (HGCMMsgSvcRegisterExtension *)pCoreMsg; … … 1965 1965 pMsg->pvExtension = pvExtension; 1966 1966 1967 rc = hgcmMsgSend(pMsg);1968 } 1969 1970 LogFlowFunc((" rc = %Rrc\n",rc));1971 return rc;1967 vrc = hgcmMsgSend(pMsg); 1968 } 1969 1970 LogFlowFunc(("vrc = %Rrc\n", vrc)); 1971 return vrc; 1972 1972 } 1973 1973 … … 1976 1976 /* Forward the message to the service thread. */ 1977 1977 HGCMMsgCore *pCoreMsg; 1978 int rc = hgcmMsgAlloc(m_pThread, &pCoreMsg, SVC_MSG_UNREGEXT, hgcmMessageAllocSvc);1979 1980 if (RT_SUCCESS( rc))1978 int vrc = hgcmMsgAlloc(m_pThread, &pCoreMsg, SVC_MSG_UNREGEXT, hgcmMessageAllocSvc); 1979 1980 if (RT_SUCCESS(vrc)) 1981 1981 { 1982 1982 HGCMMsgSvcUnregisterExtension *pMsg = (HGCMMsgSvcUnregisterExtension *)pCoreMsg; … … 1984 1984 pMsg->handle = handle; 1985 1985 1986 rc = hgcmMsgSend(pMsg);1987 } 1988 1989 LogFlowFunc((" rc = %Rrc\n",rc));1986 vrc = hgcmMsgSend(pMsg); 1987 } 1988 1989 LogFlowFunc(("vrc = %Rrc\n", vrc)); 1990 1990 } 1991 1991 … … 1997 1997 * for the client if necessary. 1998 1998 */ 1999 int rc = hgcmMsgCompletionCallback(result, pMsgCore);1999 int vrc = hgcmMsgCompletionCallback(result, pMsgCore); 2000 2000 2001 2001 HGCMMsgCall *pMsg = (HGCMMsgCall *)pMsgCore; … … 2009 2009 } 2010 2010 2011 return rc;2011 return vrc; 2012 2012 } 2013 2013 … … 2030 2030 LogFlow(("MAIN::HGCMService::GuestCall\n")); 2031 2031 2032 int rc;2032 int vrc; 2033 2033 HGCMMsgCall *pMsg = new(std::nothrow) HGCMMsgCall(m_pThread); 2034 2034 if (pMsg) … … 2052 2052 pMsg->tsArrival = tsArrival; 2053 2053 2054 rc = hgcmMsgPost(pMsg, hgcmMsgCallCompletionCallback);2055 2056 if (RT_SUCCESS( rc))2054 vrc = hgcmMsgPost(pMsg, hgcmMsgCallCompletionCallback); 2055 2056 if (RT_SUCCESS(vrc)) 2057 2057 { /* Reference donated on success. */ } 2058 2058 else … … 2060 2060 ASMAtomicDecU32(&pClient->cPendingCalls); 2061 2061 pMsg->pcCounter = NULL; 2062 Log(("MAIN::HGCMService::GuestCall: hgcmMsgPost failed: %Rrc\n", rc));2062 Log(("MAIN::HGCMService::GuestCall: hgcmMsgPost failed: %Rrc\n", vrc)); 2063 2063 pMsg->Dereference(); 2064 2064 } … … 2071 2071 pMsg->Dereference(); 2072 2072 STAM_REL_COUNTER_INC(&m_StatTooManyCalls); 2073 rc = VERR_HGCM_TOO_MANY_CLIENT_CALLS;2073 vrc = VERR_HGCM_TOO_MANY_CLIENT_CALLS; 2074 2074 } 2075 2075 } … … 2077 2077 { 2078 2078 Log(("MAIN::HGCMService::GuestCall: Message allocation failed\n")); 2079 rc = VERR_NO_MEMORY;2080 } 2081 2082 LogFlowFunc((" rc = %Rrc\n",rc));2083 return rc;2079 vrc = VERR_NO_MEMORY; 2080 } 2081 2082 LogFlowFunc(("vrc = %Rrc\n", vrc)); 2083 return vrc; 2084 2084 } 2085 2085 … … 2126 2126 2127 2127 HGCMMsgCore *pCoreMsg; 2128 int rc = hgcmMsgAlloc(m_pThread, &pCoreMsg, SVC_MSG_HOSTCALL, hgcmMessageAllocSvc);2129 2130 if (RT_SUCCESS( rc))2128 int vrc = hgcmMsgAlloc(m_pThread, &pCoreMsg, SVC_MSG_HOSTCALL, hgcmMessageAllocSvc); 2129 2130 if (RT_SUCCESS(vrc)) 2131 2131 { 2132 2132 HGCMMsgHostCallSvc *pMsg = (HGCMMsgHostCallSvc *)pCoreMsg; … … 2136 2136 pMsg->paParms = paParms; 2137 2137 2138 rc = hgcmMsgSend(pMsg);2139 } 2140 2141 LogFlowFunc((" rc = %Rrc\n",rc));2142 return rc;2138 vrc = hgcmMsgSend(pMsg); 2139 } 2140 2141 LogFlowFunc(("vrc = %Rrc\n", vrc)); 2142 return vrc; 2143 2143 } 2144 2144 … … 2165 2165 { 2166 2166 HGCMMsgCore *pCoreMsg; 2167 int rc = hgcmMsgAlloc(m_pThread, &pCoreMsg, SVC_MSG_NOTIFY, hgcmMessageAllocSvc);2168 if (RT_SUCCESS( rc))2167 int vrc = hgcmMsgAlloc(m_pThread, &pCoreMsg, SVC_MSG_NOTIFY, hgcmMessageAllocSvc); 2168 if (RT_SUCCESS(vrc)) 2169 2169 { 2170 2170 HGCMMsgNotify *pMsg = (HGCMMsgNotify *)pCoreMsg; 2171 2171 pMsg->enmEvent = enmEvent; 2172 2172 2173 rc = hgcmMsgPost(pMsg, NULL);2174 AssertRC( rc);2173 vrc = hgcmMsgPost(pMsg, NULL); 2174 AssertRC(vrc); 2175 2175 } 2176 2176 } … … 2327 2327 { 2328 2328 HGCMMsgCore *pMsgCore; 2329 int rc = hgcmMsgGet(pThread, &pMsgCore);2330 2331 if (RT_FAILURE( rc))2329 int vrc = hgcmMsgGet(pThread, &pMsgCore); 2330 2331 if (RT_FAILURE(vrc)) 2332 2332 { 2333 2333 /* The error means some serious unrecoverable problem in the hgcmMsg/hgcmThread layer. */ 2334 AssertMsgFailed(("%Rrc\n", rc));2334 AssertMsgFailed(("%Rrc\n", vrc)); 2335 2335 break; 2336 2336 } … … 2350 2350 */ 2351 2351 HGCMService *pService; 2352 rc = HGCMService::ResolveService(&pService, pMsg->pszServiceName);2353 2354 if (RT_SUCCESS( rc))2352 vrc = HGCMService::ResolveService(&pService, pMsg->pszServiceName); 2353 2354 if (RT_SUCCESS(vrc)) 2355 2355 { 2356 2356 /* Call the service instance method. */ 2357 rc = pService->CreateAndConnectClient(pMsg->pu32ClientId,2358 0,2359 pMsg->pHGCMPort->pfnGetRequestor(pMsg->pHGCMPort, pMsg->pCmd),2360 pMsg->pHGCMPort->pfnIsCmdRestored(pMsg->pHGCMPort, pMsg->pCmd));2357 vrc = pService->CreateAndConnectClient(pMsg->pu32ClientId, 2358 0, 2359 pMsg->pHGCMPort->pfnGetRequestor(pMsg->pHGCMPort, pMsg->pCmd), 2360 pMsg->pHGCMPort->pfnIsCmdRestored(pMsg->pHGCMPort, pMsg->pCmd)); 2361 2361 2362 2362 /* Release the service after resolve. */ … … 2376 2376 if (!pClient) 2377 2377 { 2378 rc = VERR_HGCM_INVALID_CLIENT_ID;2378 vrc = VERR_HGCM_INVALID_CLIENT_ID; 2379 2379 break; 2380 2380 } … … 2384 2384 2385 2385 /* Call the service instance to disconnect the client. */ 2386 rc = pService->DisconnectClient(pMsg->u32ClientId, false, pClient);2386 vrc = pService->DisconnectClient(pMsg->u32ClientId, false, pClient); 2387 2387 2388 2388 hgcmObjDereference(pClient); … … 2396 2396 pMsg->pszServiceName, pMsg->pszServiceLibrary, pMsg->pUVM)); 2397 2397 2398 rc = HGCMService::LoadService(pMsg->pszServiceLibrary, pMsg->pszServiceName,2399 pMsg->pUVM, pMsg->pVMM, pMsg->pHgcmPort);2398 vrc = HGCMService::LoadService(pMsg->pszServiceLibrary, pMsg->pszServiceName, 2399 pMsg->pUVM, pMsg->pVMM, pMsg->pHgcmPort); 2400 2400 } break; 2401 2401 … … 2409 2409 /* Resolve the service name to the pointer to service instance. */ 2410 2410 HGCMService *pService; 2411 rc = HGCMService::ResolveService(&pService, pMsg->pszServiceName);2412 2413 if (RT_SUCCESS( rc))2411 vrc = HGCMService::ResolveService(&pService, pMsg->pszServiceName); 2412 2413 if (RT_SUCCESS(vrc)) 2414 2414 { 2415 rc = pService->HostCall(pMsg->u32Function, pMsg->cParms, pMsg->paParms);2415 vrc = pService->HostCall(pMsg->u32Function, pMsg->cParms, pMsg->paParms); 2416 2416 2417 2417 pService->ReleaseService(); … … 2445 2445 LogFlowFunc(("HGCM_MSG_LOADSTATE\n")); 2446 2446 2447 rc = HGCMService::LoadState(pMsg->pSSM, pMsg->pVMM, pMsg->uVersion);2447 vrc = HGCMService::LoadState(pMsg->pSSM, pMsg->pVMM, pMsg->uVersion); 2448 2448 } break; 2449 2449 … … 2454 2454 LogFlowFunc(("HGCM_MSG_SAVESTATE\n")); 2455 2455 2456 rc = HGCMService::SaveState(pMsg->pSSM, pMsg->pVMM);2456 vrc = HGCMService::SaveState(pMsg->pSSM, pMsg->pVMM); 2457 2457 } break; 2458 2458 … … 2480 2480 if (handle == NULL) 2481 2481 { 2482 rc = VERR_NO_MEMORY;2482 vrc = VERR_NO_MEMORY; 2483 2483 } 2484 2484 else … … 2488 2488 2489 2489 HGCMService *pService; 2490 rc = HGCMService::ResolveService(&pService, handle->pszServiceName);2491 2492 if (RT_SUCCESS( rc))2490 vrc = HGCMService::ResolveService(&pService, handle->pszServiceName); 2491 2492 if (RT_SUCCESS(vrc)) 2493 2493 { 2494 2494 pService->RegisterExtension(handle, pMsg->pfnExtension, pMsg->pvExtension); … … 2497 2497 } 2498 2498 2499 if (RT_FAILURE( rc))2499 if (RT_FAILURE(vrc)) 2500 2500 { 2501 2501 RTMemFree(handle); … … 2515 2515 2516 2516 HGCMService *pService; 2517 rc = HGCMService::ResolveService(&pService, pMsg->handle->pszServiceName);2518 2519 if (RT_SUCCESS( rc))2517 vrc = HGCMService::ResolveService(&pService, pMsg->handle->pszServiceName); 2518 2519 if (RT_SUCCESS(vrc)) 2520 2520 { 2521 2521 pService->UnregisterExtension(pMsg->handle); … … 2530 2530 { 2531 2531 AssertMsgFailed(("hgcmThread: Unsupported message number %08X!!!\n", u32MsgId)); 2532 rc = VERR_NOT_SUPPORTED;2532 vrc = VERR_NOT_SUPPORTED; 2533 2533 } break; 2534 2534 } 2535 2535 2536 2536 /* Complete the message processing. */ 2537 hgcmMsgComplete(pMsgCore, rc);2538 2539 LogFlowFunc(("message processed %Rrc\n", rc));2537 hgcmMsgComplete(pMsgCore, vrc); 2538 2539 LogFlowFunc(("message processed %Rrc\n", vrc)); 2540 2540 } 2541 2541 } … … 2579 2579 /* Forward the request to the main hgcm thread. */ 2580 2580 HGCMMsgCore *pCoreMsg; 2581 int rc = hgcmMsgAlloc(g_pHgcmThread, &pCoreMsg, HGCM_MSG_LOAD, hgcmMainMessageAlloc);2582 if (RT_SUCCESS( rc))2581 int vrc = hgcmMsgAlloc(g_pHgcmThread, &pCoreMsg, HGCM_MSG_LOAD, hgcmMainMessageAlloc); 2582 if (RT_SUCCESS(vrc)) 2583 2583 { 2584 2584 /* Initialize the message. Since the message is synchronous, use the supplied pointers. */ … … 2591 2591 pMsg->pHgcmPort = pHgcmPort; 2592 2592 2593 rc = hgcmMsgSend(pMsg);2594 } 2595 2596 LogFlowFunc((" rc = %Rrc\n",rc));2597 return rc;2593 vrc = hgcmMsgSend(pMsg); 2594 } 2595 2596 LogFlowFunc(("vrc = %Rrc\n", vrc)); 2597 return vrc; 2598 2598 } 2599 2599 … … 2620 2620 /* Forward the request to the main hgcm thread. */ 2621 2621 HGCMMsgCore *pCoreMsg; 2622 int rc = hgcmMsgAlloc(g_pHgcmThread, &pCoreMsg, HGCM_MSG_REGEXT, hgcmMainMessageAlloc);2623 2624 if (RT_SUCCESS( rc))2622 int vrc = hgcmMsgAlloc(g_pHgcmThread, &pCoreMsg, HGCM_MSG_REGEXT, hgcmMainMessageAlloc); 2623 2624 if (RT_SUCCESS(vrc)) 2625 2625 { 2626 2626 /* Initialize the message. Since the message is synchronous, use the supplied pointers. */ … … 2632 2632 pMsg->pvExtension = pvExtension; 2633 2633 2634 rc = hgcmMsgSend(pMsg);2635 } 2636 2637 LogFlowFunc(("*pHandle = %p, rc = %Rrc\n", *pHandle,rc));2638 return rc;2634 vrc = hgcmMsgSend(pMsg); 2635 } 2636 2637 LogFlowFunc(("*pHandle = %p, vrc = %Rrc\n", *pHandle, vrc)); 2638 return vrc; 2639 2639 } 2640 2640 … … 2645 2645 /* Forward the request to the main hgcm thread. */ 2646 2646 HGCMMsgCore *pCoreMsg; 2647 int rc = hgcmMsgAlloc(g_pHgcmThread, &pCoreMsg, HGCM_MSG_UNREGEXT, hgcmMainMessageAlloc);2648 2649 if (RT_SUCCESS( rc))2647 int vrc = hgcmMsgAlloc(g_pHgcmThread, &pCoreMsg, HGCM_MSG_UNREGEXT, hgcmMainMessageAlloc); 2648 2649 if (RT_SUCCESS(vrc)) 2650 2650 { 2651 2651 /* Initialize the message. */ … … 2654 2654 pMsg->handle = handle; 2655 2655 2656 rc = hgcmMsgSend(pMsg);2657 } 2658 2659 LogFlowFunc((" rc = %Rrc\n",rc));2656 vrc = hgcmMsgSend(pMsg); 2657 } 2658 2659 LogFlowFunc(("vrc = %Rrc\n", vrc)); 2660 2660 return; 2661 2661 } … … 2684 2684 /* Forward the request to the main hgcm thread. */ 2685 2685 HGCMMsgCore *pCoreMsg; 2686 int rc = hgcmMsgAlloc(g_pHgcmThread, &pCoreMsg, HGCM_MSG_CONNECT, hgcmMainMessageAlloc);2687 2688 if (RT_SUCCESS( rc))2686 int vrc = hgcmMsgAlloc(g_pHgcmThread, &pCoreMsg, HGCM_MSG_CONNECT, hgcmMainMessageAlloc); 2687 2688 if (RT_SUCCESS(vrc)) 2689 2689 { 2690 2690 /* Initialize the message. Since 'pszServiceName' and 'pu32ClientId' … … 2699 2699 pMsg->pu32ClientId = pu32ClientId; 2700 2700 2701 rc = hgcmMsgPost(pMsg, hgcmMsgCompletionCallback);2702 } 2703 2704 LogFlowFunc(("rc = %Rrc\n", rc));2705 return rc;2701 vrc = hgcmMsgPost(pMsg, hgcmMsgCompletionCallback); 2702 } 2703 2704 LogFlowFunc(("rc = %Rrc\n", vrc)); 2705 return vrc; 2706 2706 } 2707 2707 … … 2727 2727 /* Forward the request to the main hgcm thread. */ 2728 2728 HGCMMsgCore *pCoreMsg; 2729 int rc = hgcmMsgAlloc(g_pHgcmThread, &pCoreMsg, HGCM_MSG_DISCONNECT, hgcmMainMessageAlloc);2730 2731 if (RT_SUCCESS( rc))2729 int vrc = hgcmMsgAlloc(g_pHgcmThread, &pCoreMsg, HGCM_MSG_DISCONNECT, hgcmMainMessageAlloc); 2730 2731 if (RT_SUCCESS(vrc)) 2732 2732 { 2733 2733 /* Initialize the message. */ … … 2738 2738 pMsg->u32ClientId = u32ClientId; 2739 2739 2740 rc = hgcmMsgPost(pMsg, hgcmMsgCompletionCallback);2741 } 2742 2743 LogFlowFunc((" rc = %Rrc\n",rc));2744 return rc;2740 vrc = hgcmMsgPost(pMsg, hgcmMsgCompletionCallback); 2741 } 2742 2743 LogFlowFunc(("vrc = %Rrc\n", vrc)); 2744 return vrc; 2745 2745 } 2746 2746 … … 2758 2758 2759 2759 HGCMMsgCore *pCoreMsg; 2760 int rc = hgcmMsgAlloc(g_pHgcmThread, &pCoreMsg, idMsg, hgcmMainMessageAlloc);2761 if (RT_SUCCESS( rc))2760 int vrc = hgcmMsgAlloc(g_pHgcmThread, &pCoreMsg, idMsg, hgcmMainMessageAlloc); 2761 if (RT_SUCCESS(vrc)) 2762 2762 { 2763 2763 HGCMMsgMainLoadSaveState *pMsg = (HGCMMsgMainLoadSaveState *)pCoreMsg; … … 2768 2768 pMsg->uVersion = uVersion; 2769 2769 2770 rc = hgcmMsgSend(pMsg);2771 } 2772 2773 LogFlowFunc((" rc = %Rrc\n",rc));2774 return rc;2770 vrc = hgcmMsgSend(pMsg); 2771 } 2772 2773 LogFlowFunc(("vrc = %Rrc\n", vrc)); 2774 return vrc; 2775 2775 } 2776 2776 … … 2825 2825 } 2826 2826 2827 int rc = VERR_HGCM_INVALID_CLIENT_ID;2827 int vrc = VERR_HGCM_INVALID_CLIENT_ID; 2828 2828 2829 2829 /* Resolve the client handle to the client instance pointer. */ … … 2835 2835 2836 2836 /* Forward the message to the service thread. */ 2837 rc = pClient->pService->GuestCall(pHGCMPort, pCmd, u32ClientId, pClient, u32Function, cParms, paParms, tsArrival);2837 vrc = pClient->pService->GuestCall(pHGCMPort, pCmd, u32ClientId, pClient, u32Function, cParms, paParms, tsArrival); 2838 2838 2839 2839 hgcmObjDereference(pClient); 2840 2840 } 2841 2841 2842 LogFlowFunc((" rc = %Rrc\n",rc));2843 return rc;2842 LogFlowFunc(("vrc = %Rrc\n", vrc)); 2843 return vrc; 2844 2844 } 2845 2845 … … 2901 2901 */ 2902 2902 HGCMMsgCore *pCoreMsg; 2903 int rc = hgcmMsgAlloc(g_pHgcmThread, &pCoreMsg, HGCM_MSG_HOSTCALL, hgcmMainMessageAlloc);2904 2905 if (RT_SUCCESS( rc))2903 int vrc = hgcmMsgAlloc(g_pHgcmThread, &pCoreMsg, HGCM_MSG_HOSTCALL, hgcmMainMessageAlloc); 2904 2905 if (RT_SUCCESS(vrc)) 2906 2906 { 2907 2907 HGCMMsgMainHostCall *pMsg = (HGCMMsgMainHostCall *)pCoreMsg; … … 2912 2912 pMsg->paParms = paParms; 2913 2913 2914 rc = hgcmMsgSend(pMsg);2915 } 2916 2917 LogFlowFunc((" rc = %Rrc\n",rc));2918 return rc;2914 vrc = hgcmMsgSend(pMsg); 2915 } 2916 2917 LogFlowFunc(("vrc = %Rrc\n", vrc)); 2918 return vrc; 2919 2919 } 2920 2920 … … 2929 2929 2930 2930 HGCMMsgCore *pCoreMsg; 2931 int rc = hgcmMsgAlloc(g_pHgcmThread, &pCoreMsg, HGCM_MSG_BRD_NOTIFY, hgcmMainMessageAlloc);2932 2933 if (RT_SUCCESS( rc))2931 int vrc = hgcmMsgAlloc(g_pHgcmThread, &pCoreMsg, HGCM_MSG_BRD_NOTIFY, hgcmMainMessageAlloc); 2932 2933 if (RT_SUCCESS(vrc)) 2934 2934 { 2935 2935 HGCMMsgMainBroadcastNotify *pMsg = (HGCMMsgMainBroadcastNotify *)pCoreMsg; … … 2937 2937 pMsg->enmEvent = enmEvent; 2938 2938 2939 rc = hgcmMsgPost(pMsg, NULL);2940 } 2941 2942 LogFlowFunc((" rc = %Rrc\n",rc));2943 return rc;2939 vrc = hgcmMsgPost(pMsg, NULL); 2940 } 2941 2942 LogFlowFunc(("vrc = %Rrc\n", vrc)); 2943 return vrc; 2944 2944 } 2945 2945 … … 2953 2953 2954 2954 HGCMMsgCore *pMsgCore; 2955 int rc = hgcmMsgAlloc(g_pHgcmThread, &pMsgCore, HGCM_MSG_RESET, hgcmMainMessageAlloc);2956 2957 if (RT_SUCCESS( rc))2955 int vrc = hgcmMsgAlloc(g_pHgcmThread, &pMsgCore, HGCM_MSG_RESET, hgcmMainMessageAlloc); 2956 2957 if (RT_SUCCESS(vrc)) 2958 2958 { 2959 2959 HGCMMsgMainReset *pMsg = (HGCMMsgMainReset *)pMsgCore; … … 2961 2961 pMsg->fForShutdown = fForShutdown; 2962 2962 2963 rc = hgcmMsgSend(pMsg);2964 } 2965 2966 LogFlowFunc((" rc = %Rrc\n",rc));2967 return rc;2963 vrc = hgcmMsgSend(pMsg); 2964 } 2965 2966 LogFlowFunc(("vrc = %Rrc\n", vrc)); 2967 return vrc; 2968 2968 } 2969 2969 … … 2972 2972 LogFlowFunc(("\n")); 2973 2973 2974 int rc = hgcmThreadInit();2975 2976 if (RT_SUCCESS( rc))2974 int vrc = hgcmThreadInit(); 2975 2976 if (RT_SUCCESS(vrc)) 2977 2977 { 2978 2978 /* … … 2980 2980 */ 2981 2981 2982 rc = hgcmThreadCreate(&g_pHgcmThread, "MainHGCMthread", hgcmThread, NULL /*pvUser*/,2983 NULL /*pszStatsSubDir*/, NULL /*pUVM*/, NULL /*pVMM*/);2984 2985 if (RT_FAILURE( rc))2986 LogRel(("Failed to start HGCM thread. HGCM services will be unavailable!!! rc = %Rrc\n",rc));2987 } 2988 2989 LogFlowFunc((" rc = %Rrc\n",rc));2990 return rc;2982 vrc = hgcmThreadCreate(&g_pHgcmThread, "MainHGCMthread", hgcmThread, NULL /*pvUser*/, 2983 NULL /*pszStatsSubDir*/, NULL /*pUVM*/, NULL /*pVMM*/); 2984 2985 if (RT_FAILURE(vrc)) 2986 LogRel(("Failed to start HGCM thread. HGCM services will be unavailable!!! vrc = %Rrc\n", vrc)); 2987 } 2988 2989 LogFlowFunc(("vrc = %Rrc\n", vrc)); 2990 return vrc; 2991 2991 } 2992 2992 … … 2999 2999 */ 3000 3000 3001 int rc = HGCMHostReset(true /*fForShutdown*/);3002 3003 if (RT_SUCCESS( rc))3001 int vrc = HGCMHostReset(true /*fForShutdown*/); 3002 3003 if (RT_SUCCESS(vrc)) 3004 3004 { 3005 3005 /* Send the quit message to the main hgcmThread. */ 3006 3006 HGCMMsgCore *pMsgCore; 3007 rc = hgcmMsgAlloc(g_pHgcmThread, &pMsgCore, HGCM_MSG_QUIT, hgcmMainMessageAlloc);3008 3009 if (RT_SUCCESS( rc))3007 vrc = hgcmMsgAlloc(g_pHgcmThread, &pMsgCore, HGCM_MSG_QUIT, hgcmMainMessageAlloc); 3008 3009 if (RT_SUCCESS(vrc)) 3010 3010 { 3011 3011 HGCMMsgMainQuit *pMsg = (HGCMMsgMainQuit *)pMsgCore; 3012 3012 pMsg->fUvmIsInvalid = fUvmIsInvalid; 3013 3013 3014 rc = hgcmMsgSend(pMsg);3015 3016 if (RT_SUCCESS( rc))3014 vrc = hgcmMsgSend(pMsg); 3015 3016 if (RT_SUCCESS(vrc)) 3017 3017 { 3018 3018 /* Wait for the thread termination. */ … … 3025 3025 } 3026 3026 3027 LogFlowFunc((" rc = %Rrc\n",rc));3028 return rc;3029 } 3030 3027 LogFlowFunc(("vrc = %Rrc\n", vrc)); 3028 return vrc; 3029 } 3030
Note:
See TracChangeset
for help on using the changeset viewer.