@@ -28,17 +28,14 @@ pub type SIZE_T = usize;
28
28
pub type WORD = u16 ;
29
29
pub type CHAR = c_char ;
30
30
pub type ULONG = c_ulong ;
31
- pub type ACCESS_MASK = DWORD ;
32
31
33
32
pub type LPCVOID = * const c_void ;
34
- pub type LPHANDLE = * mut HANDLE ;
35
33
pub type LPOVERLAPPED = * mut OVERLAPPED ;
36
34
pub type LPSECURITY_ATTRIBUTES = * mut SECURITY_ATTRIBUTES ;
37
35
pub type LPVOID = * mut c_void ;
38
36
pub type LPWCH = * mut WCHAR ;
39
37
pub type LPWSTR = * mut WCHAR ;
40
38
41
- pub type PLARGE_INTEGER = * mut c_longlong ;
42
39
pub type PSRWLOCK = * mut SRWLOCK ;
43
40
44
41
pub type socklen_t = c_int ;
@@ -345,6 +342,19 @@ compat_fn_with_fallback! {
345
342
}
346
343
}
347
344
345
+ #[ cfg( not( target_vendor = "win7" ) ) ]
346
+ #[ link( name = "synchronization" ) ]
347
+ extern "system" {
348
+ pub fn WaitOnAddress (
349
+ address : * const c_void ,
350
+ compareaddress : * const c_void ,
351
+ addresssize : usize ,
352
+ dwmilliseconds : u32 ,
353
+ ) -> BOOL ;
354
+ pub fn WakeByAddressSingle ( address : * const c_void ) ;
355
+ }
356
+
357
+ #[ cfg( target_vendor = "win7" ) ]
348
358
compat_fn_optional ! {
349
359
crate :: sys:: compat:: load_synch_functions( ) ;
350
360
pub fn WaitOnAddress (
@@ -356,30 +366,34 @@ compat_fn_optional! {
356
366
pub fn WakeByAddressSingle ( address: * const :: core:: ffi:: c_void) ;
357
367
}
358
368
369
+ #[ cfg( any( target_vendor = "win7" , target_vendor = "uwp" ) ) ]
359
370
compat_fn_with_fallback ! {
360
371
pub static NTDLL : & CStr = c"ntdll" ;
361
372
373
+ #[ cfg( target_vendor = "win7" ) ]
362
374
pub fn NtCreateKeyedEvent (
363
- KeyedEventHandle : LPHANDLE ,
364
- DesiredAccess : ACCESS_MASK ,
375
+ KeyedEventHandle : * mut HANDLE ,
376
+ DesiredAccess : DWORD ,
365
377
ObjectAttributes : LPVOID ,
366
378
Flags : ULONG
367
379
) -> NTSTATUS {
368
380
panic!( "keyed events not available" )
369
381
}
382
+ #[ cfg( target_vendor = "win7" ) ]
370
383
pub fn NtReleaseKeyedEvent (
371
384
EventHandle : HANDLE ,
372
385
Key : LPVOID ,
373
386
Alertable : BOOLEAN ,
374
- Timeout : PLARGE_INTEGER
387
+ Timeout : * mut c_longlong
375
388
) -> NTSTATUS {
376
389
panic!( "keyed events not available" )
377
390
}
391
+ #[ cfg( target_vendor = "win7" ) ]
378
392
pub fn NtWaitForKeyedEvent (
379
393
EventHandle : HANDLE ,
380
394
Key : LPVOID ,
381
395
Alertable : BOOLEAN ,
382
- Timeout : PLARGE_INTEGER
396
+ Timeout : * mut c_longlong
383
397
) -> NTSTATUS {
384
398
panic!( "keyed events not available" )
385
399
}
0 commit comments