Changeset 78625 in vbox for trunk/src/VBox
- Timestamp:
- May 21, 2019 9:47:03 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-win.cpp
r78623 r78625 162 162 Assert(pCtx->pClientData); 163 163 Assert(pCtx->hRenderEvent); 164 Assert(pCtx->pClientData-> data.pv == NULL && pCtx->pClientData->data.cb == 0 && pCtx->pClientData->data.u32Format == 0);164 Assert(pCtx->pClientData->State.data.pv == NULL && pCtx->pClientData->State.data.cb == 0 && pCtx->pClientData->State.data.u32Format == 0); 165 165 166 166 LogFlowFunc(("fFormat=%02X\n", fFormat)); … … 300 300 301 301 LogFunc(("vboxClipboardReadDataFromClient rc = %Rrc, pv %p, cb %d, u32Format %d\n", 302 rc, pCtx->pClientData-> data.pv, pCtx->pClientData->data.cb, pCtx->pClientData->data.u32Format));302 rc, pCtx->pClientData->State.data.pv, pCtx->pClientData->State.data.cb, pCtx->pClientData->State.data.u32Format)); 303 303 304 304 if ( RT_SUCCESS (rc) 305 && pCtx->pClientData-> data.pv != NULL306 && pCtx->pClientData-> data.cb > 0307 && pCtx->pClientData-> data.u32Format == fFormat)308 { 309 HANDLE hMem = GlobalAlloc(GMEM_DDESHARE | GMEM_MOVEABLE, pCtx->pClientData-> data.cb);305 && pCtx->pClientData->State.data.pv != NULL 306 && pCtx->pClientData->State.data.cb > 0 307 && pCtx->pClientData->State.data.u32Format == fFormat) 308 { 309 HANDLE hMem = GlobalAlloc(GMEM_DDESHARE | GMEM_MOVEABLE, pCtx->pClientData->State.data.cb); 310 310 311 311 LogFunc(("hMem %p\n", hMem)); … … 321 321 LogFunc(("WM_RENDERFORMAT setting data\n")); 322 322 323 if (pCtx->pClientData-> data.pv)323 if (pCtx->pClientData->State.data.pv) 324 324 { 325 memcpy(pMem, pCtx->pClientData-> data.pv, pCtx->pClientData->data.cb);326 327 RTMemFree(pCtx->pClientData-> data.pv);328 pCtx->pClientData-> data.pv = NULL;325 memcpy(pMem, pCtx->pClientData->State.data.pv, pCtx->pClientData->State.data.cb); 326 327 RTMemFree(pCtx->pClientData->State.data.pv); 328 pCtx->pClientData->State.data.pv = NULL; 329 329 } 330 330 331 pCtx->pClientData-> data.cb = 0;332 pCtx->pClientData-> data.u32Format = 0;331 pCtx->pClientData->State.data.cb = 0; 332 pCtx->pClientData->State.data.u32Format = 0; 333 333 334 334 /* The memory must be unlocked before inserting to the Clipboard. */ … … 353 353 } 354 354 355 RTMemFree(pCtx->pClientData-> data.pv);356 pCtx->pClientData-> data.pv = NULL;357 pCtx->pClientData-> data.cb = 0;358 pCtx->pClientData-> data.u32Format = 0;355 RTMemFree(pCtx->pClientData->State.data.pv); 356 pCtx->pClientData->State.data.pv = NULL; 357 pCtx->pClientData->State.data.cb = 0; 358 pCtx->pClientData->State.data.u32Format = 0; 359 359 360 360 /* Something went wrong. */ … … 684 684 int VBoxClipboardSvcImplReadData(PVBOXCLIPBOARDCLIENTDATA pClientData, uint32_t u32Format, void *pv, uint32_t cb, uint32_t *pcbActual) 685 685 { 686 AssertPtrReturn(pClientData, VERR_INVALID_POINTER);686 AssertPtrReturn(pClientData, VERR_INVALID_POINTER); 687 687 AssertPtrReturn(pClientData->State.pCtx, VERR_INVALID_POINTER); 688 688 … … 823 823 * The guest returns data that was requested in the WM_RENDERFORMAT handler. 824 824 */ 825 Assert(pClientData-> data.pv == NULL && pClientData->data.cb == 0 && pClientData->data.u32Format == 0);825 Assert(pClientData->State.data.pv == NULL && pClientData->State.data.cb == 0 && pClientData->State.data.u32Format == 0); 826 826 827 827 vboxClipboardDump(pv, cb, u32Format); … … 841 841 if (pszResult != NULL && cbResult != 0) 842 842 { 843 pClientData-> data.pv = pszResult;844 pClientData-> data.cb = cbResult;845 pClientData-> data.u32Format = u32Format;843 pClientData->State.data.pv = pszResult; 844 pClientData->State.data.cb = cbResult; 845 pClientData->State.data.u32Format = u32Format; 846 846 } 847 847 } … … 849 849 else 850 850 { 851 pClientData-> data.pv = RTMemDup(pv, cb);852 if (pClientData-> data.pv)853 { 854 pClientData-> data.cb = cb;855 pClientData-> data.u32Format = u32Format;851 pClientData->State.data.pv = RTMemDup(pv, cb); 852 if (pClientData->State.data.pv) 853 { 854 pClientData->State.data.cb = cb; 855 pClientData->State.data.u32Format = u32Format; 856 856 } 857 857 }
Note:
See TracChangeset
for help on using the changeset viewer.