Skip to content

Commit

Permalink
Merge pull request #316 from kennykerr/master
Browse files Browse the repository at this point in the history
  • Loading branch information
Amanieu committed Feb 6, 2022
2 parents a75875b + 385cf26 commit 1e14da7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
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

0 comments on commit 1e14da7

Please sign in to comment.