Index: /trunk/include/VBox/hgcmsvc.h
===================================================================
--- /trunk/include/VBox/hgcmsvc.h	(revision 75405)
+++ /trunk/include/VBox/hgcmsvc.h	(revision 75406)
@@ -82,4 +82,13 @@
     /** The service disconnects the client. */
     DECLR3CALLBACKMEMBER(void, pfnDisconnectClient, (void *pvInstance, uint32_t u32ClientID));
+
+    /**
+     * Check if the @a callHandle is for a call restored and re-submitted from saved state.
+     *
+     * @returns true if restored, false if not.
+     * @param   callHandle      The call we're checking up on.
+     */
+    DECLR3CALLBACKMEMBER(bool, pfnIsCallRestored, (VBOXHGCMCALLHANDLE callHandle));
+
 } VBOXHGCMSVCHELPERS;
 
@@ -392,5 +401,6 @@
      *  Return code is passed to pfnCallComplete callback.
      */
-    DECLR3CALLBACKMEMBER(void, pfnCall, (void *pvService, VBOXHGCMCALLHANDLE callHandle, uint32_t u32ClientID, void *pvClient, uint32_t function, uint32_t cParms, VBOXHGCMSVCPARM paParms[]));
+    DECLR3CALLBACKMEMBER(void, pfnCall, (void *pvService, VBOXHGCMCALLHANDLE callHandle, uint32_t u32ClientID, void *pvClient,
+                                         uint32_t function, uint32_t cParms, VBOXHGCMSVCPARM paParms[]));
 
     /** Host Service entry point meant for privileged features invisible to the guest.
Index: /trunk/include/VBox/vmm/pdmifs.h
===================================================================
--- /trunk/include/VBox/vmm/pdmifs.h	(revision 75405)
+++ /trunk/include/VBox/vmm/pdmifs.h	(revision 75406)
@@ -2071,12 +2071,19 @@
      * @param   rc                  The return code (VBox error code).
      * @param   pCmd                A pointer that identifies the completed command.
-     *
-     * @returns VBox status code
      */
     DECLR3CALLBACKMEMBER(void, pfnCompleted,(PPDMIHGCMPORT pInterface, int32_t rc, PVBOXHGCMCMD pCmd));
+
+    /**
+     * Checks if @a pCmd was restored & resubmitted from saved state.
+     *
+     * @returns true if restored, false if not.
+     * @param   pInterface          Pointer to this interface.
+     * @param   pCmd                The command we're checking on.
+     */
+    DECLR3CALLBACKMEMBER(bool, pfnIsCmdRestored,(PPDMIHGCMPORT pInterface, PVBOXHGCMCMD pCmd));
 
 } PDMIHGCMPORT;
 /** PDMIHGCMPORT interface ID. */
-# define PDMIHGCMPORT_IID                       "e00a0cbf-b75a-45c3-87f4-41cddbc5ae0b"
+# define PDMIHGCMPORT_IID                       "10ca89d3-18ef-44d3-535e-ca46532e3caa"
 
 
Index: /trunk/src/VBox/Devices/VMMDev/VMMDev.cpp
===================================================================
--- /trunk/src/VBox/Devices/VMMDev/VMMDev.cpp	(revision 75405)
+++ /trunk/src/VBox/Devices/VMMDev/VMMDev.cpp	(revision 75406)
@@ -4122,4 +4122,5 @@
     /* HGCM port */
     pThis->IHGCMPort.pfnCompleted           = hgcmCompleted;
+    pThis->IHGCMPort.pfnIsCmdRestored       = hgcmIsCmdRestored;
 #endif
 
Index: /trunk/src/VBox/Devices/VMMDev/VMMDevHGCM.cpp
===================================================================
--- /trunk/src/VBox/Devices/VMMDev/VMMDevHGCM.cpp	(revision 75405)
+++ /trunk/src/VBox/Devices/VMMDev/VMMDevHGCM.cpp	(revision 75406)
@@ -128,4 +128,7 @@
     bool                fCancelled;
 
+    /** Whether the command was restored from saved state. */
+    bool                fRestored;
+
     /** GC physical address of the guest request. */
     RTGCPHYS            GCPhys;
@@ -137,5 +140,6 @@
     VMMDevRequestType   enmRequestType;
 
-    union {
+    union
+    {
         struct
         {
@@ -1063,11 +1067,12 @@
     if (result == VINF_HGCM_SAVE_STATE)
     {
-        /* If the completion routine was called because HGCM saves its state,
-         * then currently nothing to be done here. The pCmd stays in the list
-         * and will be saved later when the VMMDev state will be saved.
+        /* If the completion routine was called while the HGCM service saves its state,
+         * then currently nothing to be done here.  The pCmd stays in the list and will
+         * be saved later when the VMMDev state will be saved and re-submitted on load.
          *
-         * It it assumed that VMMDev saves state after the HGCM services,
-         * and, therefore, VBOXHGCMCMD structures are not removed by
-         * vmmdevHGCMSaveState from the list, while HGCM uses them.
+         * It it assumed that VMMDev saves state after the HGCM services (VMMDev driver
+         * attached by constructor before it registers its SSM state), and, therefore,
+         * VBOXHGCMCMD structures are not removed by vmmdevHGCMSaveState from the list,
+         * while HGCM uses them.
          */
         LogFlowFunc(("VINF_HGCM_SAVE_STATE for command %p\n", pCmd));
@@ -1216,4 +1221,13 @@
                                    (PFNRT)hgcmCompletedWorker, 3, pInterface, result, pCmd);
     AssertRC(rc);
+}
+
+/**
+ * @interface_method_impl{PDMIHGCMPORT, pfnIsCmdRestored}
+ */
+DECLCALLBACK(bool) hgcmIsCmdRestored(PPDMIHGCMPORT pInterface, PVBOXHGCMCMD pCmd)
+{
+    RT_NOREF(pInterface);
+    return pCmd && pCmd->fRestored;
 }
 
@@ -1605,5 +1619,5 @@
     else
         pCmd->fCancelled = false;
-
+    pCmd->fRestored      = true;
     pCmd->enmRequestType = enmRequestType;
 
@@ -1649,5 +1663,5 @@
     else
         pCmd->fCancelled = false;
-
+    pCmd->fRestored      = true;
     pCmd->enmRequestType = enmRequestType;
 
@@ -1695,5 +1709,5 @@
     else
         pCmd->fCancelled = false;
-
+    pCmd->fRestored      = true;
     pCmd->enmRequestType = enmRequestType;
 
Index: /trunk/src/VBox/Devices/VMMDev/VMMDevHGCM.h
===================================================================
--- /trunk/src/VBox/Devices/VMMDev/VMMDevHGCM.h	(revision 75405)
+++ /trunk/src/VBox/Devices/VMMDev/VMMDevHGCM.h	(revision 75406)
@@ -29,4 +29,5 @@
 
 DECLCALLBACK(void) hgcmCompleted(PPDMIHGCMPORT pInterface, int32_t result, PVBOXHGCMCMD pCmdPtr);
+DECLCALLBACK(bool) hgcmIsCmdRestored(PPDMIHGCMPORT pInterface, PVBOXHGCMCMD pCmd);
 
 int vmmdevHGCMSaveState(VMMDevState *pVMMDevState, PSSMHANDLE pSSM);
Index: /trunk/src/VBox/Main/src-client/HGCM.cpp
===================================================================
--- /trunk/src/VBox/Main/src-client/HGCM.cpp	(revision 75405)
+++ /trunk/src/VBox/Main/src-client/HGCM.cpp	(revision 75406)
@@ -132,4 +132,5 @@
         static DECLCALLBACK(void) svcHlpCallComplete(VBOXHGCMCALLHANDLE callHandle, int32_t rc);
         static DECLCALLBACK(void) svcHlpDisconnectClient(void *pvInstance, uint32_t u32ClientId);
+        static DECLCALLBACK(bool) svcHlpIsCallRestored(VBOXHGCMCALLHANDLE callHandle);
 
     public:
@@ -755,4 +756,7 @@
 }
 
+/**
+ * @interface_method_impl{VBOXHGCMSVCHELPERS,pfnCallComplete}
+ */
 /* static */ DECLCALLBACK(void) HGCMService::svcHlpCallComplete(VBOXHGCMCALLHANDLE callHandle, int32_t rc)
 {
@@ -773,4 +777,7 @@
 }
 
+/**
+ * @interface_method_impl{VBOXHGCMSVCHELPERS,pfnDisconnectClient}
+ */
 /* static */ DECLCALLBACK(void) HGCMService::svcHlpDisconnectClient(void *pvInstance, uint32_t u32ClientId)
 {
@@ -781,4 +788,21 @@
          pService->DisconnectClient(u32ClientId, true);
      }
+}
+
+/**
+ * @interface_method_impl{VBOXHGCMSVCHELPERS,pfnIsCallRestored}
+ */
+/* static */ DECLCALLBACK(bool) HGCMService::svcHlpIsCallRestored(VBOXHGCMCALLHANDLE callHandle)
+{
+    HGCMMsgHeader *pMsgHdr = (HGCMMsgHeader *)(callHandle);
+    AssertPtrReturn(pMsgHdr, false);
+
+    PVBOXHGCMCMD pCmd = pMsgHdr->pCmd;
+    AssertPtrReturn(pCmd, false);
+
+    PPDMIHGCMPORT pHgcmPort = pMsgHdr->pHGCMPort;
+    AssertPtrReturn(pHgcmPort, false);
+
+    return pHgcmPort->pfnIsCmdRestored(pHgcmPort, pCmd);
 }
 
@@ -836,4 +860,5 @@
             m_svcHelpers.pvInstance          = this;
             m_svcHelpers.pfnDisconnectClient = svcHlpDisconnectClient;
+            m_svcHelpers.pfnIsCallRestored   = svcHlpIsCallRestored;
 
             /* Execute the load request on the service thread. */
