1
Fork 0

Add Keyed Events API to sys::windows::c.

This commit is contained in:
Mara Bos 2020-10-06 00:34:15 +02:00
parent 92f7ba8446
commit 7bfde778a4

View file

@ -31,6 +31,8 @@ pub type WORD = u16;
pub type CHAR = c_char; pub type CHAR = c_char;
pub type ULONG_PTR = usize; pub type ULONG_PTR = usize;
pub type ULONG = c_ulong; pub type ULONG = c_ulong;
pub type NTSTATUS = LONG;
pub type ACCESS_MASK = DWORD;
pub type LPBOOL = *mut BOOL; pub type LPBOOL = *mut BOOL;
pub type LPBYTE = *mut BYTE; pub type LPBYTE = *mut BYTE;
@ -286,6 +288,8 @@ pub const STACK_SIZE_PARAM_IS_A_RESERVATION: DWORD = 0x00010000;
pub const HEAP_ZERO_MEMORY: DWORD = 0x00000008; pub const HEAP_ZERO_MEMORY: DWORD = 0x00000008;
pub const STATUS_SUCCESS: NTSTATUS = 0x00000000;
#[repr(C)] #[repr(C)]
#[cfg(not(target_pointer_width = "64"))] #[cfg(not(target_pointer_width = "64"))]
pub struct WSADATA { pub struct WSADATA {
@ -1111,3 +1115,31 @@ compat_fn! {
// WaitOnAddress would've panicked. So it's fine to do nothing here. // WaitOnAddress would've panicked. So it's fine to do nothing here.
} }
} }
compat_fn! {
"ntdll":
pub fn NtCreateKeyedEvent(
KeyedEventHandle: LPHANDLE,
DesiredAccess: ACCESS_MASK,
ObjectAttributes: LPVOID,
Flags: ULONG
) -> NTSTATUS {
panic!("keyed events not available")
}
pub fn NtReleaseKeyedEvent(
EventHandle: HANDLE,
Key: LPVOID,
Alertable: BOOLEAN,
Timeout: PLARGE_INTEGER
) -> NTSTATUS {
panic!("keyed events not available")
}
pub fn NtWaitForKeyedEvent(
EventHandle: HANDLE,
Key: LPVOID,
Alertable: BOOLEAN,
Timeout: PLARGE_INTEGER
) -> NTSTATUS {
panic!("keyed events not available")
}
}