Changeset 82528 in vbox
- Timestamp:
- Dec 10, 2019 2:35:26 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibClipboard.cpp
r82527 r82528 115 115 if (RT_SUCCESS(rc)) 116 116 { 117 pCtx->fGuestFeatures = fGuestFeatures; 117 118 LogRel2(("Shared Clipboard: Host features: %#RX64\n", pCtx->fHostFeatures)); 118 119 if ( (pCtx->fHostFeatures & VBOX_SHCL_HF_0_CONTEXT_ID) … … 264 265 } Msg; 265 266 266 VBGL_HGCM_HDR_INIT(&Msg.Hdr, pCtx->idClient, VBOX_SHCL_GUEST_FN_MSG_GET, 3);267 Msg.id64Context.SetUInt 64(VBOX_SHCL_HOST_MSG_FORMATS_REPORT);267 VBGL_HGCM_HDR_INIT(&Msg.Hdr, pCtx->idClient, VBOX_SHCL_GUEST_FN_MSG_GET, 2); 268 Msg.id64Context.SetUInt32(VBOX_SHCL_HOST_MSG_FORMATS_REPORT); 268 269 Msg.f32Formats.SetUInt32(0); 269 270 … … 271 272 if (RT_SUCCESS(rc)) 272 273 { 273 rc = Msg. id64Context.GetUInt64(&pCtx->idContext);274 rc = Msg.f32Formats.GetUInt32(&pFormats->Formats); 274 275 AssertRC(rc); 275 int rc2 = Msg.f32Formats.GetUInt32(&pFormats->Formats); 276 AssertRCStmt(rc2, rc = rc2); 277 } 278 279 LogFlowFuncLeaveRC(rc); 280 return rc; 281 } 282 283 284 /** 285 * Receives a host request to read clipboard data from the guest. 276 } 277 278 LogFlowFuncLeaveRC(rc); 279 return rc; 280 } 281 282 283 /** 284 * Fetches a VBOX_SHCL_HOST_MSG_READ_DATA_CID message. 286 285 * 287 286 * @returns VBox status code. … … 289 288 * @param pfFormat Where to return the requested format. 290 289 */ 291 static int vbglR3Clipboard ReadDataRecv(PVBGLR3SHCLCMDCTX pCtx, PSHCLFORMAT pfFormat)290 static int vbglR3ClipboardFetchReadDataCid(PVBGLR3SHCLCMDCTX pCtx, PSHCLFORMAT pfFormat) 292 291 { 293 292 AssertPtrReturn(pCtx, VERR_INVALID_POINTER); … … 312 311 int rc2 = Msg.f32Format.GetUInt32(pfFormat); 313 312 AssertRCStmt(rc2, rc = rc2); 313 } 314 315 LogFlowFuncLeaveRC(rc); 316 return rc; 317 } 318 319 320 /** 321 * Fetches a VBOX_SHCL_HOST_MSG_READ_DATA message. 322 * 323 * @returns VBox status code. 324 * @param pCtx Shared Clipboard command context to use for the connection. 325 * @param pfFormat Where to return the requested format. 326 */ 327 static int vbglR3ClipboardFetchReadData(PVBGLR3SHCLCMDCTX pCtx, PSHCLFORMAT pfFormat) 328 { 329 AssertPtrReturn(pCtx, VERR_INVALID_POINTER); 330 AssertPtrReturn(pfFormat, VERR_INVALID_POINTER); 331 332 struct 333 { 334 VBGLIOCHGCMCALL Hdr; 335 HGCMFunctionParameter id32Msg; 336 HGCMFunctionParameter f32Format; 337 } Msg; 338 339 VBGL_HGCM_HDR_INIT(&Msg.Hdr, pCtx->idClient, VBOX_SHCL_GUEST_FN_MSG_GET, 2); 340 Msg.id32Msg.SetUInt32(VBOX_SHCL_HOST_MSG_READ_DATA); 341 Msg.f32Format.SetUInt32(0); 342 343 int rc = VbglR3HGCMCall(&Msg.Hdr, sizeof(Msg)); 344 if (RT_SUCCESS(rc)) 345 { 346 rc = Msg.f32Format.GetUInt32(pfFormat); 347 AssertRC(rc); 314 348 } 315 349 … … 487 521 * @note Restore check is only performed optimally with a 6.0 host. 488 522 */ 489 int VbglR3ClipboardMsgPeekWait(PVBGLR3SHCLCMDCTX pCtx, uint32_t *pidMsg, uint32_t *pcParameters, uint64_t *pidRestoreCheck) 523 VBGLR3DECL(int) VbglR3ClipboardMsgPeekWait(PVBGLR3SHCLCMDCTX pCtx, uint32_t *pidMsg, 524 uint32_t *pcParameters, uint64_t *pidRestoreCheck) 490 525 { 491 526 AssertPtrReturn(pidMsg, VERR_INVALID_POINTER); … … 2334 2369 } 2335 2370 2371 case VBOX_SHCL_HOST_MSG_READ_DATA_CID: 2372 { 2373 rc = vbglR3ClipboardFetchReadDataCid(pCtx, &pEvent->u.fReadData); 2374 if (RT_SUCCESS(rc)) 2375 pEvent->enmType = VBGLR3CLIPBOARDEVENTTYPE_READ_DATA; 2376 break; 2377 } 2378 2336 2379 case VBOX_SHCL_HOST_MSG_READ_DATA: 2337 2380 { 2338 rc = vbglR3Clipboard ReadDataRecv(pCtx, &pEvent->u.fReadData);2381 rc = vbglR3ClipboardFetchReadData(pCtx, &pEvent->u.fReadData); 2339 2382 if (RT_SUCCESS(rc)) 2340 2383 pEvent->enmType = VBGLR3CLIPBOARDEVENTTYPE_READ_DATA; … … 2351 2394 default: 2352 2395 { 2396 /** @todo r=bird: BUGBUG - need a skip command here! */ 2353 2397 rc = VERR_NOT_SUPPORTED; 2354 2398 break;
Note:
See TracChangeset
for help on using the changeset viewer.

