Changeset 82483 in vbox
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/GuestHost/SharedClipboard.h
r82480 r82483 251 251 /** 252 252 * Shared Clipboard transfer source type. 253 * @note Part of saved state! 253 254 */ 254 255 typedef enum SHCLSOURCE -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-internal.h
r81824 r82483 91 91 } SHCLCLIENTPODSTATE, *PSHCLCLIENTPODSTATE; 92 92 93 /** @name SHCLCLIENTSTATE_FLAGS_XXX 94 * @note Part of saved state! */ 93 95 /** No Shared Clipboard client flags defined. */ 94 96 #define SHCLCLIENTSTATE_FLAGS_NONE 0 … … 97 99 /** Client has a guest write operation active. */ 98 100 #define SHCLCLIENTSTATE_FLAGS_WRITE_ACTIVE RT_BIT(1) 101 /** @} */ 99 102 100 103 /** -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc.cpp
r82482 r82483 216 216 #include <VBox/log.h> 217 217 218 #include <VBox/AssertGuest.h>219 218 #include <VBox/GuestHost/clipboard-helper.h> 220 219 #include <VBox/HostServices/Service.h> … … 222 221 #include <VBox/HostServices/VBoxClipboardExt.h> 223 222 224 #include <iprt/alloc.h> 223 #include <VBox/AssertGuest.h> 224 #include <VBox/err.h> 225 #include <VBox/VMMDev.h> 226 #include <VBox/vmm/ssm.h> 227 228 #include <iprt/mem.h> 225 229 #include <iprt/string.h> 226 230 #include <iprt/assert.h> 227 231 #include <iprt/critsect.h> 228 232 #include <iprt/rand.h> 229 230 #include <VBox/err.h>231 #include <VBox/vmm/ssm.h>232 233 233 234 #include "VBoxSharedClipboardSvc-internal.h" … … 2093 2094 /** 2094 2095 * SSM descriptor table for the SHCLCLIENTSTATE structure. 2096 * 2097 * @note Saving the session ID not necessary, as they're not persistent across 2098 * state save/restore. 2095 2099 */ 2096 2100 static SSMFIELD const s_aShClSSMClientState[] = 2097 2101 { 2098 /** Note: Saving the session ID not necessary, as they're not persistent across state save/restore. */2099 2102 SSMFIELD_ENTRY(SHCLCLIENTSTATE, fGuestFeatures0), 2100 2103 SSMFIELD_ENTRY(SHCLCLIENTSTATE, fGuestFeatures1), … … 2102 2105 SSMFIELD_ENTRY(SHCLCLIENTSTATE, enmSource), 2103 2106 SSMFIELD_ENTRY(SHCLCLIENTSTATE, fFlags), 2107 SSMFIELD_ENTRY_TERM() 2108 }; 2109 2110 /** 2111 * VBox 6.1 Beta 1 version of s_aShClSSMClientState (no flags). 2112 */ 2113 static SSMFIELD const s_aShClSSMClientState61B1[] = 2114 { 2115 SSMFIELD_ENTRY(SHCLCLIENTSTATE, fGuestFeatures0), 2116 SSMFIELD_ENTRY(SHCLCLIENTSTATE, fGuestFeatures1), 2117 SSMFIELD_ENTRY(SHCLCLIENTSTATE, cbChunkSize), 2118 SSMFIELD_ENTRY(SHCLCLIENTSTATE, enmSource), 2104 2119 SSMFIELD_ENTRY_TERM() 2105 2120 }; … … 2266 2281 if (lenOrVer >= VBOX_SHCL_SAVED_STATE_VER_6_1RC1) 2267 2282 { 2268 rc = SSMR3GetStructEx(pSSM, &pClient->State, sizeof(pClient->State), 0 /* fFlags */, 2269 &s_aShClSSMClientState[0], NULL); 2270 AssertRCReturn(rc, rc); 2271 2272 rc = SSMR3GetStructEx(pSSM, &pClient->State.POD, sizeof(pClient->State.POD), 0 /* fFlags */, 2273 &s_aShClSSMClientPODState[0], NULL); 2274 AssertRCReturn(rc, rc); 2275 } 2276 else /** @todo Remove this block after 6.1 RC; don't annoy team members with broken saved states. */ 2277 { 2278 rc = SSMR3Skip(pSSM, sizeof(uint32_t)); /* Begin marker */ 2279 AssertRC(rc); 2280 2281 rc = SSMR3GetU64(pSSM, &pClient->State.fGuestFeatures0); 2282 AssertRC(rc); 2283 2284 rc = SSMR3GetU64(pSSM, &pClient->State.fGuestFeatures1); 2285 AssertRC(rc); 2286 2287 rc = SSMR3GetU32(pSSM, &pClient->State.cbChunkSize); 2288 AssertRC(rc); 2289 2290 rc = SSMR3GetU32(pSSM, (uint32_t *)&pClient->State.enmSource); 2291 AssertRC(rc); 2292 2293 rc = SSMR3Skip(pSSM, sizeof(uint32_t)); /* End marker */ 2294 AssertRC(rc); 2295 } 2296 2283 SSMR3GetStructEx(pSSM, &pClient->State, sizeof(pClient->State), 0 /* fFlags */, &s_aShClSSMClientState[0], NULL); 2284 SSMR3GetStructEx(pSSM, &pClient->State.POD, sizeof(pClient->State.POD), 0 /* fFlags */, 2285 &s_aShClSSMClientPODState[0], NULL); 2286 } 2287 else 2288 SSMR3GetStructEx(pSSM, &pClient->State, sizeof(pClient->State), 0 /* fFlags */, &s_aShClSSMClientState61B1[0], NULL); 2297 2289 rc = SSMR3GetStructEx(pSSM, &pClient->State.Transfers, sizeof(pClient->State.Transfers), 0 /* fFlags */, 2298 2290 &s_aShClSSMClientTransferState[0], NULL); … … 2300 2292 2301 2293 /* Load the client's internal message queue. */ 2302 uint64_t cMsg ;2303 rc = SSMR3GetU64(pSSM, &cMsg );2294 uint64_t cMsgs; 2295 rc = SSMR3GetU64(pSSM, &cMsgs); 2304 2296 AssertRCReturn(rc, rc); 2305 2306 for (uint64_t i = 0; i < cMsg; i++) 2297 AssertLogRelMsgReturn(cMsgs < _16K, ("Too many messages: %u (%x)\n", cMsgs, cMsgs), VERR_SSM_DATA_UNIT_FORMAT_CHANGED); 2298 2299 for (uint64_t i = 0; i < cMsgs; i++) 2307 2300 { 2308 2301 PSHCLCLIENTMSG pMsg = (PSHCLCLIENTMSG)RTMemAlloc(sizeof(SHCLCLIENTMSG)); 2309 AssertPtrReturn(pMsg, VERR_NO_MEMORY); 2310 2311 rc = SSMR3GetStructEx(pSSM, pMsg, sizeof(SHCLCLIENTMSG), 0 /*fFlags*/, &s_aShClSSMClientMsgHdr[0], NULL); 2312 AssertRCReturn(rc, rc); 2313 2302 AssertReturn(pMsg, VERR_NO_MEMORY); 2303 2304 SSMR3GetStructEx(pSSM, pMsg, sizeof(SHCLCLIENTMSG), 0 /*fFlags*/, &s_aShClSSMClientMsgHdr[0], NULL); 2314 2305 rc = SSMR3GetStructEx(pSSM, &pMsg->Ctx, sizeof(SHCLMSGCTX), 0 /*fFlags*/, &s_aShClSSMClientMsgCtx[0], NULL); 2315 AssertRCReturn(rc, rc); 2306 AssertRCReturnStmt(rc, RTMemFree(pMsg), rc); 2307 2308 AssertLogRelMsgReturnStmt(pMsg->cParms <= VMMDEV_MAX_HGCM_PARMS, 2309 ("Too many HGCM message parameters: %u (%#x)\n", pMsg->cParms, pMsg->cParms), 2310 RTMemFree(pMsg), 2311 VERR_SSM_DATA_UNIT_FORMAT_CHANGED); 2316 2312 2317 2313 pMsg->paParms = (PVBOXHGCMSVCPARM)RTMemAllocZ(sizeof(VBOXHGCMSVCPARM) * pMsg->cParms); 2318 Assert PtrReturn(pMsg->paParms, VERR_NO_MEMORY);2314 AssertReturnStmt(pMsg->paParms, RTMemFree(pMsg), VERR_NO_MEMORY); 2319 2315 2320 2316 for (uint32_t p = 0; p < pMsg->cParms; p++) 2321 2317 { 2322 2318 rc = HGCMSvcSSMR3Get(&pMsg->paParms[p], pSSM); 2323 AssertRCReturn(rc, rc); 2319 AssertRCReturn(rc, rc); /* we'll leak stuff here, oh well... */ 2324 2320 } 2325 2321
Note:
See TracChangeset
for help on using the changeset viewer.