Changeset 85834 in vbox
- Timestamp:
- Aug 19, 2020 2:05:37 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 139994
- Location:
- trunk/src/VBox
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/x11/VBoxClient/clipboard.cpp
r85798 r85834 80 80 81 81 /** 82 * Getclipboard data from the host.82 * Callback implementation for getting clipboard data from the host. 83 83 * 84 * @returns VBox result code84 * @returns VBox status code. VERR_NO_DATA if no data available. 85 85 * @param pCtx Our context information. 86 86 * @param Format The format of the data being requested. 87 87 * @param ppv On success and if pcb > 0, this will point to a buffer 88 88 * to be freed with RTMemFree containing the data read. 89 * @param pcb On success, this contains the number of bytes of data 90 * returned. 89 * @param pcb On success, this contains the number of bytes of data returned. 91 90 */ 92 91 DECLCALLBACK(int) ShClX11RequestDataForX11Callback(PSHCLCONTEXT pCtx, SHCLFORMAT Format, void **ppv, uint32_t *pcb) … … 138 137 } 139 138 139 if (!cbRead) 140 rc = VERR_NO_DATA; 141 140 142 if (RT_SUCCESS(rc)) 141 143 { … … 143 145 *ppv = pvData; 144 146 } 145 146 /*147 * Catch other errors. This also catches the case in which the buffer was148 * too small a second time, possibly because the clipboard contents149 * changed half-way through the operation. Since we can't say whether or150 * not this is actually an error, we just return size 0.151 */152 if (RT_FAILURE(rc))147 else 148 { 149 /* 150 * Catch other errors. This also catches the case in which the buffer was 151 * too small a second time, possibly because the clipboard contents 152 * changed half-way through the operation. Since we can't say whether or 153 * not this is actually an error, we just return size 0. 154 */ 153 155 RTMemFree(pvData); 156 } 154 157 } 155 158 -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-x11.cpp
r85773 r85834 316 316 317 317 /** 318 * Reads clipboard data from the guest and passes it to the X11 clipboard.318 * Callback implementation for reading clipboard data from the guest. 319 319 * 320 320 * @note Runs in Xt event thread. 321 321 * 322 * @ param pCtx Pointer to the host clipboard structure.323 * @param fFormat The format in which the data should be transferred324 * (VBOX_SHCL_FMT_XXX).325 * @param ppv On success and if pcb > 0, this will point to a buffer326 * to be freed with RTMemFree containing the data read.327 * @param pcb On success, this contains the number of bytes of data328 * 322 * @returns VBox status code. VERR_NO_DATA if no data available. 323 * @param pCtx Pointer to the host clipboard structure. 324 * @param fFormat The format in which the data should be transferred 325 * (VBOX_SHCL_FMT_XXX). 326 * @param ppv On success and if pcb > 0, this will point to a buffer 327 * to be freed with RTMemFree containing the data read. 328 * @param pcb On success, this contains the number of bytes of data returned. 329 329 */ 330 330 DECLCALLBACK(int) ShClX11RequestDataForX11Callback(PSHCLCONTEXT pCtx, SHCLFORMAT fFormat, void **ppv, uint32_t *pcb) … … 356 356 if (RT_SUCCESS(rc)) 357 357 { 358 *ppv = pPayload ? pPayload->pvData : NULL; 359 *pcb = pPayload ? pPayload->cbData : 0; 358 if ( !pPayload 359 || !pPayload->cbData) 360 { 361 rc = VERR_NO_DATA; 362 } 363 else 364 { 365 *ppv = pPayload->pvData; 366 *pcb = pPayload->cbData; 367 } 360 368 } 361 369
Note:
See TracChangeset
for help on using the changeset viewer.