@@ -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 ;
@@ -360,6 +357,19 @@ compat_fn_with_fallback! {
360
357
}
361
358
}
362
359
360
+ #[ cfg( not( target_vendor = "win7" ) ) ]
361
+ #[ link( name = "synchronization" ) ]
362
+ extern "system" {
363
+ pub fn WaitOnAddress (
364
+ address : * const c_void ,
365
+ compareaddress : * const c_void ,
366
+ addresssize : usize ,
367
+ dwmilliseconds : u32 ,
368
+ ) -> BOOL ;
369
+ pub fn WakeByAddressSingle ( address : * const c_void ) ;
370
+ }
371
+
372
+ #[ cfg( target_vendor = "win7" ) ]
363
373
compat_fn_optional ! {
364
374
crate :: sys:: compat:: load_synch_functions( ) ;
365
375
pub fn WaitOnAddress (
@@ -371,30 +381,34 @@ compat_fn_optional! {
371
381
pub fn WakeByAddressSingle ( address: * const :: core:: ffi:: c_void) ;
372
382
}
373
383
384
+ #[ cfg( any( target_vendor = "win7" , target_vendor = "uwp" ) ) ]
374
385
compat_fn_with_fallback ! {
375
386
pub static NTDLL : & CStr = c"ntdll" ;
376
387
388
+ #[ cfg( target_vendor = "win7" ) ]
377
389
pub fn NtCreateKeyedEvent (
378
- KeyedEventHandle : LPHANDLE ,
379
- DesiredAccess : ACCESS_MASK ,
390
+ KeyedEventHandle : * mut HANDLE ,
391
+ DesiredAccess : DWORD ,
380
392
ObjectAttributes : LPVOID ,
381
393
Flags : ULONG
382
394
) -> NTSTATUS {
383
395
panic!( "keyed events not available" )
384
396
}
397
+ #[ cfg( target_vendor = "win7" ) ]
385
398
pub fn NtReleaseKeyedEvent (
386
399
EventHandle : HANDLE ,
387
400
Key : LPVOID ,
388
401
Alertable : BOOLEAN ,
389
- Timeout : PLARGE_INTEGER
402
+ Timeout : * mut c_longlong
390
403
) -> NTSTATUS {
391
404
panic!( "keyed events not available" )
392
405
}
406
+ #[ cfg( target_vendor = "win7" ) ]
393
407
pub fn NtWaitForKeyedEvent (
394
408
EventHandle : HANDLE ,
395
409
Key : LPVOID ,
396
410
Alertable : BOOLEAN ,
397
- Timeout : PLARGE_INTEGER
411
+ Timeout : * mut c_longlong
398
412
) -> NTSTATUS {
399
413
panic!( "keyed events not available" )
400
414
}
0 commit comments