VirtualBox

Ignore:
Timestamp:
Oct 14, 2021 8:50:31 PM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
147502
Message:

VBoxTray/VBoxClipboard: Use VbglR3ClipboardWriteDataEx instead of the legacy function for writing the empty reply on failure. I don't think the host really support the client switching between context and non-context mode. bugref:10094

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxClipboard.cpp

    r90054 r91746  
    538538            const SHCLFORMAT fFormat = (uint32_t)pEvent->u.fReadData;
    539539
     540            LogFlowFunc(("SHCL_WIN_WM_READ_DATA: fFormat=%#x\n", fFormat));
     541
     542            int rc = SharedClipboardWinOpen(hwnd);
    540543            HANDLE hClip = NULL;
    541 
    542             LogFlowFunc(("SHCL_WIN_WM_READ_DATA: fFormat=%#x\n", fFormat));
    543 
    544             int rc = SharedClipboardWinOpen(hwnd);
    545544            if (RT_SUCCESS(rc))
    546545            {
     
    558557                        }
    559558                        else
    560                         {
    561559                            hClip = NULL;
    562                         }
    563560                    }
    564561                }
     
    577574                        }
    578575                        else
    579                         {
    580576                            hClip = NULL;
    581                         }
    582577                    }
    583578                }
     
    598593                            }
    599594                            else
    600                             {
    601595                                hClip = NULL;
    602                             }
    603596                        }
    604597                    }
    605598                }
     599
    606600                if (hClip == NULL)
    607                 {
    608601                    LogFunc(("SHCL_WIN_WM_READ_DATA: hClip=NULL, lastError=%ld\n", GetLastError()));
    609602
    610                     /* Requested clipboard format is not available, send empty data. */
    611                     VbglR3ClipboardWriteData(pCtx->CmdCtx.idClient, VBOX_SHCL_FMT_NONE, NULL, 0);
    612                 }
    613 
    614603                SharedClipboardWinClose();
    615604            }
     605
     606            /* If the requested clipboard format is not available, we must send empty data. */
     607            if (hClip == NULL)
     608                VbglR3ClipboardWriteDataEx(&pEvent->cmdCtx, VBOX_SHCL_FMT_NONE, NULL, 0);
    616609            break;
    617610        }
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette