mirror of
https://gitee.com/openharmony/third_party_rust_parking_lot
synced 2024-11-26 23:00:30 +00:00
v32
This commit is contained in:
parent
a75875b0bf
commit
385cf26f45
@ -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",
|
||||
|
@ -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,
|
||||
|
@ -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),
|
||||
|
Loading…
Reference in New Issue
Block a user