File tree Expand file tree Collapse file tree 2 files changed +32
-2
lines changed
library/std/src/sys/pal/windows Expand file tree Collapse file tree 2 files changed +32
-2
lines changed Original file line number Diff line number Diff line change @@ -501,3 +501,33 @@ compat_fn_with_fallback! {
501501}
502502#[ cfg( target_vendor = "rust9x" ) ]
503503pub use self :: SystemFunction036 as RtlGenRandom ;
504+
505+ #[ cfg( target_vendor = "rust9x" ) ]
506+ compat_fn_with_fallback ! {
507+ pub static userenv: & CStr = c"userenv" => { load: true , unicows: false } ;
508+ // >= NT 4.0
509+ // https://learn.microsoft.com/en-us/windows/win32/api/userenv/nf-userenv-getuserprofiledirectoryw
510+ pub fn GetUserProfileDirectoryW (
511+ htoken: HANDLE ,
512+ lpprofiledir: PWSTR ,
513+ lpcchsize: * mut u32
514+ ) -> BOOL {
515+ unsafe { SetLastError ( ERROR_CALL_NOT_IMPLEMENTED as u32 ) ; } ;
516+ FALSE
517+ }
518+ }
519+
520+ #[ cfg( target_vendor = "rust9x" ) ]
521+ compat_fn_with_fallback ! {
522+ pub static advapi32: & CStr = c"advapi32" => { load: true , unicows: false } ;
523+ // >= NT
524+ // https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-openprocesstoken
525+ pub fn OpenProcessToken (
526+ processhandle: HANDLE ,
527+ desiredaccess: TOKEN_ACCESS_MASK ,
528+ tokenhandle: * mut HANDLE
529+ ) -> BOOL {
530+ unsafe { SetLastError ( ERROR_CALL_NOT_IMPLEMENTED as u32 ) ; } ;
531+ FALSE
532+ }
533+ }
Original file line number Diff line number Diff line change @@ -320,7 +320,7 @@ pub fn temp_dir() -> PathBuf {
320320 super :: fill_utf16_buf ( |buf, sz| unsafe { c:: GetTempPath2W ( sz, buf) } , super :: os2path) . unwrap ( )
321321}
322322
323- #[ cfg( all( not( target_vendor = "uwp" ) , not( target_vendor = "win7" ) ) ) ]
323+ #[ cfg( all( not( target_vendor = "uwp" ) , not( target_vendor = "win7" ) , not ( target_vendor = "rust9x" ) ) ) ]
324324fn home_dir_crt ( ) -> Option < PathBuf > {
325325 unsafe {
326326 // Defined in processthreadsapi.h.
@@ -346,7 +346,7 @@ fn home_dir_crt() -> Option<PathBuf> {
346346 }
347347}
348348
349- #[ cfg( target_vendor = "win7" ) ]
349+ #[ cfg( any ( target_vendor = "win7" , target_vendor = "rust9x" ) ) ]
350350fn home_dir_crt ( ) -> Option < PathBuf > {
351351 unsafe {
352352 use crate :: sys:: handle:: Handle ;
You can’t perform that action at this time.
0 commit comments