New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PreviewPane] Parse input window handle as IntPtr type instead of Int32 #32826
base: main
Are you sure you want to change the base?
Conversation
@Aaron-Junker For whatever reason the build timed out (not the recent geomagnetic storm right?) at building PowerRenameUI (totally unrelated), could you please manually trigger the CI build again? Only the x64 build failed while the arm64 build completed just fine within normal time. Thanks for your time! |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Note: The same fix should be applied to other preview pane handlers |
@stefansjfw Gotcha, thanks, should all other fixes be applied with this PR (preferred), or in separate PRs? I'll work on it once I heard back from you. |
GcodePreviewHandler MarkdownPreviewHandler PdfPreviewHandler QoiPreviewHandler SvgPreviewHandler
@Aaron-Junker I'd like to know your opinion as well. Should this fix be applied to all affected preview handlers? If so, could I might as well change the original issue title to something like "Preview handlers fail to handle 64-bit handles"? Edit: Since some decisions are not confirmed yet, this PR has been marked as draft. I will respond ASAP if there is any update. |
@z4pf1sh I think you can do all in one PR. Thank you! |
@microsoft-github-policy-service agree |
yes, all in one is ok. It's rather simple change to review |
@Aaron-Junker @stefansjfw Seems like the latest CI build failed for a problem (looks fixed) unrelated to this PR. Could you guys consider taking some time reviewing it and proceed to merging? I do not have the permission of requesting reviews directly from GitHub UI, and am thus making this separate request. Thanks! |
Can you merge latest main into your branch and push? Should help with the CI fail. This likely won't make it into the next release (will happen soon). So it might take some time to get this in |
@stefansjfw Gotcha, done, it's fixed. Thanks for the help of you guys! |
Summary of the Pull Request
Fixes a problem where File Explorer preview handlers may crash when receiving 64-bit handles that are out of the 32-bit range.
PR Checklist
Detailed Description of the Pull Request / Additional comments
In some cases, a 64-bit Windows installation may pass a negative 64-bit handle to preview handlers, causing the current implementation (by parsing input handle as
Int32
) to fail. See the associated issue for details.Affected (and fixed) preview handlers:
GcodePreviewHandler
MarkdownPreviewHandler
MonacoPreviewHandler
PdfPreviewHandler
QoiPreviewHandler
SvgPreviewHandler
This is a very rare case as I have personally never encountered this bug in months of use, till today. It was fixed with an improved input parsing process.
Validation Steps Performed
The updated implementation works just as the old implementation before with 32-bit handles, and can be verified in C# Interactive Window with this simple one-liner:
Yet it works correctly with the value demonstrated in the issue: