Index: trunk/src/VBox/Main/Makefile.kmk
===================================================================
--- trunk/src/VBox/Main/Makefile.kmk	(revision 80377)
+++ trunk/src/VBox/Main/Makefile.kmk	(revision 80396)
@@ -853,7 +853,4 @@
 	$(if $(VBOX_WITH_USB),VBOX_WITH_USB,) \
 	$(if $(VBOX_WITH_VRDEAUTH_IN_VBOXSVC),VBOX_WITH_VRDEAUTH_IN_VBOXSVC,)
-ifdef VBOX_WITH_CRHGSMI
- VBoxC_DEFS += VBOX_WITH_CRHGSMI
-endif
 ifdef VBOX_WITH_NETSHAPER
  VBoxC_DEFS += VBOX_WITH_NETSHAPER
Index: trunk/src/VBox/Main/include/HGCM.h
===================================================================
--- trunk/src/VBox/Main/include/HGCM.h	(revision 80377)
+++ trunk/src/VBox/Main/include/HGCM.h	(revision 80396)
@@ -50,11 +50,4 @@
 int HGCMBroadcastEvent(HGCMNOTIFYEVENT enmEvent);
 
-#ifdef VBOX_WITH_CRHGSMI
-int HGCMHostSvcHandleCreate(const char *pszServiceName, HGCMCVSHANDLE * phSvc);
-int HGCMHostSvcHandleDestroy(HGCMCVSHANDLE hSvc);
-int HGCMHostFastCallAsync(HGCMCVSHANDLE hSvc, uint32_t function, PVBOXHGCMSVCPARM pParm,
-                          PHGCMHOSTFASTCALLCB pfnCompletion, void *pvCompletion);
-#endif
-
 int HGCMHostSaveState(PSSMHANDLE pSSM);
 int HGCMHostLoadState(PSSMHANDLE pSSM, uint32_t uVersion);
Index: trunk/src/VBox/Main/include/VMMDev.h
===================================================================
--- trunk/src/VBox/Main/include/VMMDev.h	(revision 80377)
+++ trunk/src/VBox/Main/include/VMMDev.h	(revision 80396)
@@ -63,9 +63,4 @@
     int hgcmLoadService (const char *pszServiceLibrary, const char *pszServiceName);
     int hgcmHostCall (const char *pszServiceName, uint32_t u32Function, uint32_t cParms, PVBOXHGCMSVCPARM paParms);
-# ifdef VBOX_WITH_CRHGSMI
-    int hgcmHostSvcHandleCreate (const char *pszServiceName, HGCMCVSHANDLE * phSvc);
-    int hgcmHostSvcHandleDestroy (HGCMCVSHANDLE hSvc);
-    int hgcmHostFastCallAsync (HGCMCVSHANDLE hSvc, uint32_t function, PVBOXHGCMSVCPARM pParm, PHGCMHOSTFASTCALLCB pfnCompletion, void *pvCompletion);
-# endif
     void hgcmShutdown(bool fUvmIsInvalid = false);
 
Index: trunk/src/VBox/Main/src-client/HGCM.cpp
===================================================================
--- trunk/src/VBox/Main/src-client/HGCM.cpp	(revision 80377)
+++ trunk/src/VBox/Main/src-client/HGCM.cpp	(revision 80396)
@@ -110,8 +110,4 @@
 
         uint32_t *m_paClientIds;
-
-#ifdef VBOX_WITH_CRHGSMI
-        uint32_t m_cHandleAcquires;
-#endif
 
         HGCMSVCEXTHANDLE m_hExtension;
@@ -180,11 +176,4 @@
         void Notify(HGCMNOTIFYEVENT enmEvent);
 
-#ifdef VBOX_WITH_CRHGSMI
-        int HandleAcquired();
-        int HandleReleased();
-        int HostFastCallAsync(uint32_t u32Function, VBOXHGCMSVCPARM *pParm, PHGCMHOSTFASTCALLCB pfnCompletion,
-                              void *pvCompletion);
-#endif
-
         uint32_t SizeOfClient(void) { return m_fntable.cbClient; };
 
@@ -280,7 +269,4 @@
     m_cClientsAllocated (0),
     m_paClientIds (NULL),
-#ifdef VBOX_WITH_CRHGSMI
-    m_cHandleAcquires (0),
-#endif
     m_hExtension (NULL),
     m_pUVM       (NULL),
@@ -418,7 +404,4 @@
 #define SVC_MSG_NOTIFY          (11) /**< pfnNotify */
 #define SVC_MSG_GUESTCANCELLED  (12) /**< pfnCancelled */
-#ifdef VBOX_WITH_CRHGSMI
-# define SVC_MSG_HOSTFASTCALLASYNC (21) /* pfnHostCall */
-#endif
 
 class HGCMMsgSvcLoad: public HGCMMsgCore
@@ -553,25 +536,8 @@
 };
 
-#ifdef VBOX_WITH_CRHGSMI
-class HGCMMsgHostFastCallAsyncSvc: public HGCMMsgCore
-{
-    public:
-        /* function number */
-        uint32_t u32Function;
-        /* parameter */
-        VBOXHGCMSVCPARM Param;
-        /* completion info */
-        PHGCMHOSTFASTCALLCB pfnCompletion;
-        void *pvCompletion;
-};
-#endif
-
 static HGCMMsgCore *hgcmMessageAllocSvc(uint32_t u32MsgId)
 {
     switch (u32MsgId)
     {
-#ifdef VBOX_WITH_CRHGSMI
-        case SVC_MSG_HOSTFASTCALLASYNC: return new HGCMMsgHostFastCallAsyncSvc();
-#endif
         case SVC_MSG_LOAD:        return new HGCMMsgSvcLoad();
         case SVC_MSG_UNLOAD:      return new HGCMMsgSvcUnload();
@@ -622,14 +588,4 @@
         switch (u32MsgId)
         {
-#ifdef VBOX_WITH_CRHGSMI
-            case SVC_MSG_HOSTFASTCALLASYNC:
-            {
-                HGCMMsgHostFastCallAsyncSvc *pMsg = (HGCMMsgHostFastCallAsyncSvc *)pMsgCore;
-
-                LogFlowFunc(("SVC_MSG_HOSTFASTCALLASYNC u32Function = %d, pParm = %p\n", pMsg->u32Function, &pMsg->Param));
-
-                rc = pSvc->m_fntable.pfnHostCall(pSvc->m_fntable.pvService, pMsg->u32Function, 1, &pMsg->Param);
-            } break;
-#endif
             case SVC_MSG_LOAD:
             {
@@ -1428,16 +1384,5 @@
         }
 
-#ifdef VBOX_WITH_CRHGSMI
-        /** @todo could this actually happen that the service is destroyed on ReleaseService? */
-        HGCMService *pNextSvc = pSvc->m_pSvcNext;
-        while (pSvc->m_cHandleAcquires)
-        {
-            pSvc->HandleReleased();
-            pSvc->ReleaseService();
-        }
-        pSvc = pNextSvc;
-#else
         pSvc = pSvc->m_pSvcNext;
-#endif
     }
 
@@ -1941,61 +1886,4 @@
 }
 
-#ifdef VBOX_WITH_CRHGSMI
-
-static DECLCALLBACK(int) hgcmMsgFastCallCompletionCallback(int32_t result, HGCMMsgCore *pMsgCore)
-{
-    /* Call the VMMDev port interface to issue IRQ notification. */
-    LogFlow(("MAIN::hgcmMsgFastCallCompletionCallback: message %p\n", pMsgCore));
-
-    HGCMMsgHostFastCallAsyncSvc *pMsg = (HGCMMsgHostFastCallAsyncSvc *)pMsgCore;
-    if (pMsg->pfnCompletion)
-        pMsg->pfnCompletion(result, pMsg->u32Function, &pMsg->Param, pMsg->pvCompletion);
-    return VINF_SUCCESS;
-}
-
-int HGCMService::HandleAcquired()
-{
-    ++m_cHandleAcquires;
-    return VINF_SUCCESS;
-}
-
-int HGCMService::HandleReleased()
-{
-    Assert(m_cHandleAcquires);
-    if (m_cHandleAcquires)
-    {
-        --m_cHandleAcquires;
-        return VINF_SUCCESS;
-    }
-    return VERR_INVALID_STATE;
-}
-
-int HGCMService::HostFastCallAsync(uint32_t u32Function, VBOXHGCMSVCPARM *pParm, PHGCMHOSTFASTCALLCB pfnCompletion,
-                                   void *pvCompletion)
-{
-    LogFlowFunc(("%s u32Function = %d, pParm = %p\n",
-                 m_pszSvcName, u32Function, pParm));
-
-    HGCMMsgCore *pCoreMsg;
-    int rc = hgcmMsgAlloc(m_pThread, &pCoreMsg, SVC_MSG_HOSTFASTCALLASYNC, hgcmMessageAllocSvc);
-
-    if (RT_SUCCESS(rc))
-    {
-        HGCMMsgHostFastCallAsyncSvc *pMsg = (HGCMMsgHostFastCallAsyncSvc *)pCoreMsg;
-
-        pMsg->u32Function      = u32Function;
-        pMsg->Param = *pParm;
-        pMsg->pfnCompletion = pfnCompletion;
-        pMsg->pvCompletion = pvCompletion;
-
-        rc = hgcmMsgPost(pMsg, hgcmMsgFastCallCompletionCallback);
-    }
-
-    LogFlowFunc(("rc = %Rrc\n", rc));
-    return rc;
-}
-
-#endif /* VBOX_WITH_CRHGSMI */
-
 /*
  * Main HGCM thread that manages services.
@@ -2014,8 +1902,4 @@
 #define HGCM_MSG_UNREGEXT   (19)  /**< Unregister a service extension. */
 #define HGCM_MSG_BRD_NOTIFY (20)  /**< Broadcast notification event (VM state change). */
-#ifdef VBOX_WITH_CRHGSMI
-# define HGCM_MSG_SVCAQUIRE  (30) /**< Acquire a service handle (for fast host calls) */
-# define HGCM_MSG_SVCRELEASE (31) /**< Release a service */
-#endif
 
 class HGCMMsgMainConnect: public HGCMMsgHeader
@@ -2110,22 +1994,4 @@
         HGCMNOTIFYEVENT enmEvent;
 };
-
-#ifdef VBOX_WITH_CRHGSMI
-class HGCMMsgMainSvcAcquire: public HGCMMsgCore
-{
-    public:
-        /* Which service to call. */
-        const char *pszServiceName;
-        /* Returned service. */
-        HGCMService *pService;
-};
-
-class HGCMMsgMainSvcRelease: public HGCMMsgCore
-{
-    public:
-        /* Svc . */
-        HGCMService *pService;
-};
-#endif
 
 
@@ -2145,8 +2011,4 @@
         case HGCM_MSG_UNREGEXT:   return new HGCMMsgMainUnregisterExtension();
         case HGCM_MSG_BRD_NOTIFY: return new HGCMMsgMainBroadcastNotify();
-#ifdef VBOX_WITH_CRHGSMI
-        case HGCM_MSG_SVCAQUIRE:  return new HGCMMsgMainSvcAcquire();
-        case HGCM_MSG_SVCRELEASE: return new HGCMMsgMainSvcRelease();
-#endif
 
         default:
@@ -2269,44 +2131,4 @@
                 HGCMService::BroadcastNotify(pMsg->enmEvent);
             } break;
-
-#ifdef VBOX_WITH_CRHGSMI
-            case HGCM_MSG_SVCAQUIRE:
-            {
-                HGCMMsgMainSvcAcquire *pMsg = (HGCMMsgMainSvcAcquire *)pMsgCore;
-
-                LogFlowFunc(("HGCM_MSG_SVCAQUIRE pszServiceName %s\n", pMsg->pszServiceName));
-
-                /* Resolve the service name to the pointer to service instance. */
-                HGCMService *pService;
-                rc = HGCMService::ResolveService(&pService, pMsg->pszServiceName);
-                if (RT_SUCCESS(rc))
-                {
-                    rc = pService->HandleAcquired();
-                    if (RT_SUCCESS(rc))
-                    {
-                        pMsg->pService = pService;
-                    }
-                    else
-                    {
-                        pService->ReleaseService();
-                    }
-                }
-            } break;
-
-            case HGCM_MSG_SVCRELEASE:
-            {
-                HGCMMsgMainSvcRelease *pMsg = (HGCMMsgMainSvcRelease *)pMsgCore;
-
-                LogFlowFunc(("HGCM_MSG_SVCARELEASE pService %p\n", pMsg->pService));
-
-                /* Resolve the service name to the pointer to service instance. */
-
-                rc = pMsg->pService->HandleReleased();
-                if (RT_SUCCESS(rc))
-                {
-                    pMsg->pService->ReleaseService();
-                }
-            } break;
-#endif
 
             case HGCM_MSG_RESET:
@@ -2824,100 +2646,4 @@
 
 
-#ifdef VBOX_WITH_CRHGSMI
-int HGCMHostSvcHandleCreate(const char *pszServiceName, HGCMCVSHANDLE * phSvc)
-{
-    LogFlowFunc(("name = %s\n", pszServiceName));
-
-    if (!pszServiceName)
-    {
-        return VERR_INVALID_PARAMETER;
-    }
-
-    if (!phSvc)
-    {
-        return VERR_INVALID_PARAMETER;
-    }
-
-    /* Host calls go to main HGCM thread that resolves the service name to the
-     * service instance pointer and then, using the service pointer, forwards
-     * the message to the service thread.
-     * So it is slow but host calls are intended mostly for configuration and
-     * other non-time-critical functions.
-     */
-    HGCMMsgCore *pCoreMsg;
-    int rc = hgcmMsgAlloc(g_pHgcmThread, &pCoreMsg, HGCM_MSG_SVCAQUIRE, hgcmMainMessageAlloc);
-
-    if (RT_SUCCESS(rc))
-    {
-        HGCMMsgMainSvcAcquire *pMsg = (HGCMMsgMainSvcAcquire *)pCoreMsg;
-
-        pMsg->pszServiceName = (char *)pszServiceName;
-        pMsg->pService = NULL;
-
-        pMsg->Reference();
-
-        rc = hgcmMsgSend(pMsg);
-        if (RT_SUCCESS(rc))
-        {
-            /* for simplicity just use a svc ptr as handle for now */
-            *phSvc = (HGCMCVSHANDLE)pMsg->pService;
-        }
-        pMsg->Dereference();
-    }
-
-    LogFlowFunc(("rc = %Rrc\n", rc));
-    return rc;
-}
-
-int HGCMHostSvcHandleDestroy(HGCMCVSHANDLE hSvc)
-{
-    LogFlowFunc(("hSvc = %p\n", hSvc));
-
-    if (!hSvc)
-    {
-        return VERR_INVALID_PARAMETER;
-    }
-
-    /* Host calls go to main HGCM thread that resolves the service name to the
-     * service instance pointer and then, using the service pointer, forwards
-     * the message to the service thread.
-     * So it is slow but host calls are intended mostly for configuration and
-     * other non-time-critical functions.
-     */
-    HGCMMsgCore *pCoreMsg;
-    int rc = hgcmMsgAlloc(g_pHgcmThread, &pCoreMsg, HGCM_MSG_SVCRELEASE, hgcmMainMessageAlloc);
-
-    if (RT_SUCCESS(rc))
-    {
-        HGCMMsgMainSvcRelease *pMsg = (HGCMMsgMainSvcRelease *)pCoreMsg;
-
-        pMsg->pService = (HGCMService *)hSvc;
-
-        rc = hgcmMsgSend(pMsg);
-    }
-
-    LogFlowFunc(("rc = %Rrc\n", rc));
-    return rc;
-}
-
-int HGCMHostFastCallAsync(HGCMCVSHANDLE hSvc, uint32_t function, VBOXHGCMSVCPARM *pParm, PHGCMHOSTFASTCALLCB pfnCompletion,
-                          void *pvCompletion)
-{
-    LogFlowFunc(("hSvc = %p, u32Function = %d, pParm = %p\n",
-            hSvc, function, pParm));
-
-    if (!hSvc)
-    {
-        return VERR_INVALID_PARAMETER;
-    }
-
-    HGCMService *pService = (HGCMService *)hSvc;
-    int rc = pService->HostFastCallAsync(function, pParm, pfnCompletion, pvCompletion);
-
-    LogFlowFunc(("rc = %Rrc\n", rc));
-    return rc;
-}
-#endif
-
 int HGCMHostReset(bool fForShutdown)
 {
Index: trunk/src/VBox/Main/src-client/VMMDevInterface.cpp
===================================================================
--- trunk/src/VBox/Main/src-client/VMMDevInterface.cpp	(revision 80377)
+++ trunk/src/VBox/Main/src-client/VMMDevInterface.cpp	(revision 80396)
@@ -754,28 +754,4 @@
         HGCMHostShutdown(fUvmIsInvalid);
 }
-
-# ifdef VBOX_WITH_CRHGSMI
-int VMMDev::hgcmHostSvcHandleCreate(const char *pszServiceName, HGCMCVSHANDLE * phSvc)
-{
-    if (!hgcmIsActive())
-        return VERR_INVALID_STATE;
-    return HGCMHostSvcHandleCreate(pszServiceName, phSvc);
-}
-
-int VMMDev::hgcmHostSvcHandleDestroy(HGCMCVSHANDLE hSvc)
-{
-    if (!hgcmIsActive())
-        return VERR_INVALID_STATE;
-    return HGCMHostSvcHandleDestroy(hSvc);
-}
-
-int VMMDev::hgcmHostFastCallAsync(HGCMCVSHANDLE hSvc, uint32_t function, PVBOXHGCMSVCPARM pParm,
-                                  PHGCMHOSTFASTCALLCB pfnCompletion, void *pvCompletion)
-{
-    if (!hgcmIsActive())
-        return VERR_INVALID_STATE;
-    return HGCMHostFastCallAsync(hSvc, function, pParm, pfnCompletion, pvCompletion);
-}
-# endif
 
 #endif /* HGCM */
