Changeset 78579 in vbox for trunk/src/VBox
- Timestamp:
- May 18, 2019 3:27:22 PM (6 years ago)
- Location:
- trunk/src/VBox/HostServices/SharedClipboard
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedClipboard/VBoxClipboard.h
r78578 r78579 66 66 uint32_t u32RequestedFormat; 67 67 68 } VBOXCLIPBOARD CLIENTDATA, *PVBOXCLIPBOARDCLIENTDATA;68 } VBOXCLIPBOARDSVCCTX, *PVBOXCLIPBOARDSVCCTX; 69 69 70 70 /* 71 71 * The service functions. Locking is between the service thread and the platform dependent windows thread. 72 72 */ 73 void vboxSvcClipboardReportMsg( VBOXCLIPBOARDCLIENTDATA *pClient, uint32_t u32Msg, uint32_t u32Formats);74 void vboxSvcClipboardCompleteReadData( VBOXCLIPBOARDCLIENTDATA *pClient, int rc, uint32_t cbActual);73 void vboxSvcClipboardReportMsg(PVBOXCLIPBOARDSVCCTX pSvcCtx, uint32_t u32Msg, uint32_t u32Formats); 74 void vboxSvcClipboardCompleteReadData(PVBOXCLIPBOARDSVCCTX pSvcCtx, int rc, uint32_t cbActual); 75 75 76 76 /* … … 80 80 void VBoxClipboardSvcImplDestroy(void); 81 81 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);82 int VBoxClipboardSvcImplConnect(PVBOXCLIPBOARDSVCCTX pSvcCtx, bool fHeadless); 83 void VBoxClipboardSvcImplDisconnect(PVBOXCLIPBOARDSVCCTX pSvcCtx); 84 void VBoxClipboardSvcImplFormatAnnounce(PVBOXCLIPBOARDSVCCTX pSvcCtx, uint32_t u32Formats); 85 int VBoxClipboardSvcImplReadData(PVBOXCLIPBOARDSVCCTX pSvcCtx, uint32_t u32Format, void *pv, uint32_t cb, uint32_t *pcbActual); 86 void VBoxClipboardSvcImplWriteData(PVBOXCLIPBOARDSVCCTX pSvcCtx, void *pv, uint32_t cb, uint32_t u32Format); 87 int VBoxClipboardSvcImplSync(PVBOXCLIPBOARDSVCCTX pSvcCtx); 88 88 89 89 /* Host unit testing interface */ -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-darwin.cpp
r78578 r78579 44 44 PasteboardRef pasteboard; 45 45 46 VBOXCLIPBOARDCLIENTDATA *pClient;46 PVBOXCLIPBOARDSVCCTX pSvcCtx; 47 47 }; 48 48 … … 167 167 * @returns RT status code 168 168 */ 169 int VBoxClipboardSvcImplConnect( VBOXCLIPBOARDCLIENTDATA *pClient, bool fHeadless)169 int VBoxClipboardSvcImplConnect(PVBOXCLIPBOARDSVCCTX pSvcCtx, bool fHeadless) 170 170 { 171 171 NOREF(fHeadless); … … 192 192 * after a save and restore of the guest. 193 193 */ 194 int VBoxClipboardSvcImplSync( VBOXCLIPBOARDCLIENTDATA *pClient)194 int VBoxClipboardSvcImplSync(PVBOXCLIPBOARDSVCCTX pSvcCtx) 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 VBoxClipboardSvcImplDisconnect( VBOXCLIPBOARDCLIENTDATA *pClient)207 void VBoxClipboardSvcImplDisconnect(PVBOXCLIPBOARDSVCCTX pSvcCtx) 208 208 { 209 209 Log(("vboxClipboardDisconnect\n")); … … 221 221 * @param u32Formats Clipboard formats the guest is offering 222 222 */ 223 void VBoxClipboardSvcImplFormatAnnounce( VBOXCLIPBOARDCLIENTDATA *pClient, uint32_t u32Formats)223 void VBoxClipboardSvcImplFormatAnnounce(PVBOXCLIPBOARDSVCCTX pSvcCtx, 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 VBoxClipboardSvcImplReadData( VBOXCLIPBOARDCLIENTDATA *pClient, uint32_t u32Format,244 int VBoxClipboardSvcImplReadData(PVBOXCLIPBOARDSVCCTX pSvcCtx, 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 VBoxClipboardSvcImplWriteData( VBOXCLIPBOARDCLIENTDATA *pClient, void *pv, uint32_t cb, uint32_t u32Format)265 void VBoxClipboardSvcImplWriteData(PVBOXCLIPBOARDSVCCTX pSvcCtx, void *pv, uint32_t cb, uint32_t u32Format) 266 266 { 267 267 VBoxSvcClipboardLock(); -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-win.cpp
r78578 r78579 61 61 RTSEMEVENT hRenderEvent; 62 62 /** Structure for keeping and communicating with client data (from the guest). */ 63 PVBOXCLIPBOARD CLIENTDATApClient;63 PVBOXCLIPBOARDSVCCTX pClient; 64 64 /** Windows-specific context data. */ 65 65 VBOXCLIPBOARDWINCTX Win; … … 602 602 } 603 603 604 int VBoxClipboardSvcImplConnect( VBOXCLIPBOARDCLIENTDATA *pClient, bool fHeadless)604 int VBoxClipboardSvcImplConnect(PVBOXCLIPBOARDSVCCTX pSvcCtx, bool fHeadless) 605 605 { 606 606 RT_NOREF(fHeadless); … … 624 624 } 625 625 626 int VBoxClipboardSvcImplSync( VBOXCLIPBOARDCLIENTDATA *pClient)626 int VBoxClipboardSvcImplSync(PVBOXCLIPBOARDSVCCTX pSvcCtx) 627 627 { 628 628 /* Sync the host clipboard content with the client. */ … … 630 630 } 631 631 632 void VBoxClipboardSvcImplDisconnect( VBOXCLIPBOARDCLIENTDATA *pClient)632 void VBoxClipboardSvcImplDisconnect(PVBOXCLIPBOARDSVCCTX pSvcCtx) 633 633 { 634 634 RT_NOREF(pClient); … … 639 639 } 640 640 641 void VBoxClipboardSvcImplFormatAnnounce( VBOXCLIPBOARDCLIENTDATA *pClient, uint32_t u32Formats)641 void VBoxClipboardSvcImplFormatAnnounce(PVBOXCLIPBOARDSVCCTX pSvcCtx, uint32_t u32Formats) 642 642 { 643 643 AssertPtrReturnVoid(pClient); … … 682 682 #endif 683 683 684 int VBoxClipboardSvcImplReadData( VBOXCLIPBOARDCLIENTDATA *pClient, uint32_t u32Format, void *pv, uint32_t cb, uint32_t *pcbActual)684 int VBoxClipboardSvcImplReadData(PVBOXCLIPBOARDSVCCTX pSvcCtx, 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 VBoxClipboardSvcImplWriteData( VBOXCLIPBOARDCLIENTDATA *pClient, void *pv, uint32_t cb, uint32_t u32Format)818 void VBoxClipboardSvcImplWriteData(PVBOXCLIPBOARDSVCCTX pSvcCtx, void *pv, uint32_t cb, uint32_t u32Format) 819 819 { 820 820 LogFlowFuncEnter(); -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-x11-stubs.cpp
r78578 r78579 59 59 * @returns RT status code 60 60 */ 61 int VBoxClipboardSvcImplConnect( VBOXCLIPBOARDCLIENTDATA *pClient, bool fHeadless)61 int VBoxClipboardSvcImplConnect(PVBOXCLIPBOARDSVCCTX pSvcCtx, bool fHeadless) 62 62 { 63 63 RT_NOREF(pClient, fHeadless); … … 70 70 * after a save and restore of the guest. 71 71 */ 72 int VBoxClipboardSvcImplSync( VBOXCLIPBOARDCLIENTDATA */* pClient */)72 int VBoxClipboardSvcImplSync(PVBOXCLIPBOARDSVCCTX /* 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 VBoxClipboardSvcImplDisconnect( VBOXCLIPBOARDCLIENTDATA *pClient)83 void VBoxClipboardSvcImplDisconnect(PVBOXCLIPBOARDSVCCTX pSvcCtx) 84 84 { 85 85 RT_NOREF(pClient); … … 94 94 * @param u32Formats Clipboard formats the guest is offering 95 95 */ 96 void VBoxClipboardSvcImplFormatAnnounce( VBOXCLIPBOARDCLIENTDATA *pClient, uint32_t u32Formats)96 void VBoxClipboardSvcImplFormatAnnounce(PVBOXCLIPBOARDSVCCTX pSvcCtx, 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 VBoxClipboardSvcImplReadData( VBOXCLIPBOARDCLIENTDATA *pClient, uint32_t u32Format,111 int VBoxClipboardSvcImplReadData(PVBOXCLIPBOARDSVCCTX pSvcCtx, 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 VBoxClipboardSvcImplWriteData( VBOXCLIPBOARDCLIENTDATA *pClient, void *pv, uint32_t cb,129 void VBoxClipboardSvcImplWriteData(PVBOXCLIPBOARDSVCCTX pSvcCtx, void *pv, uint32_t cb, 130 130 uint32_t u32Format) 131 131 { -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-x11.cpp
r78578 r78579 59 59 CLIPBACKEND *pBackend; 60 60 /** Pointer to the VBox host client data structure. */ 61 VBOXCLIPBOARDCLIENTDATA *pClient;61 PVBOXCLIPBOARDSVCCTX pSvcCtx; 62 62 /** We set this when we start shutting down as a hint not to post any new 63 63 * requests. */ … … 105 105 * the clipboard and leave ownership to X11. 106 106 */ 107 int VBoxClipboardSvcImplConnect( VBOXCLIPBOARDCLIENTDATA *pClient, bool fHeadless)107 int VBoxClipboardSvcImplConnect(PVBOXCLIPBOARDSVCCTX pSvcCtx, bool fHeadless) 108 108 { 109 109 int rc = VINF_SUCCESS; … … 144 144 * @note Host glue code 145 145 */ 146 int VBoxClipboardSvcImplSync( VBOXCLIPBOARDCLIENTDATA *pClient)146 int VBoxClipboardSvcImplSync(PVBOXCLIPBOARDSVCCTX pSvcCtx) 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 VBoxClipboardSvcImplDisconnect( VBOXCLIPBOARDCLIENTDATA *pClient)160 void VBoxClipboardSvcImplDisconnect(PVBOXCLIPBOARDSVCCTX pSvcCtx) 161 161 { 162 162 LogRelFlow(("vboxClipboardDisconnect\n")); … … 189 189 * @note Host glue code 190 190 */ 191 void VBoxClipboardSvcImplFormatAnnounce( VBOXCLIPBOARDCLIENTDATA *pClient, uint32_t u32Formats)191 void VBoxClipboardSvcImplFormatAnnounce(PVBOXCLIPBOARDSVCCTX pSvcCtx, uint32_t u32Formats) 192 192 { 193 193 LogRelFlowFunc(("called. pClient=%p, u32Formats=%02X\n", pClient, u32Formats)); … … 225 225 * 226 226 */ 227 int VBoxClipboardSvcImplReadData( VBOXCLIPBOARDCLIENTDATA *pClient,227 int VBoxClipboardSvcImplReadData(PVBOXCLIPBOARDSVCCTX pSvcCtx, 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 VBoxClipboardSvcImplWriteData( VBOXCLIPBOARDCLIENTDATA *pClient,401 void VBoxClipboardSvcImplWriteData(PVBOXCLIPBOARDSVCCTX pSvcCtx, 402 402 void *pv, uint32_t cb, uint32_t u32Format) 403 403 { … … 463 463 }; 464 464 465 void vboxSvcClipboardReportMsg( VBOXCLIPBOARDCLIENTDATA *pClient, uint32_t u32Msg, uint32_t u32Formats)465 void vboxSvcClipboardReportMsg(PVBOXCLIPBOARDSVCCTX pSvcCtx, uint32_t u32Msg, uint32_t u32Formats) 466 466 { 467 467 RT_NOREF(u32Formats); … … 477 477 } 478 478 479 void vboxSvcClipboardCompleteReadData( VBOXCLIPBOARDCLIENTDATA *pClient, int rc, uint32_t cbActual)479 void vboxSvcClipboardCompleteReadData(PVBOXCLIPBOARDSVCCTX pSvcCtx, int rc, uint32_t cbActual) 480 480 { 481 481 CLIPBACKEND *pBackend = pClient->pCtx->pBackend; … … 522 522 int main() 523 523 { 524 VBOXCLIPBOARD CLIENTDATAclient;524 VBOXCLIPBOARDSVCCTX client; 525 525 unsigned cErrors = 0; 526 526 int rc = RTR3InitExeNoArguments(0); -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc.cpp
r78578 r78579 102 102 static void *g_pvExtension; 103 103 104 static VBOXCLIPBOARDCLIENTDATA *g_pClient;104 static PVBOXCLIPBOARDSVCCTX g_pClient; 105 105 106 106 /* Serialization of data reading and format announcements from the RDP client. */ … … 200 200 * Executed under the clipboard lock. 201 201 */ 202 static bool vboxSvcClipboardReturnMsg( VBOXCLIPBOARDCLIENTDATA *pClient, VBOXHGCMSVCPARM paParms[])202 static bool vboxSvcClipboardReturnMsg(PVBOXCLIPBOARDSVCCTX pSvcCtx, VBOXHGCMSVCPARM paParms[]) 203 203 { 204 204 /* Message priority is taken into account. */ … … 254 254 } 255 255 256 void vboxSvcClipboardReportMsg( VBOXCLIPBOARDCLIENTDATA *pClient, uint32_t u32Msg, uint32_t u32Formats)256 void vboxSvcClipboardReportMsg(PVBOXCLIPBOARDSVCCTX pSvcCtx, uint32_t u32Msg, uint32_t u32Formats) 257 257 { 258 258 AssertPtrReturnVoid(pClient); … … 366 366 RT_NOREF(u32ClientID); 367 367 368 VBOXCLIPBOARDCLIENTDATA *pClient = (VBOXCLIPBOARDCLIENTDATA *)pvClient;368 PVBOXCLIPBOARDSVCCTX pSvcCtx = (PVBOXCLIPBOARDSVCCTX)pvClient; 369 369 370 370 LogFunc(("u32ClientID = %d\n", u32ClientID)); … … 386 386 { 387 387 RT_NOREF(fRequestor, fRestoring); 388 VBOXCLIPBOARDCLIENTDATA *pClient = (VBOXCLIPBOARDCLIENTDATA *)pvClient;388 PVBOXCLIPBOARDSVCCTX pSvcCtx = (PVBOXCLIPBOARDSVCCTX)pvClient; 389 389 390 390 int rc = VINF_SUCCESS; … … 431 431 u32ClientID, u32Function, cParms, paParms)); 432 432 433 VBOXCLIPBOARDCLIENTDATA *pClient = (VBOXCLIPBOARDCLIENTDATA *)pvClient;433 PVBOXCLIPBOARDSVCCTX pSvcCtx = (PVBOXCLIPBOARDSVCCTX)pvClient; 434 434 435 435 bool fAsynchronousProcessing = false; … … 713 713 * then complete it, otherwise return. See the protocol description in the 714 714 * shared clipboard module description. */ 715 void vboxSvcClipboardCompleteReadData( VBOXCLIPBOARDCLIENTDATA *pClient, int rc, uint32_t cbActual)715 void vboxSvcClipboardCompleteReadData(PVBOXCLIPBOARDSVCCTX pSvcCtx, int rc, uint32_t cbActual) 716 716 { 717 717 VBOXHGCMCALLHANDLE callHandle = NULL; … … 804 804 static SSMFIELD const g_aClipboardClientDataFields[] = 805 805 { 806 SSMFIELD_ENTRY(VBOXCLIPBOARD CLIENTDATA, u32ClientID), /* for validation purposes */807 SSMFIELD_ENTRY(VBOXCLIPBOARD CLIENTDATA, fHostMsgQuit),808 SSMFIELD_ENTRY(VBOXCLIPBOARD CLIENTDATA, fHostMsgReadData),809 SSMFIELD_ENTRY(VBOXCLIPBOARD CLIENTDATA, fHostMsgFormats),810 SSMFIELD_ENTRY(VBOXCLIPBOARD CLIENTDATA, u32RequestedFormat),806 SSMFIELD_ENTRY(VBOXCLIPBOARDSVCCTX, u32ClientID), /* for validation purposes */ 807 SSMFIELD_ENTRY(VBOXCLIPBOARDSVCCTX, fHostMsgQuit), 808 SSMFIELD_ENTRY(VBOXCLIPBOARDSVCCTX, fHostMsgReadData), 809 SSMFIELD_ENTRY(VBOXCLIPBOARDSVCCTX, fHostMsgFormats), 810 SSMFIELD_ENTRY(VBOXCLIPBOARDSVCCTX, u32RequestedFormat), 811 811 SSMFIELD_ENTRY_TERM() 812 812 }; … … 826 826 LogFunc(("u32ClientID = %d\n", u32ClientID)); 827 827 828 VBOXCLIPBOARDCLIENTDATA *pClient = (VBOXCLIPBOARDCLIENTDATA *)pvClient;828 PVBOXCLIPBOARDSVCCTX pSvcCtx = (PVBOXCLIPBOARDSVCCTX)pvClient; 829 829 830 830 /* This field used to be the length. We're using it as a version field … … 891 891 LogFunc(("u32ClientID = %d\n", u32ClientID)); 892 892 893 VBOXCLIPBOARDCLIENTDATA *pClient = (VBOXCLIPBOARDCLIENTDATA *)pvClient;893 PVBOXCLIPBOARDSVCCTX pSvcCtx = (PVBOXCLIPBOARDSVCCTX)pvClient; 894 894 895 895 /* Existing client can not be in async state yet. */ … … 1053 1053 g_pHelpers = ptable->pHelpers; 1054 1054 1055 ptable->cbClient = sizeof(VBOXCLIPBOARD CLIENTDATA);1055 ptable->cbClient = sizeof(VBOXCLIPBOARDSVCCTX); 1056 1056 1057 1057 ptable->pfnUnload = svcUnload; -
trunk/src/VBox/HostServices/SharedClipboard/testcase/tstClipboardServiceHost.cpp
r78578 r78579 26 26 extern "C" DECLCALLBACK(DECLEXPORT(int)) VBoxHGCMSvcLoad (VBOXHGCMSVCFNTABLE *ptable); 27 27 28 static VBOXCLIPBOARD CLIENTDATAg_Client;28 static VBOXCLIPBOARDSVCCTX g_Client; 29 29 static VBOXHGCMSVCHELPERS g_Helpers = { NULL }; 30 30
Note:
See TracChangeset
for help on using the changeset viewer.