We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5f292ee commit 2e25593Copy full SHA for 2e25593
library/std/src/sys/pal/windows/os.rs
@@ -202,6 +202,8 @@ fn home_dir_crt() -> Option<PathBuf> {
202
|buf, mut sz| {
203
// GetUserProfileDirectoryW does not quite use the usual protocol for
204
// negotiating the buffer size, so we have to translate.
205
+ // We rely on the *undocumented* property that this function will always set the
206
+ // size, not just on failure.
207
match c::GetUserProfileDirectoryW(
208
ptr::without_provenance_mut(CURRENT_PROCESS_TOKEN),
209
buf,
0 commit comments