-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix conhost clipboard handling bugs (#16457)
conhost has 2 bugs related to clipboard handling: * Missing retry on `OpenClipboard`: When copying to the clipboard explorer.exe is very eager to open the clipboard and peek into it. I'm not sure why it happens, but I can see `CFSDropTarget` in the call stack. It uses COM RPC and so this takes ~20ms every time. That breaks conhost's clipboard randomly during `ConsoleBench`. During non-benchmarks I expect this to break during RDP. * Missing null-terminator check during paste: `CF_UNICODETEXT` is documented to be a null-terminated string, which conhost v2 failed to handle as it relied entirely on `GlobalSize`. Additionally, this changeset simplifies the `HGLOBAL` code slightly by adding `_copyToClipboard` to abstract it away. ## Validation Steps Performed * `ConsoleBench` (#16453) doesn't fail randomly anymore ✅
- Loading branch information
Showing
2 changed files
with
79 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters