blob: 0584cbc18c92ec628e2e59f52c5f4e84d9865173 [file] [log] [blame]
//! Bindings generated by `minwin` 0.1.0
#![allow(
non_snake_case,
non_upper_case_globals,
non_camel_case_types,
clippy::upper_case_acronyms
)]
#[link(name = "kernel32")]
extern "system" {
#[link_name = "CloseHandle"]
pub fn close_handle(object: Handle) -> Bool;
#[link_name = "CreateEventA"]
pub fn create_event_a(
event_attributes: *const ::core::ffi::c_void,
manual_reset: Bool,
initial_state: Bool,
name: Pcstr,
) -> Handle;
#[link_name = "LockFileEx"]
pub fn lock_file_ex(
file: Handle,
flags: LockFileFlags::Enum,
reserved: u32,
number_of_bytes_to_lock_low: u32,
number_of_bytes_to_lock_high: u32,
overlapped: *mut Overlapped,
) -> Bool;
#[link_name = "UnlockFile"]
pub fn unlock_file(
file: Handle,
file_offset_low: u32,
file_offset_high: u32,
number_of_bytes_to_unlock_low: u32,
number_of_bytes_to_unlock_high: u32,
) -> Bool;
#[link_name = "WaitForSingleObject"]
pub fn wait_for_single_object(handle: Handle, milliseconds: u32) -> Win32Error::Enum;
}
pub const Infinite: u32 = 4294967295;
pub type Bool = i32;
pub mod FileFlagsAndAttributes {
pub type Enum = u32;
pub const FileFlagOverlapped: Enum = 1073741824;
}
pub type Handle = isize;
pub mod LockFileFlags {
pub type Enum = u32;
pub const LockfileFailImmediately: Enum = 1;
pub const LockfileExclusiveLock: Enum = 2;
}
#[repr(C)]
pub struct Overlapped {
pub internal: usize,
pub internal_high: usize,
pub anonymous: Overlapped_0,
pub event: Handle,
}
#[repr(C)]
pub union Overlapped_0 {
pub anonymous: ::std::mem::ManuallyDrop<Overlapped_0_0>,
pub pointer: *mut ::core::ffi::c_void,
}
#[repr(C)]
pub struct Overlapped_0_0 {
pub offset: u32,
pub offset_high: u32,
}
pub type Pcstr = *const u8;
pub mod Win32Error {
pub type Enum = u32;
pub const WaitObject0: Enum = 0;
pub const ErrorInvalidFunction: Enum = 1;
pub const ErrorLockViolation: Enum = 33;
pub const WaitIoCompletion: Enum = 192;
pub const WaitTimeout: Enum = 258;
pub const ErrorIoPending: Enum = 997;
}