Skip to content

We rely on an undocumented property of GetUserProfileDirectoryW #141254

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

Open
RalfJung opened this issue May 19, 2025 · 2 comments
Open

We rely on an undocumented property of GetUserProfileDirectoryW #141254

RalfJung opened this issue May 19, 2025 · 2 comments
Labels
C-bug Category: This is a bug. O-windows Operating system: Windows T-libs Relevant to the library team, which will review and decide on the PR/issue.

Comments

@RalfJung
Copy link
Member

The docs say that the size is written on failure, but in practice it is also written on success and we rely on that. See #141244 and rust-lang/miri#4332.

We shouldn't use system APIs outside their documented contract, so we should either adjust our implementation or get Microsoft to update the docs to promise this behavior we have been relying on.

Cc @ChrisDenton

@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label May 19, 2025
@RalfJung RalfJung added O-windows Operating system: Windows T-libs Relevant to the library team, which will review and decide on the PR/issue. labels May 19, 2025
@jieyouxu jieyouxu added C-bug Category: This is a bug. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels May 20, 2025
@workingjubilee
Copy link
Member

see MicrosoftDocs/sdk-api#1810

@ChrisDenton
Copy link
Member

Wait, I recognise that name.

I'd completely forgot about writing that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. O-windows Operating system: Windows T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants