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 @@ -514,3 +514,33 @@ compat_fn_with_fallback! {
514514}
515515#[ cfg( target_vendor = "rust9x" ) ]
516516pub use self :: SystemFunction036 as RtlGenRandom ;
517+
518+ #[ cfg( target_vendor = "rust9x" ) ]
519+ compat_fn_with_fallback ! {
520+ pub static userenv: & CStr = c"userenv" => { load: true , unicows: false } ;
521+ // >= NT 4.0
522+ // https://learn.microsoft.com/en-us/windows/win32/api/userenv/nf-userenv-getuserprofiledirectoryw
523+ pub fn GetUserProfileDirectoryW (
524+ htoken: HANDLE ,
525+ lpprofiledir: PWSTR ,
526+ lpcchsize: * mut u32
527+ ) -> BOOL {
528+ unsafe { SetLastError ( ERROR_CALL_NOT_IMPLEMENTED as u32 ) ; } ;
529+ FALSE
530+ }
531+ }
532+
533+ #[ cfg( target_vendor = "rust9x" ) ]
534+ compat_fn_with_fallback ! {
535+ pub static advapi32: & CStr = c"advapi32" => { load: true , unicows: false } ;
536+ // >= NT
537+ // https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-openprocesstoken
538+ pub fn OpenProcessToken (
539+ processhandle: HANDLE ,
540+ desiredaccess: TOKEN_ACCESS_MASK ,
541+ tokenhandle: * mut HANDLE
542+ ) -> BOOL {
543+ unsafe { SetLastError ( ERROR_CALL_NOT_IMPLEMENTED as u32 ) ; } ;
544+ FALSE
545+ }
546+ }
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