Changeset 87082 in vbox for trunk/src/VBox/Additions
- Timestamp:
- Dec 10, 2020 10:01:11 AM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 141862
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/x11/VBoxClient/clipboard.cpp
r86969 r87082 103 103 * @returns VBox status code. VERR_NO_DATA if no data available. 104 104 * @param pCtx Our context information. 105 * @param Format The format of the data being requested. 106 * @param ppv On success and if pcb > 0, this will point to a buffer 107 * to be freed with RTMemFree containing the data read. 108 * @param pcb On success, this contains the number of bytes of data returned. 109 */ 110 DECLCALLBACK(int) ShClX11RequestDataForX11Callback(PSHCLCONTEXT pCtx, SHCLFORMAT Format, void **ppv, uint32_t *pcb) 111 { 112 RT_NOREF(pCtx); 113 114 LogFlowFunc(("Format=0x%x\n", Format)); 105 * @param uFmt The format of the data being requested. 106 * @param ppv Returns an allocated buffer with data read from the host on success. 107 * Needs to be free'd with RTMemFree() by the caller. 108 * @param pcb Returns the amount of data read (in bytes) on success. 109 */ 110 DECLCALLBACK(int) ShClX11RequestDataForX11Callback(PSHCLCONTEXT pCtx, SHCLFORMAT uFmt, void **ppv, uint32_t *pcb) 111 { 112 LogFlowFunc(("pCtx=%p, uFmt=%#x\n", pCtx, uFmt)); 115 113 116 114 int rc = VINF_SUCCESS; 117 115 118 uint32_t cbRead = 0;119 120 116 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 121 if ( Format == VBOX_SHCL_FMT_URI_LIST)117 if (uFmt == VBOX_SHCL_FMT_URI_LIST) 122 118 { 123 119 //rc = VbglR3ClipboardRootListRead() 120 121 rc = VERR_NO_DATA; 124 122 } 125 123 else 126 124 #endif 127 125 { 126 uint32_t cbRead = 0; 127 128 128 uint32_t cbData = _4K; /** @todo Make this dynamic. */ 129 129 void *pvData = RTMemAlloc(cbData); 130 130 if (pvData) 131 131 { 132 rc = VbglR3ClipboardReadDataEx(&pCtx->CmdCtx, Format, pvData, cbData, &cbRead);132 rc = VbglR3ClipboardReadDataEx(&pCtx->CmdCtx, uFmt, pvData, cbData, &cbRead); 133 133 } 134 134 else … … 148 148 if (pvData) 149 149 { 150 rc = VbglR3ClipboardReadDataEx(&pCtx->CmdCtx, Format, pvData, cbData, &cbRead);150 rc = VbglR3ClipboardReadDataEx(&pCtx->CmdCtx, uFmt, pvData, cbData, &cbRead); 151 151 if (rc == VINF_BUFFER_OVERFLOW) 152 152 rc = VERR_BUFFER_OVERFLOW; … … 176 176 } 177 177 178 if (RT_FAILURE(rc)) 179 LogRel(("Requesting data in format %#x from host failed with %Rrc\n", uFmt, rc)); 180 178 181 LogFlowFuncLeaveRC(rc); 179 182 return rc; … … 201 204 RT_NOREF(pCtx); 202 205 203 LogFlowFunc((" Formats=0x%x\n", fFormats));206 LogFlowFunc(("fFormats=%#x\n", fFormats)); 204 207 205 208 int rc2 = VbglR3ClipboardReportFormats(pCtx->CmdCtx.idClient, fFormats);
Note:
See TracChangeset
for help on using the changeset viewer.