Index: trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-internal.h
===================================================================
--- trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-internal.h	(revision 79502)
+++ trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-internal.h	(revision 79503)
@@ -76,5 +76,5 @@
 /**
  * Structure for keeping generic client state data within the Shared Clipboard host service.
- * This structure needs to be serializable by SSM.
+ * This structure needs to be serializable by SSM (must be a POD type).
  */
 typedef struct VBOXCLIPBOARDCLIENTSTATE
@@ -125,19 +125,18 @@
     uint32_t u32AvailableFormats;
     uint32_t u32RequestedFormat;
-
+} VBOXCLIPBOARDCLIENTSTATE, *PVBOXCLIPBOARDCLIENTSTATE;
+
+/**
+ * Structure for keeping a HGCM client state within the Shared Clipboard host service.
+ */
+typedef struct _VBOXCLIPBOARDCLIENTDATA
+{
+    /** General client state data. */
+    VBOXCLIPBOARDCLIENTSTATE          State;
     /** The client's message queue (FIFO). */
     RTCList<VBOXCLIPBOARDCLIENTMSG *> queueMsg;
-} VBOXCLIPBOARDCLIENTSTATE, *PVBOXCLIPBOARDCLIENTSTATE;
-
-/**
- * Structure for keeping a HGCM client state within the Shared Clipboard host service.
- */
-typedef struct _VBOXCLIPBOARDCLIENTDATA
-{
-    /** General client state data. */
-    VBOXCLIPBOARDCLIENTSTATE       State;
 #ifdef VBOX_WITH_SHARED_CLIPBOARD_URI_LIST
     /** URI context data. */
-    SHAREDCLIPBOARDURICTX          URI;
+    SHAREDCLIPBOARDURICTX             URI;
 #endif
 } VBOXCLIPBOARDCLIENTDATA, *PVBOXCLIPBOARDCLIENTDATA;
@@ -191,10 +190,10 @@
 int vboxSvcClipboardClientDeferredSetMsgInfo(PVBOXCLIPBOARDCLIENT pClient, uint32_t uMsg, uint32_t cParms);
 
-void vboxSvcClipboardMsgQueueReset(PVBOXCLIPBOARDCLIENTSTATE pState);
+void vboxSvcClipboardMsgQueueReset(PVBOXCLIPBOARDCLIENTDATA pClientData);
 PVBOXCLIPBOARDCLIENTMSG vboxSvcClipboardMsgAlloc(uint32_t uMsg, uint32_t cParms);
 void vboxSvcClipboardMsgFree(PVBOXCLIPBOARDCLIENTMSG pMsg);
-int vboxSvcClipboardMsgAdd(PVBOXCLIPBOARDCLIENTSTATE pState, PVBOXCLIPBOARDCLIENTMSG pMsg, bool fAppend);
-int vboxSvcClipboardMsgGetNextInfo(PVBOXCLIPBOARDCLIENTSTATE pState, uint32_t *puType, uint32_t *pcParms);
-int vboxSvcClipboardMsgGetNext(PVBOXCLIPBOARDCLIENTSTATE pState,
+int vboxSvcClipboardMsgAdd(PVBOXCLIPBOARDCLIENTDATA pClientData, PVBOXCLIPBOARDCLIENTMSG pMsg, bool fAppend);
+int vboxSvcClipboardMsgGetNextInfo(PVBOXCLIPBOARDCLIENTDATA pClientData, uint32_t *puType, uint32_t *pcParms);
+int vboxSvcClipboardMsgGetNext(PVBOXCLIPBOARDCLIENTDATA pClientData,
                                uint32_t uMsg, uint32_t cParms, VBOXHGCMSVCPARM paParms[]);
 
Index: trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc.cpp
===================================================================
--- trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc.cpp	(revision 79502)
+++ trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc.cpp	(revision 79503)
@@ -159,7 +159,7 @@
 *   Prototypes                                                                                                                   *
 *********************************************************************************************************************************/
-static int vboxSvcClipboardClientStateInit(PVBOXCLIPBOARDCLIENTSTATE pState, uint32_t uClientID);
-static int vboxSvcClipboardClientStateDestroy(PVBOXCLIPBOARDCLIENTSTATE pState);
-static void vboxSvcClipboardClientStateReset(PVBOXCLIPBOARDCLIENTSTATE pState);
+static int vboxSvcClipboardClientStateInit(PVBOXCLIPBOARDCLIENTDATA pClientData, uint32_t uClientID);
+static int vboxSvcClipboardClientStateDestroy(PVBOXCLIPBOARDCLIENTDATA pClientData);
+static void vboxSvcClipboardClientStateReset(PVBOXCLIPBOARDCLIENTDATA pClientData);
 
 
@@ -265,14 +265,14 @@
  * Resets a client's state message queue.
  *
- * @param   pState              Pointer to the client's state structure to reset message queue for.
- */
-void vboxSvcClipboardMsgQueueReset(PVBOXCLIPBOARDCLIENTSTATE pState)
+ * @param   pClientData         Pointer to the client data structure to reset message queue for.
+ */
+void vboxSvcClipboardMsgQueueReset(PVBOXCLIPBOARDCLIENTDATA pClientData)
 {
     LogFlowFuncEnter();
 
-    while (!pState->queueMsg.isEmpty())
-    {
-        RTMemFree(pState->queueMsg.last());
-        pState->queueMsg.removeLast();
+    while (!pClientData->queueMsg.isEmpty())
+    {
+        RTMemFree(pClientData->queueMsg.last());
+        pClientData->queueMsg.removeLast();
     }
 }
@@ -326,9 +326,9 @@
  *
  * @returns IPRT status code.
- * @param   pState              Pointer to the client's state structure to add new message to.
+ * @param   pClientData         Pointer to the client data structure to add new message to.
  * @param   pMsg                Pointer to message to add. The queue then owns the pointer.
  * @param   fAppend             Whether to append or prepend the message to the queue.
  */
-int vboxSvcClipboardMsgAdd(PVBOXCLIPBOARDCLIENTSTATE pState, PVBOXCLIPBOARDCLIENTMSG pMsg, bool fAppend)
+int vboxSvcClipboardMsgAdd(PVBOXCLIPBOARDCLIENTDATA pClientData, PVBOXCLIPBOARDCLIENTMSG pMsg, bool fAppend)
 {
     AssertPtrReturn(pMsg, VERR_INVALID_POINTER);
@@ -337,7 +337,7 @@
 
     if (fAppend)
-        pState->queueMsg.append(pMsg);
+        pClientData->queueMsg.append(pMsg);
     else
-        pState->queueMsg.prepend(pMsg);
+        pClientData->queueMsg.prepend(pMsg);
 
     /** @todo Catch / handle OOM? */
@@ -350,9 +350,9 @@
  *
  * @returns IPRT status code. VERR_NO_DATA if no next message is available.
- * @param   pState              Pointer to the client's state structure to get message info for.
+ * @param   pClientDAta         Pointer to the client data structure to get message info for.
  * @param   puType              Where to store the message type.
  * @param   pcParms             Where to store the message parameter count.
  */
-int vboxSvcClipboardMsgGetNextInfo(PVBOXCLIPBOARDCLIENTSTATE pState, uint32_t *puType, uint32_t *pcParms)
+int vboxSvcClipboardMsgGetNextInfo(PVBOXCLIPBOARDCLIENTDATA pClientData, uint32_t *puType, uint32_t *pcParms)
 {
     AssertPtrReturn(puType, VERR_INVALID_POINTER);
@@ -361,5 +361,5 @@
     int rc;
 
-    if (pState->queueMsg.isEmpty())
+    if (pClientData->queueMsg.isEmpty())
     {
         rc = VERR_NO_DATA;
@@ -367,5 +367,5 @@
     else
     {
-        PVBOXCLIPBOARDCLIENTMSG pMsg = pState->queueMsg.first();
+        PVBOXCLIPBOARDCLIENTMSG pMsg = pClientData->queueMsg.first();
         AssertPtr(pMsg);
 
@@ -385,10 +385,10 @@
  *
  * @returns IPRT status code.
- * @param   pState              Pointer to the client's state structure to get message for.
+ * @param   pClientData         Pointer to the client data structure to get message for.
  * @param   uMsg                Message type to retrieve.
  * @param   cParms              Number of parameters the \@a paParms array can store.
  * @param   paParms             Where to store the message parameters.
  */
-int vboxSvcClipboardMsgGetNext(PVBOXCLIPBOARDCLIENTSTATE pState,
+int vboxSvcClipboardMsgGetNext(PVBOXCLIPBOARDCLIENTDATA pClientData,
                                uint32_t uMsg, uint32_t cParms, VBOXHGCMSVCPARM paParms[])
 {
@@ -396,9 +396,9 @@
 
     /* Check for pending messages in our queue. */
-    if (pState->queueMsg.isEmpty())
+    if (pClientData->queueMsg.isEmpty())
         return VERR_NO_DATA;
 
     /* Get the current message. */
-    PVBOXCLIPBOARDCLIENTMSG pMsg = pState->queueMsg.first();
+    PVBOXCLIPBOARDCLIENTMSG pMsg = pClientData->queueMsg.first();
     AssertPtr(pMsg);
 
@@ -422,9 +422,9 @@
 
         /** @todo Only remove on success? */
-        pState->queueMsg.removeFirst(); /* Remove the current message from the queue. */
+        pClientData->queueMsg.removeFirst(); /* Remove the current message from the queue. */
     }
     else
     {
-        vboxSvcClipboardMsgQueueReset(pState);
+        vboxSvcClipboardMsgQueueReset(pClientData);
         /** @todo Cleanup, send notification to guest. */
     }
@@ -706,6 +706,6 @@
     VBoxClipboardSvcImplDisconnect(pClientData);
 
-    vboxSvcClipboardClientStateReset(&pClientData->State);
-    vboxSvcClipboardClientStateDestroy(&pClientData->State);
+    vboxSvcClipboardClientStateReset(pClientData);
+    vboxSvcClipboardClientStateDestroy(pClientData);
 
     RTMemFree(itClient->second);
@@ -738,8 +738,8 @@
 
             /* Reset the client state. */
-            vboxSvcClipboardClientStateReset(&pClient->pData->State);
+            vboxSvcClipboardClientStateReset(pClient->pData);
 
             /* (Re-)initialize the client state. */
-            vboxSvcClipboardClientStateInit(&pClient->pData->State, u32ClientID);
+            vboxSvcClipboardClientStateInit(pClient->pData, u32ClientID);
 
             rc = VBoxClipboardSvcImplConnect(pClient->pData, VBoxSvcClipboardGetHeadless());
@@ -1346,8 +1346,8 @@
  *
  * @returns VBox status code.
- * @param   pState              Client state to initialize.
+ * @param   pClientData         Client state to initialize.
  * @param   uClientID           Client ID (HGCM) to use for this client state.
  */
-static int vboxSvcClipboardClientStateInit(PVBOXCLIPBOARDCLIENTSTATE pState, uint32_t uClientID)
+static int vboxSvcClipboardClientStateInit(PVBOXCLIPBOARDCLIENTDATA pClientData, uint32_t uClientID)
 {
     LogFlowFuncEnter();
@@ -1355,5 +1355,5 @@
     /* Register the client.
      * Note: Do *not* memset the struct, as it contains classes (for caching). */
-    pState->u32ClientID = uClientID;
+    pClientData->State.u32ClientID = uClientID;
 
     return VINF_SUCCESS;
@@ -1364,11 +1364,11 @@
  *
  * @returns VBox status code.
- * @param   pState              Client state to destroy.
- */
-static int vboxSvcClipboardClientStateDestroy(PVBOXCLIPBOARDCLIENTSTATE pState)
+ * @param   pClientData         Client state to destroy.
+ */
+static int vboxSvcClipboardClientStateDestroy(PVBOXCLIPBOARDCLIENTDATA pClientData)
 {
     LogFlowFuncEnter();
 
-    vboxSvcClipboardMsgQueueReset(pState);
+    vboxSvcClipboardMsgQueueReset(pClientData);
 
     return VINF_SUCCESS;
@@ -1378,27 +1378,27 @@
  * Resets a Shared Clipboard service's client state.
  *
- * @param   pState              Client state to reset.
- */
-static void vboxSvcClipboardClientStateReset(PVBOXCLIPBOARDCLIENTSTATE pState)
+ * @param   pClientData         Client state to reset.
+ */
+static void vboxSvcClipboardClientStateReset(PVBOXCLIPBOARDCLIENTDATA pClientData)
 {
     LogFlowFuncEnter();
 
     /** @todo Clear async / asynRead / ... data? */
-    vboxSvcClipboardMsgQueueReset(pState);
-
-    pState->u32ClientID                  = 0;
-    pState->fAsync                       = false;
-    pState->fReadPending                 = false;
-
-    pState->fHostMsgQuit                 = false;
-    pState->fHostMsgReadData             = false;
-    pState->fHostMsgFormats              = false;
+    vboxSvcClipboardMsgQueueReset(pClientData);
+
+    pClientData->State.u32ClientID                  = 0;
+    pClientData->State.fAsync                       = false;
+    pClientData->State.fReadPending                 = false;
+
+    pClientData->State.fHostMsgQuit                 = false;
+    pClientData->State.fHostMsgReadData             = false;
+    pClientData->State.fHostMsgFormats              = false;
 #ifdef VBOX_WITH_SHARED_CLIPBOARD_URI_LIST
-    pState->URI.fTransferStart = false;
-    pState->URI.enmTransferDir = SHAREDCLIPBOARDURITRANSFERDIR_UNKNOWN;
+    pClientData->State.URI.fTransferStart = false;
+    pClientData->State.URI.enmTransferDir = SHAREDCLIPBOARDURITRANSFERDIR_UNKNOWN;
 #endif
 
-    pState->u32AvailableFormats = 0;
-    pState->u32RequestedFormat = 0;
+    pClientData->State.u32AvailableFormats = 0;
+    pClientData->State.u32RequestedFormat = 0;
 }
 
