Changeset 93444 in vbox for trunk/src/VBox/HostServices
- Timestamp:
- Jan 26, 2022 6:01:15 PM (3 years ago)
- Location:
- trunk/src/VBox/HostServices
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/DragAndDrop/Makefile.kmk
r93115 r93444 47 47 48 48 VBoxDragAndDropSvc_LIBS = \ 49 $(LIB_VMM) \50 49 $(LIB_RUNTIME) \ 51 $(LIB_REM) \52 50 $(PATH_STAGE_LIB)/VBoxDnDHostR3Lib$(VBOX_SUFF_LIB) 53 51 -
trunk/src/VBox/HostServices/GuestControl/Makefile.kmk
r93115 r93444 40 40 41 41 VBoxGuestControlSvc_LIBS = \ 42 $(LIB_VMM) \ 43 $(LIB_RUNTIME) \ 44 $(LIB_REM) 42 $(LIB_RUNTIME) 45 43 46 44 VBoxGuestControlSvc_LDFLAGS.darwin = \ -
trunk/src/VBox/HostServices/GuestControl/VBoxGuestControlSvc.cpp
r93115 r93444 69 69 #include <VBox/VMMDev.h> 70 70 #include <VBox/vmm/ssm.h> 71 #include <VBox/vmm/vmmr3vtable.h> 71 72 #include <iprt/assert.h> 72 73 #include <iprt/cpp/autores.h> … … 905 906 uint32_t u32Function, uint32_t cParms, VBOXHGCMSVCPARM paParms[], uint64_t tsArrival); 906 907 static DECLCALLBACK(int) svcHostCall(void *pvService, uint32_t u32Function, uint32_t cParms, VBOXHGCMSVCPARM paParms[]); 907 static DECLCALLBACK(int) svcSaveState(void *pvService, uint32_t idClient, void *pvClient, PSSMHANDLE pSSM); 908 static DECLCALLBACK(int) svcLoadState(void *pvService, uint32_t idClient, void *pvClient, PSSMHANDLE pSSM, uint32_t uVersion); 908 static DECLCALLBACK(int) svcSaveState(void *pvService, uint32_t idClient, void *pvClient, 909 PSSMHANDLE pSSM, PCVMMR3VTABLE pVMM); 910 static DECLCALLBACK(int) svcLoadState(void *pvService, uint32_t idClient, void *pvClient, 911 PSSMHANDLE pSSM, PCVMMR3VTABLE pVMM, uint32_t uVersion); 909 912 static DECLCALLBACK(int) svcRegisterExtension(void *pvService, PFNHGCMSVCEXT pfnExtension, void *pvExtension); 910 913 … … 2423 2426 */ 2424 2427 /*static*/ DECLCALLBACK(int) 2425 GstCtrlService::svcSaveState(void *pvService, uint32_t idClient, void *pvClient, PSSMHANDLE pSSM )2428 GstCtrlService::svcSaveState(void *pvService, uint32_t idClient, void *pvClient, PSSMHANDLE pSSM, PCVMMR3VTABLE pVMM) 2426 2429 { 2427 2430 RT_NOREF(pvClient); … … 2434 2437 Only the root service survives, so remember who that is and its mode. */ 2435 2438 2436 SSMR3PutU32(pSSM, 1);2437 SSMR3PutBool(pSSM, pThis->m_fLegacyMode);2438 return SSMR3PutBool(pSSM, idClient == pThis->m_idMasterClient);2439 pVMM->pfnSSMR3PutU32(pSSM, 1); 2440 pVMM->pfnSSMR3PutBool(pSSM, pThis->m_fLegacyMode); 2441 return pVMM->pfnSSMR3PutBool(pSSM, idClient == pThis->m_idMasterClient); 2439 2442 } 2440 2443 … … 2444 2447 */ 2445 2448 /*static*/ DECLCALLBACK(int) 2446 GstCtrlService::svcLoadState(void *pvService, uint32_t idClient, void *pvClient, PSSMHANDLE pSSM, uint32_t uVersion) 2449 GstCtrlService::svcLoadState(void *pvService, uint32_t idClient, void *pvClient, 2450 PSSMHANDLE pSSM, PCVMMR3VTABLE pVMM, uint32_t uVersion) 2447 2451 { 2448 2452 SELF *pThis = reinterpret_cast<SELF *>(pvService); … … 2455 2459 { 2456 2460 uint32_t uSubVersion; 2457 int rc = SSMR3GetU32(pSSM, &uSubVersion);2461 int rc = pVMM->pfnSSMR3GetU32(pSSM, &uSubVersion); 2458 2462 AssertRCReturn(rc, rc); 2459 2463 if (uSubVersion != 1) 2460 return SSMR3SetLoadError(pSSM, VERR_SSM_DATA_UNIT_FORMAT_CHANGED, RT_SRC_POS,2464 return pVMM->pfnSSMR3SetLoadError(pSSM, VERR_SSM_DATA_UNIT_FORMAT_CHANGED, RT_SRC_POS, 2461 2465 "sub version %u, expected 1\n", uSubVersion); 2462 2466 bool fLegacyMode; 2463 rc = SSMR3GetBool(pSSM, &fLegacyMode);2467 rc = pVMM->pfnSSMR3GetBool(pSSM, &fLegacyMode); 2464 2468 AssertRCReturn(rc, rc); 2465 2469 pThis->m_fLegacyMode = fLegacyMode; 2466 2470 2467 2471 bool fIsMaster; 2468 rc = SSMR3GetBool(pSSM, &fIsMaster);2472 rc = pVMM->pfnSSMR3GetBool(pSSM, &fIsMaster); 2469 2473 AssertRCReturn(rc, rc); 2470 2474 -
trunk/src/VBox/HostServices/GuestControl/testcase/Makefile.kmk
r93115 r93444 35 35 ../VBoxGuestControlSvc.cpp \ 36 36 tstGuestControlSvc.cpp 37 tstGuestControlSvc_LIBS = $(LIB_RUNTIME) $(LIB_VMM)37 tstGuestControlSvc_LIBS = $(LIB_RUNTIME) 38 38 39 39 $$(tstGuestControlSvc_0_OUTDIR)/tstGuestControlSvc.run: $$(tstGuestControlSvc_1_STAGE_TARGET) -
trunk/src/VBox/HostServices/GuestProperties/Makefile.kmk
r93115 r93444 40 40 41 41 VBoxGuestPropSvc_LIBS = \ 42 $(LIB_VMM) \ 43 $(LIB_RUNTIME) \ 44 $(LIB_REM) 42 $(LIB_RUNTIME) 45 43 46 44 VBoxGuestPropSvc_LDFLAGS.darwin = \ -
trunk/src/VBox/HostServices/HostChannel/Makefile.kmk
r93115 r93444 36 36 37 37 VBoxHostChannel_LIBS = \ 38 $(LIB_VMM) \39 38 $(LIB_RUNTIME) 40 39 -
trunk/src/VBox/HostServices/SharedClipboard/Makefile.kmk
r93115 r93444 73 73 74 74 VBoxSharedClipboard_LIBS = \ 75 $(LIB_VMM) \ 76 $(LIB_RUNTIME) \ 77 $(LIB_REM) 75 $(LIB_RUNTIME) 78 76 if1of ($(KBUILD_TARGET), linux solaris freebsd) 79 77 ifndef VBOX_HEADLESS -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc.cpp
r93316 r93444 184 184 #define LOG_GROUP LOG_GROUP_SHARED_CLIPBOARD 185 185 #include <VBox/log.h> 186 #include <VBox/vmm/vmmr3vtable.h> /* must be included before hgcmsvc.h */ 186 187 187 188 #include <VBox/GuestHost/clipboard-helper.h> … … 2457 2458 #endif /* !UNIT_TEST */ 2458 2459 2459 static DECLCALLBACK(int) svcSaveState(void *, uint32_t u32ClientID, void *pvClient, PSSMHANDLE pSSM )2460 static DECLCALLBACK(int) svcSaveState(void *, uint32_t u32ClientID, void *pvClient, PSSMHANDLE pSSM, PCVMMR3VTABLE pVMM) 2460 2461 { 2461 2462 LogFlowFuncEnter(); … … 2475 2476 2476 2477 /* Write Shared Clipboard saved state version. */ 2477 SSMR3PutU32(pSSM, VBOX_SHCL_SAVED_STATE_VER_CURRENT);2478 2479 int rc = SSMR3PutStructEx(pSSM, &pClient->State, sizeof(pClient->State), 0 /*fFlags*/, &s_aShClSSMClientState[0], NULL);2478 pVMM->pfnSSMR3PutU32(pSSM, VBOX_SHCL_SAVED_STATE_VER_CURRENT); 2479 2480 int rc = pVMM->pfnSSMR3PutStructEx(pSSM, &pClient->State, sizeof(pClient->State), 0 /*fFlags*/, &s_aShClSSMClientState[0], NULL); 2480 2481 AssertRCReturn(rc, rc); 2481 2482 2482 rc = SSMR3PutStructEx(pSSM, &pClient->State.POD, sizeof(pClient->State.POD), 0 /*fFlags*/, &s_aShClSSMClientPODState[0], NULL);2483 rc = pVMM->pfnSSMR3PutStructEx(pSSM, &pClient->State.POD, sizeof(pClient->State.POD), 0 /*fFlags*/, &s_aShClSSMClientPODState[0], NULL); 2483 2484 AssertRCReturn(rc, rc); 2484 2485 2485 rc = SSMR3PutStructEx(pSSM, &pClient->State.Transfers, sizeof(pClient->State.Transfers), 0 /*fFlags*/, &s_aShClSSMClientTransferState[0], NULL);2486 rc = pVMM->pfnSSMR3PutStructEx(pSSM, &pClient->State.Transfers, sizeof(pClient->State.Transfers), 0 /*fFlags*/, &s_aShClSSMClientTransferState[0], NULL); 2486 2487 AssertRCReturn(rc, rc); 2487 2488 2488 2489 /* Serialize the client's internal message queue. */ 2489 rc = SSMR3PutU64(pSSM, pClient->cMsgAllocated);2490 rc = pVMM->pfnSSMR3PutU64(pSSM, pClient->cMsgAllocated); 2490 2491 AssertRCReturn(rc, rc); 2491 2492 … … 2493 2494 RTListForEach(&pClient->MsgQueue, pMsg, SHCLCLIENTMSG, ListEntry) 2494 2495 { 2495 SSMR3PutStructEx(pSSM, pMsg, sizeof(SHCLCLIENTMSG), 0 /*fFlags*/, &s_aShClSSMClientMsgHdr[0], NULL);2496 SSMR3PutStructEx(pSSM, pMsg, sizeof(SHCLCLIENTMSG), 0 /*fFlags*/, &s_aShClSSMClientMsgCtx[0], NULL);2496 pVMM->pfnSSMR3PutStructEx(pSSM, pMsg, sizeof(SHCLCLIENTMSG), 0 /*fFlags*/, &s_aShClSSMClientMsgHdr[0], NULL); 2497 pVMM->pfnSSMR3PutStructEx(pSSM, pMsg, sizeof(SHCLCLIENTMSG), 0 /*fFlags*/, &s_aShClSSMClientMsgCtx[0], NULL); 2497 2498 2498 2499 for (uint32_t iParm = 0; iParm < pMsg->cParms; iParm++) 2499 HGCMSvcSSMR3Put(&pMsg->aParms[iParm], pSSM );2500 } 2501 2502 rc = SSMR3PutU64(pSSM, pClient->Legacy.cCID);2500 HGCMSvcSSMR3Put(&pMsg->aParms[iParm], pSSM, pVMM); 2501 } 2502 2503 rc = pVMM->pfnSSMR3PutU64(pSSM, pClient->Legacy.cCID); 2503 2504 AssertRCReturn(rc, rc); 2504 2505 … … 2506 2507 RTListForEach(&pClient->Legacy.lstCID, pCID, SHCLCLIENTLEGACYCID, Node) 2507 2508 { 2508 rc = SSMR3PutStructEx(pSSM, pCID, sizeof(SHCLCLIENTLEGACYCID), 0 /*fFlags*/, &s_aShClSSMClientLegacyCID[0], NULL);2509 rc = pVMM->pfnSSMR3PutStructEx(pSSM, pCID, sizeof(SHCLCLIENTLEGACYCID), 0 /*fFlags*/, &s_aShClSSMClientLegacyCID[0], NULL); 2509 2510 AssertRCReturn(rc, rc); 2510 2511 } 2511 2512 #else /* UNIT_TEST */ 2512 RT_NOREF 3(u32ClientID, pvClient, pSSM);2513 RT_NOREF(u32ClientID, pvClient, pSSM, pVMM); 2513 2514 #endif /* UNIT_TEST */ 2514 2515 return VINF_SUCCESS; … … 2516 2517 2517 2518 #ifndef UNIT_TEST 2518 static int svcLoadStateV0(uint32_t u32ClientID, void *pvClient, PSSMHANDLE pSSM, uint32_t uVersion)2519 static int svcLoadStateV0(uint32_t u32ClientID, void *pvClient, PSSMHANDLE pSSM, PCVMMR3VTABLE pVMM, uint32_t uVersion) 2519 2520 { 2520 2521 RT_NOREF(u32ClientID, pvClient, pSSM, uVersion); 2521 2522 2522 2523 uint32_t uMarker; 2523 int rc = SSMR3GetU32(pSSM, &uMarker); /* Begin marker. */2524 int rc = pVMM->pfnSSMR3GetU32(pSSM, &uMarker); /* Begin marker. */ 2524 2525 AssertRC(rc); 2525 2526 Assert(uMarker == UINT32_C(0x19200102) /* SSMR3STRUCT_BEGIN */); 2526 2527 2527 rc = SSMR3Skip(pSSM, sizeof(uint32_t)); /* Client ID */2528 rc = pVMM->pfnSSMR3Skip(pSSM, sizeof(uint32_t)); /* Client ID */ 2528 2529 AssertRCReturn(rc, rc); 2529 2530 2530 2531 bool fValue; 2531 rc = SSMR3GetBool(pSSM, &fValue); /* fHostMsgQuit */2532 rc = pVMM->pfnSSMR3GetBool(pSSM, &fValue); /* fHostMsgQuit */ 2532 2533 AssertRCReturn(rc, rc); 2533 2534 2534 rc = SSMR3GetBool(pSSM, &fValue); /* fHostMsgReadData */2535 rc = pVMM->pfnSSMR3GetBool(pSSM, &fValue); /* fHostMsgReadData */ 2535 2536 AssertRCReturn(rc, rc); 2536 2537 2537 rc = SSMR3GetBool(pSSM, &fValue); /* fHostMsgFormats */2538 rc = pVMM->pfnSSMR3GetBool(pSSM, &fValue); /* fHostMsgFormats */ 2538 2539 AssertRCReturn(rc, rc); 2539 2540 2540 2541 uint32_t fFormats; 2541 rc = SSMR3GetU32(pSSM, &fFormats); /* u32RequestedFormat */2542 rc = pVMM->pfnSSMR3GetU32(pSSM, &fFormats); /* u32RequestedFormat */ 2542 2543 AssertRCReturn(rc, rc); 2543 2544 2544 rc = SSMR3GetU32(pSSM, &uMarker); /* End marker. */2545 rc = pVMM->pfnSSMR3GetU32(pSSM, &uMarker); /* End marker. */ 2545 2546 AssertRCReturn(rc, rc); 2546 2547 Assert(uMarker == UINT32_C(0x19920406) /* SSMR3STRUCT_END */); … … 2550 2551 #endif /* UNIT_TEST */ 2551 2552 2552 static DECLCALLBACK(int) svcLoadState(void *, uint32_t u32ClientID, void *pvClient, PSSMHANDLE pSSM, uint32_t uVersion) 2553 static DECLCALLBACK(int) svcLoadState(void *, uint32_t u32ClientID, void *pvClient, 2554 PSSMHANDLE pSSM, PCVMMR3VTABLE pVMM, uint32_t uVersion) 2553 2555 { 2554 2556 LogFlowFuncEnter(); … … 2563 2565 /* Restore the client data. */ 2564 2566 uint32_t lenOrVer; 2565 int rc = SSMR3GetU32(pSSM, &lenOrVer);2567 int rc = pVMM->pfnSSMR3GetU32(pSSM, &lenOrVer); 2566 2568 AssertRCReturn(rc, rc); 2567 2569 … … 2569 2571 2570 2572 if (lenOrVer == VBOX_SHCL_SAVED_STATE_VER_3_1) 2571 return svcLoadStateV0(u32ClientID, pvClient, pSSM, uVersion);2573 return svcLoadStateV0(u32ClientID, pvClient, pSSM, pVMM, uVersion); 2572 2574 2573 2575 if ( lenOrVer >= VBOX_SHCL_SAVED_STATE_VER_6_1B2 … … 2576 2578 if (lenOrVer >= VBOX_SHCL_SAVED_STATE_VER_6_1RC1) 2577 2579 { 2578 SSMR3GetStructEx(pSSM, &pClient->State, sizeof(pClient->State), 0 /* fFlags */, &s_aShClSSMClientState[0], NULL); 2579 SSMR3GetStructEx(pSSM, &pClient->State.POD, sizeof(pClient->State.POD), 0 /* fFlags */, 2580 &s_aShClSSMClientPODState[0], NULL); 2580 pVMM->pfnSSMR3GetStructEx(pSSM, &pClient->State, sizeof(pClient->State), 0 /* fFlags */, 2581 &s_aShClSSMClientState[0], NULL); 2582 pVMM->pfnSSMR3GetStructEx(pSSM, &pClient->State.POD, sizeof(pClient->State.POD), 0 /* fFlags */, 2583 &s_aShClSSMClientPODState[0], NULL); 2581 2584 } 2582 2585 else 2583 SSMR3GetStructEx(pSSM, &pClient->State, sizeof(pClient->State), 0 /* fFlags */, &s_aShClSSMClientState61B1[0], NULL); 2584 rc = SSMR3GetStructEx(pSSM, &pClient->State.Transfers, sizeof(pClient->State.Transfers), 0 /* fFlags */, 2585 &s_aShClSSMClientTransferState[0], NULL); 2586 pVMM->pfnSSMR3GetStructEx(pSSM, &pClient->State, sizeof(pClient->State), 0 /* fFlags */, 2587 &s_aShClSSMClientState61B1[0], NULL); 2588 rc = pVMM->pfnSSMR3GetStructEx(pSSM, &pClient->State.Transfers, sizeof(pClient->State.Transfers), 0 /* fFlags */, 2589 &s_aShClSSMClientTransferState[0], NULL); 2586 2590 AssertRCReturn(rc, rc); 2587 2591 2588 2592 /* Load the client's internal message queue. */ 2589 2593 uint64_t cMsgs; 2590 rc = SSMR3GetU64(pSSM, &cMsgs);2594 rc = pVMM->pfnSSMR3GetU64(pSSM, &cMsgs); 2591 2595 AssertRCReturn(rc, rc); 2592 2596 AssertLogRelMsgReturn(cMsgs < _16K, ("Too many messages: %u (%x)\n", cMsgs, cMsgs), VERR_SSM_DATA_UNIT_FORMAT_CHANGED); … … 2600 2604 } u; 2601 2605 2602 SSMR3GetStructEx(pSSM, &u.Msg, RT_UOFFSETOF(SHCLCLIENTMSG, aParms), 0 /*fFlags*/, &s_aShClSSMClientMsgHdr[0], NULL); 2603 rc = SSMR3GetStructEx(pSSM, &u.Msg, RT_UOFFSETOF(SHCLCLIENTMSG, aParms), 0 /*fFlags*/, &s_aShClSSMClientMsgCtx[0], NULL); 2606 pVMM->pfnSSMR3GetStructEx(pSSM, &u.Msg, RT_UOFFSETOF(SHCLCLIENTMSG, aParms), 0 /*fFlags*/, 2607 &s_aShClSSMClientMsgHdr[0], NULL); 2608 rc = pVMM->pfnSSMR3GetStructEx(pSSM, &u.Msg, RT_UOFFSETOF(SHCLCLIENTMSG, aParms), 0 /*fFlags*/, 2609 &s_aShClSSMClientMsgCtx[0], NULL); 2604 2610 AssertRCReturn(rc, rc); 2605 2611 … … 2614 2620 for (uint32_t p = 0; p < pMsg->cParms; p++) 2615 2621 { 2616 rc = HGCMSvcSSMR3Get(&pMsg->aParms[p], pSSM );2622 rc = HGCMSvcSSMR3Get(&pMsg->aParms[p], pSSM, pVMM); 2617 2623 AssertRCReturnStmt(rc, shClSvcMsgFree(pClient, pMsg), rc); 2618 2624 } … … 2626 2632 { 2627 2633 uint64_t cCID; 2628 rc = SSMR3GetU64(pSSM, &cCID);2634 rc = pVMM->pfnSSMR3GetU64(pSSM, &cCID); 2629 2635 AssertRCReturn(rc, rc); 2630 2636 AssertLogRelMsgReturn(cCID < _16K, ("Too many context IDs: %u (%x)\n", cCID, cCID), VERR_SSM_DATA_UNIT_FORMAT_CHANGED); … … 2635 2641 AssertPtrReturn(pCID, VERR_NO_MEMORY); 2636 2642 2637 SSMR3GetStructEx(pSSM, pCID, sizeof(SHCLCLIENTLEGACYCID), 0 /* fFlags */, &s_aShClSSMClientLegacyCID[0], NULL); 2643 pVMM->pfnSSMR3GetStructEx(pSSM, pCID, sizeof(SHCLCLIENTLEGACYCID), 0 /* fFlags */, 2644 &s_aShClSSMClientLegacyCID[0], NULL); 2638 2645 RTListAppend(&pClient->Legacy.lstCID, &pCID->Node); 2639 2646 } … … 2650 2657 2651 2658 #else /* UNIT_TEST */ 2652 RT_NOREF(u32ClientID, pvClient, pSSM, uVersion);2659 RT_NOREF(u32ClientID, pvClient, pSSM, pVMM, uVersion); 2653 2660 #endif /* UNIT_TEST */ 2654 2661 return VINF_SUCCESS; -
trunk/src/VBox/HostServices/SharedFolders/Makefile.kmk
r93115 r93444 47 47 48 48 VBoxSharedFolders_LIBS = \ 49 $(LIB_VMM) \ 50 $(LIB_RUNTIME) \ 51 $(LIB_REM) 49 $(LIB_RUNTIME) 52 50 53 51 include $(FILE_KBUILD_SUB_FOOTER) -
trunk/src/VBox/HostServices/SharedFolders/VBoxSharedFoldersSvc.cpp
r93115 r93444 33 33 #include <VBox/vmm/ssm.h> 34 34 #include <VBox/vmm/pdmifs.h> 35 #include <VBox/vmm/vmmr3vtable.h> 35 36 36 37 … … 194 195 * as the contents of a shared folder might change in between save and restore. 195 196 */ 196 static DECLCALLBACK(int) svcSaveState(void *, uint32_t u32ClientID, void *pvClient, PSSMHANDLE pSSM )197 static DECLCALLBACK(int) svcSaveState(void *, uint32_t u32ClientID, void *pvClient, PSSMHANDLE pSSM, PCVMMR3VTABLE pVMM) 197 198 { 198 199 #ifndef UNITTEST /* Read this as not yet tested */ … … 202 203 Log(("SharedFolders host service: saving state, u32ClientID = %u\n", u32ClientID)); 203 204 204 int rc = SSMR3PutU32(pSSM, SHFL_SAVED_STATE_VERSION);205 int rc = pVMM->pfnSSMR3PutU32(pSSM, SHFL_SAVED_STATE_VERSION); 205 206 AssertRCReturn(rc, rc); 206 207 207 rc = SSMR3PutU32(pSSM, SHFL_MAX_MAPPINGS);208 rc = pVMM->pfnSSMR3PutU32(pSSM, SHFL_MAX_MAPPINGS); 208 209 AssertRCReturn(rc, rc); 209 210 210 211 /* Save client structure length & contents */ 211 rc = SSMR3PutU32(pSSM, sizeof(*pClient));212 rc = pVMM->pfnSSMR3PutU32(pSSM, sizeof(*pClient)); 212 213 AssertRCReturn(rc, rc); 213 214 214 rc = SSMR3PutMem(pSSM, pClient, sizeof(*pClient));215 rc = pVMM->pfnSSMR3PutMem(pSSM, pClient, sizeof(*pClient)); 215 216 AssertRCReturn(rc, rc); 216 217 … … 221 222 MAPPING *pFolderMapping = vbsfMappingGetByRoot(i); 222 223 223 rc = SSMR3PutU32(pSSM, pFolderMapping? pFolderMapping->cMappings: 0);224 rc = pVMM->pfnSSMR3PutU32(pSSM, pFolderMapping? pFolderMapping->cMappings: 0); 224 225 AssertRCReturn(rc, rc); 225 226 226 rc = SSMR3PutBool(pSSM, pFolderMapping? pFolderMapping->fValid: false);227 rc = pVMM->pfnSSMR3PutBool(pSSM, pFolderMapping? pFolderMapping->fValid: false); 227 228 AssertRCReturn(rc, rc); 228 229 … … 230 231 { 231 232 uint32_t len = (uint32_t)strlen(pFolderMapping->pszFolderName); 232 SSMR3PutU32(pSSM, len);233 SSMR3PutStrZ(pSSM, pFolderMapping->pszFolderName);233 pVMM->pfnSSMR3PutU32(pSSM, len); 234 pVMM->pfnSSMR3PutStrZ(pSSM, pFolderMapping->pszFolderName); 234 235 235 236 len = ShflStringSizeOfBuffer(pFolderMapping->pMapName); 236 SSMR3PutU32(pSSM, len);237 SSMR3PutMem(pSSM, pFolderMapping->pMapName, len);238 239 SSMR3PutBool(pSSM, pFolderMapping->fHostCaseSensitive);240 241 SSMR3PutBool(pSSM, pFolderMapping->fGuestCaseSensitive);237 pVMM->pfnSSMR3PutU32(pSSM, len); 238 pVMM->pfnSSMR3PutMem(pSSM, pFolderMapping->pMapName, len); 239 240 pVMM->pfnSSMR3PutBool(pSSM, pFolderMapping->fHostCaseSensitive); 241 242 pVMM->pfnSSMR3PutBool(pSSM, pFolderMapping->fGuestCaseSensitive); 242 243 243 244 len = ShflStringSizeOfBuffer(pFolderMapping->pAutoMountPoint); 244 SSMR3PutU32(pSSM, len);245 rc = SSMR3PutMem(pSSM, pFolderMapping->pAutoMountPoint, len);245 pVMM->pfnSSMR3PutU32(pSSM, len); 246 rc = pVMM->pfnSSMR3PutMem(pSSM, pFolderMapping->pAutoMountPoint, len); 246 247 AssertRCReturn(rc, rc); 247 248 } … … 249 250 250 251 #else 251 RT_NOREF 3(u32ClientID, pvClient, pSSM);252 RT_NOREF(u32ClientID, pvClient, pSSM, pVMM); 252 253 #endif 253 254 return VINF_SUCCESS; 254 255 } 255 256 256 static DECLCALLBACK(int) svcLoadState(void *, uint32_t u32ClientID, void *pvClient, PSSMHANDLE pSSM, uint32_t uVersion) 257 static DECLCALLBACK(int) svcLoadState(void *, uint32_t u32ClientID, void *pvClient, 258 PSSMHANDLE pSSM, PCVMMR3VTABLE pVMM, uint32_t uVersion) 257 259 { 258 260 #ifndef UNITTEST /* Read this as not yet tested */ … … 265 267 266 268 uint32_t uShfVersion = 0; 267 int rc = SSMR3GetU32(pSSM, &uShfVersion);269 int rc = pVMM->pfnSSMR3GetU32(pSSM, &uShfVersion); 268 270 AssertRCReturn(rc, rc); 269 271 270 272 if ( uShfVersion > SHFL_SAVED_STATE_VERSION 271 273 || uShfVersion < SHFL_SAVED_STATE_VERSION_FOLDERNAME_UTF16) 272 return SSMR3SetLoadError(pSSM, VERR_SSM_UNSUPPORTED_DATA_UNIT_VERSION, RT_SRC_POS,273 "Unknown shared folders state version %u!", uShfVersion);274 275 rc = SSMR3GetU32(pSSM, &nrMappings);274 return pVMM->pfnSSMR3SetLoadError(pSSM, VERR_SSM_UNSUPPORTED_DATA_UNIT_VERSION, RT_SRC_POS, 275 "Unknown shared folders state version %u!", uShfVersion); 276 277 rc = pVMM->pfnSSMR3GetU32(pSSM, &nrMappings); 276 278 AssertRCReturn(rc, rc); 277 279 if (nrMappings != SHFL_MAX_MAPPINGS) … … 279 281 280 282 /* Restore the client data (flags + path delimiter + mapping counts (new) at the moment) */ 281 rc = SSMR3GetU32(pSSM, &len);283 rc = pVMM->pfnSSMR3GetU32(pSSM, &len); 282 284 AssertRCReturn(rc, rc); 283 285 … … 285 287 pClient->fHasMappingCounts = false; 286 288 else if (len != sizeof(*pClient)) 287 return SSMR3SetLoadError(pSSM, VERR_SSM_DATA_UNIT_FORMAT_CHANGED, RT_SRC_POS,288 "Saved SHFLCLIENTDATA size %u differs from current %u!", len, sizeof(*pClient));289 290 rc = SSMR3GetMem(pSSM, pClient, len);289 return pVMM->pfnSSMR3SetLoadError(pSSM, VERR_SSM_DATA_UNIT_FORMAT_CHANGED, RT_SRC_POS, 290 "Saved SHFLCLIENTDATA size %u differs from current %u!", len, sizeof(*pClient)); 291 292 rc = pVMM->pfnSSMR3GetMem(pSSM, pClient, len); 291 293 AssertRCReturn(rc, rc); 292 294 … … 297 299 else if ( pClient->enmErrorStyle <= kShflErrorStyle_Invalid 298 300 || pClient->enmErrorStyle >= kShflErrorStyle_End) 299 return SSMR3SetLoadError(pSSM, VERR_SSM_DATA_UNIT_FORMAT_CHANGED, RT_SRC_POS,300 "Saved SHFLCLIENTDATA enmErrorStyle value %d is not known/valid!", pClient->enmErrorStyle);301 return pVMM->pfnSSMR3SetLoadError(pSSM, VERR_SSM_DATA_UNIT_FORMAT_CHANGED, RT_SRC_POS, 302 "Saved SHFLCLIENTDATA enmErrorStyle value %d is not known/valid!", pClient->enmErrorStyle); 301 303 302 304 /* Drop the root IDs of all configured mappings before restoring: */ … … 311 313 312 314 /* restore the folder mapping counter. */ 313 rc = SSMR3GetU32(pSSM, &mapping.cMappings);315 rc = pVMM->pfnSSMR3GetU32(pSSM, &mapping.cMappings); 314 316 AssertRCReturn(rc, rc); 315 317 316 rc = SSMR3GetBool(pSSM, &mapping.fValid);318 rc = pVMM->pfnSSMR3GetBool(pSSM, &mapping.fValid); 317 319 AssertRCReturn(rc, rc); 318 320 … … 321 323 /* Load the host path name. */ 322 324 uint32_t cb; 323 rc = SSMR3GetU32(pSSM, &cb);325 rc = pVMM->pfnSSMR3GetU32(pSSM, &cb); 324 326 AssertRCReturn(rc, rc); 325 327 … … 328 330 { 329 331 AssertReturn(cb > SHFLSTRING_HEADER_SIZE && cb <= UINT16_MAX + SHFLSTRING_HEADER_SIZE && !(cb & 1), 330 SSMR3SetLoadError(pSSM, VERR_SSM_DATA_UNIT_FORMAT_CHANGED, RT_SRC_POS, "Bad folder name size: %#x", cb)); 332 pVMM->pfnSSMR3SetLoadError(pSSM, VERR_SSM_DATA_UNIT_FORMAT_CHANGED, RT_SRC_POS, 333 "Bad folder name size: %#x", cb)); 331 334 PSHFLSTRING pFolderName = (PSHFLSTRING)RTMemAlloc(cb); 332 335 AssertReturn(pFolderName != NULL, VERR_NO_MEMORY); 333 336 334 rc = SSMR3GetMem(pSSM, pFolderName, cb);337 rc = pVMM->pfnSSMR3GetMem(pSSM, pFolderName, cb); 335 338 AssertRCReturn(rc, rc); 336 339 AssertReturn(pFolderName->u16Size < cb && pFolderName->u16Length < pFolderName->u16Size, 337 SSMR3SetLoadError(pSSM, VERR_SSM_DATA_UNIT_FORMAT_CHANGED, RT_SRC_POS,338 "Bad folder name string: %#x/%#x cb=%#x",339 pFolderName->u16Size, pFolderName->u16Length, cb));340 pVMM->pfnSSMR3SetLoadError(pSSM, VERR_SSM_DATA_UNIT_FORMAT_CHANGED, RT_SRC_POS, 341 "Bad folder name string: %#x/%#x cb=%#x", 342 pFolderName->u16Size, pFolderName->u16Length, cb)); 340 343 341 344 rc = RTUtf16ToUtf8(pFolderName->String.ucs2, &pszFolderName); … … 348 351 AssertReturn(pszFolderName, VERR_NO_MEMORY); 349 352 350 rc = SSMR3GetStrZ(pSSM, pszFolderName, cb + 1);353 rc = pVMM->pfnSSMR3GetStrZ(pSSM, pszFolderName, cb + 1); 351 354 AssertRCReturn(rc, rc); 352 355 mapping.pszFolderName = pszFolderName; … … 354 357 355 358 /* Load the map name. */ 356 rc = SSMR3GetU32(pSSM, &cb);359 rc = pVMM->pfnSSMR3GetU32(pSSM, &cb); 357 360 AssertRCReturn(rc, rc); 358 361 AssertReturn(cb > SHFLSTRING_HEADER_SIZE && cb <= UINT16_MAX + SHFLSTRING_HEADER_SIZE && !(cb & 1), 359 SSMR3SetLoadError(pSSM, VERR_SSM_DATA_UNIT_FORMAT_CHANGED, RT_SRC_POS, "Bad map name size: %#x", cb)); 362 pVMM->pfnSSMR3SetLoadError(pSSM, VERR_SSM_DATA_UNIT_FORMAT_CHANGED, RT_SRC_POS, 363 "Bad map name size: %#x", cb)); 360 364 361 365 PSHFLSTRING pMapName = (PSHFLSTRING)RTMemAlloc(cb); 362 366 AssertReturn(pMapName != NULL, VERR_NO_MEMORY); 363 367 364 rc = SSMR3GetMem(pSSM, pMapName, cb);368 rc = pVMM->pfnSSMR3GetMem(pSSM, pMapName, cb); 365 369 AssertRCReturn(rc, rc); 366 370 AssertReturn(pMapName->u16Size < cb && pMapName->u16Length < pMapName->u16Size, 367 SSMR3SetLoadError(pSSM, VERR_SSM_DATA_UNIT_FORMAT_CHANGED, RT_SRC_POS,368 "Bad map name string: %#x/%#x cb=%#x",369 pMapName->u16Size, pMapName->u16Length, cb));371 pVMM->pfnSSMR3SetLoadError(pSSM, VERR_SSM_DATA_UNIT_FORMAT_CHANGED, RT_SRC_POS, 372 "Bad map name string: %#x/%#x cb=%#x", 373 pMapName->u16Size, pMapName->u16Length, cb)); 370 374 371 375 /* Load case sensitivity config. */ 372 rc = SSMR3GetBool(pSSM, &mapping.fHostCaseSensitive);376 rc = pVMM->pfnSSMR3GetBool(pSSM, &mapping.fHostCaseSensitive); 373 377 AssertRCReturn(rc, rc); 374 378 375 rc = SSMR3GetBool(pSSM, &mapping.fGuestCaseSensitive);379 rc = pVMM->pfnSSMR3GetBool(pSSM, &mapping.fGuestCaseSensitive); 376 380 AssertRCReturn(rc, rc); 377 381 … … 380 384 if (uShfVersion > SHFL_SAVED_STATE_VERSION_PRE_AUTO_MOUNT_POINT) 381 385 { 382 rc = SSMR3GetU32(pSSM, &cb);386 rc = pVMM->pfnSSMR3GetU32(pSSM, &cb); 383 387 AssertRCReturn(rc, rc); 384 388 AssertReturn(cb > SHFLSTRING_HEADER_SIZE && cb <= UINT16_MAX + SHFLSTRING_HEADER_SIZE && !(cb & 1), 385 SSMR3SetLoadError(pSSM, VERR_SSM_DATA_UNIT_FORMAT_CHANGED, RT_SRC_POS, "Bad auto mount point size: %#x", cb)); 389 pVMM->pfnSSMR3SetLoadError(pSSM, VERR_SSM_DATA_UNIT_FORMAT_CHANGED, RT_SRC_POS, 390 "Bad auto mount point size: %#x", cb)); 386 391 387 392 pAutoMountPoint = (PSHFLSTRING)RTMemAlloc(cb); 388 393 AssertReturn(pAutoMountPoint != NULL, VERR_NO_MEMORY); 389 394 390 rc = SSMR3GetMem(pSSM, pAutoMountPoint, cb);395 rc = pVMM->pfnSSMR3GetMem(pSSM, pAutoMountPoint, cb); 391 396 AssertRCReturn(rc, rc); 392 397 AssertReturn(pAutoMountPoint->u16Size < cb && pAutoMountPoint->u16Length < pAutoMountPoint->u16Size, 393 SSMR3SetLoadError(pSSM, VERR_SSM_DATA_UNIT_FORMAT_CHANGED, RT_SRC_POS,394 "Bad auto mount point string: %#x/%#x cb=%#x",395 pAutoMountPoint->u16Size, pAutoMountPoint->u16Length, cb));398 pVMM->pfnSSMR3SetLoadError(pSSM, VERR_SSM_DATA_UNIT_FORMAT_CHANGED, RT_SRC_POS, 399 "Bad auto mount point string: %#x/%#x cb=%#x", 400 pAutoMountPoint->u16Size, pAutoMountPoint->u16Length, cb)); 396 401 397 402 } … … 428 433 Log(("SharedFolders host service: successfully loaded state\n")); 429 434 #else 430 RT_NOREF(u32ClientID, pvClient, pSSM, uVersion);435 RT_NOREF(u32ClientID, pvClient, pSSM, pVMM, uVersion); 431 436 #endif 432 437 return VINF_SUCCESS;
Note:
See TracChangeset
for help on using the changeset viewer.