Changeset 93495 in vbox for trunk/src/VBox/HostServices/SharedClipboard
- Timestamp:
- Jan 31, 2022 1:08:33 PM (3 years ago)
- Location:
- trunk/src/VBox/HostServices/SharedClipboard
- Files:
-
- 1 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-darwin.cpp
r93115 r93495 120 120 121 121 122 int ShClBackendInit( VBOXHGCMSVCFNTABLE *pTable)123 { 124 RT_NOREF(p Table);122 int ShClBackendInit(PSHCLBACKEND pBackend, VBOXHGCMSVCFNTABLE *pTable) 123 { 124 RT_NOREF(pBackend, pTable); 125 125 g_ctx.fTerminate = false; 126 126 … … 139 139 } 140 140 141 void ShClBackendDestroy(void) 142 { 141 void ShClBackendDestroy(PSHCLBACKEND pBackend) 142 { 143 RT_NOREF(pBackend); 144 143 145 /* 144 146 * Signal the termination of the polling thread and wait for it to respond. … … 158 160 } 159 161 160 int ShClBackendConnect(PSHCL CLIENT pClient, bool fHeadless)161 { 162 RT_NOREF( fHeadless);162 int ShClBackendConnect(PSHCLBACKEND pBackend, PSHCLCLIENT pClient, bool fHeadless) 163 { 164 RT_NOREF(pBackend, fHeadless); 163 165 164 166 if (g_ctx.pClient != NULL) … … 178 180 } 179 181 180 int ShClBackendSync(PSHCLCLIENT pClient) 181 { 182 int ShClBackendSync(PSHCLBACKEND pBackend, PSHCLCLIENT pClient) 183 { 184 RT_NOREF(pBackend); 185 182 186 /* Sync the host clipboard content with the client. */ 183 187 ShClSvcLock(); … … 190 194 } 191 195 192 int ShClBackendDisconnect(PSHCLCLIENT pClient) 193 { 196 int ShClBackendDisconnect(PSHCLBACKEND pBackend, PSHCLCLIENT pClient) 197 { 198 RT_NOREF(pBackend); 199 194 200 ShClSvcLock(); 195 201 … … 201 207 } 202 208 203 int ShClBackendFormatAnnounce(PSHCLCLIENT pClient, SHCLFORMATS fFormats) 204 { 209 int ShClBackendFormatAnnounce(PSHCLBACKEND pBackend, PSHCLCLIENT pClient, SHCLFORMATS fFormats) 210 { 211 RT_NOREF(pBackend); 212 205 213 LogFlowFunc(("fFormats=%02X\n", fFormats)); 206 214 … … 247 255 } 248 256 249 int ShClBackendReadData(PSHCL CLIENT pClient, PSHCLCLIENTCMDCTX pCmdCtx, SHCLFORMAT fFormat,257 int ShClBackendReadData(PSHCLBACKEND pBackend, PSHCLCLIENT pClient, PSHCLCLIENTCMDCTX pCmdCtx, SHCLFORMAT fFormat, 250 258 void *pvData, uint32_t cbData, uint32_t *pcbActual) 251 259 { … … 255 263 AssertPtrReturn(pcbActual, VERR_INVALID_POINTER); 256 264 257 RT_NOREF(p CmdCtx);265 RT_NOREF(pBackend, pCmdCtx); 258 266 259 267 ShClSvcLock(); … … 271 279 } 272 280 273 int ShClBackendWriteData(PSHCL CLIENT pClient, PSHCLCLIENTCMDCTX pCmdCtx, SHCLFORMAT fFormat, void *pvData, uint32_t cbData)274 { 275 RT_NOREF(p CmdCtx);281 int ShClBackendWriteData(PSHCLBACKEND pBackend, PSHCLCLIENT pClient, PSHCLCLIENTCMDCTX pCmdCtx, SHCLFORMAT fFormat, void *pvData, uint32_t cbData) 282 { 283 RT_NOREF(pBackend, pCmdCtx); 276 284 277 285 LogFlowFuncEnter(); … … 289 297 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 290 298 291 int ShClBackendTransferReadDir(PSHCL CLIENT pClient, PSHCLDIRDATA pDirData)292 { 293 RT_NOREF(p Client, pDirData);294 return VERR_NOT_IMPLEMENTED; 295 } 296 297 int ShClBackendTransferWriteDir(PSHCL CLIENT pClient, PSHCLDIRDATA pDirData)298 { 299 RT_NOREF(p Client, pDirData);300 return VERR_NOT_IMPLEMENTED; 301 } 302 303 int ShClBackendTransferReadFileHdr(PSHCL CLIENT pClient, PSHCLFILEHDR pFileHdr)304 { 305 RT_NOREF(p Client, pFileHdr);306 return VERR_NOT_IMPLEMENTED; 307 } 308 309 int ShClBackendTransferWriteFileHdr(PSHCL CLIENT pClient, PSHCLFILEHDR pFileHdr)310 { 311 RT_NOREF(p Client, pFileHdr);312 return VERR_NOT_IMPLEMENTED; 313 } 314 315 int ShClBackendTransferReadFileData(PSHCL CLIENT pClient, PSHCLFILEDATA pFileData)316 { 317 RT_NOREF(p Client, pFileData);318 return VERR_NOT_IMPLEMENTED; 319 } 320 321 int ShClBackendTransferWriteFileData(PSHCL CLIENT pClient, PSHCLFILEDATA pFileData)322 { 323 RT_NOREF(p Client, pFileData);299 int ShClBackendTransferReadDir(PSHCLBACKEND pBackend, PSHCLCLIENT pClient, PSHCLDIRDATA pDirData) 300 { 301 RT_NOREF(pBackend, pClient, pDirData); 302 return VERR_NOT_IMPLEMENTED; 303 } 304 305 int ShClBackendTransferWriteDir(PSHCLBACKEND pBackend, PSHCLCLIENT pClient, PSHCLDIRDATA pDirData) 306 { 307 RT_NOREF(pBackend, pClient, pDirData); 308 return VERR_NOT_IMPLEMENTED; 309 } 310 311 int ShClBackendTransferReadFileHdr(PSHCLBACKEND pBackend, PSHCLCLIENT pClient, PSHCLFILEHDR pFileHdr) 312 { 313 RT_NOREF(pBackend, pClient, pFileHdr); 314 return VERR_NOT_IMPLEMENTED; 315 } 316 317 int ShClBackendTransferWriteFileHdr(PSHCLBACKEND pBackend, PSHCLCLIENT pClient, PSHCLFILEHDR pFileHdr) 318 { 319 RT_NOREF(pBackend, pClient, pFileHdr); 320 return VERR_NOT_IMPLEMENTED; 321 } 322 323 int ShClBackendTransferReadFileData(PSHCLBACKEND pBackend, PSHCLCLIENT pClient, PSHCLFILEDATA pFileData) 324 { 325 RT_NOREF(pBackend, pClient, pFileData); 326 return VERR_NOT_IMPLEMENTED; 327 } 328 329 int ShClBackendTransferWriteFileData(PSHCLBACKEND pBackend, PSHCLCLIENT pClient, PSHCLFILEDATA pFileData) 330 { 331 RT_NOREF(pBackend, pClient, pFileData); 324 332 return VERR_NOT_IMPLEMENTED; 325 333 } -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-internal.h
r93115 r93495 139 139 struct SHCLCLIENTSTATE *pPrev; 140 140 141 /** Backend-dependent opaque context structure. 142 * This contains data only known to a certain backend implementation. 143 * Optional and can be NULL. */ 141 144 SHCLCONTEXT *pCtx; 142 143 145 /** The client's HGCM ID. Not related to the session ID below! */ 144 146 uint32_t uClientID; … … 177 179 #endif /* VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS */ 178 180 181 /** Prototypes for the Shared Clipboard backend. */ 182 struct SHCLBACKEND; 183 typedef SHCLBACKEND *PSHCLBACKEND; 184 179 185 /** 180 186 * Structure for keeping data per (connected) HGCM client. … … 182 188 typedef struct _SHCLCLIENT 183 189 { 190 /** Pointer to associated backend, if any. 191 * Might be NULL if not being used. */ 192 PSHCLBACKEND pBackend; 184 193 /** General client state data. */ 185 194 SHCLCLIENTSTATE State; … … 296 305 int ShClSvcGuestDataSignal(PSHCLCLIENT pClient, PSHCLCLIENTCMDCTX pCmdCtx, SHCLFORMAT uFormat, void *pvData, uint32_t cbData); 297 306 int ShClSvcHostReportFormats(PSHCLCLIENT pClient, SHCLFORMATS fFormats); 307 PSHCLBACKEND ShClSvcGetBackend(void); 298 308 uint32_t ShClSvcGetMode(void); 299 309 bool ShClSvcGetHeadless(void); … … 311 321 /** @} */ 312 322 313 314 /** @name Platform-dependent implementations for the Shared Clipboard host service,called *only* by the host service.323 /** @name Platform-dependent implementations for the Shared Clipboard host service ("backends"), 324 * called *only* by the host service. 315 325 * @{ 316 326 */ 317 327 /** 328 * Structure for keeping Shared Clipboard backend instance data. 329 */ 330 typedef struct SHCLBACKEND 331 { 332 /** Callback table to use. 333 * Some callbacks might be optional and therefore NULL -- see the table for more details. */ 334 SHCLCALLBACKS Callbacks; 335 } SHCLBACKEND; 336 /** Pointer to a Shared Clipboard backend. */ 337 typedef SHCLBACKEND *PSHCLBACKEND; 338 339 /** 318 340 * Called on initialization. 319 341 * 342 * @param pBackend Shared Clipboard backend to initialize. 320 343 * @param pTable The HGCM service call and parameter table. Mainly for 321 344 * adjusting the limits. 322 345 */ 323 int ShClBackendInit( VBOXHGCMSVCFNTABLE *pTable);346 int ShClBackendInit(PSHCLBACKEND pBackend, VBOXHGCMSVCFNTABLE *pTable); 324 347 325 348 /** 326 349 * Called on destruction. 327 */ 328 void ShClBackendDestroy(void); 350 * 351 * @param pBackend Shared Clipboard backend to destroy. 352 */ 353 void ShClBackendDestroy(PSHCLBACKEND pBackend); 329 354 330 355 /** … … 332 357 * 333 358 * @returns VBox status code. 359 * @param pBackend Shared Clipboard backend to set callbacks for. 360 * @param pCallbacks Backend callbacks to use. 361 * When NULL is specified, the backend's default callbacks are being used. 362 */ 363 void ShClBackendSetCallbacks(PSHCLBACKEND pBackend, PSHCLCALLBACKS pCallbacks); 364 365 /** 366 * Called when a new HGCM client connects. 367 * 368 * @returns VBox status code. 369 * @param pBackend Shared Clipboard backend to connect to. 334 370 * @param pClient Shared Clipboard client context. 335 371 * @param fHeadless Whether this is a headless connection or not. 336 372 */ 337 int ShClBackendConnect(PSHCL CLIENT pClient, bool fHeadless);373 int ShClBackendConnect(PSHCLBACKEND pBackend, PSHCLCLIENT pClient, bool fHeadless); 338 374 339 375 /** … … 341 377 * 342 378 * @returns VBox status code. 343 * @param pClient Shared Clipboard client context. 344 */ 345 int ShClBackendDisconnect(PSHCLCLIENT pClient); 379 * @param pBackend Shared Clipboard backend to disconnect from. 380 * @param pClient Shared Clipboard client context. 381 */ 382 int ShClBackendDisconnect(PSHCLBACKEND pBackend, PSHCLCLIENT pClient); 346 383 347 384 /** … … 349 386 * 350 387 * @returns VBox status code. 388 * @param pBackend Shared Clipboard backend to announce formats to. 351 389 * @param pClient Shared Clipboard client context. 352 390 * @param fFormats The announced formats from the guest, 353 391 * VBOX_SHCL_FMT_XXX. 354 392 */ 355 int ShClBackendFormatAnnounce(PSHCL CLIENT pClient, SHCLFORMATS fFormats);393 int ShClBackendFormatAnnounce(PSHCLBACKEND pBackend, PSHCLCLIENT pClient, SHCLFORMATS fFormats); 356 394 357 395 /** … … 359 397 * 360 398 * @returns VBox status code. 399 * @param pBackend Shared Clipboard backend to read data from. 361 400 * @param pClient Shared Clipboard client context. 362 401 * @param pCmdCtx Shared Clipboard command context. … … 369 408 * data 370 409 */ 371 int ShClBackendReadData(PSHCL CLIENT pClient, PSHCLCLIENTCMDCTX pCmdCtx, SHCLFORMAT uFormat,410 int ShClBackendReadData(PSHCLBACKEND pBackend, PSHCLCLIENT pClient, PSHCLCLIENTCMDCTX pCmdCtx, SHCLFORMAT uFormat, 372 411 void *pvData, uint32_t cbData, uint32_t *pcbActual); 373 412 … … 376 415 * 377 416 * @returns VBox status code. 417 * @param pBackend Shared Clipboard backend to write data to. 378 418 * @param pClient Shared Clipboard client context. 379 419 * @param pCmdCtx Shared Clipboard command context. … … 382 422 * @param cbData Size (in bytes) of buffer clipboard data to write. 383 423 */ 384 int ShClBackendWriteData(PSHCL CLIENT pClient, PSHCLCLIENTCMDCTX pCmdCtx, SHCLFORMAT uFormat, void *pvData, uint32_t cbData);424 int ShClBackendWriteData(PSHCLBACKEND pBackend, PSHCLCLIENT pClient, PSHCLCLIENTCMDCTX pCmdCtx, SHCLFORMAT uFormat, void *pvData, uint32_t cbData); 385 425 386 426 /** … … 388 428 * 389 429 * @returns VBox status code. 390 * @param pClient Shared Clipboard client context. 391 */ 392 int ShClBackendSync(PSHCLCLIENT pClient); 430 * @param pBackend Shared Clipboard backend to synchronize. 431 * @param pClient Shared Clipboard client context. 432 */ 433 int ShClBackendSync(PSHCLBACKEND pBackend, PSHCLCLIENT pClient); 393 434 /** @} */ 394 435 … … 401 442 * 402 443 * @returns VBox status code. 444 * @param pBackend Shared Clipboard backend to use. 403 445 * @param pClient Shared Clipboard client context. 404 446 * @param pTransfer Shared Clipboard transfer created. 405 447 */ 406 int ShClBackendTransferCreate(PSHCL CLIENT pClient, PSHCLTRANSFER pTransfer);448 int ShClBackendTransferCreate(PSHCLBACKEND pBackend, PSHCLCLIENT pClient, PSHCLTRANSFER pTransfer); 407 449 /** 408 450 * Called before a transfer gets destroyed. 409 451 * 410 452 * @returns VBox status code. 453 * @param pBackend Shared Clipboard backend to use. 411 454 * @param pClient Shared Clipboard client context. 412 455 * @param pTransfer Shared Clipboard transfer to destroy. 413 456 */ 414 int ShClBackendTransferDestroy(PSHCL CLIENT pClient, PSHCLTRANSFER pTransfer);457 int ShClBackendTransferDestroy(PSHCLBACKEND pBackend, PSHCLCLIENT pClient, PSHCLTRANSFER pTransfer); 415 458 /** 416 459 * Called when getting (determining) the transfer roots on the host side. 417 460 * 418 461 * @returns VBox status code. 462 * @param pBackend Shared Clipboard backend to use. 419 463 * @param pClient Shared Clipboard client context. 420 464 * @param pTransfer Shared Clipboard transfer to get roots for. 421 465 */ 422 int ShClBackendTransferGetRoots(PSHCL CLIENT pClient, PSHCLTRANSFER pTransfer);466 int ShClBackendTransferGetRoots(PSHCLBACKEND pBackend, PSHCLCLIENT pClient, PSHCLTRANSFER pTransfer); 423 467 /** @} */ 424 468 #endif -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-transfers.cpp
r93115 r93495 77 77 PSHCLTRANSFER pTransfer; 78 78 while ((pTransfer = ShClTransferCtxGetTransferByIndex(&pClient->Transfers.Ctx, uIdx++))) 79 ShClBackendTransferDestroy(pClient , pTransfer);79 ShClBackendTransferDestroy(pClient->pBackend, pClient, pTransfer); 80 80 81 81 ShClTransferCtxDestroy(&pClient->Transfers.Ctx); … … 1364 1364 { 1365 1365 /* Get roots if this is a local write transfer (host -> guest). */ 1366 rc = ShClBackendTransferGetRoots(pClient , pTransfer);1366 rc = ShClBackendTransferGetRoots(pClient->pBackend, pClient, pTransfer); 1367 1367 } 1368 1368 else … … 1893 1893 if (RT_SUCCESS(rc)) 1894 1894 { 1895 rc = ShClBackendTransferCreate(pClient , pTransfer);1895 rc = ShClBackendTransferCreate(pClient->pBackend, pClient, pTransfer); 1896 1896 if (RT_SUCCESS(rc)) 1897 1897 { … … 1954 1954 if (RT_FAILURE(rc)) 1955 1955 { 1956 ShClBackendTransferDestroy(pClient , pTransfer);1956 ShClBackendTransferDestroy(pClient->pBackend, pClient, pTransfer); 1957 1957 ShClTransferDestroy(pTransfer); 1958 1958 … … 2009 2009 if (RT_SUCCESS(rc2)) 2010 2010 { 2011 ShClBackendTransferDestroy(pClient , pTransfer);2011 ShClBackendTransferDestroy(pClient->pBackend, pClient, pTransfer); 2012 2012 ShClTransferDestroy(pTransfer); 2013 2013 pTransfer = NULL; -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-win.cpp
r93115 r93495 622 622 */ 623 623 624 int ShClBackendInit( VBOXHGCMSVCFNTABLE *pTable)625 { 626 RT_NOREF(p Table);624 int ShClBackendInit(PSHCLBACKEND pBackend, VBOXHGCMSVCFNTABLE *pTable) 625 { 626 RT_NOREF(pBackend, pTable); 627 627 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 628 628 HRESULT hr = OleInitialize(NULL); … … 639 639 } 640 640 641 void ShClBackendDestroy(void) 642 { 641 void ShClBackendDestroy(PSHCLBACKEND pBackend) 642 { 643 RT_NOREF(pBackend); 644 643 645 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 644 646 OleSetClipboard(NULL); /* Make sure to flush the clipboard on destruction. */ … … 647 649 } 648 650 649 int ShClBackendConnect(PSHCL CLIENT pClient, bool fHeadless)650 { 651 RT_NOREF( fHeadless);651 int ShClBackendConnect(PSHCLBACKEND pBackend, PSHCLCLIENT pClient, bool fHeadless) 652 { 653 RT_NOREF(pBackend, fHeadless); 652 654 653 655 LogFlowFuncEnter(); … … 680 682 } 681 683 682 int ShClBackendSync(PSHCLCLIENT pClient) 683 { 684 int ShClBackendSync(PSHCLBACKEND pBackend, PSHCLCLIENT pClient) 685 { 686 RT_NOREF(pBackend); 687 684 688 /* Sync the host clipboard content with the client. */ 685 689 return vboxClipboardSvcWinSyncInternal(pClient->State.pCtx); 686 690 } 687 691 688 int ShClBackendDisconnect(PSHCLCLIENT pClient) 689 { 692 int ShClBackendDisconnect(PSHCLBACKEND pBackend, PSHCLCLIENT pClient) 693 { 694 RT_NOREF(pBackend); 695 690 696 AssertPtrReturn(pClient, VERR_INVALID_POINTER); 691 697 … … 727 733 } 728 734 729 int ShClBackendFormatAnnounce(PSHCLCLIENT pClient, SHCLFORMATS fFormats) 730 { 735 int ShClBackendFormatAnnounce(PSHCLBACKEND pBackend, PSHCLCLIENT pClient, SHCLFORMATS fFormats) 736 { 737 RT_NOREF(pBackend); 738 731 739 AssertPtrReturn(pClient, VERR_INVALID_POINTER); 732 740 … … 747 755 } 748 756 749 int ShClBackendReadData(PSHCL CLIENT pClient, PSHCLCLIENTCMDCTX pCmdCtx,757 int ShClBackendReadData(PSHCLBACKEND pBackend, PSHCLCLIENT pClient, PSHCLCLIENTCMDCTX pCmdCtx, 750 758 SHCLFORMAT uFmt, void *pvData, uint32_t cbData, uint32_t *pcbActual) 751 759 { … … 755 763 AssertPtrReturn(pcbActual, VERR_INVALID_POINTER); 756 764 757 RT_NOREF(p CmdCtx);765 RT_NOREF(pBackend, pCmdCtx); 758 766 759 767 AssertPtrReturn(pClient->State.pCtx, VERR_INVALID_POINTER); … … 861 869 } 862 870 863 int ShClBackendWriteData(PSHCL CLIENT pClient, PSHCLCLIENTCMDCTX pCmdCtx,871 int ShClBackendWriteData(PSHCLBACKEND pBackend, PSHCLCLIENT pClient, PSHCLCLIENTCMDCTX pCmdCtx, 864 872 SHCLFORMAT uFormat, void *pvData, uint32_t cbData) 865 873 { 866 RT_NOREF(p Client, pCmdCtx, uFormat, pvData, cbData);874 RT_NOREF(pBackend, pClient, pCmdCtx, uFormat, pvData, cbData); 867 875 868 876 LogFlowFuncEnter(); … … 875 883 876 884 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 877 int ShClBackendTransferCreate(PSHCL CLIENT pClient, PSHCLTRANSFER pTransfer)878 { 879 RT_NOREF(p Client, pTransfer);885 int ShClBackendTransferCreate(PSHCLBACKEND pBackend, PSHCLCLIENT pClient, PSHCLTRANSFER pTransfer) 886 { 887 RT_NOREF(pBackend, pClient, pTransfer); 880 888 881 889 LogFlowFuncEnter(); … … 884 892 } 885 893 886 int ShClBackendTransferDestroy(PSHCLCLIENT pClient, PSHCLTRANSFER pTransfer) 887 { 894 int ShClBackendTransferDestroy(PSHCLBACKEND pBackend, PSHCLCLIENT pClient, PSHCLTRANSFER pTransfer) 895 { 896 RT_NOREF(pBackend); 897 888 898 LogFlowFuncEnter(); 889 899 … … 893 903 } 894 904 895 int ShClBackendTransferGetRoots(PSHCLCLIENT pClient, PSHCLTRANSFER pTransfer) 896 { 905 int ShClBackendTransferGetRoots(PSHCLBACKEND pBackend, PSHCLCLIENT pClient, PSHCLTRANSFER pTransfer) 906 { 907 RT_NOREF(pBackend); 908 897 909 LogFlowFuncEnter(); 898 910 -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-x11-stubs.cpp
r93115 r93495 41 41 * Initialise the host side of the shared clipboard - called by the hgcm layer. 42 42 */ 43 int ShClBackendInit( VBOXHGCMSVCFNTABLE *pTable)43 int ShClBackendInit(PSHCLBACKEND pBackend, VBOXHGCMSVCFNTABLE *pTable) 44 44 { 45 45 RT_NOREF(pTable); … … 51 51 * Terminate the host side of the shared clipboard - called by the hgcm layer. 52 52 */ 53 void ShClBackendDestroy( void)53 void ShClBackendDestroy(PSHCLBACKEND pBackend) 54 54 { 55 RT_NOREF(pBackend); 55 56 LogFlowFunc(("called, returning\n")); 56 57 } 57 58 58 int ShClBackendConnect(PSHCL CLIENT pClient, bool fHeadless)59 int ShClBackendConnect(PSHCLBACKEND pBackend, PSHCLCLIENT pClient, bool fHeadless) 59 60 { 60 RT_NOREF(p Client, fHeadless);61 RT_NOREF(pBackend, pClient, fHeadless); 61 62 LogFlowFunc(("called, returning VINF_SUCCESS\n")); 62 63 return VINF_SUCCESS; … … 67 68 * after a save and restore of the guest. 68 69 */ 69 int ShClBackendSync(PSHCL CLIENT pClient)70 int ShClBackendSync(PSHCLBACKEND pBackend, PSHCLCLIENT pClient) 70 71 { 71 RT_NOREF(p Client);72 RT_NOREF(pBackend, pClient); 72 73 LogFlowFunc(("called, returning VINF_SUCCESS\n")); 73 74 return VINF_SUCCESS; 74 75 } 75 76 76 int ShClBackendDisconnect(PSHCL CLIENT pClient)77 int ShClBackendDisconnect(PSHCLBACKEND pBackend, PSHCLCLIENT pClient) 77 78 { 78 RT_NOREF(p Client);79 RT_NOREF(pBackend, pClient); 79 80 return VINF_SUCCESS; 80 81 } … … 84 85 * Called by the HGCM clipboard subsystem. 85 86 */ 86 int ShClBackendFormatAnnounce(PSHCL CLIENT pClient, SHCLFORMATS fFormats)87 int ShClBackendFormatAnnounce(PSHCLBACKEND pBackend, PSHCLCLIENT pClient, SHCLFORMATS fFormats) 87 88 { 88 RT_NOREF(p Client, fFormats);89 RT_NOREF(pBackend, pClient, fFormats); 89 90 return VINF_SUCCESS; 90 91 } … … 93 94 * Called by the HGCM clipboard subsystem when the guest wants to read the host clipboard. 94 95 */ 95 int ShClBackendReadData(PSHCL CLIENT pClient, PSHCLCLIENTCMDCTX pCmdCtx,96 int ShClBackendReadData(PSHCLBACKEND pBackend, PSHCLCLIENT pClient, PSHCLCLIENTCMDCTX pCmdCtx, 96 97 SHCLFORMAT uFormat, void *pvData, uint32_t cbData, uint32_t *pcbActual) 97 98 { 98 RT_NOREF(p Client, pCmdCtx, uFormat, pvData, cbData);99 RT_NOREF(pBackend, pClient, pCmdCtx, uFormat, pvData, cbData); 99 100 100 101 /* No data available. */ … … 104 105 } 105 106 106 int ShClBackendWriteData(PSHCL CLIENT pClient, PSHCLCLIENTCMDCTX pCmdCtx,107 int ShClBackendWriteData(PSHCLBACKEND pBackend, PSHCLCLIENT pClient, PSHCLCLIENTCMDCTX pCmdCtx, 107 108 SHCLFORMAT uFormat, void *pvData, uint32_t cbData) 108 109 { 109 RT_NOREF(p Client, pCmdCtx, uFormat, pvData, cbData);110 RT_NOREF(pBackend, pClient, pCmdCtx, uFormat, pvData, cbData); 110 111 return VERR_NOT_IMPLEMENTED; 111 112 } -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-x11.cpp
r93326 r93495 60 60 }; 61 61 62 63 int ShClBackendInit(VBOXHGCMSVCFNTABLE *pTable) 64 { 62 /********************************************************************************************************************************* 63 * Prototypes * 64 *********************************************************************************************************************************/ 65 static DECLCALLBACK(int) shClReportFormatsCallback(PSHCLCONTEXT pCtx, uint32_t fFormats, void *pvUser); 66 static DECLCALLBACK(int) shClSendDataToDestCallback(PSHCLCONTEXT pCtx, void *pv, uint32_t cb, void *pvUser); 67 static DECLCALLBACK(int) shClRequestDataFromSourceCallback(PSHCLCONTEXT pCtx, SHCLFORMAT uFmt, void **ppv, uint32_t *pcb, void *pvUser); 68 69 70 int ShClBackendInit(PSHCLBACKEND pBackend, VBOXHGCMSVCFNTABLE *pTable) 71 { 72 RT_NOREF(pBackend); 73 65 74 LogFlowFuncEnter(); 66 75 … … 69 78 pTable->acMaxClients[i] = RT_MIN(VBOX_SHARED_CLIPBOARD_X11_CONNECTIONS_MAX, pTable->acMaxClients[i]); 70 79 80 RT_ZERO(pBackend->Callbacks); 81 /* Use internal callbacks by default. */ 82 pBackend->Callbacks.pfnReportFormats = shClReportFormatsCallback; 83 pBackend->Callbacks.pfnOnRequestDataFromSource = shClRequestDataFromSourceCallback; 84 pBackend->Callbacks.pfnOnSendDataToDest = shClSendDataToDestCallback; 85 71 86 return VINF_SUCCESS; 72 87 } 73 88 74 void ShClBackendDestroy(void) 75 { 89 void ShClBackendDestroy(PSHCLBACKEND pBackend) 90 { 91 RT_NOREF(pBackend); 92 76 93 LogFlowFuncEnter(); 94 } 95 96 void ShClBackendSetCallbacks(PSHCLBACKEND pBackend, PSHCLCALLBACKS pCallbacks) 97 { 98 #define SET_FN_IF_NOT_NULL(a_Fn) \ 99 if (pCallbacks->pfn##a_Fn) \ 100 pBackend->Callbacks.pfn##a_Fn = pCallbacks->pfn##a_Fn; 101 102 SET_FN_IF_NOT_NULL(ReportFormats); 103 SET_FN_IF_NOT_NULL(OnClipboardRead); 104 SET_FN_IF_NOT_NULL(OnClipboardWrite); 105 SET_FN_IF_NOT_NULL(OnRequestDataFromSource); 106 SET_FN_IF_NOT_NULL(OnSendDataToDest); 107 108 #undef SET_FN_IF_NOT_NULL 77 109 } 78 110 … … 81 113 * the clipboard and leave ownership to X11. 82 114 */ 83 int ShClBackendConnect(PSHCL CLIENT pClient, bool fHeadless)115 int ShClBackendConnect(PSHCLBACKEND pBackend, PSHCLCLIENT pClient, bool fHeadless) 84 116 { 85 117 int rc; … … 99 131 if (RT_SUCCESS(rc)) 100 132 { 101 rc = ShClX11Init(&pCtx->X11, pCtx, fHeadless);133 rc = ShClX11Init(&pCtx->X11, &pBackend->Callbacks, pCtx, fHeadless); 102 134 if (RT_SUCCESS(rc)) 103 135 { … … 133 165 } 134 166 135 int ShClBackendSync(PSHCLCLIENT pClient) 136 { 167 int ShClBackendSync(PSHCLBACKEND pBackend, PSHCLCLIENT pClient) 168 { 169 RT_NOREF(pBackend); 170 137 171 LogFlowFuncEnter(); 138 172 … … 149 183 * Note! Host glue code 150 184 */ 151 int ShClBackendDisconnect(PSHCLCLIENT pClient) 152 { 185 int ShClBackendDisconnect(PSHCLBACKEND pBackend, PSHCLCLIENT pClient) 186 { 187 RT_NOREF(pBackend); 188 153 189 LogFlowFuncEnter(); 154 190 … … 178 214 } 179 215 180 int ShClBackendFormatAnnounce(PSHCLCLIENT pClient, SHCLFORMATS fFormats) 181 { 216 int ShClBackendFormatAnnounce(PSHCLBACKEND pBackend, PSHCLCLIENT pClient, SHCLFORMATS fFormats) 217 { 218 RT_NOREF(pBackend); 219 182 220 int rc = ShClX11ReportFormatsToX11(&pClient->State.pCtx->X11, fFormats); 183 221 … … 205 243 * the backend code. 206 244 */ 207 int ShClBackendReadData(PSHCL CLIENT pClient, PSHCLCLIENTCMDCTX pCmdCtx, SHCLFORMAT uFormat,245 int ShClBackendReadData(PSHCLBACKEND pBackend, PSHCLCLIENT pClient, PSHCLCLIENTCMDCTX pCmdCtx, SHCLFORMAT uFormat, 208 246 void *pvData, uint32_t cbData, uint32_t *pcbActual) 209 247 { 248 RT_NOREF(pBackend); 249 210 250 AssertPtrReturn(pClient, VERR_INVALID_POINTER); 211 251 AssertPtrReturn(pCmdCtx, VERR_INVALID_POINTER); … … 215 255 RT_NOREF(pCmdCtx); 216 256 217 LogFlowFunc(("pClient=%p, uFormat=% 02X, pv=%p, cb=%u, pcbActual=%p\n",257 LogFlowFunc(("pClient=%p, uFormat=%#x, pv=%p, cb=%RU32, pcbActual=%p\n", 218 258 pClient, uFormat, pvData, cbData, pcbActual)); 219 259 … … 269 309 } 270 310 271 int ShClBackendWriteData(PSHCL CLIENT pClient, PSHCLCLIENTCMDCTX pCmdCtx, SHCLFORMAT uFormat, void *pvData, uint32_t cbData)272 { 273 RT_NOREF(p Client, pCmdCtx, uFormat, pvData, cbData);311 int ShClBackendWriteData(PSHCLBACKEND pBackend, PSHCLCLIENT pClient, PSHCLCLIENTCMDCTX pCmdCtx, SHCLFORMAT uFormat, void *pvData, uint32_t cbData) 312 { 313 RT_NOREF(pBackend, pClient, pCmdCtx, uFormat, pvData, cbData); 274 314 275 315 LogFlowFuncEnter(); … … 281 321 } 282 322 283 DECLCALLBACK(void) ShClX11ReportFormatsCallback(PSHCLCONTEXT pCtx, uint32_t fFormats) 284 { 323 /** @copydoc SHCLBACKENDCALLBACKS::pfnReportFormats */ 324 static DECLCALLBACK(int) shClReportFormatsCallback(PSHCLCONTEXT pCtx, uint32_t fFormats, void *pvUser) 325 { 326 RT_NOREF(pvUser); 327 285 328 LogFlowFunc(("pCtx=%p, fFormats=%#x\n", pCtx, fFormats)); 286 329 … … 305 348 306 349 LogFlowFuncLeaveRC(rc); 307 } 308 309 DECLCALLBACK(void) ShClX11ReportDataCallback(PSHCLCONTEXT pCtx, int rcCompletion, 310 CLIPREADCBREQ *pReq, void *pv, uint32_t cb) 311 { 312 AssertPtrReturnVoid(pCtx); 313 AssertPtrReturnVoid(pReq); 314 315 LogFlowFunc(("rcCompletion=%Rrc, pReq=%p, pv=%p, cb=%RU32, idEvent=%RU32\n", rcCompletion, pReq, pv, cb, pReq->idEvent)); 350 return rc; 351 } 352 353 /** @copydoc SHCLBACKENDCALLBACKS::pfnOnSendDataToDest */ 354 static DECLCALLBACK(int) shClSendDataToDestCallback(PSHCLCONTEXT pCtx, void *pv, uint32_t cb, void *pvUser) 355 { 356 AssertPtrReturn(pCtx, VERR_INVALID_POINTER); 357 AssertPtrReturn(pvUser, VERR_INVALID_POINTER); 358 359 PSHCLX11READDATAREQ pData = (PSHCLX11READDATAREQ)pvUser; 360 CLIPREADCBREQ *pReq = pData->pReq; 361 362 LogFlowFunc(("rcCompletion=%Rrc, pReq=%p, pv=%p, cb=%RU32, idEvent=%RU32\n", 363 pData->rcCompletion, pReq, pv, cb, pReq->idEvent)); 316 364 317 365 if (pReq->idEvent != NIL_SHCLEVENTID) … … 320 368 321 369 PSHCLEVENTPAYLOAD pPayload = NULL; 322 if ( RT_SUCCESS( rcCompletion)370 if ( RT_SUCCESS(pData->rcCompletion) 323 371 && pv 324 372 && cb) … … 348 396 RTMemFree(pReq); 349 397 350 LogRel2(("Shared Clipboard: Reading X11 clipboard data from host completed with %Rrc\n", rcCompletion)); 351 } 352 353 DECLCALLBACK(int) ShClX11RequestDataCallback(PSHCLCONTEXT pCtx, SHCLFORMAT uFmt, void **ppv, uint32_t *pcb) 354 { 398 LogRel2(("Shared Clipboard: Reading X11 clipboard data from host completed with %Rrc\n", pData->rcCompletion)); 399 400 return VINF_SUCCESS; 401 } 402 403 /** @copydoc SHCLBACKENDCALLBACKS::pfnOnRequestDataFromSource */ 404 static DECLCALLBACK(int) shClRequestDataFromSourceCallback(PSHCLCONTEXT pCtx, SHCLFORMAT uFmt, void **ppv, uint32_t *pcb, void *pvUser) 405 { 406 RT_NOREF(pvUser); 407 355 408 LogFlowFunc(("pCtx=%p, uFmt=0x%x\n", pCtx, uFmt)); 356 409 … … 437 490 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 438 491 439 int ShClBackendTransferCreate(PSHCLCLIENT pClient, PSHCLTRANSFER pTransfer) 440 { 492 int ShClBackendTransferCreate(PSHCLBACKEND pBackend, PSHCLCLIENT pClient, PSHCLTRANSFER pTransfer) 493 { 494 RT_NOREF(pBackend); 441 495 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS_HTTP 442 496 return ShClHttpTransferRegister(&pClient->State.pCtx->X11.HttpCtx, pTransfer); … … 447 501 } 448 502 449 int ShClBackendTransferDestroy(PSHCLCLIENT pClient, PSHCLTRANSFER pTransfer) 450 { 503 int ShClBackendTransferDestroy(PSHCLBACKEND pBackend, PSHCLCLIENT pClient, PSHCLTRANSFER pTransfer) 504 { 505 RT_NOREF(pBackend); 451 506 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS_HTTP 452 507 return ShClHttpTransferUnregister(&pClient->State.pCtx->X11.HttpCtx, pTransfer); … … 458 513 } 459 514 460 int ShClBackendTransferGetRoots(PSHCLCLIENT pClient, PSHCLTRANSFER pTransfer) 461 { 515 int ShClBackendTransferGetRoots(PSHCLBACKEND pBackend, PSHCLCLIENT pClient, PSHCLTRANSFER pTransfer) 516 { 517 RT_NOREF(pBackend); 518 462 519 LogFlowFuncEnter(); 463 520 -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc.cpp
r93444 r93495 242 242 * Global Variables * 243 243 *********************************************************************************************************************************/ 244 /** The backend instance data. 245 * Only one backend at a time is supported currently. */ 246 SHCLBACKEND g_ShClBackend; 244 247 PVBOXHGCMSVCHELPERS g_pHelpers; 245 248 … … 282 285 { 283 286 return g_uMode; 287 } 288 289 /** 290 * Returns the Shared Clipboard backend in use. 291 * 292 * @returns Pointer to backend instance. 293 */ 294 PSHCLBACKEND ShClSvcGetBackend(void) 295 { 296 return &g_ShClBackend; 284 297 } 285 298 … … 1563 1576 } 1564 1577 #endif 1565 rc = ShClBackendFormatAnnounce( pClient, fFormats);1578 rc = ShClBackendFormatAnnounce(&g_ShClBackend, pClient, fFormats); 1566 1579 if (RT_FAILURE(rc)) 1567 1580 LogRel(("Shared Clipboard: Reporting guest clipboard formats to the host failed with %Rrc\n", rc)); … … 1717 1730 else 1718 1731 { 1719 rc = ShClBackendReadData( pClient, &cmdCtx, uFormat, pvData, cbData, &cbActual);1732 rc = ShClBackendReadData(&g_ShClBackend, pClient, &cmdCtx, uFormat, pvData, cbData, &cbActual); 1720 1733 if (RT_SUCCESS(rc)) 1721 1734 LogRel2(("Shared Clipboard: Read host clipboard data (max %RU32 bytes), got %RU32 bytes\n", cbData, cbActual)); … … 1892 1905 { 1893 1906 /* Let the backend implementation know. */ 1894 rc = ShClBackendWriteData( pClient, &cmdCtx, uFormat, pvData, cbData);1907 rc = ShClBackendWriteData(&g_ShClBackend, pClient, &cmdCtx, uFormat, pvData, cbData); 1895 1908 if (RT_FAILURE(rc)) 1896 1909 LogRel(("Shared Clipboard: Writing guest clipboard data to the host failed with %Rrc\n", rc)); … … 1970 1983 shClSvcModeSet(VBOX_SHCL_MODE_OFF); 1971 1984 1972 rc = ShClBackendInit( pTable);1985 rc = ShClBackendInit(ShClSvcGetBackend(), pTable); 1973 1986 1974 1987 /* Clean up on failure, because 'svnUnload' will not be called … … 1988 2001 LogFlowFuncEnter(); 1989 2002 1990 ShClBackendDestroy( );2003 ShClBackendDestroy(ShClSvcGetBackend()); 1991 2004 1992 2005 RTCritSectDelete(&g_CritSect); … … 2016 2029 #endif 2017 2030 2018 ShClBackendDisconnect( pClient);2031 ShClBackendDisconnect(&g_ShClBackend, pClient); 2019 2032 2020 2033 shClSvcClientDestroy(pClient); … … 2039 2052 * crash any worse that racing map insertion/removal. */ 2040 2053 g_mapClients[u32ClientID] = pClient; /** @todo Handle OOM / collisions? */ 2041 2042 rc = ShClBackendConnect(pClient, ShClSvcGetHeadless()); 2054 rc = ShClBackendConnect(&g_ShClBackend, pClient, ShClSvcGetHeadless()); 2043 2055 if (RT_SUCCESS(rc)) 2044 2056 { 2045 2057 /* Sync the host clipboard content with the client. */ 2046 rc = ShClBackendSync( pClient);2058 rc = ShClBackendSync(&g_ShClBackend, pClient); 2047 2059 if (RT_SUCCESS(rc)) 2048 2060 { … … 2063 2075 2064 2076 LogFunc(("ShClBackendSync failed: %Rrc\n", rc)); 2065 ShClBackendDisconnect( pClient);2077 ShClBackendDisconnect(&g_ShClBackend, pClient); 2066 2078 } 2067 2079 else … … 2654 2666 2655 2667 /* Actual host data are to be reported to guest (SYNC). */ 2656 ShClBackendSync( pClient);2668 ShClBackendSync(&g_ShClBackend, pClient); 2657 2669 2658 2670 #else /* UNIT_TEST */ -
trunk/src/VBox/HostServices/SharedClipboard/testcase/Makefile.kmk
r93401 r93495 20 20 21 21 if defined(VBOX_WITH_TESTCASES) && !defined(VBOX_ONLY_ADDITIONS) && !defined(VBOX_ONLY_SDK) 22 23 if 0 24 # 25 # Testcase which mocks HGCM to also test the VbglR3-side of Shared Clipboard. 26 # 27 # Goal is to use and test as much guest side code as possible as a self-contained 28 # binary on the host here. 29 # 30 # Note: No #ifdef TESTCASE hacks or similar allowed, has to run 31 # without #ifdef modifications to the core code! 32 # 33 PROGRAMS += tstClipboardMockHGCM 34 tstClipboardMockHGCM_TEMPLATE = VBOXR3TSTEXE 35 tstClipboardMockHGCM_DEFS = VBOX_WITH_HGCM VBOX_WITH_SHARED_CLIPBOARD 36 tstClipboardMockHGCM_SOURCES = \ 37 ../VBoxSharedClipboardSvc.cpp \ 38 $(PATH_ROOT)/src/VBox/GuestHost/SharedClipboard/clipboard-common.cpp \ 39 $(PATH_ROOT)/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibClipboard.cpp \ 40 $(PATH_ROOT)/src/VBox/HostServices/common/message.cpp \ 41 tstClipboardMockHGCM.cpp 42 tstClipboardMockHGCM_LIBS = $(LIB_RUNTIME) 43 44 if1of ($(KBUILD_TARGET), linux) 45 tstClipboardMockHGCM_SOURCES.linux += \ 46 $(PATH_ROOT)/src/VBox/GuestHost/SharedClipboard/clipboard-x11.cpp \ 47 ../VBoxSharedClipboardSvc-x11.cpp 48 tstClipboardMockHGCM_LIBPATH = \ 49 $(VBOX_LIBPATH_X11) 50 tstClipboardMockHGCM_LIBS += \ 51 Xt \ 52 X11 53 endif 54 55 tstClipboardMockHGCM_SOURCES.darwin += ../VBoxSharedClipboardSvc-darwin.cpp 56 tstClipboardMockHGCM_SOURCES.win += ../VBoxSharedClipboardSvc-win.cpp 57 58 tstClipboardMockHGCM_CLEAN = $(tstClipboardMockHGCM_0_OUTDIR)/tstClipboardMockHGCM.run 59 60 if defined(VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS) 61 tstClipboardMockHGCM_DEFS += VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 62 tstClipboardMockHGCM_SOURCES += \ 63 ../VBoxSharedClipboardSvc-transfers.cpp \ 64 $(PATH_ROOT)/src/VBox/GuestHost/SharedClipboard/clipboard-transfers.cpp 65 endif 66 endif 22 67 23 68 # -
trunk/src/VBox/HostServices/SharedClipboard/testcase/tstClipboardServiceHost.cpp
r93115 r93495 310 310 } 311 311 312 int ShClBackendInit( VBOXHGCMSVCFNTABLE *) { return VINF_SUCCESS; }313 void ShClBackendDestroy( ) { }314 int ShClBackendDisconnect(PSHCL CLIENT) { return VINF_SUCCESS; }315 int ShClBackendConnect(PSHCL CLIENT, bool) { return VINF_SUCCESS; }316 int ShClBackendFormatAnnounce(PSHCL CLIENT, SHCLFORMATS) { AssertFailed(); return VINF_SUCCESS; }317 int ShClBackendReadData(PSHCL CLIENT, PSHCLCLIENTCMDCTX, SHCLFORMAT, void *, uint32_t, unsigned int *) { AssertFailed(); return VERR_WRONG_ORDER; }318 int ShClBackendWriteData(PSHCL CLIENT, PSHCLCLIENTCMDCTX, SHCLFORMAT, void *, uint32_t) { AssertFailed(); return VINF_SUCCESS; }319 int ShClBackendSync(PSHCL CLIENT) { return VINF_SUCCESS; }312 int ShClBackendInit(PSHCLBACKEND, VBOXHGCMSVCFNTABLE *) { return VINF_SUCCESS; } 313 void ShClBackendDestroy(PSHCLBACKEND) { } 314 int ShClBackendDisconnect(PSHCLBACKEND, PSHCLCLIENT) { return VINF_SUCCESS; } 315 int ShClBackendConnect(PSHCLBACKEND, PSHCLCLIENT, bool) { return VINF_SUCCESS; } 316 int ShClBackendFormatAnnounce(PSHCLBACKEND, PSHCLCLIENT, SHCLFORMATS) { AssertFailed(); return VINF_SUCCESS; } 317 int ShClBackendReadData(PSHCLBACKEND, PSHCLCLIENT, PSHCLCLIENTCMDCTX, SHCLFORMAT, void *, uint32_t, unsigned int *) { AssertFailed(); return VERR_WRONG_ORDER; } 318 int ShClBackendWriteData(PSHCLBACKEND, PSHCLCLIENT, PSHCLCLIENTCMDCTX, SHCLFORMAT, void *, uint32_t) { AssertFailed(); return VINF_SUCCESS; } 319 int ShClBackendSync(PSHCLBACKEND, PSHCLCLIENT) { return VINF_SUCCESS; } 320 320 321 321 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 322 int ShClBackendTransferCreate(PSHCL CLIENT, PSHCLTRANSFER) { return VINF_SUCCESS; }323 int ShClBackendTransferDestroy(PSHCL CLIENT, PSHCLTRANSFER) { return VINF_SUCCESS; }324 int ShClBackendTransferGetRoots(PSHCL CLIENT, PSHCLTRANSFER) { return VINF_SUCCESS; }322 int ShClBackendTransferCreate(PSHCLBACKEND, PSHCLCLIENT, PSHCLTRANSFER) { return VINF_SUCCESS; } 323 int ShClBackendTransferDestroy(PSHCLBACKEND, PSHCLCLIENT, PSHCLTRANSFER) { return VINF_SUCCESS; } 324 int ShClBackendTransferGetRoots(PSHCLBACKEND, PSHCLCLIENT, PSHCLTRANSFER) { return VINF_SUCCESS; } 325 325 #endif /* VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS */ 326 326 -
trunk/src/VBox/HostServices/SharedClipboard/testcase/tstClipboardServiceImpl.cpp
r93401 r93495 27 27 #include <iprt/test.h> 28 28 29 extern "C" DECLCALLBACK(DECLEXPORT(int)) VBoxHGCMSvcLoad 29 extern "C" DECLCALLBACK(DECLEXPORT(int)) VBoxHGCMSvcLoad(VBOXHGCMSVCFNTABLE *ptable); 30 30 31 31 static SHCLCLIENT g_Client; … … 55 55 } 56 56 57 int ShClBackendInit( VBOXHGCMSVCFNTABLE *) { return VINF_SUCCESS; }58 void ShClBackendDestroy( void) { }59 int ShClBackendDisconnect(PSHCL CLIENT) { return VINF_SUCCESS; }60 int ShClBackendConnect(PSHCL CLIENT, bool) { return VINF_SUCCESS; }61 int ShClBackendFormatAnnounce(PSHCL CLIENT, SHCLFORMATS) { AssertFailed(); return VINF_SUCCESS; }62 int ShClBackendReadData(PSHCL CLIENT, PSHCLCLIENTCMDCTX, SHCLFORMAT, void *, uint32_t, unsigned int *) { AssertFailed(); return VERR_WRONG_ORDER; }63 int ShClBackendWriteData(PSHCL CLIENT, PSHCLCLIENTCMDCTX, SHCLFORMAT, void *, uint32_t) { AssertFailed(); return VINF_SUCCESS; }64 int ShClBackendSync(PSHCL CLIENT) { return VINF_SUCCESS; }57 int ShClBackendInit(PSHCLBACKEND, VBOXHGCMSVCFNTABLE *) { return VINF_SUCCESS; } 58 void ShClBackendDestroy(PSHCLBACKEND) { } 59 int ShClBackendDisconnect(PSHCLBACKEND, PSHCLCLIENT) { return VINF_SUCCESS; } 60 int ShClBackendConnect(PSHCLBACKEND, PSHCLCLIENT, bool) { return VINF_SUCCESS; } 61 int ShClBackendFormatAnnounce(PSHCLBACKEND, PSHCLCLIENT, SHCLFORMATS) { AssertFailed(); return VINF_SUCCESS; } 62 int ShClBackendReadData(PSHCLBACKEND, PSHCLCLIENT, PSHCLCLIENTCMDCTX, SHCLFORMAT, void *, uint32_t, unsigned int *) { AssertFailed(); return VERR_WRONG_ORDER; } 63 int ShClBackendWriteData(PSHCLBACKEND, PSHCLCLIENT, PSHCLCLIENTCMDCTX, SHCLFORMAT, void *, uint32_t) { AssertFailed(); return VINF_SUCCESS; } 64 int ShClBackendSync(PSHCLBACKEND, PSHCLCLIENT) { return VINF_SUCCESS; } 65 65 66 66 static void testAnnounceAndReadData(void)
Note:
See TracChangeset
for help on using the changeset viewer.