Skip to content

Commit

Permalink
Add comment documenting why we can't use a simpler solution
Browse files Browse the repository at this point in the history
See #90144 for context.

r? @joshtriplett
  • Loading branch information
smmalis37 authored Oct 22, 2021
1 parent 68a698b commit c736c2a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions library/std/src/sys/windows/os.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,10 @@ pub fn temp_dir() -> PathBuf {
#[cfg(not(target_vendor = "uwp"))]
fn home_dir_crt() -> Option<PathBuf> {
unsafe {
// The magic constant -4 can be used as the token passed to GetUserProfileDirectoryW below
// instead of us having to go through these multiple steps to get a token. However this is
// not implemented on Windows 7, only Windows 8 and up. When we drop support for Windows 7
// we can simplify this code. See #90144 for details.
use crate::sys::handle::Handle;

let me = c::GetCurrentProcess();
Expand Down

0 comments on commit c736c2a

Please sign in to comment.