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! {
514
514
}
515
515
#[ cfg( target_vendor = "rust9x" ) ]
516
516
pub 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 {
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