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