Index: trunk/src/VBox/Main/src-client/GuestCtrlPrivate.cpp
===================================================================
--- trunk/src/VBox/Main/src-client/GuestCtrlPrivate.cpp	(revision 75774)
+++ trunk/src/VBox/Main/src-client/GuestCtrlPrivate.cpp	(revision 75798)
@@ -1179,6 +1179,5 @@
 }
 
-int GuestObject::sendCommand(uint32_t uFunction,
-                             uint32_t cParms, PVBOXHGCMSVCPARM paParms)
+int GuestObject::sendCommand(uint32_t uFunction, uint32_t cParms, PVBOXHGCMSVCPARM paParms)
 {
 #ifndef VBOX_GUESTCTRL_TEST_CASE
@@ -1192,4 +1191,11 @@
     if (pVMMDev)
     {
+        /* HACK ALERT! We extend the first parameter to 64-bit and use the
+                       two topmost bits for call destination information. */
+        Assert(paParms[0].type == VBOX_HGCM_SVC_PARM_32BIT);
+        paParms[0].type = VBOX_HGCM_SVC_PARM_64BIT;
+        paParms[0].u.uint64 = (uint64_t)paParms[0].u.uint32 | VBOX_GUESTCTRL_DST_SESSION;
+
+        /* Make the call. */
         LogFlowThisFunc(("uFunction=%RU32, cParms=%RU32\n", uFunction, cParms));
         vrc = pVMMDev->hgcmHostCall(HGCMSERVICE_NAME, uFunction, cParms, paParms);
Index: trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp
===================================================================
--- trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp	(revision 75774)
+++ trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp	(revision 75798)
@@ -718,5 +718,5 @@
     alock.release(); /* Drop the write lock before waiting. */
 
-    vrc = i_sendCommand(HOST_SESSION_CLOSE, i, paParms);
+    vrc = i_sendCommand(HOST_SESSION_CLOSE, i, paParms, VBOX_GUESTCTRL_DST_BOTH);
     if (RT_SUCCESS(vrc))
         vrc = i_waitForStatusChange(pEvent, GuestSessionWaitForFlag_Terminate, uTimeoutMS,
@@ -1946,5 +1946,5 @@
     alock.release(); /* Drop write lock before sending. */
 
-    vrc = i_sendCommand(HOST_SESSION_CREATE, i, paParms);
+    vrc = i_sendCommand(HOST_SESSION_CREATE, i, paParms, VBOX_GUESTCTRL_DST_ROOT_SVC);
     if (RT_SUCCESS(vrc))
     {
@@ -2454,6 +2454,6 @@
 }
 
-int GuestSession::i_sendCommand(uint32_t uFunction,
-                                uint32_t uParms, PVBOXHGCMSVCPARM paParms)
+int GuestSession::i_sendCommand(uint32_t uFunction, uint32_t uParms, PVBOXHGCMSVCPARM paParms,
+                                uint64_t fDst /*= VBOX_GUESTCTRL_DST_SESSION*/)
 {
     LogFlowThisFuncEnter();
@@ -2467,5 +2467,14 @@
     AssertPtr(pVMMDev);
 
-    LogFlowThisFunc(("uFunction=%RU32, uParms=%RU32\n", uFunction, uParms));
+    LogFlowThisFunc(("uFunction=%RU32 (%s), uParms=%RU32\n", uFunction, GstCtrlHostFnName((guestControl::eHostFn)uFunction), uParms));
+
+    /* HACK ALERT! We extend the first parameter to 64-bit and use the
+                   two topmost bits for call destination information. */
+    Assert(fDst == VBOX_GUESTCTRL_DST_SESSION || fDst == VBOX_GUESTCTRL_DST_ROOT_SVC || fDst == VBOX_GUESTCTRL_DST_BOTH);
+    Assert(paParms[0].type == VBOX_HGCM_SVC_PARM_32BIT);
+    paParms[0].type = VBOX_HGCM_SVC_PARM_64BIT;
+    paParms[0].u.uint64 = (uint64_t)paParms[0].u.uint32 | fDst;
+
+    /* Make the call. */
     int vrc = pVMMDev->hgcmHostCall(HGCMSERVICE_NAME, uFunction, uParms, paParms);
     if (RT_FAILURE(vrc))
Index: trunk/src/VBox/Main/src-client/HGCMThread.cpp
===================================================================
--- trunk/src/VBox/Main/src-client/HGCMThread.cpp	(revision 75774)
+++ trunk/src/VBox/Main/src-client/HGCMThread.cpp	(revision 75798)
@@ -556,5 +556,5 @@
 int HGCMThread::MsgComplete(HGCMMsgCore *pMsg, int32_t result)
 {
-    LogFlow(("HGCMThread::MsgComplete: thread = %p, pMsg = %p\n", this, pMsg));
+    LogFlow(("HGCMThread::MsgComplete: thread = %p, pMsg = %p, result = %Rrc (%d)\n", this, pMsg, result, result));
 
     AssertRelease(pMsg->m_pThread == this);
@@ -740,15 +740,15 @@
 }
 
-int hgcmMsgComplete(HGCMMsgCore *pMsg, int32_t u32Result)
-{
-    LogFlow(("MAIN::hgcmMsgComplete: pMsg = %p\n", pMsg));
+int hgcmMsgComplete(HGCMMsgCore *pMsg, int32_t rcMsg)
+{
+    LogFlow(("MAIN::hgcmMsgComplete: pMsg = %p, rcMsg = %Rrc (%d)\n", pMsg, rcMsg, rcMsg));
 
     int rc;
     if (pMsg)
-        rc = pMsg->Thread()->MsgComplete(pMsg, u32Result);
+        rc = pMsg->Thread()->MsgComplete(pMsg, rcMsg);
     else
         rc = VINF_SUCCESS;
 
-    LogFlow(("MAIN::hgcmMsgComplete: pMsg = %p, rc = %Rrc\n", pMsg, rc));
+    LogFlow(("MAIN::hgcmMsgComplete: pMsg = %p, rcMsg =%Rrc (%d), returns rc = %Rrc\n", pMsg, rcMsg, rcMsg, rc));
     return rc;
 }
