Handle RPC_E_CANTCALLOUT_ININPUTSYNCCALL in OfficeViewer resize#1862
Merged
Conversation
…nResize Co-authored-by: emako <24737061+emako@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix unhandled exception with XLSX and CSV files in QuickLook
Handle RPC_E_CANTCALLOUT_ININPUTSYNCCALL in OfficeViewer resize
Jan 16, 2026
emako
approved these changes
Jan 16, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes an unhandled COM exception that occurs when resizing XLSX and CSV file previews. The exception RPC_E_CANTCALLOUT_ININPUTSYNCCALL (0x8001010D) is thrown when SetRect is called on preview handlers during input-synchronous callbacks.
Changes:
- Added try-catch block around
SetRectcall inOnResizemethod to handle transient COM threading exception - Exception is safely ignored as subsequent resize events will successfully update the preview handler
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| var r = ClientRectangle; | ||
| _mCurrentPreviewHandler?.SetRect(ref r); | ||
| } | ||
| catch (COMException ex) when (ex.HResult == unchecked((int)0x8001010D)) |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
COM preview handlers throw
0x8001010D(RPC_E_CANTCALLOUT_ININPUTSYNCCALL) whenSetRectis called during input-synchronous callbacks. This manifests as unhandled exceptions when resizing XLSX/CSV previews.Changes
SetRectcall inPreviewHandlerHost.OnResizewith try-catch for HResult0x8001010DOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.