Skip to content
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

Fix KnownFolder for x86 Windows #17705

Merged
merged 2 commits into from
Dec 15, 2024
Merged

Conversation

stevemonaco
Copy link
Contributor

@stevemonaco stevemonaco commented Dec 6, 2024

What does the pull request do?

Fixes an AccessViolationException when StorageProvider.TryGetWellKnownFolderAsync(WellKnownFolder.Downloads) is called on Windows x86.

What is the current behavior?

AccessViolationException on Windows x86, works on Windows x64. Unknown on Windows ARM.

What is the updated/expected behavior with this PR?

Works on Windows x86/x64. Untested on Windows ARM (no device to test with).

How was the solution implemented (if it's not obvious)?

Eliminate MarshalAs(UnmanagedType.LPStruct)] Guid in favor of Guid*. Suspect some marshaling difference is at play and prefer the directly blittable type.

Thanks to @tannergooding for guidance and overall style cleanups.

Removed try-finally as there aren't any exceptions to handle -- prototype version used an early return.

Checklist

Fixed issues

Fixes #17679

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.3.999-cibuild0053731-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@maxkatz6 maxkatz6 added bug os-windows backport-candidate-11.2.x Consider this PR for backporting to 11.2 branch labels Dec 6, 2024
@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.3.999-cibuild0053733-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

Copy link
Member

@MrJul MrJul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@MrJul MrJul added this pull request to the merge queue Dec 15, 2024
Merged via the queue into AvaloniaUI:master with commit 860879a Dec 15, 2024
11 checks passed
maxkatz6 pushed a commit that referenced this pull request Dec 19, 2024
* Fix KnownFolder for x86 Windows

* Remove try-finally
@maxkatz6 maxkatz6 added backported-11.2.x and removed backport-candidate-11.2.x Consider this PR for backporting to 11.2 branch labels Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

StorageProvider.TryGetWellKnownFolderAsync - System.AccessViolationException
5 participants