VirtualBox

Changeset 94937 in vbox


Ignore:
Timestamp:
May 9, 2022 9:10:16 AM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
151345
Message:

Main/src-client/HGCM.cpp: Adjust to the new rules wrt. to rc -> hrc,vrc usage, ​bugref:10223

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/HGCM.cpp

    r93444 r94937  
    357357    RTErrInfoInitStatic(&ErrInfo);
    358358
    359     int rc;
     359    int vrc;
    360360
    361361    if (RTPathHasPath(m_pszSvcLibrary))
    362         rc = SUPR3HardenedLdrLoadPlugIn(m_pszSvcLibrary, &m_hLdrMod, &ErrInfo.Core);
     362        vrc = SUPR3HardenedLdrLoadPlugIn(m_pszSvcLibrary, &m_hLdrMod, &ErrInfo.Core);
    363363    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))
    367367    {
    368368        LogFlowFunc(("successfully loaded the library.\n"));
     
    370370        m_pfnLoad = NULL;
    371371
    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))
    380380            {
    381381                /* m_pfnLoad was NULL */
    382                 rc = VERR_SYMBOL_NOT_FOUND;
     382                vrc = VERR_SYMBOL_NOT_FOUND;
    383383            }
    384384        }
    385385
    386         if (RT_SUCCESS(rc))
     386        if (RT_SUCCESS(vrc))
    387387        {
    388388            RT_ZERO(m_fntable);
     
    402402            /** @todo provide way to configure different values via extra data.   */
    403403
    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))
    409409            {
    410410                if (   m_fntable.pfnUnload != NULL
     
    434434                    Log(("HGCMService::loadServiceDLL: at least one of function pointers is NULL\n"));
    435435
    436                     rc = VERR_INVALID_PARAMETER;
     436                    vrc = VERR_INVALID_PARAMETER;
    437437
    438438                    if (m_fntable.pfnUnload)
     
    446446    else
    447447    {
    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));
    450450        m_hLdrMod = NIL_RTLDRMOD;
    451451    }
    452452
    453     if (RT_FAILURE(rc))
     453    if (RT_FAILURE(vrc))
    454454    {
    455455        unloadServiceDLL();
    456456    }
    457457
    458     return rc;
     458    return vrc;
    459459}
    460460
     
    672672    {
    673673        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))
    677677        {
    678678            /* The error means some serious unrecoverable problem in the hgcmMsg/hgcmThread layer. */
    679             AssertMsgFailed(("%Rrc\n", rc));
     679            AssertMsgFailed(("%Rrc\n", vrc));
    680680            break;
    681681        }
     
    691691            {
    692692                LogFlowFunc(("SVC_MSG_LOAD\n"));
    693                 rc = pSvc->loadServiceDLL();
     693                vrc = pSvc->loadServiceDLL();
    694694            } break;
    695695
     
    717717                {
    718718                    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);
    722722                    pSvc->m_fInConnectOrDisconnect = false;
    723723
     
    726726                else
    727727                {
    728                     rc = VERR_HGCM_INVALID_CLIENT_ID;
     728                    vrc = VERR_HGCM_INVALID_CLIENT_ID;
    729729                }
    730730            } break;
     
    739739                {
    740740                    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));
    743743                    pSvc->m_fInConnectOrDisconnect = false;
    744744                }
    745745                else
    746746                {
    747                     rc = VERR_HGCM_INVALID_CLIENT_ID;
     747                    vrc = VERR_HGCM_INVALID_CLIENT_ID;
    748748                }
    749749            } break;
     
    768768                else
    769769                {
    770                     rc = VERR_HGCM_INVALID_CLIENT_ID;
     770                    vrc = VERR_HGCM_INVALID_CLIENT_ID;
    771771                }
    772772            } break;
     
    788788                else
    789789                {
    790                     rc = VERR_HGCM_INVALID_CLIENT_ID;
     790                    vrc = VERR_HGCM_INVALID_CLIENT_ID;
    791791                }
    792792            } break;
     
    799799                             pMsg->u32Function, pMsg->cParms, pMsg->paParms));
    800800
    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);
    802802            } break;
    803803
     
    815815                    bool fHaveClientState = pSvc->m_fntable.pfnLoadState != NULL;
    816816                    if (pMsg->uVersion > HGCM_SAVED_STATE_VERSION_V2)
    817                         rc = pMsg->pVMM->pfnSSMR3GetBool(pMsg->pSSM, &fHaveClientState);
     817                        vrc = pMsg->pVMM->pfnSSMR3GetBool(pMsg->pSSM, &fHaveClientState);
    818818                    else
    819                         rc = VINF_SUCCESS;
    820                     if (RT_SUCCESS(rc) )
     819                        vrc = VINF_SUCCESS;
     820                    if (RT_SUCCESS(vrc) )
    821821                    {
    822822                        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);
    826826                        else
    827                             AssertLogRelStmt(!fHaveClientState, rc = VERR_INTERNAL_ERROR_5);
     827                            AssertLogRelStmt(!fHaveClientState, vrc = VERR_INTERNAL_ERROR_5);
    828828                    }
    829829                    hgcmObjDereference(pClient);
     
    831831                else
    832832                {
    833                     rc = VERR_HGCM_INVALID_CLIENT_ID;
     833                    vrc = VERR_HGCM_INVALID_CLIENT_ID;
    834834                }
    835835            } break;
     
    843843                HGCMClient *pClient = HGCMClient::ReferenceByHandle(pMsg->u32ClientId);
    844844
    845                 rc = VINF_SUCCESS;
     845                vrc = VINF_SUCCESS;
    846846
    847847                if (pClient)
    848848                {
    849849                    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)
    852852                    {
    853853                        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);
    856856                        g_fSaveState = false;
    857857                    }
     
    861861                else
    862862                {
    863                     rc = VERR_HGCM_INVALID_CLIENT_ID;
     863                    vrc = VERR_HGCM_INVALID_CLIENT_ID;
    864864                }
    865865            } break;
     
    873873                if (pSvc->m_hExtension)
    874874                {
    875                     rc = VERR_NOT_SUPPORTED;
     875                    vrc = VERR_NOT_SUPPORTED;
    876876                }
    877877                else
     
    879879                    if (pSvc->m_fntable.pfnRegisterExtension)
    880880                    {
    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);
    883883                    }
    884884                    else
    885885                    {
    886                         rc = VERR_NOT_SUPPORTED;
     886                        vrc = VERR_NOT_SUPPORTED;
    887887                    }
    888888
    889                     if (RT_SUCCESS(rc))
     889                    if (RT_SUCCESS(vrc))
    890890                    {
    891891                        pSvc->m_hExtension = pMsg->handle;
     
    902902                if (pSvc->m_hExtension != pMsg->handle)
    903903                {
    904                     rc = VERR_NOT_SUPPORTED;
     904                    vrc = VERR_NOT_SUPPORTED;
    905905                }
    906906                else
     
    908908                    if (pSvc->m_fntable.pfnRegisterExtension)
    909909                    {
    910                         rc = pSvc->m_fntable.pfnRegisterExtension(pSvc->m_fntable.pvService, NULL, NULL);
     910                        vrc = pSvc->m_fntable.pfnRegisterExtension(pSvc->m_fntable.pvService, NULL, NULL);
    911911                    }
    912912                    else
    913913                    {
    914                         rc = VERR_NOT_SUPPORTED;
     914                        vrc = VERR_NOT_SUPPORTED;
    915915                    }
    916916
     
    931931            {
    932932                AssertMsgFailed(("hgcmServiceThread::Unsupported message number %08X\n", u32MsgId));
    933                 rc = VERR_NOT_SUPPORTED;
     933                vrc = VERR_NOT_SUPPORTED;
    934934            } break;
    935935        }
     
    940940             * Other messages have to be completed here.
    941941             */
    942             hgcmMsgComplete (pMsgCore, rc);
     942            hgcmMsgComplete (pMsgCore, vrc);
    943943        }
    944944        STAM_REL_PROFILE_STOP(&pSvc->m_StatHandleMsg, a);
     
    976976     /* Resolve the client ID and verify that it belongs to this service before
    977977        trying to disconnect it. */
    978      int rc = VERR_NOT_FOUND;
     978     int vrc = VERR_NOT_FOUND;
    979979     HGCMClient * const pClient = HGCMClient::ReferenceByHandle(idClient);
    980980     if (pClient)
    981981     {
    982982         if (pClient->pService == pService)
    983              rc = pService->DisconnectClient(idClient, true, pClient);
     983             vrc = pService->DisconnectClient(idClient, true, pClient);
    984984         hgcmObjDereference(pClient);
    985985     }
    986      return rc;
     986     return vrc;
    987987}
    988988
     
    11431143        RTStrCopy(szThreadName, sizeof(szThreadName), pszServiceName);
    11441144
    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))
    11471147    {
    11481148        m_pszSvcName    = RTStrDup(pszServiceName);
     
    11571157            m_pszSvcName = NULL;
    11581158
    1159             rc = VERR_NO_MEMORY;
     1159            vrc = VERR_NO_MEMORY;
    11601160        }
    11611161        else
     
    11821182            /* Execute the load request on the service thread. */
    11831183            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))
    11871187            {
    11881188                HGCMMsgSvcLoad *pMsg = (HGCMMsgSvcLoad *)pCoreMsg;
     
    11901190                pMsg->pUVM = pUVM;
    11911191
    1192                 rc = hgcmMsgSend(pMsg);
     1192                vrc = hgcmMsgSend(pMsg);
    11931193            }
    11941194        }
    11951195    }
    11961196
    1197     if (RT_FAILURE(rc))
     1197    if (RT_FAILURE(vrc))
    11981198    {
    11991199        instanceDestroy();
    12001200    }
    12011201
    1202     LogFlowFunc(("rc = %Rrc\n", rc));
    1203     return rc;
     1202    LogFlowFunc(("vrc = %Rrc\n", vrc));
     1203    return vrc;
    12041204}
    12051205
     
    12421242
    12431243    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))
    12511251            hgcmThreadWait(m_pThread);
    12521252    }
     
    12751275
    12761276    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))
    12801280    {
    12811281        HGCMMsgLoadSaveStateClient *pMsg = (HGCMMsgLoadSaveStateClient *)pCoreMsg;
     
    12851285        pMsg->pVMM        = pVMM;
    12861286
    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;
    12921292}
    12931293
     
    12971297
    12981298    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))
    13021302    {
    13031303        HGCMMsgLoadSaveStateClient *pMsg = (HGCMMsgLoadSaveStateClient *)pCoreMsg;
     
    13081308        pMsg->u32ClientId = u32ClientId;
    13091309
    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;
    13151315}
    13161316
     
    13351335
    13361336    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))
    13401340    {
    13411341        /* The service is already loaded. */
    13421342        pSvc->ReleaseService();
    1343         rc = VERR_HGCM_SERVICE_EXISTS;
     1343        vrc = VERR_HGCM_SERVICE_EXISTS;
    13441344    }
    13451345    else
     
    13501350        if (!pSvc)
    13511351        {
    1352             rc = VERR_NO_MEMORY;
     1352            vrc = VERR_NO_MEMORY;
    13531353        }
    13541354        else
    13551355        {
    13561356            /* 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))
    13591359            {
    13601360                /* Insert the just created service to list for future references. */
     
    13801380    }
    13811381
    1382     LogFlowFunc(("rc = %Rrc\n", rc));
    1383     return rc;
     1382    LogFlowFunc(("vrc = %Rrc\n", vrc));
     1383    return vrc;
    13841384}
    13851385
     
    15551555{
    15561556    /* 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);
    15591559
    15601560    LogFlowFunc(("%d services to be saved:\n", sm_cServices));
    15611561
    15621562    /* 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);
    15651565
    15661566    /* Save every service. */
     
    15721572
    15731573        /* 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);
    15761576
    15771577        /* 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);
    15801580
    15811581        /* 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);
    15841584
    15851585        /* Call the service for every client. Normally a service must not have
     
    15961596
    15971597            /* 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);
    16001600
    16011601            /* 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);
    16041604        }
    16051605
     
    16231623    uint32_t u32;
    16241624
    1625     int rc = pVMM->pfnSSMR3GetU32(pSSM, &u32);
    1626     AssertRCReturn(rc, rc);
     1625    int vrc = pVMM->pfnSSMR3GetU32(pSSM, &u32);
     1626    AssertRCReturn(vrc, vrc);
    16271627
    16281628    hgcmObjSetHandleCount(u32);
     
    16311631    uint32_t cServices;
    16321632
    1633     rc = pVMM->pfnSSMR3GetU32(pSSM, &cServices);
    1634     AssertRCReturn(rc, rc);
     1633    vrc = pVMM->pfnSSMR3GetU32(pSSM, &cServices);
     1634    AssertRCReturn(vrc, vrc);
    16351635
    16361636    LogFlowFunc(("%d services to be restored:\n", cServices));
     
    16391639    {
    16401640        /* 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);
    16431643        AssertReturn(u32 <= VBOX_HGCM_SVC_NAME_MAX_BYTES, VERR_SSM_UNEXPECTED_DATA);
    16441644
    16451645        /* Get the service name. */
    16461646        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);
    16491649
    16501650        LogRel(("HGCM: Restoring [%s]\n", szServiceName));
     
    16521652        /* Resolve the service instance. */
    16531653        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);
    16561656
    16571657        /* Get the number of clients. */
    16581658        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))
    16611661        {
    16621662            pSvc->ReleaseService();
    16631663            AssertFailed();
    1664             return rc;
     1664            return vrc;
    16651665        }
    16661666
     
    16701670               but restored here in time for calling CreateAndConnectClient). */
    16711671            uint32_t u32ClientId;
    1672             rc = pVMM->pfnSSMR3GetU32(pSSM, &u32ClientId);
     1672            vrc = pVMM->pfnSSMR3GetU32(pSSM, &u32ClientId);
    16731673            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);
    16771677
    16781678            /* 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);
    16811681
    16821682            /* 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);
    16851685        }
    16861686
     
    17671767
    17681768    /* 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))
    17721772    {
    17731773        /* Call the service. */
    17741774        HGCMMsgCore *pCoreMsg;
    17751775
    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))
    17791779        {
    17801780            HGCMMsgSvcConnect *pMsg = (HGCMMsgSvcConnect *)pCoreMsg;
     
    17841784            pMsg->fRestoring = fRestoring;
    17851785
    1786             rc = hgcmMsgSend(pMsg);
    1787 
    1788             if (RT_SUCCESS(rc))
     1786            vrc = hgcmMsgSend(pMsg);
     1787
     1788            if (RT_SUCCESS(vrc))
    17891789            {
    17901790                /* Add the client Id to the array. */
     
    18091809                        else
    18101810                        {
    1811                             rc = VERR_NO_MEMORY;
     1811                            vrc = VERR_NO_MEMORY;
    18121812                        }
    18131813                    }
    18141814                    else
    18151815                    {
    1816                         rc = VERR_NO_MEMORY;
     1816                        vrc = VERR_NO_MEMORY;
    18171817                    }
    18181818                }
    18191819
    1820                 if (RT_SUCCESS(rc))
     1820                if (RT_SUCCESS(vrc))
    18211821                {
    18221822                    m_paClientIds[m_cClients] = handle;
     
    18301830    }
    18311831
    1832     if (RT_SUCCESS(rc))
     1832    if (RT_SUCCESS(vrc))
    18331833    {
    18341834        if (pu32ClientIdOut != NULL)
     
    18471847    }
    18481848
    1849     LogFlowFunc(("rc = %Rrc\n", rc));
    1850     return rc;
     1849    LogFlowFunc(("vrc = %Rrc\n", vrc));
     1850    return vrc;
    18511851}
    18521852
     
    18741874
    18751875    bool fReleaseService = false;
    1876     int  rc              = VERR_NOT_FOUND;
     1876    int  vrc             = VERR_NOT_FOUND;
    18771877    for (uint32_t i = 0; i < m_cClients; i++)
    18781878    {
     
    18911891            fReleaseService = true;
    18921892
    1893             rc = VINF_SUCCESS;
     1893            vrc = VINF_SUCCESS;
    18941894            break;
    18951895        }
     
    18971897
    18981898    /* 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)
    19011901    {
    19021902        if (m_acClients[pClient->idxCategory] > 0)
     
    19081908
    19091909    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));
    19111911
    19121912    /*
     
    19181918        HGCMMsgCore *pCoreMsg;
    19191919
    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))
    19231923        {
    19241924            HGCMMsgSvcDisconnect *pMsg = (HGCMMsgSvcDisconnect *)pCoreMsg;
     
    19271927            pMsg->pClient = pClient;
    19281928
    1929             rc = hgcmMsgSend(pMsg);
     1929            vrc = hgcmMsgSend(pMsg);
    19301930        }
    19311931        else
    19321932        {
    19331933            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));
    19351935        }
    19361936    }
     
    19431943        ReleaseService();
    19441944
    1945     LogFlowFunc(("rc = %Rrc\n", rc));
    1946     return rc;
     1945    LogFlowFunc(("vrc = %Rrc\n", vrc));
     1946    return vrc;
    19471947}
    19481948
     
    19551955    /* Forward the message to the service thread. */
    19561956    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))
    19601960    {
    19611961        HGCMMsgSvcRegisterExtension *pMsg = (HGCMMsgSvcRegisterExtension *)pCoreMsg;
     
    19651965        pMsg->pvExtension  = pvExtension;
    19661966
    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;
    19721972}
    19731973
     
    19761976    /* Forward the message to the service thread. */
    19771977    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))
    19811981    {
    19821982        HGCMMsgSvcUnregisterExtension *pMsg = (HGCMMsgSvcUnregisterExtension *)pCoreMsg;
     
    19841984        pMsg->handle = handle;
    19851985
    1986         rc = hgcmMsgSend(pMsg);
    1987     }
    1988 
    1989     LogFlowFunc(("rc = %Rrc\n", rc));
     1986        vrc = hgcmMsgSend(pMsg);
     1987    }
     1988
     1989    LogFlowFunc(("vrc = %Rrc\n", vrc));
    19901990}
    19911991
     
    19971997     * for the client if necessary.
    19981998     */
    1999     int rc = hgcmMsgCompletionCallback(result, pMsgCore);
     1999    int vrc = hgcmMsgCompletionCallback(result, pMsgCore);
    20002000
    20012001    HGCMMsgCall *pMsg = (HGCMMsgCall *)pMsgCore;
     
    20092009    }
    20102010
    2011     return rc;
     2011    return vrc;
    20122012}
    20132013
     
    20302030    LogFlow(("MAIN::HGCMService::GuestCall\n"));
    20312031
    2032     int rc;
     2032    int vrc;
    20332033    HGCMMsgCall *pMsg = new(std::nothrow) HGCMMsgCall(m_pThread);
    20342034    if (pMsg)
     
    20522052            pMsg->tsArrival   = tsArrival;
    20532053
    2054             rc = hgcmMsgPost(pMsg, hgcmMsgCallCompletionCallback);
    2055 
    2056             if (RT_SUCCESS(rc))
     2054            vrc = hgcmMsgPost(pMsg, hgcmMsgCallCompletionCallback);
     2055
     2056            if (RT_SUCCESS(vrc))
    20572057            { /* Reference donated on success. */ }
    20582058            else
     
    20602060                ASMAtomicDecU32(&pClient->cPendingCalls);
    20612061                pMsg->pcCounter = NULL;
    2062                 Log(("MAIN::HGCMService::GuestCall: hgcmMsgPost failed: %Rrc\n", rc));
     2062                Log(("MAIN::HGCMService::GuestCall: hgcmMsgPost failed: %Rrc\n", vrc));
    20632063                pMsg->Dereference();
    20642064            }
     
    20712071            pMsg->Dereference();
    20722072            STAM_REL_COUNTER_INC(&m_StatTooManyCalls);
    2073             rc = VERR_HGCM_TOO_MANY_CLIENT_CALLS;
     2073            vrc = VERR_HGCM_TOO_MANY_CLIENT_CALLS;
    20742074        }
    20752075    }
     
    20772077    {
    20782078        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;
    20842084}
    20852085
     
    21262126
    21272127    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))
    21312131    {
    21322132        HGCMMsgHostCallSvc *pMsg = (HGCMMsgHostCallSvc *)pCoreMsg;
     
    21362136        pMsg->paParms          = paParms;
    21372137
    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;
    21432143}
    21442144
     
    21652165    {
    21662166        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))
    21692169        {
    21702170            HGCMMsgNotify *pMsg = (HGCMMsgNotify *)pCoreMsg;
    21712171            pMsg->enmEvent = enmEvent;
    21722172
    2173             rc = hgcmMsgPost(pMsg, NULL);
    2174             AssertRC(rc);
     2173            vrc = hgcmMsgPost(pMsg, NULL);
     2174            AssertRC(vrc);
    21752175        }
    21762176    }
     
    23272327    {
    23282328        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))
    23322332        {
    23332333            /* The error means some serious unrecoverable problem in the hgcmMsg/hgcmThread layer. */
    2334             AssertMsgFailed(("%Rrc\n", rc));
     2334            AssertMsgFailed(("%Rrc\n", vrc));
    23352335            break;
    23362336        }
     
    23502350                 */
    23512351                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))
    23552355                {
    23562356                    /* 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));
    23612361
    23622362                    /* Release the service after resolve. */
     
    23762376                if (!pClient)
    23772377                {
    2378                     rc = VERR_HGCM_INVALID_CLIENT_ID;
     2378                    vrc = VERR_HGCM_INVALID_CLIENT_ID;
    23792379                    break;
    23802380                }
     
    23842384
    23852385                /* Call the service instance to disconnect the client. */
    2386                 rc = pService->DisconnectClient(pMsg->u32ClientId, false, pClient);
     2386                vrc = pService->DisconnectClient(pMsg->u32ClientId, false, pClient);
    23872387
    23882388                hgcmObjDereference(pClient);
     
    23962396                             pMsg->pszServiceName, pMsg->pszServiceLibrary, pMsg->pUVM));
    23972397
    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);
    24002400            } break;
    24012401
     
    24092409                /* Resolve the service name to the pointer to service instance. */
    24102410                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))
    24142414                {
    2415                     rc = pService->HostCall(pMsg->u32Function, pMsg->cParms, pMsg->paParms);
     2415                    vrc = pService->HostCall(pMsg->u32Function, pMsg->cParms, pMsg->paParms);
    24162416
    24172417                    pService->ReleaseService();
     
    24452445                LogFlowFunc(("HGCM_MSG_LOADSTATE\n"));
    24462446
    2447                 rc = HGCMService::LoadState(pMsg->pSSM, pMsg->pVMM, pMsg->uVersion);
     2447                vrc = HGCMService::LoadState(pMsg->pSSM, pMsg->pVMM, pMsg->uVersion);
    24482448            } break;
    24492449
     
    24542454                LogFlowFunc(("HGCM_MSG_SAVESTATE\n"));
    24552455
    2456                 rc = HGCMService::SaveState(pMsg->pSSM, pMsg->pVMM);
     2456                vrc = HGCMService::SaveState(pMsg->pSSM, pMsg->pVMM);
    24572457            } break;
    24582458
     
    24802480                if (handle == NULL)
    24812481                {
    2482                     rc = VERR_NO_MEMORY;
     2482                    vrc = VERR_NO_MEMORY;
    24832483                }
    24842484                else
     
    24882488
    24892489                    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))
    24932493                    {
    24942494                        pService->RegisterExtension(handle, pMsg->pfnExtension, pMsg->pvExtension);
     
    24972497                    }
    24982498
    2499                     if (RT_FAILURE(rc))
     2499                    if (RT_FAILURE(vrc))
    25002500                    {
    25012501                        RTMemFree(handle);
     
    25152515
    25162516                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))
    25202520                {
    25212521                    pService->UnregisterExtension(pMsg->handle);
     
    25302530            {
    25312531                AssertMsgFailed(("hgcmThread: Unsupported message number %08X!!!\n", u32MsgId));
    2532                 rc = VERR_NOT_SUPPORTED;
     2532                vrc = VERR_NOT_SUPPORTED;
    25332533            } break;
    25342534        }
    25352535
    25362536        /* 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));
    25402540    }
    25412541}
     
    25792579    /* Forward the request to the main hgcm thread. */
    25802580    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))
    25832583    {
    25842584        /* Initialize the message. Since the message is synchronous, use the supplied pointers. */
     
    25912591        pMsg->pHgcmPort         = pHgcmPort;
    25922592
    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;
    25982598}
    25992599
     
    26202620    /* Forward the request to the main hgcm thread. */
    26212621    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))
    26252625    {
    26262626        /* Initialize the message. Since the message is synchronous, use the supplied pointers. */
     
    26322632        pMsg->pvExtension    = pvExtension;
    26332633
    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;
    26392639}
    26402640
     
    26452645    /* Forward the request to the main hgcm thread. */
    26462646    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))
    26502650    {
    26512651        /* Initialize the message. */
     
    26542654        pMsg->handle = handle;
    26552655
    2656         rc = hgcmMsgSend(pMsg);
    2657     }
    2658 
    2659     LogFlowFunc(("rc = %Rrc\n", rc));
     2656        vrc = hgcmMsgSend(pMsg);
     2657    }
     2658
     2659    LogFlowFunc(("vrc = %Rrc\n", vrc));
    26602660    return;
    26612661}
     
    26842684    /* Forward the request to the main hgcm thread. */
    26852685    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))
    26892689    {
    26902690        /* Initialize the message. Since 'pszServiceName' and 'pu32ClientId'
     
    26992699        pMsg->pu32ClientId   = pu32ClientId;
    27002700
    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;
    27062706}
    27072707
     
    27272727    /* Forward the request to the main hgcm thread. */
    27282728    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))
    27322732    {
    27332733        /* Initialize the message. */
     
    27382738        pMsg->u32ClientId = u32ClientId;
    27392739
    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;
    27452745}
    27462746
     
    27582758
    27592759    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))
    27622762    {
    27632763        HGCMMsgMainLoadSaveState *pMsg = (HGCMMsgMainLoadSaveState *)pCoreMsg;
     
    27682768        pMsg->uVersion = uVersion;
    27692769
    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;
    27752775}
    27762776
     
    28252825    }
    28262826
    2827     int rc = VERR_HGCM_INVALID_CLIENT_ID;
     2827    int vrc = VERR_HGCM_INVALID_CLIENT_ID;
    28282828
    28292829    /* Resolve the client handle to the client instance pointer. */
     
    28352835
    28362836        /* 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);
    28382838
    28392839        hgcmObjDereference(pClient);
    28402840    }
    28412841
    2842     LogFlowFunc(("rc = %Rrc\n", rc));
    2843     return rc;
     2842    LogFlowFunc(("vrc = %Rrc\n", vrc));
     2843    return vrc;
    28442844}
    28452845
     
    29012901     */
    29022902    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))
    29062906    {
    29072907        HGCMMsgMainHostCall *pMsg = (HGCMMsgMainHostCall *)pCoreMsg;
     
    29122912        pMsg->paParms        = paParms;
    29132913
    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;
    29192919}
    29202920
     
    29292929
    29302930    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))
    29342934    {
    29352935        HGCMMsgMainBroadcastNotify *pMsg = (HGCMMsgMainBroadcastNotify *)pCoreMsg;
     
    29372937        pMsg->enmEvent = enmEvent;
    29382938
    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;
    29442944}
    29452945
     
    29532953
    29542954    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))
    29582958    {
    29592959        HGCMMsgMainReset *pMsg = (HGCMMsgMainReset *)pMsgCore;
     
    29612961        pMsg->fForShutdown = fForShutdown;
    29622962
    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;
    29682968}
    29692969
     
    29722972    LogFlowFunc(("\n"));
    29732973
    2974     int rc = hgcmThreadInit();
    2975 
    2976     if (RT_SUCCESS(rc))
     2974    int vrc = hgcmThreadInit();
     2975
     2976    if (RT_SUCCESS(vrc))
    29772977    {
    29782978        /*
     
    29802980         */
    29812981
    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;
    29912991}
    29922992
     
    29992999     */
    30003000
    3001     int rc = HGCMHostReset(true /*fForShutdown*/);
    3002 
    3003     if (RT_SUCCESS(rc))
     3001    int vrc = HGCMHostReset(true /*fForShutdown*/);
     3002
     3003    if (RT_SUCCESS(vrc))
    30043004    {
    30053005        /* Send the quit message to the main hgcmThread. */
    30063006        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))
    30103010        {
    30113011            HGCMMsgMainQuit *pMsg = (HGCMMsgMainQuit *)pMsgCore;
    30123012            pMsg->fUvmIsInvalid = fUvmIsInvalid;
    30133013
    3014             rc = hgcmMsgSend(pMsg);
    3015 
    3016             if (RT_SUCCESS(rc))
     3014            vrc = hgcmMsgSend(pMsg);
     3015
     3016            if (RT_SUCCESS(vrc))
    30173017            {
    30183018                /* Wait for the thread termination. */
     
    30253025    }
    30263026
    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.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette