-
Notifications
You must be signed in to change notification settings - Fork 225
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #374 from EmbarkStudios/remove-windows-sys
- Loading branch information
Showing
5 changed files
with
53 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
//! Manual bindings to the win32 API to avoid dependencies on windows-sys or winapi | ||
//! as these bindings will **never** change and parking_lot_core is a foundational | ||
//! dependency for the Rust ecosystem, so the dependencies used by it have an | ||
//! outsize affect | ||
pub const INFINITE: u32 = 4294967295; | ||
pub const ERROR_TIMEOUT: u32 = 1460; | ||
pub const GENERIC_READ: u32 = 2147483648; | ||
pub const GENERIC_WRITE: u32 = 1073741824; | ||
pub const STATUS_SUCCESS: i32 = 0; | ||
pub const STATUS_TIMEOUT: i32 = 258; | ||
|
||
pub type HANDLE = isize; | ||
pub type HINSTANCE = isize; | ||
pub type BOOL = i32; | ||
pub type BOOLEAN = u8; | ||
pub type NTSTATUS = i32; | ||
pub type FARPROC = Option<unsafe extern "system" fn() -> isize>; | ||
pub type WaitOnAddress = unsafe extern "system" fn( | ||
Address: *const std::ffi::c_void, | ||
CompareAddress: *const std::ffi::c_void, | ||
AddressSize: usize, | ||
dwMilliseconds: u32, | ||
) -> BOOL; | ||
pub type WakeByAddressSingle = unsafe extern "system" fn(Address: *const std::ffi::c_void); | ||
|
||
#[link(name = "kernel32")] | ||
extern "system" { | ||
pub fn GetLastError() -> u32; | ||
pub fn CloseHandle(hObject: HANDLE) -> BOOL; | ||
|
||
pub fn GetModuleHandleA(lpModuleName: *const u8) -> HINSTANCE; | ||
pub fn GetProcAddress(hModule: HINSTANCE, lpProcName: *const u8) -> FARPROC; | ||
|
||
pub fn Sleep(dwMilliseconds: u32); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters