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! {
501
501
}
502
502
#[ cfg( target_vendor = "rust9x" ) ]
503
503
pub 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 {
320
320
super :: fill_utf16_buf ( |buf, sz| unsafe { c:: GetTempPath2W ( sz, buf) } , super :: os2path) . unwrap ( )
321
321
}
322
322
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" ) ) ) ]
324
324
fn home_dir_crt ( ) -> Option < PathBuf > {
325
325
unsafe {
326
326
// Defined in processthreadsapi.h.
@@ -346,7 +346,7 @@ fn home_dir_crt() -> Option<PathBuf> {
346
346
}
347
347
}
348
348
349
- #[ cfg( target_vendor = "win7" ) ]
349
+ #[ cfg( any ( target_vendor = "win7" , target_vendor = "rust9x" ) ) ]
350
350
fn home_dir_crt ( ) -> Option < PathBuf > {
351
351
unsafe {
352
352
use crate :: sys:: handle:: Handle ;
You can’t perform that action at this time.
0 commit comments