Changeset 4711 in vbox for trunk/src/VBox/Additions/WINNT
- Timestamp:
- Sep 11, 2007 1:49:44 PM (18 years ago)
- svn:sync-xref-src-repo-rev:
- 24381
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/VBoxService/VBoxClipboard.cpp
r4071 r4711 20 20 #include <VBox/HostServices/VBoxClipboardSvc.h> 21 21 #include "helpers.h" 22 #include <iprt/asm.h> 22 23 23 24 typedef struct _VBOXCLIPBOARDCONTEXT … … 38 39 // uint64_t u64LastSentCRC64; 39 40 40 bool fAnnouncing;41 volatile uint32_t u32Announcing; 41 42 42 43 } VBOXCLIPBOARDCONTEXT; … … 335 336 dprintf (("vboxClipboardProcessMsg: WM_DRAWCLIPBOARD, hwnd %p\n", pCtx->hwnd)); 336 337 337 if (!pCtx->fAnnouncing) 338 { 338 if (ASMAtomicCmpXchgU32 (&pCtx->u32Announcing, 0, 1) == false) 339 { 340 /* Could not do 1->0 transition. That means u32Announcing is 0. */ 339 341 vboxClipboardChanged (pCtx); 340 342 } … … 356 358 UINT format = (UINT)wParam; 357 359 360 dprintf (("vboxClipboardProcessMsg: WM_RENDERFORMAT, format %x\n", format)); 361 358 362 switch (format) 359 363 { … … 518 522 uint32_t u32Formats = (uint32_t)lParam; 519 523 520 /* Prevent the WM_DRAWCLIPBOARD processing. */521 pCtx->fAnnouncing = true;522 523 524 if (OpenClipboard (hwnd)) 524 525 { … … 530 531 { 531 532 dprintf(("window proc WM_USER: VBOX_SHARED_CLIPBOARD_FMT_UNICODETEXT\n")); 532 hClip = SetClipboardData (CF_UNICODETEXT, NULL); 533 534 /* Prevent the WM_DRAWCLIPBOARD processing. Will be reset in WM_DRAWCLIPBOARD. */ 535 if (ASMAtomicCmpXchgU32 (&pCtx->u32Announcing, 1, 0) == true) 536 { 537 hClip = SetClipboardData (CF_UNICODETEXT, NULL); 538 } 533 539 } 534 540 … … 536 542 { 537 543 dprintf(("window proc WM_USER: VBOX_SHARED_CLIPBOARD_FMT_BITMAP\n")); 538 hClip = SetClipboardData (CF_DIB, NULL); 544 545 /* Prevent the WM_DRAWCLIPBOARD processing. Will be reset in WM_DRAWCLIPBOARD. */ 546 if (ASMAtomicCmpXchgU32 (&pCtx->u32Announcing, 1, 0) == true) 547 { 548 hClip = SetClipboardData (CF_DIB, NULL); 549 } 539 550 } 540 551 … … 545 556 if (format != 0) 546 557 { 547 hClip = SetClipboardData (format, NULL); 558 /* Prevent the WM_DRAWCLIPBOARD processing. Will be reset in WM_DRAWCLIPBOARD. */ 559 if (ASMAtomicCmpXchgU32 (&pCtx->u32Announcing, 1, 0) == true) 560 { 561 hClip = SetClipboardData (format, NULL); 562 } 548 563 } 549 564 } … … 551 566 CloseClipboard(); 552 567 553 dprintf(("window proc WM_USER: hClip %p \n", hClip));568 dprintf(("window proc WM_USER: hClip %p, err %d\n", hClip, GetLastError ())); 554 569 } 555 570 else … … 557 572 dprintf(("window proc WM_USER: failed to open clipboard\n")); 558 573 } 559 560 pCtx->fAnnouncing = false;561 574 } break; 562 575
Note:
See TracChangeset
for help on using the changeset viewer.