Changeset 78578 in vbox for trunk/src/VBox
- Timestamp:
- May 18, 2019 2:48:13 PM (6 years ago)
- Location:
- trunk/src/VBox/HostServices/SharedClipboard
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedClipboard/VBoxClipboard.h
r78501 r78578 75 75 76 76 /* 77 * Platform dependent functions.77 * Platform-dependent implementations. 78 78 */ 79 int vboxClipboardInit(void);80 void vboxClipboardDestroy(void);79 int VBoxClipboardSvcImplInit(void); 80 void VBoxClipboardSvcImplDestroy(void); 81 81 82 int vboxClipboardConnect(VBOXCLIPBOARDCLIENTDATA *pClient, bool fHeadless); 83 void vboxClipboardDisconnect(VBOXCLIPBOARDCLIENTDATA *pClient); 84 void vboxClipboardFormatAnnounce(VBOXCLIPBOARDCLIENTDATA *pClient, uint32_t u32Formats); 85 int vboxClipboardReadData(VBOXCLIPBOARDCLIENTDATA *pClient, uint32_t u32Format, void *pv, uint32_t cb, uint32_t *pcbActual); 86 void vboxClipboardWriteData(VBOXCLIPBOARDCLIENTDATA *pClient, void *pv, uint32_t cb, uint32_t u32Format); 87 88 int vboxClipboardSync (VBOXCLIPBOARDCLIENTDATA *pClient); 82 int VBoxClipboardSvcImplConnect(VBOXCLIPBOARDCLIENTDATA *pClient, bool fHeadless); 83 void VBoxClipboardSvcImplDisconnect(VBOXCLIPBOARDCLIENTDATA *pClient); 84 void VBoxClipboardSvcImplFormatAnnounce(VBOXCLIPBOARDCLIENTDATA *pClient, uint32_t u32Formats); 85 int VBoxClipboardSvcImplReadData(VBOXCLIPBOARDCLIENTDATA *pClient, uint32_t u32Format, void *pv, uint32_t cb, uint32_t *pcbActual); 86 void VBoxClipboardSvcImplWriteData(VBOXCLIPBOARDCLIENTDATA *pClient, void *pv, uint32_t cb, uint32_t u32Format); 87 int VBoxClipboardSvcImplSync(VBOXCLIPBOARDCLIENTDATA *pClient); 89 88 90 89 /* Host unit testing interface */ -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-darwin.cpp
r78318 r78578 118 118 119 119 /** Initialise the host side of the shared clipboard - called by the hgcm layer. */ 120 int vboxClipboardInit(void)120 int VBoxClipboardSvcImplInit(void) 121 121 { 122 122 Log(("vboxClipboardInit\n")); … … 139 139 140 140 /** Terminate the host side of the shared clipboard - called by the hgcm layer. */ 141 void vboxClipboardDestroy(void)141 void VBoxClipboardSvcImplDestroy(void) 142 142 { 143 143 Log(("vboxClipboardDestroy\n")); … … 167 167 * @returns RT status code 168 168 */ 169 int vboxClipboardConnect(VBOXCLIPBOARDCLIENTDATA *pClient, bool fHeadless)169 int VBoxClipboardSvcImplConnect(VBOXCLIPBOARDCLIENTDATA *pClient, bool fHeadless) 170 170 { 171 171 NOREF(fHeadless); … … 182 182 183 183 /* Initially sync the host clipboard content with the client. */ 184 int rc = vboxClipboardSync(pClient);184 int rc = VBoxClipboardSvcImplSync(pClient); 185 185 186 186 VBoxSvcClipboardUnlock(); … … 192 192 * after a save and restore of the guest. 193 193 */ 194 int vboxClipboardSync(VBOXCLIPBOARDCLIENTDATA *pClient)194 int VBoxClipboardSvcImplSync(VBOXCLIPBOARDCLIENTDATA *pClient) 195 195 { 196 196 /* Sync the host clipboard content with the client. */ … … 205 205 * Shut down the shared clipboard subsystem and "disconnect" the guest. 206 206 */ 207 void vboxClipboardDisconnect(VBOXCLIPBOARDCLIENTDATA *pClient)207 void VBoxClipboardSvcImplDisconnect(VBOXCLIPBOARDCLIENTDATA *pClient) 208 208 { 209 209 Log(("vboxClipboardDisconnect\n")); … … 221 221 * @param u32Formats Clipboard formats the guest is offering 222 222 */ 223 void vboxClipboardFormatAnnounce(VBOXCLIPBOARDCLIENTDATA *pClient, uint32_t u32Formats)223 void VBoxClipboardSvcImplFormatAnnounce(VBOXCLIPBOARDCLIENTDATA *pClient, uint32_t u32Formats) 224 224 { 225 225 Log(("vboxClipboardFormatAnnounce u32Formats %02X\n", u32Formats)); … … 242 242 * @param pcbActual Where to write the actual size of the written data 243 243 */ 244 int vboxClipboardReadData(VBOXCLIPBOARDCLIENTDATA *pClient, uint32_t u32Format,244 int VBoxClipboardSvcImplReadData(VBOXCLIPBOARDCLIENTDATA *pClient, uint32_t u32Format, 245 245 void *pv, uint32_t cb, uint32_t *pcbActual) 246 246 { … … 263 263 * @param u32Format The format of the data written 264 264 */ 265 void vboxClipboardWriteData(VBOXCLIPBOARDCLIENTDATA *pClient, void *pv, uint32_t cb, uint32_t u32Format)265 void VBoxClipboardSvcImplWriteData(VBOXCLIPBOARDCLIENTDATA *pClient, void *pv, uint32_t cb, uint32_t u32Format) 266 266 { 267 267 VBoxSvcClipboardLock(); -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-win.cpp
r78501 r78578 562 562 * Public platform dependent functions. 563 563 */ 564 int vboxClipboardInit(void)564 int VBoxClipboardSvcImplInit(void) 565 565 { 566 566 RT_ZERO(g_ctx); /* Be careful not messing up non-POD types! */ … … 582 582 } 583 583 584 void vboxClipboardDestroy(void)584 void VBoxClipboardSvcImplDestroy(void) 585 585 { 586 586 LogFlowFuncEnter(); … … 602 602 } 603 603 604 int vboxClipboardConnect(VBOXCLIPBOARDCLIENTDATA *pClient, bool fHeadless)604 int VBoxClipboardSvcImplConnect(VBOXCLIPBOARDCLIENTDATA *pClient, bool fHeadless) 605 605 { 606 606 RT_NOREF(fHeadless); … … 619 619 620 620 /* Sync the host clipboard content with the client. */ 621 vboxClipboardSync(pClient);621 VBoxClipboardSvcImplSync(pClient); 622 622 623 623 return VINF_SUCCESS; 624 624 } 625 625 626 int vboxClipboardSync(VBOXCLIPBOARDCLIENTDATA *pClient)626 int VBoxClipboardSvcImplSync(VBOXCLIPBOARDCLIENTDATA *pClient) 627 627 { 628 628 /* Sync the host clipboard content with the client. */ … … 630 630 } 631 631 632 void vboxClipboardDisconnect(VBOXCLIPBOARDCLIENTDATA *pClient)632 void VBoxClipboardSvcImplDisconnect(VBOXCLIPBOARDCLIENTDATA *pClient) 633 633 { 634 634 RT_NOREF(pClient); … … 639 639 } 640 640 641 void vboxClipboardFormatAnnounce(VBOXCLIPBOARDCLIENTDATA *pClient, uint32_t u32Formats)641 void VBoxClipboardSvcImplFormatAnnounce(VBOXCLIPBOARDCLIENTDATA *pClient, uint32_t u32Formats) 642 642 { 643 643 AssertPtrReturnVoid(pClient); … … 682 682 #endif 683 683 684 int vboxClipboardReadData(VBOXCLIPBOARDCLIENTDATA *pClient, uint32_t u32Format, void *pv, uint32_t cb, uint32_t *pcbActual)684 int VBoxClipboardSvcImplReadData(VBOXCLIPBOARDCLIENTDATA *pClient, uint32_t u32Format, void *pv, uint32_t cb, uint32_t *pcbActual) 685 685 { 686 686 AssertPtrReturn(pClient, VERR_INVALID_POINTER); … … 816 816 } 817 817 818 void vboxClipboardWriteData(VBOXCLIPBOARDCLIENTDATA *pClient, void *pv, uint32_t cb, uint32_t u32Format)818 void VBoxClipboardSvcImplWriteData(VBOXCLIPBOARDCLIENTDATA *pClient, void *pv, uint32_t cb, uint32_t u32Format) 819 819 { 820 820 LogFlowFuncEnter(); -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-x11-stubs.cpp
r78182 r78578 40 40 41 41 /** Initialise the host side of the shared clipboard - called by the hgcm layer. */ 42 int vboxClipboardInit(void)42 int VBoxClipboardSvcImplInit(void) 43 43 { 44 44 LogFlowFunc(("called, returning VINF_SUCCESS.\n")); … … 47 47 48 48 /** Terminate the host side of the shared clipboard - called by the hgcm layer. */ 49 void vboxClipboardDestroy(void)49 void VBoxClipboardSvcImplDestroy(void) 50 50 { 51 51 LogFlowFunc(("called, returning.\n")); … … 59 59 * @returns RT status code 60 60 */ 61 int vboxClipboardConnect(VBOXCLIPBOARDCLIENTDATA *pClient, bool fHeadless)61 int VBoxClipboardSvcImplConnect(VBOXCLIPBOARDCLIENTDATA *pClient, bool fHeadless) 62 62 { 63 63 RT_NOREF(pClient, fHeadless); … … 70 70 * after a save and restore of the guest. 71 71 */ 72 int vboxClipboardSync(VBOXCLIPBOARDCLIENTDATA * /* pClient */)72 int VBoxClipboardSvcImplSync(VBOXCLIPBOARDCLIENTDATA * /* pClient */) 73 73 { 74 74 LogFlowFunc(("called, returning VINF_SUCCESS.\n")); … … 81 81 * @param pClient Structure containing context information about the guest system 82 82 */ 83 void vboxClipboardDisconnect(VBOXCLIPBOARDCLIENTDATA *pClient)83 void VBoxClipboardSvcImplDisconnect(VBOXCLIPBOARDCLIENTDATA *pClient) 84 84 { 85 85 RT_NOREF(pClient); … … 94 94 * @param u32Formats Clipboard formats the guest is offering 95 95 */ 96 void vboxClipboardFormatAnnounce(VBOXCLIPBOARDCLIENTDATA *pClient, uint32_t u32Formats)96 void VBoxClipboardSvcImplFormatAnnounce(VBOXCLIPBOARDCLIENTDATA *pClient, uint32_t u32Formats) 97 97 { 98 98 RT_NOREF(pClient, u32Formats); … … 109 109 * @param pcbActual Where to write the actual size of the written data 110 110 */ 111 int vboxClipboardReadData(VBOXCLIPBOARDCLIENTDATA *pClient, uint32_t u32Format,111 int VBoxClipboardSvcImplReadData(VBOXCLIPBOARDCLIENTDATA *pClient, uint32_t u32Format, 112 112 void *pv, uint32_t cb, uint32_t *pcbActual) 113 113 { … … 127 127 * @param u32Format The format of the data written 128 128 */ 129 void vboxClipboardWriteData(VBOXCLIPBOARDCLIENTDATA *pClient, void *pv, uint32_t cb,129 void VBoxClipboardSvcImplWriteData(VBOXCLIPBOARDCLIENTDATA *pClient, void *pv, uint32_t cb, 130 130 uint32_t u32Format) 131 131 { -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-x11.cpp
r78317 r78578 85 85 * @note Host glue code 86 86 */ 87 int vboxClipboardInit(void)87 int VBoxClipboardSvcImplInit(void) 88 88 { 89 89 return VINF_SUCCESS; … … 94 94 * @note host glue code 95 95 */ 96 void vboxClipboardDestroy(void)96 void VBoxClipboardSvcImplDestroy(void) 97 97 { 98 98 … … 105 105 * the clipboard and leave ownership to X11. 106 106 */ 107 int vboxClipboardConnect(VBOXCLIPBOARDCLIENTDATA *pClient, bool fHeadless)107 int VBoxClipboardSvcImplConnect(VBOXCLIPBOARDCLIENTDATA *pClient, bool fHeadless) 108 108 { 109 109 int rc = VINF_SUCCESS; … … 144 144 * @note Host glue code 145 145 */ 146 int vboxClipboardSync(VBOXCLIPBOARDCLIENTDATA *pClient)146 int VBoxClipboardSvcImplSync(VBOXCLIPBOARDCLIENTDATA *pClient) 147 147 { 148 148 /* Tell the guest we have no data in case X11 is not available. If … … 158 158 * @note Host glue code 159 159 */ 160 void vboxClipboardDisconnect(VBOXCLIPBOARDCLIENTDATA *pClient)160 void VBoxClipboardSvcImplDisconnect(VBOXCLIPBOARDCLIENTDATA *pClient) 161 161 { 162 162 LogRelFlow(("vboxClipboardDisconnect\n")); … … 169 169 pCtx->fShuttingDown = true; 170 170 /* If there is a currently pending request, release it immediately. */ 171 vboxClipboardWriteData(pClient, NULL, 0, 0);171 VBoxClipboardSvcImplWriteData(pClient, NULL, 0, 0); 172 172 int rc = ClipStopX11(pCtx->pBackend); 173 173 /** @todo handle this slightly more reasonably, or be really sure … … 189 189 * @note Host glue code 190 190 */ 191 void vboxClipboardFormatAnnounce(VBOXCLIPBOARDCLIENTDATA *pClient, uint32_t u32Formats)191 void VBoxClipboardSvcImplFormatAnnounce(VBOXCLIPBOARDCLIENTDATA *pClient, uint32_t u32Formats) 192 192 { 193 193 LogRelFlowFunc(("called. pClient=%p, u32Formats=%02X\n", pClient, u32Formats)); … … 225 225 * 226 226 */ 227 int vboxClipboardReadData(VBOXCLIPBOARDCLIENTDATA *pClient,227 int VBoxClipboardSvcImplReadData(VBOXCLIPBOARDCLIENTDATA *pClient, 228 228 uint32_t u32Format, void *pv, uint32_t cb, 229 229 uint32_t *pcbActual) … … 399 399 * @note Host glue code 400 400 */ 401 void vboxClipboardWriteData(VBOXCLIPBOARDCLIENTDATA *pClient,401 void VBoxClipboardSvcImplWriteData(VBOXCLIPBOARDCLIENTDATA *pClient, 402 402 void *pv, uint32_t cb, uint32_t u32Format) 403 403 { … … 470 470 if ((u32Msg == VBOX_SHARED_CLIPBOARD_HOST_MSG_READ_DATA) 471 471 && !pBackend->writeData.timeout) 472 vboxClipboardWriteData(pClient, pBackend->writeData.pv,472 VBoxClipboardSvcImplWriteData(pClient, pBackend->writeData.pv, 473 473 pBackend->writeData.cb, 474 474 pBackend->writeData.format); … … 527 527 RTPrintf(TEST_NAME ": TESTING\n"); 528 528 AssertRCReturn(rc, 1); 529 rc = vboxClipboardConnect(&client, false);529 rc = VBoxClipboardSvcImplConnect(&client, false); 530 530 CLIPBACKEND *pBackend = client.pCtx->pBackend; 531 531 AssertRCReturn(rc, 1); 532 vboxClipboardFormatAnnounce(&client,532 VBoxClipboardSvcImplFormatAnnounce(&client, 533 533 VBOX_SHARED_CLIPBOARD_FMT_UNICODETEXT); 534 534 if (pBackend->formats != VBOX_SHARED_CLIPBOARD_FMT_UNICODETEXT) … … 541 541 client.asyncRead.paParms = (VBOXHGCMSVCPARM *)&client; 542 542 uint32_t u32Dummy; 543 rc = vboxClipboardReadData(&client, VBOX_SHARED_CLIPBOARD_FMT_UNICODETEXT,543 rc = VBoxClipboardSvcImplReadData(&client, VBOX_SHARED_CLIPBOARD_FMT_UNICODETEXT, 544 544 &u32Dummy, 42, &u32Dummy); 545 545 if (rc != VINF_HGCM_ASYNC_EXECUTE) … … 609 609 /* Data arriving after a timeout should *not* cause any segfaults or 610 610 * memory leaks. Check with Valgrind! */ 611 vboxClipboardWriteData(&client, (void *)"tested", sizeof("tested"), 999);612 vboxClipboardDisconnect(&client);611 VBoxClipboardSvcImplWriteData(&client, (void *)"tested", sizeof("tested"), 999); 612 VBoxClipboardSvcImplDisconnect(&client); 613 613 if (cErrors > 0) 614 614 RTPrintf(TEST_NAME ": errors: %u\n", cErrors); -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc.cpp
r78501 r78578 337 337 vboxSvcClipboardModeSet(VBOX_SHARED_CLIPBOARD_MODE_OFF); 338 338 339 rc = vboxClipboardInit();339 rc = VBoxClipboardSvcImplInit(); 340 340 341 341 /* Clean up on failure, because 'svnUnload' will not be called … … 353 353 static DECLCALLBACK(int) svcUnload(void *) 354 354 { 355 vboxClipboardDestroy();355 VBoxClipboardSvcImplDestroy(); 356 356 RTCritSectDelete(&critsect); 357 357 return VINF_SUCCESS; … … 374 374 vboxSvcClipboardCompleteReadData(pClient, VERR_NO_DATA, 0); 375 375 376 vboxClipboardDisconnect(pClient);376 VBoxClipboardSvcImplDisconnect(pClient); 377 377 378 378 memset(pClient, 0, sizeof(*pClient)); … … 405 405 pClient->u32ClientID = u32ClientID; 406 406 407 rc = vboxClipboardConnect(pClient, VBoxSvcClipboardGetHeadless());407 rc = VBoxClipboardSvcImplConnect(pClient, VBoxSvcClipboardGetHeadless()); 408 408 409 409 if (RT_SUCCESS(rc)) … … 534 534 else 535 535 { 536 vboxClipboardFormatAnnounce (pClient, u32Formats);536 VBoxClipboardSvcImplFormatAnnounce (pClient, u32Formats); 537 537 } 538 538 } … … 608 608 * support one pending read at one time. */ 609 609 vboxSvcClipboardCompleteReadData(pClient, VERR_NO_DATA, 0); 610 rc = vboxClipboardReadData (pClient, u32Format, pv, cb, &cbActual);610 rc = VBoxClipboardSvcImplReadData (pClient, u32Format, pv, cb, &cbActual); 611 611 } 612 612 … … 684 684 else 685 685 { 686 vboxClipboardWriteData (pClient, pv, cb, u32Format);686 VBoxClipboardSvcImplWriteData (pClient, pv, cb, u32Format); 687 687 } 688 688 } … … 957 957 958 958 /* Actual host data are to be reported to guest (SYNC). */ 959 vboxClipboardSync(pClient);959 VBoxClipboardSvcImplSync(pClient); 960 960 961 961 #else /* UNIT_TEST*/ -
trunk/src/VBox/HostServices/SharedClipboard/testcase/tstClipboardServiceHost.cpp
r78171 r78578 273 273 } 274 274 275 int vboxClipboardInit() { return VINF_SUCCESS; }276 void vboxClipboardDestroy() { }277 void vboxClipboardDisconnect(_VBOXCLIPBOARDCLIENTDATA *) { AssertFailed(); }278 int vboxClipboardConnect(_VBOXCLIPBOARDCLIENTDATA *, bool)275 int VBoxClipboardSvcImplInit() { return VINF_SUCCESS; } 276 void VBoxClipboardSvcImplDestroy() { } 277 void VBoxClipboardSvcImplDisconnect(_VBOXCLIPBOARDCLIENTDATA *) { AssertFailed(); } 278 int VBoxClipboardSvcImplConnect(_VBOXCLIPBOARDCLIENTDATA *, bool) 279 279 { AssertFailed(); return VERR_WRONG_ORDER; } 280 void vboxClipboardFormatAnnounce(_VBOXCLIPBOARDCLIENTDATA *, unsigned int)280 void VBoxClipboardSvcImplFormatAnnounce(_VBOXCLIPBOARDCLIENTDATA *, unsigned int) 281 281 { AssertFailed(); } 282 int vboxClipboardReadData(_VBOXCLIPBOARDCLIENTDATA *, unsigned int, void *, unsigned int, unsigned int *)282 int VBoxClipboardSvcImplReadData(_VBOXCLIPBOARDCLIENTDATA *, unsigned int, void *, unsigned int, unsigned int *) 283 283 { AssertFailed(); return VERR_WRONG_ORDER; } 284 void vboxClipboardWriteData(_VBOXCLIPBOARDCLIENTDATA *, void *, unsigned int, unsigned int) { AssertFailed(); }285 int vboxClipboardSync(_VBOXCLIPBOARDCLIENTDATA *)284 void VBoxClipboardSvcImplWriteData(_VBOXCLIPBOARDCLIENTDATA *, void *, unsigned int, unsigned int) { AssertFailed(); } 285 int VBoxClipboardSvcImplSync(_VBOXCLIPBOARDCLIENTDATA *) 286 286 { AssertFailed(); return VERR_WRONG_ORDER; }
Note:
See TracChangeset
for help on using the changeset viewer.