@@ -140,7 +140,7 @@ compat_fn_with_fallback! {
140
140
141
141
// >= Win8 / Server 2012
142
142
// https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getsystemtimepreciseasfiletime
143
- #[ cfg( target_vendor = "win7" ) ]
143
+ #[ cfg( any ( target_vendor = "win7" , target_vendor = "rust9x" ) ) ]
144
144
pub fn GetSystemTimePreciseAsFileTime ( lpsystemtimeasfiletime: * mut FILETIME ) -> ( ) {
145
145
unsafe { GetSystemTimeAsFileTime ( lpsystemtimeasfiletime) }
146
146
}
@@ -346,3 +346,48 @@ compat_fn_with_fallback! {
346
346
// https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-setthreadstackguarantee
347
347
pub fn SetThreadStackGuarantee ( stacksizeinbytes: * mut u32 ) -> BOOL { TRUE }
348
348
}
349
+
350
+ #[ cfg( target_vendor = "rust9x" ) ]
351
+ compat_fn_with_fallback ! {
352
+ pub static KERNEL32 : & CStr = c"kernel32" => { load: false , unicows: false } ;
353
+ // >= 95 / NT 3.5
354
+ // https://learn.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getsystemtimeasfiletime
355
+ pub fn GetSystemTimeAsFileTime ( lpSystemTimeAsFileTime: * mut FILETIME ) {
356
+ unsafe {
357
+ // implementation based on old MSDN docs
358
+ let mut st: SYSTEMTIME = crate :: mem:: zeroed( ) ;
359
+ GetSystemTime ( & mut st) ;
360
+ crate :: sys:: cvt( SystemTimeToFileTime ( & st, lpSystemTimeAsFileTime) ) . unwrap( ) ;
361
+ }
362
+ }
363
+ // >= NT 4
364
+ // https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-switchtothread
365
+ pub fn SwitchToThread ( ) -> BOOL {
366
+ unsafe { Sleep ( 0 ) ; }
367
+ TRUE
368
+ }
369
+
370
+ // >= Vista / Server 2008
371
+ // https://learn.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-createwaitabletimerexw
372
+ pub fn CreateWaitableTimerExW (
373
+ lptimerattributes: * const SECURITY_ATTRIBUTES ,
374
+ lptimername: PCWSTR ,
375
+ dwflags: u32 ,
376
+ dwdesiredaccess: u32
377
+ ) -> HANDLE {
378
+ ptr:: null_mut( )
379
+ }
380
+
381
+ // >= 98 / NT 4
382
+ // https://learn.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-setwaitabletimer
383
+ pub fn SetWaitableTimer ( htimer: HANDLE ,
384
+ lpduetime: * const i64 ,
385
+ lperiod: i32 ,
386
+ pfncompletionroutine: PTIMERAPCROUTINE ,
387
+ lpargtocompletionroutine: * const core:: ffi:: c_void,
388
+ fresume: BOOL
389
+ ) -> BOOL {
390
+ unsafe { SetLastError ( ERROR_CALL_NOT_IMPLEMENTED as u32 ) ; } ;
391
+ FALSE
392
+ }
393
+ }
0 commit comments