Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Target windows-sys version 0.32 #316

Merged
merged 1 commit into from Feb 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/Cargo.toml
Expand Up @@ -23,7 +23,7 @@ libc = "0.2.95"
redox_syscall = "0.2.8"

[target.'cfg(windows)'.dependencies]
windows-sys = { version = "0.29", features = [
windows-sys = { version = "0.32", features = [
"Win32_Foundation",
"Win32_System_LibraryLoader",
"Win32_System_SystemServices",
Expand Down
8 changes: 4 additions & 4 deletions core/src/thread_parker/windows/keyed_event.rs
Expand Up @@ -56,17 +56,17 @@ impl KeyedEvent {
#[allow(non_snake_case)]
pub fn create() -> Option<KeyedEvent> {
unsafe {
let ntdll = GetModuleHandleA(b"ntdll.dll\0".as_ptr() as *mut u8);
let ntdll = GetModuleHandleA(b"ntdll.dll\0".as_ptr());
if ntdll == 0 {
return None;
}

let NtCreateKeyedEvent =
GetProcAddress(ntdll, b"NtCreateKeyedEvent\0".as_ptr() as *mut u8)?;
GetProcAddress(ntdll, b"NtCreateKeyedEvent\0".as_ptr())?;
let NtReleaseKeyedEvent =
GetProcAddress(ntdll, b"NtReleaseKeyedEvent\0".as_ptr() as *mut u8)?;
GetProcAddress(ntdll, b"NtReleaseKeyedEvent\0".as_ptr())?;
let NtWaitForKeyedEvent =
GetProcAddress(ntdll, b"NtWaitForKeyedEvent\0".as_ptr() as *mut u8)?;
GetProcAddress(ntdll, b"NtWaitForKeyedEvent\0".as_ptr())?;

let NtCreateKeyedEvent: extern "system" fn(
KeyedEventHandle: *mut HANDLE,
Expand Down
6 changes: 3 additions & 3 deletions core/src/thread_parker/windows/waitaddress.rs
Expand Up @@ -36,14 +36,14 @@ impl WaitAddress {
// MSDN claims that that WaitOnAddress and WakeByAddressSingle are
// located in kernel32.dll, but they are lying...
let synch_dll =
GetModuleHandleA(b"api-ms-win-core-synch-l1-2-0.dll\0".as_ptr() as *mut u8);
GetModuleHandleA(b"api-ms-win-core-synch-l1-2-0.dll\0".as_ptr());
if synch_dll == 0 {
return None;
}

let WaitOnAddress = GetProcAddress(synch_dll, b"WaitOnAddress\0".as_ptr() as *mut u8)?;
let WaitOnAddress = GetProcAddress(synch_dll, b"WaitOnAddress\0".as_ptr())?;
let WakeByAddressSingle =
GetProcAddress(synch_dll, b"WakeByAddressSingle\0".as_ptr() as *mut u8)?;
GetProcAddress(synch_dll, b"WakeByAddressSingle\0".as_ptr())?;

Some(WaitAddress {
WaitOnAddress: mem::transmute(WaitOnAddress),
Expand Down