VirtualBox

Changeset 42721 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Aug 9, 2012 5:28:36 PM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
79930
Message:

Main/GuestProcess: fix lots of warninga about variables shadowing the rc method

File:
1 edited

Legend:

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

    r42716 r42721  
    340340
    341341    /* Create a new context ID and assign it. */
    342     int rc = VERR_NOT_FOUND;
     342    int vrc = VERR_NOT_FOUND;
    343343
    344344    ULONG uCount = mData.mNextContextID++;
     
    360360             * we can use this context ID for our new callback we want
    361361             * to add below. */
    362             rc = VINF_SUCCESS;
     362            vrc = VINF_SUCCESS;
    363363            break;
    364364        }
     
    369369    }
    370370
    371     if (RT_SUCCESS(rc))
     371    if (RT_SUCCESS(vrc))
    372372    {
    373373        /* Add callback with new context ID to our callback map.
     
    386386    }
    387387
    388     return rc;
     388    return vrc;
    389389}
    390390
     
    401401    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    402402
    403     int rc;
     403    int vrc;
    404404
    405405    /* Get the optional callback associated to this context ID.
     
    427427            AssertReturn(CALLBACKDATAMAGIC_CLIENT_DISCONNECTED == pCallbackData->hdr.u32Magic, VERR_INVALID_PARAMETER);
    428428
    429             rc = onGuestDisconnected(pCallback, pCallbackData); /* Affects all callbacks. */
     429            vrc = onGuestDisconnected(pCallback, pCallbackData); /* Affects all callbacks. */
    430430            break;
    431431        }
     
    438438            AssertReturn(CALLBACKDATAMAGIC_EXEC_STATUS == pCallbackData->hdr.u32Magic, VERR_INVALID_PARAMETER);
    439439
    440             rc = onProcessStatusChange(pCallback, pCallbackData);
     440            vrc = onProcessStatusChange(pCallback, pCallbackData);
    441441            break;
    442442        }
     
    449449            AssertReturn(CALLBACKDATAMAGIC_EXEC_OUT == pCallbackData->hdr.u32Magic, VERR_INVALID_PARAMETER);
    450450
    451             rc = onProcessOutput(pCallback, pCallbackData);
     451            vrc = onProcessOutput(pCallback, pCallbackData);
    452452            break;
    453453        }
     
    460460            AssertReturn(CALLBACKDATAMAGIC_EXEC_IN_STATUS == pCallbackData->hdr.u32Magic, VERR_INVALID_PARAMETER);
    461461
    462             rc = onProcessInputStatus(pCallback, pCallbackData);
     462            vrc = onProcessInputStatus(pCallback, pCallbackData);
    463463            break;
    464464        }
     
    466466        default:
    467467            /* Silently ignore not implemented functions. */
    468             rc = VERR_NOT_IMPLEMENTED;
     468            vrc = VERR_NOT_IMPLEMENTED;
    469469            break;
    470470    }
    471471
    472472#ifdef DEBUG
    473     LogFlowFuncLeaveRC(rc);
     473    LogFlowFuncLeaveRC(vrc);
    474474#endif
    475     return rc;
     475    return vrc;
    476476}
    477477
     
    585585
    586586    /* Signal in any case. */
    587     int rc = signalWaiters(waitRes);
    588     AssertRC(rc);
    589 
    590     LogFlowFuncLeaveRC(rc);
    591     return rc;
     587    int vrc = signalWaiters(waitRes);
     588    AssertRC(vrc);
     589
     590    LogFlowFuncLeaveRC(vrc);
     591    return vrc;
    592592}
    593593
     
    600600                     mData.mPID, pData->u32Status, pData->u32Flags, pData->cbProcessed, pCallback, pData));
    601601
    602     int rc = checkPID(pData->u32PID);
    603     if (RT_FAILURE(rc))
    604         return rc;
     602    int vrc = checkPID(pData->u32PID);
     603    if (RT_FAILURE(vrc))
     604        return vrc;
    605605
    606606    /* First, signal callback in every case (if available). */
    607607    if (pCallback)
    608608    {
    609         rc = pCallback->SetData(pData, sizeof(CALLBACKDATAEXECINSTATUS));
     609        vrc = pCallback->SetData(pData, sizeof(CALLBACKDATAEXECINSTATUS));
    610610
    611611        int rc2 = pCallback->Signal();
    612         if (RT_SUCCESS(rc))
    613             rc = rc2;
     612        if (RT_SUCCESS(vrc))
     613            vrc = rc2;
    614614    }
    615615
     
    620620    {
    621621        int rc2 = signalWaiters(ProcessWaitResult_StdIn);
    622         if (RT_SUCCESS(rc))
    623             rc = rc2;
    624     }
    625 
    626     LogFlowFuncLeaveRC(rc);
    627     return rc;
     622        if (RT_SUCCESS(vrc))
     623            vrc = rc2;
     624    }
     625
     626    LogFlowFuncLeaveRC(vrc);
     627    return vrc;
    628628}
    629629
     
    644644                     pData->u32PID, pData->u32Status, pData->u32Flags, pCallback, pData));
    645645
    646     int rc = checkPID(pData->u32PID);
    647     if (RT_FAILURE(rc))
    648         return rc;
     646    int vrc = checkPID(pData->u32PID);
     647    if (RT_FAILURE(vrc))
     648        return vrc;
    649649
    650650    BOOL fSignal = FALSE;
     
    733733            if (mData.mPID)
    734734            {
    735                 strError += Utf8StrFmt(tr("Error rc=%Rrc occured (PID %RU32)"), rc, mData.mPID);
     735                strError += Utf8StrFmt(tr("Error vrc=%Rrc occured (PID %RU32)"), vrc, mData.mPID);
    736736            }
    737737            else
     
    782782            }
    783783
    784             rc = setErrorInternal(pData->u32Flags, strError);
    785             AssertRC(rc);
     784            vrc = setErrorInternal(pData->u32Flags, strError);
     785            AssertRC(vrc);
    786786            break;
    787787        }
     
    799799    }
    800800
    801     LogFlowThisFunc(("Got rc=%Rrc, waitResult=%d\n", rc, waitRes));
     801    LogFlowThisFunc(("Got vrc=%Rrc, waitResult=%d\n", vrc, waitRes));
    802802
    803803    /*
     
    805805     */
    806806    if (pCallback)
    807         rc = pCallback->Signal();
     807        vrc = pCallback->Signal();
    808808
    809809    if (fSignal)
    810810    {
    811811        int rc2 = signalWaiters(waitRes);
    812         if (RT_SUCCESS(rc))
    813             rc = rc2;
    814     }
    815 
    816     LogFlowFuncLeaveRC(rc);
    817     return rc;
     812        if (RT_SUCCESS(vrc))
     813            vrc = rc2;
     814    }
     815
     816    LogFlowFuncLeaveRC(vrc);
     817    return vrc;
    818818}
    819819
     
    826826                     mData.mPID, pData->u32HandleId, pData->u32Flags, pData->pvData, pData->cbData, pCallback, pData));
    827827
    828     int rc = checkPID(pData->u32PID);
    829     if (RT_FAILURE(rc))
    830         return rc;
     828    int vrc = checkPID(pData->u32PID);
     829    if (RT_FAILURE(vrc))
     830        return vrc;
    831831
    832832    /* First, signal callback in every case (if available). */
    833833    if (pCallback)
    834834    {
    835         rc = pCallback->SetData(pData, sizeof(CALLBACKDATAEXECOUT));
     835        vrc = pCallback->SetData(pData, sizeof(CALLBACKDATAEXECOUT));
    836836
    837837        int rc2 = pCallback->Signal();
    838         if (RT_SUCCESS(rc))
    839             rc = rc2;
     838        if (RT_SUCCESS(vrc))
     839            vrc = rc2;
    840840    }
    841841
     
    865865        int rc2 = signalWaiters(  pData->u32HandleId == OUTPUT_HANDLE_ID_STDOUT
    866866                                ? ProcessWaitResult_StdOut : ProcessWaitResult_StdErr);
    867         if (RT_SUCCESS(rc))
    868             rc = rc2;
    869     }
    870 
    871     LogFlowFuncLeaveRC(rc);
    872     return rc;
     867        if (RT_SUCCESS(vrc))
     868            vrc = rc2;
     869    }
     870
     871    LogFlowFuncLeaveRC(vrc);
     872    return vrc;
    873873}
    874874
     
    894894
    895895    /* Create callback and add it to the map. */
    896     int rc = pCallbackRead->Init(VBOXGUESTCTRLCALLBACKTYPE_EXEC_OUTPUT);
    897     if (RT_SUCCESS(rc))
    898         rc = callbackAdd(pCallbackRead, &uContextID);
     896    int vrc = pCallbackRead->Init(VBOXGUESTCTRLCALLBACKTYPE_EXEC_OUTPUT);
     897    if (RT_SUCCESS(vrc))
     898        vrc = callbackAdd(pCallbackRead, &uContextID);
    899899
    900900    alock.release(); /* Drop the write lock again. */
    901901
    902     if (RT_SUCCESS(rc))
     902    if (RT_SUCCESS(vrc))
    903903    {
    904904        VBOXHGCMSVCPARM paParms[5];
     
    910910        paParms[i++].setUInt32(0 /* Flags, none set yet. */);
    911911
    912         rc = sendCommand(HOST_EXEC_GET_OUTPUT, i, paParms);
    913     }
    914 
    915     if (RT_SUCCESS(rc))
     912        vrc = sendCommand(HOST_EXEC_GET_OUTPUT, i, paParms);
     913    }
     914
     915    if (RT_SUCCESS(vrc))
    916916    {
    917917        /*
     
    920920         */
    921921        LogFlowThisFunc(("Waiting for callback (%RU32ms) ...\n", uTimeoutMS));
    922         rc = pCallbackRead->Wait(uTimeoutMS);
    923         if (RT_SUCCESS(rc)) /* Wait was successful, check for supplied information. */
    924         {
    925             rc = pCallbackRead->GetResultCode();
    926             LogFlowThisFunc(("Callback returned rc=%Rrc, cbData=%RU32\n", rc, pCallbackRead->GetDataSize()));
    927 
    928             if (RT_SUCCESS(rc))
     922        vrc = pCallbackRead->Wait(uTimeoutMS);
     923        if (RT_SUCCESS(vrc)) /* Wait was successful, check for supplied information. */
     924        {
     925            vrc = pCallbackRead->GetResultCode();
     926            LogFlowThisFunc(("Callback returned vrc=%Rrc, cbData=%RU32\n", vrc, pCallbackRead->GetDataSize()));
     927
     928            if (RT_SUCCESS(vrc))
    929929            {
    930930                Assert(pCallbackRead->GetDataSize() == sizeof(CALLBACKDATAEXECOUT));
     
    946946        }
    947947        else
    948             rc = VERR_TIMEOUT;
     948            vrc = VERR_TIMEOUT;
    949949    }
    950950
     
    953953    AssertPtr(pCallbackRead);
    954954    int rc2 = callbackRemove(uContextID);
    955     if (RT_SUCCESS(rc))
    956         rc = rc2;
    957 
    958     LogFlowFuncLeaveRC(rc);
    959     return rc;
     955    if (RT_SUCCESS(vrc))
     956        vrc = rc2;
     957
     958    LogFlowFuncLeaveRC(vrc);
     959    return vrc;
    960960}
    961961
     
    973973
    974974    LogFlowThisFunc(("uFunction=%RU32, uParms=%RU32\n", uFunction, uParms));
    975     int rc = pVMMDev->hgcmHostCall("VBoxGuestControlSvc", uFunction, uParms, paParms);
    976     if (RT_FAILURE(rc))
     975    int vrc = pVMMDev->hgcmHostCall("VBoxGuestControlSvc", uFunction, uParms, paParms);
     976    if (RT_FAILURE(vrc))
    977977    {
    978978        int rc2;
    979         if (rc == VERR_INVALID_VM_HANDLE)
    980             rc2 = setErrorInternal(rc, tr("VMM device is not available (is the VM running?)"));
    981         else if (rc == VERR_NOT_FOUND)
    982             rc2 = setErrorInternal(rc, tr("The guest execution service is not ready (yet)"));
    983         else if (rc == VERR_HGCM_SERVICE_NOT_FOUND)
    984             rc2 = setErrorInternal(rc, tr("The guest execution service is not available"));
     979        if (vrc == VERR_INVALID_VM_HANDLE)
     980            rc2 = setErrorInternal(vrc, tr("VMM device is not available (is the VM running?)"));
     981        else if (vrc == VERR_NOT_FOUND)
     982            rc2 = setErrorInternal(vrc, tr("The guest execution service is not ready (yet)"));
     983        else if (vrc == VERR_HGCM_SERVICE_NOT_FOUND)
     984            rc2 = setErrorInternal(vrc, tr("The guest execution service is not available"));
    985985        else
    986             rc2 = setErrorInternal(rc, Utf8StrFmt(tr("The HGCM call failed with error %Rrc"), rc));
     986            rc2 = setErrorInternal(vrc, Utf8StrFmt(tr("The HGCM call failed with error %Rrc"), vrc));
    987987        AssertRC(rc2);
    988988    }
    989989
    990     LogFlowFuncLeaveRC(rc);
    991     return rc;
     990    LogFlowFuncLeaveRC(vrc);
     991    return vrc;
    992992}
    993993
    994994/* Does not do locking; caller is responsible for that! */
    995 int GuestProcess::setErrorInternal(int rc, const Utf8Str &strMessage)
    996 {
    997     LogFlowThisFunc(("rc=%Rrc, strMsg=%s\n", rc, strMessage.c_str()));
    998 
    999     Assert(RT_FAILURE(rc));
     995int GuestProcess::setErrorInternal(int vrc, const Utf8Str &strMessage)
     996{
     997    LogFlowThisFunc(("vrc=%Rrc, strMsg=%s\n", vrc, strMessage.c_str()));
     998
     999    Assert(RT_FAILURE(vrc));
    10001000    Assert(!strMessage.isEmpty());
    10011001
     
    10081008
    10091009    mData.mStatus = ProcessStatus_Error;
    1010     mData.mRC = rc;
     1010    mData.mRC = vrc;
    10111011    mData.mErrorMsg = strMessage;
    10121012
     
    10291029    /* Note: No write locking here -- already done in the caller. */
    10301030
    1031     int rc = VINF_SUCCESS;
     1031    int vrc = VINF_SUCCESS;
    10321032    if (mData.mWaitEvent)
    1033         rc = mData.mWaitEvent->Signal(enmWaitResult);
    1034     LogFlowFuncLeaveRC(rc);
    1035     return rc;
     1033        vrc = mData.mWaitEvent->Signal(enmWaitResult);
     1034    LogFlowFuncLeaveRC(vrc);
     1035    return vrc;
    10361036}
    10371037
     
    10451045    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    10461046
    1047     int rc;
     1047    int vrc;
    10481048    uint32_t uContextID = 0;
    10491049    GuestCtrlCallback *pCallbackStart = new GuestCtrlCallback();
     
    10541054
    10551055    /* Create callback and add it to the map. */
    1056     rc = pCallbackStart->Init(VBOXGUESTCTRLCALLBACKTYPE_EXEC_START);
    1057     if (RT_SUCCESS(rc))
    1058         rc = callbackAdd(pCallbackStart, &uContextID);
    1059 
    1060     if (RT_SUCCESS(rc))
     1056    vrc = pCallbackStart->Init(VBOXGUESTCTRLCALLBACKTYPE_EXEC_START);
     1057    if (RT_SUCCESS(vrc))
     1058        vrc = callbackAdd(pCallbackStart, &uContextID);
     1059
     1060    if (RT_SUCCESS(vrc))
    10611061    {
    10621062        GuestSession *pSession = mData.mParent;
     
    10721072            char **papszArgv = (char**)RTMemAlloc(sizeof(char*) * (cArgs + 1));
    10731073            AssertReturn(papszArgv, VERR_NO_MEMORY);
    1074             for (size_t i = 0; RT_SUCCESS(rc) && i < cArgs; i++)
    1075                 rc = RTStrDupEx(&papszArgv[i], mData.mProcess.mArguments[i].c_str());
     1074            for (size_t i = 0; RT_SUCCESS(vrc) && i < cArgs; i++)
     1075                vrc = RTStrDupEx(&papszArgv[i], mData.mProcess.mArguments[i].c_str());
    10761076            papszArgv[cArgs] = NULL;
    10771077
    1078             if (RT_SUCCESS(rc))
    1079                 rc = RTGetOptArgvToString(&pszArgs, papszArgv, RTGETOPTARGV_CNV_QUOTE_MS_CRT);
     1078            if (RT_SUCCESS(vrc))
     1079                vrc = RTGetOptArgvToString(&pszArgs, papszArgv, RTGETOPTARGV_CNV_QUOTE_MS_CRT);
    10801080        }
    10811081        size_t cbArgs = pszArgs ? strlen(pszArgs) + 1 : 0; /* Include terminating zero. */
     
    10841084        void *pvEnv = NULL;
    10851085        size_t cbEnv = 0;
    1086         rc = mData.mProcess.mEnvironment.BuildEnvironmentBlock(&pvEnv, &cbEnv, NULL /* cEnv */);
    1087 
    1088         if (RT_SUCCESS(rc))
     1086        vrc = mData.mProcess.mEnvironment.BuildEnvironmentBlock(&pvEnv, &cbEnv, NULL /* cEnv */);
     1087
     1088        if (RT_SUCCESS(vrc))
    10891089        {
    10901090            /* Prepare HGCM call. */
     
    11161116
    11171117            /* Note: Don't hold the write lock in here, because setErrorInternal */
    1118             rc = sendCommand(HOST_EXEC_CMD, i, paParms);
     1118            vrc = sendCommand(HOST_EXEC_CMD, i, paParms);
    11191119        }
    11201120
     
    11281128        alock.release();
    11291129
    1130         if (RT_SUCCESS(rc))
     1130        if (RT_SUCCESS(vrc))
    11311131        {
    11321132            /*
     
    11351135             */
    11361136            LogFlowThisFunc(("Waiting for callback (%RU32ms) ...\n", uTimeoutMS));
    1137             rc = pCallbackStart->Wait(uTimeoutMS);
    1138             if (RT_SUCCESS(rc)) /* Wait was successful, check for supplied information. */
     1137            vrc = pCallbackStart->Wait(uTimeoutMS);
     1138            if (RT_SUCCESS(vrc)) /* Wait was successful, check for supplied information. */
    11391139            {
    1140                 rc = pCallbackStart->GetResultCode();
    1141                 LogFlowThisFunc(("Callback returned rc=%Rrc\n", rc));
     1140                vrc = pCallbackStart->GetResultCode();
     1141                LogFlowThisFunc(("Callback returned vrc=%Rrc\n", vrc));
    11421142            }
    11431143            else
    1144                 rc = VERR_TIMEOUT;
     1144                vrc = VERR_TIMEOUT;
    11451145        }
    11461146
     
    11491149        AssertPtr(pCallbackStart);
    11501150        int rc2 = callbackRemove(uContextID);
    1151         if (RT_SUCCESS(rc))
    1152             rc = rc2;
    1153     }
    1154 
    1155     LogFlowFuncLeaveRC(rc);
    1156     return rc;
     1151        if (RT_SUCCESS(vrc))
     1152            vrc = rc2;
     1153    }
     1154
     1155    LogFlowFuncLeaveRC(vrc);
     1156    return vrc;
    11571157}
    11581158
     
    11661166    AssertReturn(pTask->isOk(), pTask->rc());
    11671167
    1168     int rc = RTThreadCreate(NULL, GuestProcess::startProcessThread,
     1168    int vrc = RTThreadCreate(NULL, GuestProcess::startProcessThread,
    11691169                            (void *)pTask.get(), 0,
    11701170                            RTTHREADTYPE_MAIN_WORKER, 0,
    11711171                            "gctlPrcStart");
    1172     if (RT_SUCCESS(rc))
     1172    if (RT_SUCCESS(vrc))
    11731173    {
    11741174        /* pTask is now owned by startProcessThread(), so release it. */
     
    11761176    }
    11771177
    1178     LogFlowFuncLeaveRC(rc);
    1179     return rc;
     1178    LogFlowFuncLeaveRC(vrc);
     1179    return vrc;
    11801180}
    11811181
     
    11931193    if (FAILED(autoCaller.rc())) return autoCaller.rc();
    11941194
    1195     int rc = pProcess->startProcess();
    1196     if (RT_FAILURE(rc))
     1195    int vrc = pProcess->startProcess();
     1196    if (RT_FAILURE(vrc))
    11971197    {
    11981198        /** @todo What now? */
    11991199    }
    12001200
    1201     LogFlowFuncLeaveRC(rc);
    1202     return rc;
     1201    LogFlowFuncLeaveRC(vrc);
     1202    return vrc;
    12031203}
    12041204
     
    13441344    alock.release(); /* Release lock before waiting. */
    13451345
    1346     int rc = mData.mWaitEvent->Wait(uTimeoutMS);
    1347     if (RT_SUCCESS(rc))
     1346    int vrc = mData.mWaitEvent->Wait(uTimeoutMS);
     1347    if (RT_SUCCESS(vrc))
    13481348        waitRes = mData.mWaitEvent->GetResult();
    13491349
     
    13571357    mData.mWaitCount--;
    13581358
    1359     LogFlowFuncLeaveRC(rc);
    1360     return rc;
     1359    LogFlowFuncLeaveRC(vrc);
     1360    return vrc;
    13611361}
    13621362
     
    13651365    LogFlowThisFunc(("uTimeoutMS=%RU32\n", uTimeoutMS));
    13661366
    1367     int rc = VINF_SUCCESS;
     1367    int vrc = VINF_SUCCESS;
    13681368
    13691369    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     
    13731373
    13741374        GuestProcessWaitResult waitRes;
    1375         rc = waitFor(ProcessWaitForFlag_Start, uTimeoutMS, waitRes);
    1376         if (   RT_FAILURE(rc)
     1375        vrc = waitFor(ProcessWaitForFlag_Start, uTimeoutMS, waitRes);
     1376        if (   RT_FAILURE(vrc)
    13771377            || (    waitRes.mResult == ProcessWaitResult_Start
    13781378                &&  waitRes.mResult == ProcessWaitResult_Any
     
    13801380           )
    13811381        {
    1382             if (RT_SUCCESS(rc))
    1383                 rc = waitRes.mRC;
    1384         }
    1385     }
    1386 
    1387     LogFlowFuncLeaveRC(rc);
    1388     return rc;
     1382            if (RT_SUCCESS(vrc))
     1383                vrc = waitRes.mRC;
     1384        }
     1385    }
     1386
     1387    LogFlowFuncLeaveRC(vrc);
     1388    return vrc;
    13891389}
    13901390
     
    14071407
    14081408    /* Create callback and add it to the map. */
    1409     int rc = pCallbackWrite->Init(VBOXGUESTCTRLCALLBACKTYPE_EXEC_INPUT_STATUS);
    1410     if (RT_SUCCESS(rc))
    1411         rc = callbackAdd(pCallbackWrite, &uContextID);
     1409    int vrc = pCallbackWrite->Init(VBOXGUESTCTRLCALLBACKTYPE_EXEC_INPUT_STATUS);
     1410    if (RT_SUCCESS(vrc))
     1411        vrc = callbackAdd(pCallbackWrite, &uContextID);
    14121412
    14131413    alock.release(); /* Drop the write lock again. */
    14141414
    1415     if (RT_SUCCESS(rc))
     1415    if (RT_SUCCESS(vrc))
    14161416    {
    14171417        VBOXHGCMSVCPARM paParms[5];
     
    14241424        paParms[i++].setUInt32(cbData);
    14251425
    1426         rc = sendCommand(HOST_EXEC_SET_INPUT, i, paParms);
    1427     }
    1428 
    1429     if (RT_SUCCESS(rc))
     1426        vrc = sendCommand(HOST_EXEC_SET_INPUT, i, paParms);
     1427    }
     1428
     1429    if (RT_SUCCESS(vrc))
    14301430    {
    14311431        /*
     
    14341434         */
    14351435        LogFlowThisFunc(("Waiting for callback (%RU32ms) ...\n", uTimeoutMS));
    1436         rc = pCallbackWrite->Wait(uTimeoutMS);
    1437         if (RT_SUCCESS(rc)) /* Wait was successful, check for supplied information. */
    1438         {
    1439             rc = pCallbackWrite->GetResultCode();
    1440             LogFlowThisFunc(("Callback returned rc=%Rrc, cbData=%RU32\n", rc, pCallbackWrite->GetDataSize()));
    1441 
    1442             if (RT_SUCCESS(rc))
     1436        vrc = pCallbackWrite->Wait(uTimeoutMS);
     1437        if (RT_SUCCESS(vrc)) /* Wait was successful, check for supplied information. */
     1438        {
     1439            vrc = pCallbackWrite->GetResultCode();
     1440            LogFlowThisFunc(("Callback returned vrc=%Rrc, cbData=%RU32\n", vrc, pCallbackWrite->GetDataSize()));
     1441
     1442            if (RT_SUCCESS(vrc))
    14431443            {
    14441444                Assert(pCallbackWrite->GetDataSize() == sizeof(CALLBACKDATAEXECINSTATUS));
     
    14541454
    14551455                    case INPUT_STS_ERROR:
    1456                         rc = pData->u32Flags; /** @todo Fix int vs. uint32_t! */
     1456                        vrc = pData->u32Flags; /** @todo Fix int vs. uint32_t! */
    14571457                        break;
    14581458
    14591459                    case INPUT_STS_TERMINATED:
    1460                         rc = VERR_CANCELLED;
     1460                        vrc = VERR_CANCELLED;
    14611461                        break;
    14621462
    14631463                    case INPUT_STS_OVERFLOW:
    1464                         rc = VERR_BUFFER_OVERFLOW;
     1464                        vrc = VERR_BUFFER_OVERFLOW;
    14651465                        break;
    14661466
     
    14771477        }
    14781478        else
    1479             rc = VERR_TIMEOUT;
     1479            vrc = VERR_TIMEOUT;
    14801480    }
    14811481
     
    14841484    AssertPtr(pCallbackWrite);
    14851485    int rc2 = callbackRemove(uContextID);
    1486     if (RT_SUCCESS(rc))
    1487         rc = rc2;
    1488 
    1489     LogFlowFuncLeaveRC(rc);
    1490     return rc;
     1486    if (RT_SUCCESS(vrc))
     1487        vrc = rc2;
     1488
     1489    LogFlowFuncLeaveRC(vrc);
     1490    return vrc;
    14911491}
    14921492
     
    15101510
    15111511    size_t cbRead;
    1512     int rc = readData(aHandle, aSize, aTimeoutMS, data.raw(), aSize, &cbRead);
    1513     if (RT_SUCCESS(rc))
     1512    int vrc = readData(aHandle, aSize, aTimeoutMS, data.raw(), aSize, &cbRead);
     1513    if (RT_SUCCESS(vrc))
    15141514    {
    15151515        if (data.size() != cbRead)
     
    15191519
    15201520    /** @todo Do setError() here. */
    1521     HRESULT hr = RT_SUCCESS(rc) ? S_OK : VBOX_E_IPRT_ERROR;
    1522     LogFlowFuncLeaveRC(rc);
     1521    HRESULT hr = RT_SUCCESS(vrc) ? S_OK : VBOX_E_IPRT_ERROR;
     1522    LogFlowFuncLeaveRC(vrc);
    15231523
    15241524    return hr;
     
    15361536    if (FAILED(autoCaller.rc())) return autoCaller.rc();
    15371537
    1538     int rc = terminateProcess();
     1538    int vrc = terminateProcess();
    15391539    /** @todo Do setError() here. */
    1540     HRESULT hr = RT_SUCCESS(rc) ? S_OK : VBOX_E_IPRT_ERROR;
    1541     LogFlowFuncLeaveRC(rc);
     1540    HRESULT hr = RT_SUCCESS(vrc) ? S_OK : VBOX_E_IPRT_ERROR;
     1541    LogFlowFuncLeaveRC(vrc);
    15421542
    15431543    return hr;
     
    15631563
    15641564    GuestProcessWaitResult waitRes;
    1565     int rc = waitFor(aWaitFlags, aTimeoutMS, waitRes);
    1566     if (RT_SUCCESS(rc))
     1565    int vrc = waitFor(aWaitFlags, aTimeoutMS, waitRes);
     1566    if (RT_SUCCESS(vrc))
    15671567    {
    15681568        *aReason = waitRes.mResult;
     
    15711571    else
    15721572    {
    1573         if (rc == VERR_TIMEOUT)
     1573        if (vrc == VERR_TIMEOUT)
    15741574            hr = setError(VBOX_E_IPRT_ERROR,
    15751575                          tr("Process \"%s\" (PID %RU32) did not respond within time (%RU32ms)"),
     
    15771577        else
    15781578            hr = setError(VBOX_E_IPRT_ERROR,
    1579                           tr("Waiting for process \"%s\" (PID %RU32) failed with rc=%Rrc"),
    1580                           mData.mProcess.mCommand.c_str(), mData.mPID, rc);
    1581     }
    1582     LogFlowFuncLeaveRC(rc);
     1579                          tr("Waiting for process \"%s\" (PID %RU32) failed with vrc=%Rrc"),
     1580                          mData.mProcess.mCommand.c_str(), mData.mPID, vrc);
     1581    }
     1582    LogFlowFuncLeaveRC(vrc);
    15831583    return hr;
    15841584#endif /* VBOX_WITH_GUEST_CONTROL */
     
    16251625
    16261626    com::SafeArray<BYTE> data(ComSafeArrayInArg(aData));
    1627     int rc = writeData(aHandle, aFlags, data.raw(), data.size(), aTimeoutMS, (uint32_t*)aWritten);
     1627    int vrc = writeData(aHandle, aFlags, data.raw(), data.size(), aTimeoutMS, (uint32_t*)aWritten);
    16281628    /** @todo Do setError() here. */
    1629     HRESULT hr = RT_SUCCESS(rc) ? S_OK : VBOX_E_IPRT_ERROR;
    1630     LogFlowFuncLeaveRC(rc);
     1629    HRESULT hr = RT_SUCCESS(vrc) ? S_OK : VBOX_E_IPRT_ERROR;
     1630    LogFlowFuncLeaveRC(vrc);
    16311631
    16321632    return hr;
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