Changeset 81559 in vbox for trunk/src/VBox/Additions/common
- Timestamp:
- Oct 28, 2019 10:09:35 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibClipboard.cpp
r81460 r81559 94 94 VBOX_SHCL_GUEST_FN_CONNECT, VBOX_SHCL_CPARMS_CONNECT); 95 95 96 VbglHGCMParmUInt32Set(&Msg.uProtocolVer, 0);97 VbglHGCMParmUInt32Set(&Msg.uProtocolFlags, 0);98 96 VbglHGCMParmUInt32Set(&Msg.cbChunkSize, 0); 99 97 VbglHGCMParmUInt32Set(&Msg.enmCompression, 0); … … 103 101 if (RT_SUCCESS(rc)) 104 102 { 105 rc = VbglHGCMParmUInt32Get(&Msg.uProtocolVer, &pCtx->uProtocolVer); 106 if (RT_SUCCESS(rc)) 107 rc = VbglHGCMParmUInt32Get(&Msg.uProtocolFlags, &pCtx->uProtocolFlags); 108 if (RT_SUCCESS(rc)) 109 rc = VbglHGCMParmUInt32Get(&Msg.cbChunkSize, &pCtx->cbChunkSize); 103 rc = VbglHGCMParmUInt32Get(&Msg.cbChunkSize, &pCtx->cbChunkSize); 110 104 111 105 /** @todo Add / handle checksum + compression type. */ … … 116 110 * Report features to the host. 117 111 */ 118 uint64_t fHostFeatures0Ignored; 119 rc = VbglR3ClipboardReportFeatures(pCtx->uClientID, VBOX_SHCL_GF_NONE /* None yet */, 120 &fHostFeatures0Ignored); 112 const uint64_t fGuestFeatures = VBOX_SHCL_GF_0_CONTEXT_ID; 113 114 rc = VbglR3ClipboardReportFeatures(pCtx->uClientID, fGuestFeatures, 115 &pCtx->fHostFeatures); 121 116 if (RT_SUCCESS(rc)) 122 LogRel2(("Shared Clipboard: Host features: %#RX64\n", fHostFeatures0Ignored));117 LogRel2(("Shared Clipboard: Host features: %#RX64\n", pCtx->fHostFeatures)); 123 118 else 124 119 LogRel(("Shared Clipboard: Warning! Feature reporing failed: %Rrc\n", rc)); 120 121 pCtx->fUseLegacyProtocol = false; 125 122 } 126 123 } … … 128 125 { 129 126 /* If the above call fails, make sure to use some sane defaults for 130 * the old (legacy) protocol. */ 131 pCtx->uProtocolVer = 0; 132 pCtx->uProtocolFlags = 0; 133 pCtx->cbChunkSize = _64K; 127 * the old (legacy, VBox <= 6.1) protocol. */ 128 pCtx->fUseLegacyProtocol = true; 129 pCtx->cbChunkSize = _64K; /* Use 64KB as chunk size by default. */ 134 130 135 131 rc = VINF_SUCCESS; /* Failing above is not fatal. */ 136 132 } 137 133 138 LogFlowFunc(("uProtocolVer=%RU32, cbChunkSize=%RU32\n", pCtx->uProtocolVer, pCtx->cbChunkSize)); 139 140 LogRel2(("Shared Clipboard: Client %RU32 connected, using protocol v%RU32 (cbChunkSize=%RU32)\n", 141 pCtx->uClientID, pCtx->uProtocolVer, pCtx->cbChunkSize)); 142 134 LogFlowFunc(("fHostFeatures=%#RX64, cbChunkSize=%RU32\n", pCtx->fHostFeatures, pCtx->cbChunkSize)); 135 136 LogRel2(("Shared Clipboard: Client %RU32 connected (cbChunkSize=%RU32, fUseLegacyProtocol=%RTbool)\n", 137 pCtx->uClientID, pCtx->cbChunkSize, pCtx->fUseLegacyProtocol)); 143 138 } 144 139 … … 194 189 RT_ZERO(Msg); 195 190 196 if (pCtx->uProtocolVer >= 1) 197 { 198 VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, 199 VBOX_SHCL_GUEST_FN_MSG_GET, 3); 200 201 Msg.u.v1.uContext.SetUInt64(VBOX_SHCL_HOST_MSG_FORMATS_REPORT); 202 Msg.u.v1.uFormats.SetUInt32(0); 203 Msg.u.v1.fFlags.SetUInt32(0); 204 } 191 VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, VBOX_SHCL_GUEST_FN_MSG_GET, 3); 192 193 Msg.u.v1.uContext.SetUInt64(VBOX_SHCL_HOST_MSG_FORMATS_REPORT); 194 Msg.u.v1.uFormats.SetUInt32(0); 195 Msg.u.v1.fFlags.SetUInt32(0); 205 196 206 197 int rc = VbglR3HGCMCall(&Msg.hdr, sizeof(Msg)); … … 256 247 257 248 /** 258 * Get a host message, legacy version ( protocol v0). Do not use anymore.249 * Get a host message, legacy version (which does not have VBOX_SHCL_GUEST_FN_MSG_GET). Do not use anymore. 259 250 * 260 251 * Note: This is the old message which still is being used for the non-URI Shared Clipboard transfers, … … 2218 2209 2219 2210 #ifdef LOG_ENABLED 2220 LogFunc(("Handling idMsg=%RU32 (%s) , protocol v%RU32\n", idMsg, ShClHostMsgToStr(idMsg), pCtx->uProtocolVer));2211 LogFunc(("Handling idMsg=%RU32 (%s)\n", idMsg, ShClHostMsgToStr(idMsg))); 2221 2212 #endif 2222 2213 switch (idMsg) … … 2308 2299 LogFlowFunc(("uFormats=0x%x\n", pFormats->uFormats)); 2309 2300 2310 if (pCtx-> uProtocolVer == 0)2301 if (pCtx->fUseLegacyProtocol) 2311 2302 { 2312 2303 VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, VBOX_SHCL_GUEST_FN_FORMATS_REPORT, 1); … … 2402 2393 int rc; 2403 2394 2404 if (pCtx-> uProtocolVer == 0)2395 if (pCtx->fUseLegacyProtocol) 2405 2396 { 2406 2397 rc = VbglR3ClipboardWriteData(pCtx->uClientID, pData->uFormat, pData->pvData, pData->cbData);
Note:
See TracChangeset
for help on using the changeset viewer.