Changeset 78440 in vbox for trunk/src/VBox/Additions/WINNT/VBoxTray
- Timestamp:
- May 7, 2019 5:44:31 PM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 130440
- Location:
- trunk/src/VBox/Additions/WINNT/VBoxTray
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/VBoxTray/Makefile.kmk
r78307 r78440 52 52 VBoxClipboard.cpp \ 53 53 $(PATH_ROOT)/src/VBox/GuestHost/SharedClipboard/clipboard-win.cpp 54 ifdef VBOX_WITH_SHARED_CLIPBOARD_URI_LIST 55 VBoxTray_SOURCES += \ 56 $(PATH_ROOT)/src/VBox/GuestHost/SharedClipboard/ClipboardURIList.cpp \ 57 $(PATH_ROOT)/src/VBox/GuestHost/SharedClipboard/ClipboardURIObject.cpp \ 58 $(PATH_ROOT)/src/VBox/GuestHost/SharedClipboard/ClipboardPath.cpp \ 59 $(PATH_ROOT)/src/VBox/GuestHost/SharedClipboard/ClipboardDataObjectImpl-win.cpp \ 60 $(PATH_ROOT)/src/VBox/GuestHost/SharedClipboard/ClipboardEnumFormatEtcImpl-win.cpp \ 61 $(PATH_ROOT)/src/VBox/GuestHost/SharedClipboard/ClipboardStreamImpl-win.cpp 62 endif 54 63 endif 55 64 ifdef VBOX_WITH_DRAG_AND_DROP -
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxClipboard.cpp
r78317 r78440 174 174 { 175 175 /* Insert the requested clipboard format data into the clipboard. */ 176 uint32_t u32Format = 0; 177 UINT format = (UINT)wParam; 178 179 LogFlowFunc(("WM_RENDERFORMAT, format = %x\n", format)); 180 switch (format) 176 uint32_t fFormat = VBOX_SHARED_CLIPBOARD_FMT_NONE; 177 178 const UINT cfFormat = (UINT)wParam; 179 switch (cfFormat) 181 180 { 182 181 case CF_UNICODETEXT: 183 u32Format |= VBOX_SHARED_CLIPBOARD_FMT_UNICODETEXT;182 fFormat = VBOX_SHARED_CLIPBOARD_FMT_UNICODETEXT; 184 183 break; 185 184 186 185 case CF_DIB: 187 u32Format |= VBOX_SHARED_CLIPBOARD_FMT_BITMAP;186 fFormat = VBOX_SHARED_CLIPBOARD_FMT_BITMAP; 188 187 break; 189 188 189 #ifdef VBOX_WITH_SHARED_CLIPBOARD_URI_LIST 190 case CF_HDROP: 191 fFormat = VBOX_SHARED_CLIPBOARD_FMT_URI_LIST; 192 break; 193 #endif 190 194 default: 191 if ( format >= 0xC000)195 if (cfFormat >= 0xC000) /** @todo r=andy Explain. */ 192 196 { 193 TCHAR szFormatName[256]; 194 195 int cActual = GetClipboardFormatName( format, szFormatName, sizeof(szFormatName) / sizeof(TCHAR));197 TCHAR szFormatName[256]; /** @todo r=andy Do we need Unicode support here as well? */ 198 199 int cActual = GetClipboardFormatName(cfFormat, szFormatName, sizeof(szFormatName) / sizeof(TCHAR)); 196 200 if (cActual) 197 201 { 198 202 if (strcmp(szFormatName, "HTML Format") == 0) 199 { 200 u32Format |= VBOX_SHARED_CLIPBOARD_FMT_HTML; 201 } 203 fFormat = VBOX_SHARED_CLIPBOARD_FMT_HTML; 202 204 } 203 205 } … … 205 207 } 206 208 207 if (u32Format == 0) 209 LogFunc(("WM_RENDERFORMAT: format=%u -> fFormat=0x%x\n", cfFormat, fFormat)); 210 211 if (fFormat == VBOX_SHARED_CLIPBOARD_FMT_NONE) 208 212 { 209 213 /* Unsupported clipboard format is requested. */ 210 Log FlowFunc(("Unsupported clipboard format requested: %ld\n", u32Format));214 LogRel(("Clipboard: Unsupported clipboard format requested (0x%x)\n", fFormat)); 211 215 VBoxClipboardWinClear(); 212 216 } 217 #ifdef VBOX_WITH_SHARED_CLIPBOARD_URI_LIST 218 else if (fFormat == VBOX_SHARED_CLIPBOARD_FMT_URI_LIST) 219 { 220 221 } 222 #endif 213 223 else 214 224 { 215 const uint32_t cbPrealloc = 4096; /** @todo r=andy Make it dynamic for supporting larger text buffers! */225 const uint32_t cbPrealloc = _4K; 216 226 uint32_t cb = 0; 217 227 … … 228 238 { 229 239 /* Read the host data to the preallocated buffer. */ 230 int vboxrc = VbglR3ClipboardReadData(pCtx->u32ClientID, u32Format, pMem, cbPrealloc, &cb);240 int vboxrc = VbglR3ClipboardReadData(pCtx->u32ClientID, fFormat, pMem, cbPrealloc, &cb); 231 241 LogFlowFunc(("VbglR3ClipboardReadData returned with rc = %Rrc\n", vboxrc)); 232 242 … … 259 269 /* Read the host data to the preallocated buffer. */ 260 270 uint32_t cbNew = 0; 261 vboxrc = VbglR3ClipboardReadData(pCtx->u32ClientID, u32Format, pMem, cb, &cbNew);271 vboxrc = VbglR3ClipboardReadData(pCtx->u32ClientID, fFormat, pMem, cb, &cbNew); 262 272 LogFlowFunc(("VbglR3ClipboardReadData returned with rc = %Rrc, cb = %d, cbNew = %d\n", vboxrc, cb, cbNew)); 263 273 … … 287 297 * must have the exact string size. 288 298 */ 289 if ( u32Format == VBOX_SHARED_CLIPBOARD_FMT_UNICODETEXT)299 if (fFormat == VBOX_SHARED_CLIPBOARD_FMT_UNICODETEXT) 290 300 { 291 301 size_t cbActual = 0; … … 319 329 /* 'hMem' contains the host clipboard data. 320 330 * size is 'cb' and format is 'format'. */ 321 HANDLE hClip = SetClipboardData( format, hMem);331 HANDLE hClip = SetClipboardData(cfFormat, hMem); 322 332 LogFlowFunc(("WM_RENDERFORMAT hClip = %p\n", hClip)); 323 333 … … 362 372 { 363 373 /* Announce available formats. Do not insert data, they will be inserted in WM_RENDER*. */ 364 uint32_t u32Formats = (uint32_t)lParam;365 366 LogFlowFunc(("VBOX_WM_SHCLPB_SET_FORMATS: u32Formats=0x%x\n", u32Formats));374 VBOXCLIPBOARDFORMATS fFormats = (uint32_t)lParam; 375 376 LogFlowFunc(("VBOX_WM_SHCLPB_SET_FORMATS: fFormats=0x%x\n", fFormats)); 367 377 368 378 int vboxrc = VBoxClipboardWinOpen(hwnd); … … 373 383 HANDLE hClip = NULL; 374 384 375 if ( u32Formats & VBOX_SHARED_CLIPBOARD_FMT_UNICODETEXT)385 if (fFormats & VBOX_SHARED_CLIPBOARD_FMT_UNICODETEXT) 376 386 hClip = SetClipboardData(CF_UNICODETEXT, NULL); 377 387 378 if ( u32Formats & VBOX_SHARED_CLIPBOARD_FMT_BITMAP)388 if (fFormats & VBOX_SHARED_CLIPBOARD_FMT_BITMAP) 379 389 hClip = SetClipboardData(CF_DIB, NULL); 380 390 381 if ( u32Formats & VBOX_SHARED_CLIPBOARD_FMT_HTML)391 if (fFormats & VBOX_SHARED_CLIPBOARD_FMT_HTML) 382 392 { 383 393 UINT format = RegisterClipboardFormat("HTML Format"); … … 387 397 388 398 #ifdef VBOX_WITH_SHARED_CLIPBOARD_URI_LIST 389 if ( u32Formats & VBOX_SHARED_CLIPBOARD_FMT_URI_LIST)399 if (fFormats & VBOX_SHARED_CLIPBOARD_FMT_URI_LIST) 390 400 hClip = SetClipboardData(CF_HDROP, NULL); 391 401 #endif 402 403 /** @todo Implement more flexible clipboard precedence for supported formats. */ 404 405 if (hClip == NULL) 406 LogRel(("Clipboard: Unsupported format(s) from host (0x%x), ignoring\n", fFormats)); 407 392 408 VBoxClipboardWinClose(); 393 409 … … 479 495 if (hDrop) 480 496 { 481 vboxrc = VbglR3ClipboardWriteData(pCtx->u32ClientID, VBOX_SHARED_CLIPBOARD_FMT_URI_LIST,482 ); 497 /* vboxrc = VbglR3ClipboardWriteData(pCtx->u32ClientID, VBOX_SHARED_CLIPBOARD_FMT_URI_LIST, 498 );*/ 483 499 GlobalUnlock(hClip); 484 500 } … … 681 697 break; 682 698 683 LogF lowFunc(("Error getting host message, rc=%Rrc\n", rc));699 LogFunc(("Error getting host message, rc=%Rrc\n", rc)); 684 700 685 701 if (*pfShutdown) … … 701 717 * respond to WM_RENDERFORMAT message. */ 702 718 ::PostMessage(pWinCtx->hWnd, VBOX_CLIPBOARD_WM_SET_FORMATS, 0, u32Formats); 703 }704 719 break; 720 } 705 721 706 722 case VBOX_SHARED_CLIPBOARD_HOST_MSG_READ_DATA: … … 708 724 /* The host needs data in the specified format. */ 709 725 ::PostMessage(pWinCtx->hWnd, VBOX_CLIPBOARD_WM_READ_DATA, 0, u32Formats); 710 }711 726 break; 727 } 712 728 713 729 case VBOX_SHARED_CLIPBOARD_HOST_MSG_QUIT: … … 716 732 LogRel(("Clipboard: Terminating ...\n")); 717 733 ASMAtomicXchgBool(pfShutdown, true); 718 }719 734 break; 735 } 720 736 721 737 default: … … 725 741 /* Wait a bit before retrying. */ 726 742 RTThreadSleep(1000); 727 }728 743 break; 744 } 729 745 } 730 746 }
Note:
See TracChangeset
for help on using the changeset viewer.