Index: trunk/src/VBox/Main/src-client/GuestCtrlImpl.cpp
===================================================================
--- trunk/src/VBox/Main/src-client/GuestCtrlImpl.cpp	(revision 71273)
+++ trunk/src/VBox/Main/src-client/GuestCtrlImpl.cpp	(revision 71299)
@@ -546,9 +546,9 @@
     {
         Assert(!pSession.isNull());
-        int guestRc;
-        rc = pSession->i_startSessionInternal(&guestRc);
+        int rcGuest;
+        rc = pSession->i_startSessionInternal(&rcGuest);
         if (RT_FAILURE(rc))
         {
-            /** @todo Handle guestRc! */
+            /** @todo Handle rcGuest! */
 
             hr = setError(VBOX_E_IPRT_ERROR, tr("Could not open guest session: %Rrc"), rc);
Index: trunk/src/VBox/Main/src-client/GuestCtrlPrivate.cpp
===================================================================
--- trunk/src/VBox/Main/src-client/GuestCtrlPrivate.cpp	(revision 71273)
+++ trunk/src/VBox/Main/src-client/GuestCtrlPrivate.cpp	(revision 71299)
@@ -935,16 +935,16 @@
 
 int GuestBase::signalWaitEventInternal(PVBOXGUESTCTRLHOSTCBCTX pCbCtx,
-                                       int guestRc, const GuestWaitEventPayload *pPayload)
-{
-    if (RT_SUCCESS(guestRc))
+                                       int rcGuest, const GuestWaitEventPayload *pPayload)
+{
+    if (RT_SUCCESS(rcGuest))
         return signalWaitEventInternalEx(pCbCtx, VINF_SUCCESS,
                                          0 /* Guest rc */, pPayload);
 
     return signalWaitEventInternalEx(pCbCtx, VERR_GSTCTL_GUEST_ERROR,
-                                     guestRc, pPayload);
+                                     rcGuest, pPayload);
 }
 
 int GuestBase::signalWaitEventInternalEx(PVBOXGUESTCTRLHOSTCBCTX pCbCtx,
-                                         int rc, int guestRc,
+                                         int rc, int rcGuest,
                                          const GuestWaitEventPayload *pPayload)
 {
@@ -958,9 +958,9 @@
         if (itEvent != mWaitEvents.end())
         {
-            LogFlowThisFunc(("Signalling event=%p (CID %RU32, rc=%Rrc, guestRc=%Rrc, pPayload=%p) ...\n",
-                             itEvent->second, itEvent->first, rc, guestRc, pPayload));
+            LogFlowThisFunc(("Signalling event=%p (CID %RU32, rc=%Rrc, rcGuest=%Rrc, pPayload=%p) ...\n",
+                             itEvent->second, itEvent->first, rc, rcGuest, pPayload));
             GuestWaitEvent *pEvent = itEvent->second;
             AssertPtr(pEvent);
-            rc2 = pEvent->SignalInternal(rc, guestRc, pPayload);
+            rc2 = pEvent->SignalInternal(rc, rcGuest, pPayload);
         }
         else
@@ -1164,5 +1164,5 @@
 }
 
-int GuestWaitEventBase::SignalInternal(int rc, int guestRc,
+int GuestWaitEventBase::SignalInternal(int rc, int rcGuest,
                                        const GuestWaitEventPayload *pPayload)
 {
@@ -1172,7 +1172,7 @@
 #ifdef VBOX_STRICT
     if (rc == VERR_GSTCTL_GUEST_ERROR)
-        AssertMsg(RT_FAILURE(guestRc), ("Guest error indicated but no actual guest error set (%Rrc)\n", guestRc));
+        AssertMsg(RT_FAILURE(rcGuest), ("Guest error indicated but no actual guest error set (%Rrc)\n", rcGuest));
     else
-        AssertMsg(RT_SUCCESS(guestRc), ("No guest error indicated but actual guest error set (%Rrc)\n", guestRc));
+        AssertMsg(RT_SUCCESS(rcGuest), ("No guest error indicated but actual guest error set (%Rrc)\n", rcGuest));
 #endif
 
@@ -1185,5 +1185,5 @@
     {
         mRc = rc;
-        mGuestRc = guestRc;
+        mGuestRc = rcGuest;
 
         rc2 = RTSemEventSignal(mEventSem);
Index: trunk/src/VBox/Main/src-client/GuestDirectoryImpl.cpp
===================================================================
--- trunk/src/VBox/Main/src-client/GuestDirectoryImpl.cpp	(revision 71273)
+++ trunk/src/VBox/Main/src-client/GuestDirectoryImpl.cpp	(revision 71299)
@@ -209,10 +209,10 @@
 
 /* static */
-Utf8Str GuestDirectory::i_guestErrorToString(int guestRc)
+Utf8Str GuestDirectory::i_guestErrorToString(int rcGuest)
 {
     Utf8Str strError;
 
     /** @todo pData->u32Flags: int vs. uint32 -- IPRT errors are *negative* !!! */
-    switch (guestRc)
+    switch (rcGuest)
     {
         case VERR_DIR_NOT_EMPTY:
@@ -221,5 +221,5 @@
 
         default:
-            strError += Utf8StrFmt("%Rrc", guestRc);
+            strError += Utf8StrFmt("%Rrc", rcGuest);
             break;
     }
@@ -247,11 +247,11 @@
  *
  * @return VBox status code.
- * @param  pGuestRc             Where to store the guest result code in case VERR_GSTCTL_GUEST_ERROR is returned.
- */
-int GuestDirectory::i_closeInternal(int *pGuestRc)
-{
-    AssertPtrReturn(pGuestRc, VERR_INVALID_POINTER);
-
-    int rc = mData.mProcessTool.terminate(30 * 1000 /* 30s timeout */, pGuestRc);
+ * @param  prcGuest             Where to store the guest result code in case VERR_GSTCTL_GUEST_ERROR is returned.
+ */
+int GuestDirectory::i_closeInternal(int *prcGuest)
+{
+    AssertPtrReturn(prcGuest, VERR_INVALID_POINTER);
+
+    int rc = mData.mProcessTool.terminate(30 * 1000 /* 30s timeout */, prcGuest);
     if (RT_FAILURE(rc))
         return rc;
@@ -271,9 +271,9 @@
  * @return VBox status code. Will return VERR_NO_MORE_FILES if no more entries are available.
  * @param  fsObjInfo            Where to store the read directory entry.
- * @param  pGuestRc             Where to store the guest result code in case VERR_GSTCTL_GUEST_ERROR is returned.
- */
-int GuestDirectory::i_readInternal(ComObjPtr<GuestFsObjInfo> &fsObjInfo, int *pGuestRc)
-{
-    AssertPtrReturn(pGuestRc, VERR_INVALID_POINTER);
+ * @param  prcGuest             Where to store the guest result code in case VERR_GSTCTL_GUEST_ERROR is returned.
+ */
+int GuestDirectory::i_readInternal(ComObjPtr<GuestFsObjInfo> &fsObjInfo, int *prcGuest)
+{
+    AssertPtrReturn(prcGuest, VERR_INVALID_POINTER);
 
     /* Create the FS info object. */
@@ -284,5 +284,5 @@
     GuestProcessStreamBlock curBlock;
     int rc = mData.mProcessTool.waitEx(GUESTPROCESSTOOL_WAIT_FLAG_STDOUT_BLOCK,
-                                         &curBlock, pGuestRc);
+                                         &curBlock, prcGuest);
     if (RT_SUCCESS(rc))
     {
@@ -320,10 +320,10 @@
 
 /* static */
-HRESULT GuestDirectory::i_setErrorExternal(VirtualBoxBase *pInterface, int guestRc)
+HRESULT GuestDirectory::i_setErrorExternal(VirtualBoxBase *pInterface, int rcGuest)
 {
     AssertPtr(pInterface);
-    AssertMsg(RT_FAILURE(guestRc), ("Guest rc does not indicate a failure when setting error\n"));
-
-    return pInterface->setError(VBOX_E_IPRT_ERROR, GuestDirectory::i_guestErrorToString(guestRc).c_str());
+    AssertMsg(RT_FAILURE(rcGuest), ("Guest rc does not indicate a failure when setting error\n"));
+
+    return pInterface->setError(VBOX_E_IPRT_ERROR, GuestDirectory::i_guestErrorToString(rcGuest).c_str());
 }
 
Index: trunk/src/VBox/Main/src-client/GuestFileImpl.cpp
===================================================================
--- trunk/src/VBox/Main/src-client/GuestFileImpl.cpp	(revision 71273)
+++ trunk/src/VBox/Main/src-client/GuestFileImpl.cpp	(revision 71299)
@@ -355,5 +355,5 @@
 }
 
-int GuestFile::i_closeFile(int *pGuestRc)
+int GuestFile::i_closeFile(int *prcGuest)
 {
     LogFlowThisFunc(("strFile=%s\n", mData.mOpenInfo.mFileName.c_str()));
@@ -386,5 +386,5 @@
     if (RT_SUCCESS(vrc))
         vrc = i_waitForStatusChange(pEvent, 30 * 1000 /* Timeout in ms */,
-                                    NULL /* FileStatus */, pGuestRc);
+                                    NULL /* FileStatus */, prcGuest);
     unregisterWaitEvent(pEvent);
 
@@ -394,10 +394,10 @@
 
 /* static */
-Utf8Str GuestFile::i_guestErrorToString(int guestRc)
+Utf8Str GuestFile::i_guestErrorToString(int rcGuest)
 {
     Utf8Str strError;
 
     /** @todo pData->u32Flags: int vs. uint32 -- IPRT errors are *negative* !!! */
-    switch (guestRc)
+    switch (rcGuest)
     {
         case VERR_ALREADY_EXISTS:
@@ -418,5 +418,5 @@
 
         default:
-            strError += Utf8StrFmt("%Rrc", guestRc);
+            strError += Utf8StrFmt("%Rrc", rcGuest);
             break;
     }
@@ -443,16 +443,16 @@
     pSvcCbData->mpaParms[idx++].getUInt32(&dataCb.rc);
 
-    int guestRc = (int)dataCb.rc; /* uint32_t vs. int. */
-
-    LogFlowFunc(("uType=%RU32, guestRc=%Rrc\n",
-                 dataCb.uType, guestRc));
-
-    if (RT_FAILURE(guestRc))
-    {
-        int rc2 = i_setFileStatus(FileStatus_Error, guestRc);
+    int rcGuest = (int)dataCb.rc; /* uint32_t vs. int. */
+
+    LogFlowFunc(("uType=%RU32, rcGuest=%Rrc\n",
+                 dataCb.uType, rcGuest));
+
+    if (RT_FAILURE(rcGuest))
+    {
+        int rc2 = i_setFileStatus(FileStatus_Error, rcGuest);
         AssertRC(rc2);
 
         rc2 = signalWaitEventInternal(pCbCtx,
-                                      guestRc, NULL /* pPayload */);
+                                      rcGuest, NULL /* pPayload */);
         AssertRC(rc2);
 
@@ -464,5 +464,5 @@
         case GUEST_FILE_NOTIFYTYPE_ERROR:
         {
-            int rc2 = i_setFileStatus(FileStatus_Error, guestRc);
+            int rc2 = i_setFileStatus(FileStatus_Error, rcGuest);
             AssertRC(rc2);
 
@@ -481,5 +481,5 @@
 
                 /* Set the process status. */
-                int rc2 = i_setFileStatus(FileStatus_Open, guestRc);
+                int rc2 = i_setFileStatus(FileStatus_Open, rcGuest);
                 AssertRC(rc2);
             }
@@ -492,5 +492,5 @@
         case GUEST_FILE_NOTIFYTYPE_CLOSE:
         {
-            int rc2 = i_setFileStatus(FileStatus_Closed, guestRc);
+            int rc2 = i_setFileStatus(FileStatus_Closed, rcGuest);
             AssertRC(rc2);
 
@@ -592,9 +592,9 @@
     {
         GuestWaitEventPayload payload(dataCb.uType, &dataCb, sizeof(dataCb));
-        int rc2 = signalWaitEventInternal(pCbCtx, guestRc, &payload);
+        int rc2 = signalWaitEventInternal(pCbCtx, rcGuest, &payload);
         AssertRC(rc2);
     }
 
-    LogFlowThisFunc(("uType=%RU32, guestRc=%Rrc\n",
+    LogFlowThisFunc(("uType=%RU32, rcGuest=%Rrc\n",
                      dataCb.uType, dataCb.rc));
 
@@ -642,5 +642,5 @@
 }
 
-int GuestFile::i_openFile(uint32_t uTimeoutMS, int *pGuestRc)
+int GuestFile::i_openFile(uint32_t uTimeoutMS, int *prcGuest)
 {
     LogFlowThisFuncEnter();
@@ -688,5 +688,5 @@
     if (RT_SUCCESS(vrc))
         vrc = i_waitForStatusChange(pEvent, uTimeoutMS,
-                                    NULL /* FileStatus */, pGuestRc);
+                                    NULL /* FileStatus */, prcGuest);
 
     unregisterWaitEvent(pEvent);
@@ -860,10 +860,10 @@
 
 /* static */
-HRESULT GuestFile::i_setErrorExternal(VirtualBoxBase *pInterface, int guestRc)
+HRESULT GuestFile::i_setErrorExternal(VirtualBoxBase *pInterface, int rcGuest)
 {
     AssertPtr(pInterface);
-    AssertMsg(RT_FAILURE(guestRc), ("Guest rc does not indicate a failure when setting error\n"));
-
-    return pInterface->setError(VBOX_E_IPRT_ERROR, GuestFile::i_guestErrorToString(guestRc).c_str());
+    AssertMsg(RT_FAILURE(rcGuest), ("Guest rc does not indicate a failure when setting error\n"));
+
+    return pInterface->setError(VBOX_E_IPRT_ERROR, GuestFile::i_guestErrorToString(rcGuest).c_str());
 }
 
@@ -985,5 +985,5 @@
 
 int GuestFile::i_waitForStatusChange(GuestWaitEvent *pEvent, uint32_t uTimeoutMS,
-                                     FileStatus_T *pFileStatus, int *pGuestRc)
+                                     FileStatus_T *pFileStatus, int *prcGuest)
 {
     AssertPtrReturn(pEvent, VERR_INVALID_POINTER);
@@ -1021,6 +1021,6 @@
             vrc = VERR_GSTCTL_GUEST_ERROR;
 
-        if (pGuestRc)
-            *pGuestRc = (int)lGuestRc;
+        if (prcGuest)
+            *prcGuest = (int)lGuestRc;
     }
 
@@ -1183,6 +1183,6 @@
 
     /* Close file on guest. */
-    int guestRc;
-    int rc = i_closeFile(&guestRc);
+    int rcGuest;
+    int rc = i_closeFile(&rcGuest);
     /* On failure don't return here, instead do all the cleanup
      * work first and then return an error. */
@@ -1196,5 +1196,5 @@
     {
         if (rc == VERR_GSTCTL_GUEST_ERROR)
-            return GuestFile::i_setErrorExternal(this, guestRc);
+            return GuestFile::i_setErrorExternal(this, rcGuest);
 
         return setError(VBOX_E_IPRT_ERROR,
Index: trunk/src/VBox/Main/src-client/GuestProcessImpl.cpp
===================================================================
--- trunk/src/VBox/Main/src-client/GuestProcessImpl.cpp	(revision 71273)
+++ trunk/src/VBox/Main/src-client/GuestProcessImpl.cpp	(revision 71299)
@@ -282,6 +282,6 @@
 
     /* Terminate process if not already done yet. */
-    int guestRc = VINF_SUCCESS;
-    int vrc = i_terminateProcess(30 * 1000, &guestRc); /** @todo Make timeouts configurable. */
+    int rcGuest = VINF_SUCCESS;
+    int vrc = i_terminateProcess(30 * 1000, &rcGuest); /** @todo Make timeouts configurable. */
     /* Note: Don't return here yet; first uninit all other stuff in
      *       case of failure. */
@@ -295,6 +295,6 @@
     baseUninit();
 
-    LogFlowThisFunc(("Returning rc=%Rrc, guestRc=%Rrc\n",
-                     vrc, guestRc));
+    LogFlowThisFunc(("Returning rc=%Rrc, rcGuest=%Rrc\n",
+                     vrc, rcGuest));
     RT_NOREF_PV(vrc);
 }
@@ -495,10 +495,10 @@
 
 /* static */
-Utf8Str GuestProcess::i_guestErrorToString(int guestRc)
+Utf8Str GuestProcess::i_guestErrorToString(int rcGuest)
 {
     Utf8Str strError;
 
     /** @todo pData->u32Flags: int vs. uint32 -- IPRT errors are *negative* !!! */
-    switch (guestRc)
+    switch (rcGuest)
     {
         case VERR_FILE_NOT_FOUND: /* This is the most likely error. */
@@ -549,5 +549,5 @@
 
         default:
-            strError += Utf8StrFmt("%Rrc", guestRc);
+            strError += Utf8StrFmt("%Rrc", rcGuest);
             break;
     }
@@ -851,8 +851,8 @@
 
 int GuestProcess::i_readData(uint32_t uHandle, uint32_t uSize, uint32_t uTimeoutMS,
-                             void *pvData, size_t cbData, uint32_t *pcbRead, int *pGuestRc)
-{
-    LogFlowThisFunc(("uPID=%RU32, uHandle=%RU32, uSize=%RU32, uTimeoutMS=%RU32, pvData=%p, cbData=%RU32, pGuestRc=%p\n",
-                     mData.mPID, uHandle, uSize, uTimeoutMS, pvData, cbData, pGuestRc));
+                             void *pvData, size_t cbData, uint32_t *pcbRead, int *prcGuest)
+{
+    LogFlowThisFunc(("uPID=%RU32, uHandle=%RU32, uSize=%RU32, uTimeoutMS=%RU32, pvData=%p, cbData=%RU32, prcGuest=%p\n",
+                     mData.mPID, uHandle, uSize, uTimeoutMS, pvData, cbData, prcGuest));
     AssertReturn(uSize, VERR_INVALID_PARAMETER);
     AssertPtrReturn(pvData, VERR_INVALID_POINTER);
@@ -874,6 +874,6 @@
         if (pcbRead)
             *pcbRead = 0;
-        if (pGuestRc)
-            *pGuestRc = VINF_SUCCESS;
+        if (prcGuest)
+            *prcGuest = VINF_SUCCESS;
         return VINF_SUCCESS; /* Nothing to read anymore. */
     }
@@ -996,13 +996,13 @@
 
 /* static */
-HRESULT GuestProcess::i_setErrorExternal(VirtualBoxBase *pInterface, int guestRc)
+HRESULT GuestProcess::i_setErrorExternal(VirtualBoxBase *pInterface, int rcGuest)
 {
     AssertPtr(pInterface);
-    AssertMsg(RT_FAILURE(guestRc), ("Guest rc does not indicate a failure when setting error\n"));
-
-    return pInterface->setError(VBOX_E_IPRT_ERROR, GuestProcess::i_guestErrorToString(guestRc).c_str());
-}
-
-int GuestProcess::i_startProcess(uint32_t cMsTimeout, int *pGuestRc)
+    AssertMsg(RT_FAILURE(rcGuest), ("Guest rc does not indicate a failure when setting error\n"));
+
+    return pInterface->setError(VBOX_E_IPRT_ERROR, GuestProcess::i_guestErrorToString(rcGuest).c_str());
+}
+
+int GuestProcess::i_startProcess(uint32_t cMsTimeout, int *prcGuest)
 {
     LogFlowThisFunc(("cMsTimeout=%RU32, procExe=%s, procTimeoutMS=%RU32, procFlags=%x, sessionID=%RU32\n",
@@ -1032,5 +1032,5 @@
         return vrc;
 
-    vrc = i_startProcessInner(cMsTimeout, alock, pEvent, pGuestRc);
+    vrc = i_startProcessInner(cMsTimeout, alock, pEvent, prcGuest);
 
     unregisterWaitEvent(pEvent);
@@ -1040,5 +1040,5 @@
 }
 
-int GuestProcess::i_startProcessInner(uint32_t cMsTimeout, AutoWriteLock &rLock, GuestWaitEvent *pEvent, int *pGuestRc)
+int GuestProcess::i_startProcessInner(uint32_t cMsTimeout, AutoWriteLock &rLock, GuestWaitEvent *pEvent, int *prcGuest)
 {
     GuestSession *pSession = mSession;
@@ -1147,5 +1147,5 @@
     if (RT_SUCCESS(vrc))
         vrc = i_waitForStatusChange(pEvent, cMsTimeout,
-                                    NULL /* Process status */, pGuestRc);
+                                    NULL /* Process status */, prcGuest);
     return vrc;
 }
@@ -1205,7 +1205,7 @@
 }
 
-int GuestProcess::i_terminateProcess(uint32_t uTimeoutMS, int *pGuestRc)
-{
-    /* pGuestRc is optional. */
+int GuestProcess::i_terminateProcess(uint32_t uTimeoutMS, int *prcGuest)
+{
+    /* prcGuest is optional. */
     LogFlowThisFunc(("uTimeoutMS=%RU32\n", uTimeoutMS));
 
@@ -1255,5 +1255,5 @@
             if (RT_SUCCESS(vrc))
                 vrc = i_waitForStatusChange(pEvent, uTimeoutMS,
-                                            NULL /* ProcessStatus */, pGuestRc);
+                                            NULL /* ProcessStatus */, prcGuest);
             unregisterWaitEvent(pEvent);
         }
@@ -1376,5 +1376,5 @@
 
 int GuestProcess::i_waitFor(uint32_t fWaitFlags, ULONG uTimeoutMS,
-                            ProcessWaitResult_T &waitResult, int *pGuestRc)
+                            ProcessWaitResult_T &waitResult, int *prcGuest)
 {
     AssertReturn(fWaitFlags, VERR_INVALID_PARAMETER);
@@ -1382,6 +1382,6 @@
     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
 
-    LogFlowThisFunc(("fWaitFlags=0x%x, uTimeoutMS=%RU32, procStatus=%RU32, procRc=%Rrc, pGuestRc=%p\n",
-                     fWaitFlags, uTimeoutMS, mData.mStatus, mData.mLastError, pGuestRc));
+    LogFlowThisFunc(("fWaitFlags=0x%x, uTimeoutMS=%RU32, procStatus=%RU32, procRc=%Rrc, prcGuest=%p\n",
+                     fWaitFlags, uTimeoutMS, mData.mStatus, mData.mLastError, prcGuest));
 
     /* Did some error occur before? Then skip waiting and return. */
@@ -1392,7 +1392,7 @@
         AssertMsg(RT_FAILURE(mData.mLastError),
                              ("No error rc (%Rrc) set when guest process indicated an error\n", mData.mLastError));
-        if (pGuestRc)
-            *pGuestRc = mData.mLastError; /* Return last set error. */
-        LogFlowThisFunc(("Process is in error state (guestRc=%Rrc)\n", mData.mLastError));
+        if (prcGuest)
+            *prcGuest = mData.mLastError; /* Return last set error. */
+        LogFlowThisFunc(("Process is in error state (rcGuest=%Rrc)\n", mData.mLastError));
         return VERR_GSTCTL_GUEST_ERROR;
     }
@@ -1403,7 +1403,7 @@
     if (waitResult != ProcessWaitResult_None)
     {
-        if (pGuestRc)
-            *pGuestRc = mData.mLastError; /* Return last set error (if any). */
-        LogFlowThisFunc(("Nothing to wait for (guestRc=%Rrc)\n", mData.mLastError));
+        if (prcGuest)
+            *prcGuest = mData.mLastError; /* Return last set error (if any). */
+        LogFlowThisFunc(("Nothing to wait for (rcGuest=%Rrc)\n", mData.mLastError));
         return RT_SUCCESS(mData.mLastError) ? VINF_SUCCESS : VERR_GSTCTL_GUEST_ERROR;
     }
@@ -1451,5 +1451,5 @@
                                     uTimeoutMS == RT_INDEFINITE_WAIT
                                     ? RT_INDEFINITE_WAIT : uTimeoutMS - (uint32_t)u64ElapsedMS,
-                                    &newStatus, pGuestRc);
+                                    &newStatus, prcGuest);
         if (RT_SUCCESS(vrc))
         {
@@ -1598,9 +1598,9 @@
 
 int GuestProcess::i_waitForStatusChange(GuestWaitEvent *pEvent, uint32_t uTimeoutMS,
-                                        ProcessStatus_T *pProcessStatus, int *pGuestRc)
+                                        ProcessStatus_T *pProcessStatus, int *prcGuest)
 {
     AssertPtrReturn(pEvent, VERR_INVALID_POINTER);
     /* pProcessStatus is optional. */
-    /* pGuestRc is optional. */
+    /* prcGuest is optional. */
 
     VBoxEventType_T evtType;
@@ -1628,5 +1628,5 @@
         ComAssertComRC(hr);
 
-        LogFlowThisFunc(("Got procStatus=%RU32, guestRc=%RI32 (%Rrc)\n",
+        LogFlowThisFunc(("Got procStatus=%RU32, rcGuest=%RI32 (%Rrc)\n",
                          procStatus, lGuestRc, lGuestRc));
 
@@ -1634,6 +1634,6 @@
             vrc = VERR_GSTCTL_GUEST_ERROR;
 
-        if (pGuestRc)
-            *pGuestRc = (int)lGuestRc;
+        if (prcGuest)
+            *prcGuest = (int)lGuestRc;
     }
 
@@ -1677,8 +1677,8 @@
 
 int GuestProcess::i_writeData(uint32_t uHandle, uint32_t uFlags,
-                              void *pvData, size_t cbData, uint32_t uTimeoutMS, uint32_t *puWritten, int *pGuestRc)
-{
-    LogFlowThisFunc(("uPID=%RU32, uHandle=%RU32, uFlags=%RU32, pvData=%p, cbData=%RU32, uTimeoutMS=%RU32, puWritten=%p, pGuestRc=%p\n",
-                     mData.mPID, uHandle, uFlags, pvData, cbData, uTimeoutMS, puWritten, pGuestRc));
+                              void *pvData, size_t cbData, uint32_t uTimeoutMS, uint32_t *puWritten, int *prcGuest)
+{
+    LogFlowThisFunc(("uPID=%RU32, uHandle=%RU32, uFlags=%RU32, pvData=%p, cbData=%RU32, uTimeoutMS=%RU32, puWritten=%p, prcGuest=%p\n",
+                     mData.mPID, uHandle, uFlags, pvData, cbData, uTimeoutMS, puWritten, prcGuest));
     /* All is optional. There can be 0 byte writes. */
     AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
@@ -1688,6 +1688,6 @@
         if (puWritten)
             *puWritten = 0;
-        if (pGuestRc)
-            *pGuestRc = VINF_SUCCESS;
+        if (prcGuest)
+            *prcGuest = VINF_SUCCESS;
         return VINF_SUCCESS; /* Not available for writing (anymore). */
     }
@@ -1739,5 +1739,5 @@
         if (RT_SUCCESS(vrc))
         {
-            /** @todo Set guestRc. */
+            /** @todo Set rcGuest. */
 
             if (puWritten)
@@ -1768,6 +1768,6 @@
     HRESULT hr = S_OK;
 
-    uint32_t cbRead; int guestRc;
-    int vrc = i_readData(aHandle, aToRead, aTimeoutMS, &aData.front(), aToRead, &cbRead, &guestRc);
+    uint32_t cbRead; int rcGuest;
+    int vrc = i_readData(aHandle, aToRead, aTimeoutMS, &aData.front(), aToRead, &cbRead, &rcGuest);
     if (RT_SUCCESS(vrc))
     {
@@ -1782,5 +1782,5 @@
         {
             case VERR_GSTCTL_GUEST_ERROR:
-                hr = GuestProcess::i_setErrorExternal(this, guestRc);
+                hr = GuestProcess::i_setErrorExternal(this, rcGuest);
                 break;
 
@@ -1803,7 +1803,7 @@
     HRESULT hr = S_OK;
 
-    int guestRc;
+    int rcGuest;
     int vrc = i_terminateProcess(30 * 1000 /* Timeout in ms */,
-                                 &guestRc);
+                                 &rcGuest);
     if (RT_FAILURE(vrc))
     {
@@ -1811,5 +1811,5 @@
         {
            case VERR_GSTCTL_GUEST_ERROR:
-                hr = GuestProcess::i_setErrorExternal(this, guestRc);
+                hr = GuestProcess::i_setErrorExternal(this, rcGuest);
                 break;
 
@@ -1848,7 +1848,7 @@
     HRESULT hr = S_OK;
 
-    int guestRc;
+    int rcGuest;
     ProcessWaitResult_T waitResult;
-    int vrc = i_waitFor(aWaitFor, aTimeoutMS, waitResult, &guestRc);
+    int vrc = i_waitFor(aWaitFor, aTimeoutMS, waitResult, &rcGuest);
     if (RT_SUCCESS(vrc))
     {
@@ -1860,5 +1860,5 @@
         {
             case VERR_GSTCTL_GUEST_ERROR:
-                hr = GuestProcess::i_setErrorExternal(this, guestRc);
+                hr = GuestProcess::i_setErrorExternal(this, rcGuest);
                 break;
 
@@ -1899,8 +1899,8 @@
     HRESULT hr = S_OK;
 
-    uint32_t cbWritten; int guestRc;
+    uint32_t cbWritten; int rcGuest;
     uint32_t cbData = (uint32_t)aData.size();
     void *pvData = cbData > 0? (void *)&aData.front(): NULL;
-    int vrc = i_writeData(aHandle, aFlags, pvData, cbData, aTimeoutMS, &cbWritten, &guestRc);
+    int vrc = i_writeData(aHandle, aFlags, pvData, cbData, aTimeoutMS, &cbWritten, &rcGuest);
     if (RT_FAILURE(vrc))
     {
@@ -1908,5 +1908,5 @@
         {
             case VERR_GSTCTL_GUEST_ERROR:
-                hr = GuestProcess::i_setErrorExternal(this, guestRc);
+                hr = GuestProcess::i_setErrorExternal(this, rcGuest);
                 break;
 
@@ -1952,9 +1952,9 @@
 GuestProcessTool::~GuestProcessTool(void)
 {
-    terminate(30 * 1000, NULL /* pGuestRc */);
+    terminate(30 * 1000, NULL /* prcGuest */);
 }
 
 int GuestProcessTool::init(GuestSession *pGuestSession, const GuestProcessStartupInfo &startupInfo,
-                           bool fAsync, int *pGuestRc)
+                           bool fAsync, int *prcGuest)
 {
     LogFlowThisFunc(("pGuestSession=%p, exe=%s, fAsync=%RTbool\n",
@@ -1983,6 +1983,6 @@
            )
         {
-            if (pGuestRc)
-                *pGuestRc = vrcGuest;
+            if (prcGuest)
+                *prcGuest = vrcGuest;
             vrc = VERR_GSTCTL_GUEST_ERROR;
         }
@@ -2047,8 +2047,8 @@
 /* static */
 int GuestProcessTool::run(      GuestSession              *pGuestSession,
-                            const GuestProcessStartupInfo   &startupInfo,
-                                  int                       *pGuestRc /* = NULL */)
-{
-    int guestRc;
+                          const GuestProcessStartupInfo   &startupInfo,
+                                int                       *prcGuest /* = NULL */)
+{
+    int rcGuest;
 
     GuestProcessToolErrorInfo errorInfo;
@@ -2056,11 +2056,11 @@
     if (RT_SUCCESS(vrc))
     {
-        if (errorInfo.guestRc == VWRN_GSTCTL_PROCESS_EXIT_CODE)
-            guestRc = GuestProcessTool::exitCodeToRc(startupInfo, errorInfo.iExitCode);
+        if (errorInfo.rcGuest == VWRN_GSTCTL_PROCESS_EXIT_CODE)
+            rcGuest = GuestProcessTool::exitCodeToRc(startupInfo, errorInfo.iExitCode);
         else
-            guestRc = errorInfo.guestRc;
-
-        if (pGuestRc)
-            *pGuestRc = guestRc;
+            rcGuest = errorInfo.rcGuest;
+
+        if (prcGuest)
+            *prcGuest = rcGuest;
     }
 
@@ -2078,6 +2078,6 @@
 /* static */
 int GuestProcessTool::runErrorInfo(      GuestSession              *pGuestSession,
-                                     const GuestProcessStartupInfo   &startupInfo,
-                                           GuestProcessToolErrorInfo &errorInfo)
+                                   const GuestProcessStartupInfo   &startupInfo,
+                                         GuestProcessToolErrorInfo &errorInfo)
 {
     return runExErrorInfo(pGuestSession, startupInfo,
@@ -2095,14 +2095,14 @@
  *                                  Optional.
  * @param   cStrmOutObjects         Number of stream objects passed in. Optional.
- * @param   pGuestRc                Error code returned from the guest side if VERR_GSTCTL_GUEST_ERROR is returned. Optional.
+ * @param   prcGuest                Error code returned from the guest side if VERR_GSTCTL_GUEST_ERROR is returned. Optional.
  */
 /* static */
 int GuestProcessTool::runEx(      GuestSession              *pGuestSession,
-                              const GuestProcessStartupInfo   &startupInfo,
-                                    GuestCtrlStreamObjects    *paStrmOutObjects,
-                                    uint32_t                   cStrmOutObjects,
-                                    int                       *pGuestRc /* = NULL */)
-{
-    int guestRc;
+                            const GuestProcessStartupInfo   &startupInfo,
+                                  GuestCtrlStreamObjects    *paStrmOutObjects,
+                                  uint32_t                   cStrmOutObjects,
+                                  int                       *prcGuest /* = NULL */)
+{
+    int rcGuest;
 
     GuestProcessToolErrorInfo errorInfo;
@@ -2110,15 +2110,15 @@
     if (RT_SUCCESS(vrc))
     {
-        if (errorInfo.guestRc == VWRN_GSTCTL_PROCESS_EXIT_CODE)
-            guestRc = GuestProcessTool::exitCodeToRc(startupInfo, errorInfo.iExitCode);
+        if (errorInfo.rcGuest == VWRN_GSTCTL_PROCESS_EXIT_CODE)
+            rcGuest = GuestProcessTool::exitCodeToRc(startupInfo, errorInfo.iExitCode);
         else
-            guestRc = errorInfo.guestRc;
+            rcGuest = errorInfo.rcGuest;
 
         /* Return VERR_GSTCTL_GUEST_ERROR if we retrieved a guest return code. */
-        if (RT_FAILURE(guestRc))
+        if (RT_FAILURE(rcGuest))
             vrc = VERR_GSTCTL_GUEST_ERROR;
 
-        if (pGuestRc)
-            *pGuestRc = guestRc;
+        if (prcGuest)
+            *prcGuest = rcGuest;
     }
 
@@ -2154,5 +2154,5 @@
 
     GuestProcessTool procTool;
-    int vrc = procTool.init(pGuestSession, startupInfo, false /* Async */, &errorInfo.guestRc);
+    int vrc = procTool.init(pGuestSession, startupInfo, false /* Async */, &errorInfo.rcGuest);
     if (RT_SUCCESS(vrc))
     {
@@ -2164,5 +2164,5 @@
                 vrc = procTool.waitEx(  paStrmOutObjects
                                         ? GUESTPROCESSTOOL_WAIT_FLAG_STDOUT_BLOCK
-                                        : GUESTPROCESSTOOL_WAIT_FLAG_NONE, &strmBlk, &errorInfo.guestRc);
+                                        : GUESTPROCESSTOOL_WAIT_FLAG_NONE, &strmBlk, &errorInfo.rcGuest);
                 if (paStrmOutObjects)
                     paStrmOutObjects->push_back(strmBlk);
@@ -2178,10 +2178,10 @@
     {
         /* Make sure the process runs until completion. */
-        vrc = procTool.wait(GUESTPROCESSTOOL_WAIT_FLAG_NONE, &errorInfo.guestRc);
+        vrc = procTool.wait(GUESTPROCESSTOOL_WAIT_FLAG_NONE, &errorInfo.rcGuest);
         if (RT_SUCCESS(vrc))
-            errorInfo.guestRc = procTool.terminatedOk(&errorInfo.iExitCode);
-    }
-
-    LogFlowFunc(("Returned rc=%Rrc, guestRc=%Rrc, iExitCode=%d\n", vrc, errorInfo.guestRc, errorInfo.iExitCode));
+            errorInfo.rcGuest = procTool.terminatedOk(&errorInfo.iExitCode);
+    }
+
+    LogFlowFunc(("Returned rc=%Rrc, rcGuest=%Rrc, iExitCode=%d\n", vrc, errorInfo.rcGuest, errorInfo.iExitCode));
     return vrc;
 }
@@ -2220,12 +2220,12 @@
 }
 
-int GuestProcessTool::wait(uint32_t fToolWaitFlags, int *pGuestRc)
-{
-    return waitEx(fToolWaitFlags, NULL /* pStrmBlkOut */, pGuestRc);
-}
-
-int GuestProcessTool::waitEx(uint32_t fToolWaitFlags, GuestProcessStreamBlock *pStrmBlkOut, int *pGuestRc)
-{
-    LogFlowThisFunc(("fToolWaitFlags=0x%x, pStreamBlock=%p, pGuestRc=%p\n", fToolWaitFlags, pStrmBlkOut, pGuestRc));
+int GuestProcessTool::wait(uint32_t fToolWaitFlags, int *prcGuest)
+{
+    return waitEx(fToolWaitFlags, NULL /* pStrmBlkOut */, prcGuest);
+}
+
+int GuestProcessTool::waitEx(uint32_t fToolWaitFlags, GuestProcessStreamBlock *pStrmBlkOut, int *prcGuest)
+{
+    LogFlowThisFunc(("fToolWaitFlags=0x%x, pStreamBlock=%p, prcGuest=%p\n", fToolWaitFlags, pStrmBlkOut, prcGuest));
 
     /* Can we parse the next block without waiting? */
@@ -2405,6 +2405,6 @@
     LogFlowThisFunc(("Loop ended with rc=%Rrc, vrcGuest=%Rrc, waitRes=%RU32\n",
                      vrc, vrcGuest, waitRes));
-    if (pGuestRc)
-        *pGuestRc = vrcGuest;
+    if (prcGuest)
+        *prcGuest = vrcGuest;
 
     LogFlowFuncLeaveRC(vrc);
@@ -2412,5 +2412,5 @@
 }
 
-int GuestProcessTool::terminate(uint32_t uTimeoutMS, int *pGuestRc)
+int GuestProcessTool::terminate(uint32_t uTimeoutMS, int *prcGuest)
 {
     LogFlowThisFuncEnter();
@@ -2419,5 +2419,5 @@
     if (!pProcess.isNull())
     {
-        rc = pProcess->i_terminateProcess(uTimeoutMS, pGuestRc);
+        rc = pProcess->i_terminateProcess(uTimeoutMS, prcGuest);
         pProcess.setNull();
     }
Index: trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp
===================================================================
--- trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp	(revision 71273)
+++ trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp	(revision 71299)
@@ -242,5 +242,5 @@
                 hr = thisListener.createObject();
                 if (SUCCEEDED(hr))
-                    hr = thisListener->init(pListener, this);
+                    hr = thisListener->init(pListener, this); /* thisListener takes ownership of pListener. */
                 if (SUCCEEDED(hr))
                 {
@@ -340,4 +340,7 @@
               ("mNumObjects=%RU32 when it should be 0\n", mData.mNumObjects));
 
+    /* Unitialize our local listener. */
+    mLocalListener.setNull();
+
     baseUninit();
 
@@ -590,7 +593,7 @@
 ///////////////////////////////////////////////////////////////////////////////
 
-int GuestSession::i_closeSession(uint32_t uFlags, uint32_t uTimeoutMS, int *pGuestRc)
-{
-    AssertPtrReturn(pGuestRc, VERR_INVALID_POINTER);
+int GuestSession::i_closeSession(uint32_t uFlags, uint32_t uTimeoutMS, int *prcGuest)
+{
+    AssertPtrReturn(prcGuest, VERR_INVALID_POINTER);
 
     LogFlowThisFunc(("uFlags=%x, uTimeoutMS=%RU32\n", uFlags, uTimeoutMS));
@@ -647,5 +650,5 @@
     if (RT_SUCCESS(vrc))
         vrc = i_waitForStatusChange(pEvent, GuestSessionWaitForFlag_Terminate, uTimeoutMS,
-                                  NULL /* Session status */, pGuestRc);
+                                  NULL /* Session status */, prcGuest);
 
     unregisterWaitEvent(pEvent);
@@ -656,7 +659,7 @@
 
 int GuestSession::i_directoryCreateInternal(const Utf8Str &strPath, uint32_t uMode,
-                                            uint32_t uFlags, int *pGuestRc)
-{
-    AssertPtrReturn(pGuestRc, VERR_INVALID_POINTER);
+                                            uint32_t uFlags, int *prcGuest)
+{
+    AssertPtrReturn(prcGuest, VERR_INVALID_POINTER);
 
     LogFlowThisFunc(("strPath=%s, uMode=%x, uFlags=%x\n", strPath.c_str(), uMode, uFlags));
@@ -702,5 +705,5 @@
 
     if (RT_SUCCESS(vrc))
-        vrc = GuestProcessTool::run(this, procInfo, pGuestRc);
+        vrc = GuestProcessTool::run(this, procInfo, prcGuest);
 
     LogFlowFuncLeaveRC(vrc);
@@ -721,11 +724,11 @@
 
 int GuestSession::i_directoryQueryInfoInternal(const Utf8Str &strPath, bool fFollowSymlinks,
-                                               GuestFsObjData &objData, int *pGuestRc)
-{
-    AssertPtrReturn(pGuestRc, VERR_INVALID_POINTER);
+                                               GuestFsObjData &objData, int *prcGuest)
+{
+    AssertPtrReturn(prcGuest, VERR_INVALID_POINTER);
 
     LogFlowThisFunc(("strPath=%s, fFollowSymlinks=%RTbool\n", strPath.c_str(), fFollowSymlinks));
 
-    int vrc = i_fsQueryInfoInternal(strPath, fFollowSymlinks, objData, pGuestRc);
+    int vrc = i_fsQueryInfoInternal(strPath, fFollowSymlinks, objData, prcGuest);
     if (RT_SUCCESS(vrc))
     {
@@ -780,8 +783,8 @@
 
 int GuestSession::i_directoryRemoveInternal(const Utf8Str &strPath, uint32_t uFlags,
-                                            int *pGuestRc)
+                                            int *prcGuest)
 {
     AssertReturn(!(uFlags & ~DIRREMOVE_FLAG_VALID_MASK), VERR_INVALID_PARAMETER);
-    AssertPtrReturn(pGuestRc, VERR_INVALID_POINTER);
+    AssertPtrReturn(prcGuest, VERR_INVALID_POINTER);
 
     LogFlowThisFunc(("strPath=%s, uFlags=0x%x\n", strPath.c_str(), uFlags));
@@ -810,6 +813,6 @@
         vrc = pEvent->Wait(30 * 1000);
         if (   vrc == VERR_GSTCTL_GUEST_ERROR
-            && pGuestRc)
-            *pGuestRc = pEvent->GuestResult();
+            && prcGuest)
+            *prcGuest = pEvent->GuestResult();
     }
 
@@ -821,7 +824,7 @@
 
 int GuestSession::i_objectCreateTempInternal(const Utf8Str &strTemplate, const Utf8Str &strPath,
-                                             bool fDirectory, Utf8Str &strName, int *pGuestRc)
-{
-    AssertPtrReturn(pGuestRc, VERR_INVALID_POINTER);
+                                             bool fDirectory, Utf8Str &strName, int *prcGuest)
+{
+    AssertPtrReturn(prcGuest, VERR_INVALID_POINTER);
 
     LogFlowThisFunc(("strTemplate=%s, strPath=%s, fDirectory=%RTbool\n",
@@ -867,6 +870,6 @@
             {
                 vrcGuest = vrc;
-                if (pGuestRc)
-                    *pGuestRc = vrc;
+                if (prcGuest)
+                    *prcGuest = vrc;
                 vrc = VERR_GSTCTL_GUEST_ERROR;
             }
@@ -878,6 +881,6 @@
             strName = objData.mName;
     }
-    else if (pGuestRc)
-        *pGuestRc = vrcGuest;
+    else if (prcGuest)
+        *prcGuest = vrcGuest;
 
     LogFlowThisFunc(("Returning vrc=%Rrc, vrcGuest=%Rrc\n", vrc, vrcGuest));
@@ -886,7 +889,7 @@
 
 int GuestSession::i_directoryOpenInternal(const GuestDirectoryOpenInfo &openInfo,
-                                          ComObjPtr<GuestDirectory> &pDirectory, int *pGuestRc)
-{
-    AssertPtrReturn(pGuestRc, VERR_INVALID_POINTER);
+                                          ComObjPtr<GuestDirectory> &pDirectory, int *prcGuest)
+{
+    AssertPtrReturn(prcGuest, VERR_INVALID_POINTER);
 
     LogFlowThisFunc(("strPath=%s, strPath=%s, uFlags=%x\n",
@@ -967,6 +970,6 @@
     {
         /* Nothing further to do here yet. */
-        if (pGuestRc)
-            *pGuestRc = VINF_SUCCESS;
+        if (prcGuest)
+            *prcGuest = VINF_SUCCESS;
     }
 
@@ -1225,5 +1228,5 @@
 }
 
-int GuestSession::i_fileRemoveInternal(const Utf8Str &strPath, int *pGuestRc)
+int GuestSession::i_fileRemoveInternal(const Utf8Str &strPath, int *prcGuest)
 {
     LogFlowThisFunc(("strPath=%s\n", strPath.c_str()));
@@ -1250,5 +1253,5 @@
 
     if (RT_SUCCESS(vrc))
-        vrc = GuestProcessTool::run(this, procInfo, pGuestRc);
+        vrc = GuestProcessTool::run(this, procInfo, prcGuest);
 
     LogFlowFuncLeaveRC(vrc);
@@ -1257,5 +1260,5 @@
 
 int GuestSession::i_fileOpenInternal(const GuestFileOpenInfo &openInfo,
-                                     ComObjPtr<GuestFile> &pFile, int *pGuestRc)
+                                     ComObjPtr<GuestFile> &pFile, int *prcGuest)
 {
     LogFlowThisFunc(("strFile=%s, enmAccessMode=%d (%s) enmOpenAction=%d (%s) uCreationMode=%RU32 mfOpenEx=%RU32\n",
@@ -1345,10 +1348,10 @@
     if (RT_SUCCESS(rc))
     {
-        int guestRc;
-        rc = pFile->i_openFile(30 * 1000 /* 30s timeout */, &guestRc);
+        int rcGuest;
+        rc = pFile->i_openFile(30 * 1000 /* 30s timeout */, &rcGuest);
         if (   rc == VERR_GSTCTL_GUEST_ERROR
-            && pGuestRc)
-        {
-            *pGuestRc = guestRc;
+            && prcGuest)
+        {
+            *prcGuest = rcGuest;
         }
     }
@@ -1358,9 +1361,9 @@
 }
 
-int GuestSession::i_fileQueryInfoInternal(const Utf8Str &strPath, bool fFollowSymlinks, GuestFsObjData &objData, int *pGuestRc)
+int GuestSession::i_fileQueryInfoInternal(const Utf8Str &strPath, bool fFollowSymlinks, GuestFsObjData &objData, int *prcGuest)
 {
     LogFlowThisFunc(("strPath=%s fFollowSymlinks=%RTbool\n", strPath.c_str(), fFollowSymlinks));
 
-    int vrc = i_fsQueryInfoInternal(strPath, fFollowSymlinks, objData, pGuestRc);
+    int vrc = i_fsQueryInfoInternal(strPath, fFollowSymlinks, objData, prcGuest);
     if (RT_SUCCESS(vrc))
     {
@@ -1373,10 +1376,10 @@
 }
 
-int GuestSession::i_fileQuerySizeInternal(const Utf8Str &strPath, bool fFollowSymlinks, int64_t *pllSize, int *pGuestRc)
+int GuestSession::i_fileQuerySizeInternal(const Utf8Str &strPath, bool fFollowSymlinks, int64_t *pllSize, int *prcGuest)
 {
     AssertPtrReturn(pllSize, VERR_INVALID_POINTER);
 
     GuestFsObjData objData;
-    int vrc = i_fileQueryInfoInternal(strPath, fFollowSymlinks, objData, pGuestRc);
+    int vrc = i_fileQueryInfoInternal(strPath, fFollowSymlinks, objData, prcGuest);
     if (RT_SUCCESS(vrc))
         *pllSize = objData.mObjectSize;
@@ -1392,8 +1395,8 @@
  * @param   fFollowSymlinks     Whether to follow symbolic links or not.
  * @param   objData             Where to return the file system object data, if found.
- * @param   pGuestRc            Guest rc, when returning VERR_GSTCTL_GUEST_ERROR.
+ * @param   prcGuest            Guest rc, when returning VERR_GSTCTL_GUEST_ERROR.
  *                              Any other return code indicates some host side error.
  */
-int GuestSession::i_fsQueryInfoInternal(const Utf8Str &strPath, bool fFollowSymlinks, GuestFsObjData &objData, int *pGuestRc)
+int GuestSession::i_fsQueryInfoInternal(const Utf8Str &strPath, bool fFollowSymlinks, GuestFsObjData &objData, int *prcGuest)
 {
     LogFlowThisFunc(("strPath=%s\n", strPath.c_str()));
@@ -1431,6 +1434,6 @@
             {
                 vrcGuest = vrc;
-                if (pGuestRc)
-                    *pGuestRc = vrc;
+                if (prcGuest)
+                    *prcGuest = vrc;
                 vrc = VERR_GSTCTL_GUEST_ERROR;
             }
@@ -1439,6 +1442,6 @@
             vrc = VERR_BROKEN_PIPE;
     }
-    else if (pGuestRc)
-        *pGuestRc = vrcGuest;
+    else if (prcGuest)
+        *prcGuest = vrcGuest;
 
     LogFlowThisFunc(("Returning vrc=%Rrc, vrcGuest=%Rrc\n", vrc, vrcGuest));
@@ -1457,10 +1460,10 @@
 
 /* static */
-Utf8Str GuestSession::i_guestErrorToString(int guestRc)
+Utf8Str GuestSession::i_guestErrorToString(int rcGuest)
 {
     Utf8Str strError;
 
     /** @todo pData->u32Flags: int vs. uint32 -- IPRT errors are *negative* !!! */
-    switch (guestRc)
+    switch (rcGuest)
     {
         case VERR_INVALID_VM_HANDLE:
@@ -1501,5 +1504,5 @@
 
         default:
-            strError += Utf8StrFmt("%Rrc", guestRc);
+            strError += Utf8StrFmt("%Rrc", rcGuest);
             break;
     }
@@ -1570,10 +1573,10 @@
     AssertRCReturn(vrc, vrc);
 
-    LogFlowThisFunc(("ID=%RU32, uType=%RU32, guestRc=%Rrc\n",
+    LogFlowThisFunc(("ID=%RU32, uType=%RU32, rcGuest=%Rrc\n",
                      mData.mSession.mID, dataCb.uType, dataCb.uResult));
 
     GuestSessionStatus_T sessionStatus = GuestSessionStatus_Undefined;
 
-    int guestRc = dataCb.uResult; /** @todo uint32_t vs. int. */
+    int rcGuest = dataCb.uResult; /** @todo uint32_t vs. int. */
     switch (dataCb.uType)
     {
@@ -1631,5 +1634,5 @@
     if (RT_SUCCESS(vrc))
     {
-        if (RT_FAILURE(guestRc))
+        if (RT_FAILURE(rcGuest))
             sessionStatus = GuestSessionStatus_Error;
     }
@@ -1637,7 +1640,7 @@
     /* Set the session status. */
     if (RT_SUCCESS(vrc))
-        vrc = i_setSessionStatus(sessionStatus, guestRc);
-
-    LogFlowThisFunc(("ID=%RU32, guestRc=%Rrc\n", mData.mSession.mID, guestRc));
+        vrc = i_setSessionStatus(sessionStatus, rcGuest);
+
+    LogFlowThisFunc(("ID=%RU32, rcGuest=%Rrc\n", mData.mSession.mID, rcGuest));
 
     LogFlowFuncLeaveRC(vrc);
@@ -1645,5 +1648,5 @@
 }
 
-int GuestSession::i_startSessionInternal(int *pGuestRc)
+int GuestSession::i_startSessionInternal(int *prcGuest)
 {
     AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
@@ -1711,5 +1714,5 @@
         vrc = i_waitForStatusChange(pEvent, GuestSessionWaitForFlag_Start,
                                     30 * 1000 /* 30s timeout */,
-                                    NULL /* Session status */, pGuestRc);
+                                    NULL /* Session status */, prcGuest);
     }
     else
@@ -1794,5 +1797,5 @@
 
 int GuestSession::i_pathRenameInternal(const Utf8Str &strSource, const Utf8Str &strDest,
-                                     uint32_t uFlags, int *pGuestRc)
+                                     uint32_t uFlags, int *prcGuest)
 {
     AssertReturn(!(uFlags & ~PATHRENAME_FLAG_VALID_MASK), VERR_INVALID_PARAMETER);
@@ -1826,6 +1829,6 @@
         vrc = pEvent->Wait(30 * 1000);
         if (   vrc == VERR_GSTCTL_GUEST_ERROR
-            && pGuestRc)
-            *pGuestRc = pEvent->GuestResult();
+            && prcGuest)
+            *prcGuest = pEvent->GuestResult();
     }
 
@@ -2085,10 +2088,10 @@
 
 /* static */
-HRESULT GuestSession::i_setErrorExternal(VirtualBoxBase *pInterface, int guestRc)
+HRESULT GuestSession::i_setErrorExternal(VirtualBoxBase *pInterface, int rcGuest)
 {
     AssertPtr(pInterface);
-    AssertMsg(RT_FAILURE(guestRc), ("Guest rc does not indicate a failure when setting error\n"));
-
-    return pInterface->setError(VBOX_E_IPRT_ERROR, GuestSession::i_guestErrorToString(guestRc).c_str());
+    AssertMsg(RT_FAILURE(rcGuest), ("Guest rc does not indicate a failure when setting error\n"));
+
+    return pInterface->setError(VBOX_E_IPRT_ERROR, GuestSession::i_guestErrorToString(rcGuest).c_str());
 }
 
@@ -2186,5 +2189,5 @@
 }
 
-int GuestSession::i_waitFor(uint32_t fWaitFlags, ULONG uTimeoutMS, GuestSessionWaitResult_T &waitResult, int *pGuestRc)
+int GuestSession::i_waitFor(uint32_t fWaitFlags, ULONG uTimeoutMS, GuestSessionWaitResult_T &waitResult, int *prcGuest)
 {
     LogFlowThisFuncEnter();
@@ -2192,6 +2195,6 @@
     AssertReturn(fWaitFlags, VERR_INVALID_PARAMETER);
 
-    /*LogFlowThisFunc(("fWaitFlags=0x%x, uTimeoutMS=%RU32, mStatus=%RU32, mWaitCount=%RU32, mWaitEvent=%p, pGuestRc=%p\n",
-                     fWaitFlags, uTimeoutMS, mData.mStatus, mData.mWaitCount, mData.mWaitEvent, pGuestRc));*/
+    /*LogFlowThisFunc(("fWaitFlags=0x%x, uTimeoutMS=%RU32, mStatus=%RU32, mWaitCount=%RU32, mWaitEvent=%p, prcGuest=%p\n",
+                     fWaitFlags, uTimeoutMS, mData.mStatus, mData.mWaitCount, mData.mWaitEvent, prcGuest));*/
 
     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
@@ -2202,6 +2205,6 @@
         waitResult = GuestSessionWaitResult_Error;
         AssertMsg(RT_FAILURE(mData.mRC), ("No error rc (%Rrc) set when guest session indicated an error\n", mData.mRC));
-        if (pGuestRc)
-            *pGuestRc = mData.mRC; /* Return last set error. */
+        if (prcGuest)
+            *prcGuest = mData.mRC; /* Return last set error. */
         return VERR_GSTCTL_GUEST_ERROR;
     }
@@ -2286,6 +2289,6 @@
     if (waitResult != GuestSessionWaitResult_None)
     {
-        if (pGuestRc)
-            *pGuestRc = mData.mRC; /* Return last set error (if any). */
+        if (prcGuest)
+            *prcGuest = mData.mRC; /* Return last set error (if any). */
         return RT_SUCCESS(mData.mRC) ? VINF_SUCCESS : VERR_GSTCTL_GUEST_ERROR;
     }
@@ -2314,5 +2317,5 @@
     GuestSessionStatus_T sessionStatus;
     vrc = i_waitForStatusChange(pEvent, fWaitFlags,
-                                uTimeoutMS, &sessionStatus, pGuestRc);
+                                uTimeoutMS, &sessionStatus, prcGuest);
     if (RT_SUCCESS(vrc))
     {
@@ -2353,5 +2356,5 @@
 
 int GuestSession::i_waitForStatusChange(GuestWaitEvent *pEvent, uint32_t fWaitFlags, uint32_t uTimeoutMS,
-                                        GuestSessionStatus_T *pSessionStatus, int *pGuestRc)
+                                        GuestSessionStatus_T *pSessionStatus, int *prcGuest)
 {
     RT_NOREF(fWaitFlags);
@@ -2383,6 +2386,6 @@
         if (RT_FAILURE((int)lGuestRc))
             vrc = VERR_GSTCTL_GUEST_ERROR;
-        if (pGuestRc)
-            *pGuestRc = (int)lGuestRc;
+        if (prcGuest)
+            *prcGuest = (int)lGuestRc;
 
         LogFlowThisFunc(("Status changed event for session ID=%RU32, new status is: %RU32 (%Rrc)\n",
@@ -2406,7 +2409,7 @@
 
     /* Close session on guest. */
-    int guestRc = VINF_SUCCESS;
+    int rcGuest = VINF_SUCCESS;
     int rc = i_closeSession(0 /* Flags */, 30 * 1000 /* Timeout */,
-                            &guestRc);
+                            &rcGuest);
     /* On failure don't return here, instead do all the cleanup
      * work first and then return an error. */
@@ -2420,10 +2423,10 @@
         rc = rc2;
 
-    LogFlowThisFunc(("Returning rc=%Rrc, guestRc=%Rrc\n",
-                     rc, guestRc));
+    LogFlowThisFunc(("Returning rc=%Rrc, rcGuest=%Rrc\n",
+                     rc, rcGuest));
     if (RT_FAILURE(rc))
     {
         if (rc == VERR_GSTCTL_GUEST_ERROR)
-            return GuestSession::i_setErrorExternal(this, guestRc);
+            return GuestSession::i_setErrorExternal(this, rcGuest);
 
         return setError(VBOX_E_IPRT_ERROR,
@@ -2769,6 +2772,6 @@
     HRESULT hr = S_OK;
 
-    ComObjPtr <GuestDirectory> pDirectory; int guestRc;
-    int rc = i_directoryCreateInternal(aPath, (uint32_t)aMode, fFlags, &guestRc);
+    ComObjPtr <GuestDirectory> pDirectory; int rcGuest;
+    int rc = i_directoryCreateInternal(aPath, (uint32_t)aMode, fFlags, &rcGuest);
     if (RT_FAILURE(rc))
     {
@@ -2777,5 +2780,5 @@
             case VERR_GSTCTL_GUEST_ERROR:
                 hr = setError(VBOX_E_IPRT_ERROR, tr("Directory creation failed: %s",
-                                                    GuestDirectory::i_guestErrorToString(guestRc).c_str()));
+                                                    GuestDirectory::i_guestErrorToString(rcGuest).c_str()));
                 break;
 
@@ -2810,8 +2813,8 @@
     HRESULT hr = S_OK;
 
-    int guestRc;
+    int rcGuest;
     int rc = i_objectCreateTempInternal(aTemplateName,
                                         aPath,
-                                        true /* Directory */, aDirectory, &guestRc);
+                                        true /* Directory */, aDirectory, &rcGuest);
     if (!RT_SUCCESS(rc))
     {
@@ -2819,5 +2822,5 @@
         {
             case VERR_GSTCTL_GUEST_ERROR:
-                hr = GuestProcess::i_setErrorExternal(this, guestRc);
+                hr = GuestProcess::i_setErrorExternal(this, rcGuest);
                 break;
 
@@ -2841,6 +2844,6 @@
     HRESULT hr = S_OK;
 
-    GuestFsObjData objData; int guestRc;
-    int rc = i_directoryQueryInfoInternal(aPath, aFollowSymlinks != FALSE, objData, &guestRc);
+    GuestFsObjData objData; int rcGuest;
+    int rc = i_directoryQueryInfoInternal(aPath, aFollowSymlinks != FALSE, objData, &rcGuest);
     if (RT_SUCCESS(rc))
         *aExists = objData.mType == FsObjType_Directory;
@@ -2851,5 +2854,5 @@
             case VERR_GSTCTL_GUEST_ERROR:
             {
-                switch (guestRc)
+                switch (rcGuest)
                 {
                     case VERR_PATH_NOT_FOUND:
@@ -2858,5 +2861,5 @@
                     default:
                         hr = setError(VBOX_E_IPRT_ERROR, tr("Querying directory existence \"%s\" failed: %s"),
-                                      aPath.c_str(), GuestProcess::i_guestErrorToString(guestRc).c_str());
+                                      aPath.c_str(), GuestProcess::i_guestErrorToString(rcGuest).c_str());
                         break;
                 }
@@ -2901,6 +2904,6 @@
     openInfo.mFlags = fFlags;
 
-    ComObjPtr <GuestDirectory> pDirectory; int guestRc;
-    int rc = i_directoryOpenInternal(openInfo, pDirectory, &guestRc);
+    ComObjPtr <GuestDirectory> pDirectory; int rcGuest;
+    int rc = i_directoryOpenInternal(openInfo, pDirectory, &rcGuest);
     if (RT_SUCCESS(rc))
     {
@@ -2918,5 +2921,5 @@
 
             case VERR_GSTCTL_GUEST_ERROR:
-                hr = GuestDirectory::i_setErrorExternal(this, guestRc);
+                hr = GuestDirectory::i_setErrorExternal(this, rcGuest);
                 break;
 
@@ -2945,6 +2948,6 @@
     uint32_t uFlags = 0;
 
-    int guestRc;
-    int vrc = i_directoryRemoveInternal(aPath, uFlags, &guestRc);
+    int rcGuest;
+    int vrc = i_directoryRemoveInternal(aPath, uFlags, &rcGuest);
     if (RT_FAILURE(vrc))
     {
@@ -2957,5 +2960,5 @@
 
             case VERR_GSTCTL_GUEST_ERROR:
-                hr = GuestDirectory::i_setErrorExternal(this, guestRc);
+                hr = GuestDirectory::i_setErrorExternal(this, rcGuest);
                 break;
 
@@ -3006,6 +3009,6 @@
     uint32_t uFlags = DIRREMOVE_FLAG_RECURSIVE
                     | DIRREMOVE_FLAG_CONTENT_AND_DIR;
-    int guestRc;
-    int vrc = i_directoryRemoveInternal(aPath, uFlags, &guestRc);
+    int rcGuest;
+    int vrc = i_directoryRemoveInternal(aPath, uFlags, &rcGuest);
     if (RT_FAILURE(vrc))
     {
@@ -3018,5 +3021,5 @@
 
             case VERR_GSTCTL_GUEST_ERROR:
-                hr = GuestFile::i_setErrorExternal(this, guestRc);
+                hr = GuestFile::i_setErrorExternal(this, rcGuest);
                 break;
 
@@ -3163,6 +3166,6 @@
         return setError(E_INVALIDARG, tr("No file to check existence for specified"));
 
-    GuestFsObjData objData; int guestRc;
-    int vrc = i_fileQueryInfoInternal(aPath, aFollowSymlinks != FALSE, objData, &guestRc);
+    GuestFsObjData objData; int rcGuest;
+    int vrc = i_fileQueryInfoInternal(aPath, aFollowSymlinks != FALSE, objData, &rcGuest);
     if (RT_SUCCESS(vrc))
     {
@@ -3176,5 +3179,5 @@
     {
         case VERR_GSTCTL_GUEST_ERROR:
-            hr = GuestProcess::i_setErrorExternal(this, guestRc);
+            hr = GuestProcess::i_setErrorExternal(this, rcGuest);
             break;
 
@@ -3276,6 +3279,6 @@
 
     ComObjPtr <GuestFile> pFile;
-    int guestRc;
-    int vrc = i_fileOpenInternal(openInfo, pFile, &guestRc);
+    int rcGuest;
+    int vrc = i_fileOpenInternal(openInfo, pFile, &rcGuest);
     if (RT_SUCCESS(vrc))
         /* Return directory object to the caller. */
@@ -3291,5 +3294,5 @@
 
             case VERR_GSTCTL_GUEST_ERROR:
-                hr = GuestFile::i_setErrorExternal(this, guestRc);
+                hr = GuestFile::i_setErrorExternal(this, rcGuest);
                 break;
 
@@ -3311,6 +3314,6 @@
     HRESULT hr = S_OK;
 
-    int64_t llSize; int guestRc;
-    int vrc = i_fileQuerySizeInternal(aPath, aFollowSymlinks != FALSE,  &llSize, &guestRc);
+    int64_t llSize; int rcGuest;
+    int vrc = i_fileQuerySizeInternal(aPath, aFollowSymlinks != FALSE,  &llSize, &rcGuest);
     if (RT_SUCCESS(vrc))
     {
@@ -3321,5 +3324,5 @@
         if (GuestProcess::i_isGuestError(vrc))
         {
-            hr = GuestProcess::i_setErrorExternal(this, guestRc);
+            hr = GuestProcess::i_setErrorExternal(this, rcGuest);
         }
         else
@@ -3378,6 +3381,6 @@
     HRESULT hrc = S_OK;
 
-    GuestFsObjData Info; int guestRc;
-    int vrc = i_fsQueryInfoInternal(aPath, aFollowSymlinks != FALSE, Info, &guestRc);
+    GuestFsObjData Info; int rcGuest;
+    int vrc = i_fsQueryInfoInternal(aPath, aFollowSymlinks != FALSE, Info, &rcGuest);
     if (RT_SUCCESS(vrc))
     {
@@ -3397,5 +3400,5 @@
         if (GuestProcess::i_isGuestError(vrc))
         {
-            hrc = GuestProcess::i_setErrorExternal(this, guestRc);
+            hrc = GuestProcess::i_setErrorExternal(this, rcGuest);
         }
         else
@@ -3415,11 +3418,11 @@
     HRESULT hrc = S_OK;
 
-    int guestRc;
-    int vrc = i_fileRemoveInternal(aPath, &guestRc);
+    int rcGuest;
+    int vrc = i_fileRemoveInternal(aPath, &rcGuest);
     if (RT_FAILURE(vrc))
     {
         if (GuestProcess::i_isGuestError(vrc))
         {
-            hrc = GuestProcess::i_setErrorExternal(this, guestRc);
+            hrc = GuestProcess::i_setErrorExternal(this, rcGuest);
         }
         else
@@ -3462,6 +3465,6 @@
 
     /* Call worker to do the job. */
-    int guestRc;
-    int vrc = i_pathRenameInternal(aSource, aDestination, fBackend, &guestRc);
+    int rcGuest;
+    int vrc = i_pathRenameInternal(aSource, aDestination, fBackend, &rcGuest);
     if (RT_FAILURE(vrc))
     {
@@ -3475,5 +3478,5 @@
             case VERR_GSTCTL_GUEST_ERROR:
                 hr = setError(VBOX_E_IPRT_ERROR,
-                              tr("Renaming guest directory failed: %Rrc"), guestRc);
+                              tr("Renaming guest directory failed: %Rrc"), rcGuest);
                 break;
 
@@ -3676,6 +3679,6 @@
     HRESULT hr = S_OK;
 
-    int guestRc; GuestSessionWaitResult_T waitResult;
-    int vrc = i_waitFor(aWaitFor, aTimeoutMS, waitResult, &guestRc);
+    int rcGuest; GuestSessionWaitResult_T waitResult;
+    int vrc = i_waitFor(aWaitFor, aTimeoutMS, waitResult, &rcGuest);
     if (RT_SUCCESS(vrc))
         *aReason = waitResult;
@@ -3685,5 +3688,5 @@
         {
             case VERR_GSTCTL_GUEST_ERROR:
-                hr = GuestSession::i_setErrorExternal(this, guestRc);
+                hr = GuestSession::i_setErrorExternal(this, rcGuest);
                 break;
 
Index: trunk/src/VBox/Main/src-client/GuestSessionImplTasks.cpp
===================================================================
--- trunk/src/VBox/Main/src-client/GuestSessionImplTasks.cpp	(revision 71273)
+++ trunk/src/VBox/Main/src-client/GuestSessionImplTasks.cpp	(revision 71299)
@@ -215,7 +215,7 @@
                  strPath.c_str(), enmDirecotryCreateFlags, uMode, fFollowSymlinks));
 
-    GuestFsObjData objData; int guestRc;
-
-    int rc = mSession->i_directoryQueryInfoInternal(strPath, fFollowSymlinks, objData, &guestRc);
+    GuestFsObjData objData; int rcGuest;
+
+    int rc = mSession->i_directoryQueryInfoInternal(strPath, fFollowSymlinks, objData, &rcGuest);
     if (RT_SUCCESS(rc))
     {
@@ -228,9 +228,9 @@
             case VERR_GSTCTL_GUEST_ERROR:
             {
-                switch (guestRc)
+                switch (rcGuest)
                 {
                     case VERR_FILE_NOT_FOUND:
                     case VERR_PATH_NOT_FOUND:
-                        rc = mSession->i_directoryCreateInternal(strPath.c_str(), uMode, enmDirecotryCreateFlags, &guestRc);
+                        rc = mSession->i_directoryCreateInternal(strPath.c_str(), uMode, enmDirecotryCreateFlags, &rcGuest);
                         break;
                     default:
@@ -249,5 +249,5 @@
         if (rc == VERR_GSTCTL_GUEST_ERROR)
         {
-            setProgressErrorMsg(VBOX_E_IPRT_ERROR, GuestProcess::i_guestErrorToString(guestRc));
+            setProgressErrorMsg(VBOX_E_IPRT_ERROR, GuestProcess::i_guestErrorToString(rcGuest));
         }
         else
@@ -996,4 +996,5 @@
     ComObjPtr <GuestDirectory> pDir; int rcGuest;
     rc = mSession->i_directoryOpenInternal(dirOpenInfo, pDir, &rcGuest);
+
     if (RT_FAILURE(rc))
     {
