Changeset 100450 in vbox for trunk/src/VBox
- Timestamp:
- Jul 10, 2023 11:03:30 AM (17 months ago)
- Location:
- trunk/src/VBox
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxClipboard.cpp
r100433 r100450 515 515 case WM_RENDERFORMAT: /* Guest wants to render the clipboard data. */ 516 516 { 517 LogFunc(("WM_RENDERFORMAT\n"));518 519 517 /* Insert the requested clipboard format data into the clipboard. */ 520 const UINT cfFormat = (UINT)wParam; 521 522 const SHCLFORMAT fFormat = SharedClipboardWinClipboardFormatToVBox(cfFormat); 523 524 LogFunc(("WM_RENDERFORMAT: cfFormat=%u -> fFormat=0x%x\n", cfFormat, fFormat)); 525 518 const UINT uFmtWin = (UINT)wParam; 519 const SHCLFORMAT uFmtVBox = SharedClipboardWinClipboardFormatToVBox(uFmtWin); 520 521 LogFunc(("WM_RENDERFORMAT: uFmtWin=%u -> uFmtVBox=0x%x\n", uFmtWin, uFmtVBox)); 526 522 #ifdef LOG_ENABLED 527 char *pszFmts = ShClFormatsToStrA( fFormat);523 char *pszFmts = ShClFormatsToStrA(uFmtVBox); 528 524 AssertPtrReturn(pszFmts, 0); 529 LogRel(("Shared Clipboard: Rendering Windows format %#x as VBox format '%s'\n", cfFormat, pszFmts));525 LogRel(("Shared Clipboard: Rendering Windows format %#x as VBox format '%s'\n", uFmtWin, pszFmts)); 530 526 RTStrFree(pszFmts); 531 527 #endif 532 if ( fFormat== VBOX_SHCL_FMT_NONE)528 if (uFmtVBox == VBOX_SHCL_FMT_NONE) 533 529 { 534 LogRel(("Shared Clipboard: Unsupported format (%#x) requested\n", cfFormat));530 LogRel(("Shared Clipboard: Unsupported format (%#x) requested\n", uFmtWin)); 535 531 SharedClipboardWinClear(); 536 532 } … … 548 544 { 549 545 /* Read the host data to the preallocated buffer. */ 550 int rc = VbglR3ClipboardReadDataEx(&pCtx->CmdCtx, fFormat, pvMem, cbPrealloc, &cb);546 int rc = VbglR3ClipboardReadDataEx(&pCtx->CmdCtx, uFmtVBox, pvMem, cbPrealloc, &cb); 551 547 if (RT_SUCCESS(rc)) 552 548 { … … 575 571 /* Read the host data to the preallocated buffer. */ 576 572 uint32_t cbNew = 0; 577 rc = VbglR3ClipboardReadDataEx(&pCtx->CmdCtx, fFormat, pvMem, cb, &cbNew);573 rc = VbglR3ClipboardReadDataEx(&pCtx->CmdCtx, uFmtVBox, pvMem, cb, &cbNew); 578 574 if ( RT_SUCCESS(rc) 579 575 && cbNew <= cb) … … 608 604 * must have the exact string size. 609 605 */ 610 if ( fFormat== VBOX_SHCL_FMT_UNICODETEXT)606 if (uFmtVBox == VBOX_SHCL_FMT_UNICODETEXT) 611 607 { 612 608 size_t cwcActual = 0; … … 625 621 } 626 622 } 627 else if ( fFormat== VBOX_SHCL_FMT_HTML)623 else if (uFmtVBox == VBOX_SHCL_FMT_HTML) 628 624 { 629 625 /* Wrap content into CF_HTML clipboard format if needed. */ … … 678 674 /* 'hMem' contains the host clipboard data. 679 675 * size is 'cb' and format is 'format'. */ 680 HANDLE hClip = SetClipboardData( cfFormat, hMem);676 HANDLE hClip = SetClipboardData(uFmtWin, hMem); 681 677 if (hClip) 682 678 { -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-win.cpp
r100432 r100450 496 496 case WM_RENDERFORMAT: 497 497 { 498 LogFunc(("WM_RENDERFORMAT\n"));499 500 498 /* Insert the requested clipboard format data into the clipboard. */ 501 const UINT uFormat = (UINT)wParam; 502 const SHCLFORMAT fFormat = SharedClipboardWinClipboardFormatToVBox(uFormat); 503 LogFunc(("WM_RENDERFORMAT: uFormat=%u -> fFormat=0x%x\n", uFormat, fFormat)); 504 505 if ( fFormat == VBOX_SHCL_FMT_NONE 499 const UINT uFmtWin = (UINT)wParam; 500 const SHCLFORMAT uFmtVBox = SharedClipboardWinClipboardFormatToVBox(uFmtWin); 501 502 LogFunc(("WM_RENDERFORMAT: uFmtWin=%u -> uFmtVBox=0x%x\n", uFmtWin, uFmtVBox)); 503 #ifdef LOG_ENABLED 504 char *pszFmts = ShClFormatsToStrA(uFmtVBox); 505 AssertPtrReturn(pszFmts, 0); 506 LogRel(("Shared Clipboard: Rendering Windows format %#x as VBox format '%s'\n", uFmtWin, pszFmts)); 507 RTStrFree(pszFmts); 508 #endif 509 if ( uFmtVBox == VBOX_SHCL_FMT_NONE 506 510 || pCtx->pClient == NULL) 507 511 { … … 514 518 void *pvData = NULL; 515 519 uint32_t cbData = 0; 516 int rc = ShClSvcReadDataFromGuest(pCtx->pClient, uF ormat, &pvData, &cbData);520 int rc = ShClSvcReadDataFromGuest(pCtx->pClient, uFmtVBox, &pvData, &cbData); 517 521 if ( RT_SUCCESS(rc) 518 522 && pvData … … 520 524 { 521 525 /* Wrap HTML clipboard content info CF_HTML format if needed. */ 522 if ( fFormat== VBOX_SHCL_FMT_HTML526 if (uFmtVBox == VBOX_SHCL_FMT_HTML 523 527 && !SharedClipboardWinIsCFHTML((char *)pvData)) 524 528 { … … 537 541 } 538 542 539 rc = SharedClipboardWinDataWrite(uF ormat, pvData, cbData);543 rc = SharedClipboardWinDataWrite(uFmtWin, pvData, cbData); 540 544 if (RT_FAILURE(rc)) 541 545 LogRel(("Shared Clipboard: Setting clipboard data for Windows host failed with %Rrc\n", rc));
Note:
See TracChangeset
for help on using the changeset viewer.