diff options
| author | David Lönnhager <david.l@mullvad.net> | 2023-10-17 13:14:12 +0200 |
|---|---|---|
| committer | David Lönnhager <david.l@mullvad.net> | 2023-10-20 18:17:24 +0200 |
| commit | 8a5ad4bb07dec0e34985fc5eaa9c40352bc05655 (patch) | |
| tree | b95ea58bc205e0f717e9e4d75bef39d773786f2a /talpid-windows/src/sync.rs | |
| parent | 5cee95d43bb0cc3654e5558ba02919dbf32d52aa (diff) | |
| download | mullvadvpn-8a5ad4bb07dec0e34985fc5eaa9c40352bc05655.tar.xz mullvadvpn-8a5ad4bb07dec0e34985fc5eaa9c40352bc05655.zip | |
Add process module to talpid-windows
Diffstat (limited to 'talpid-windows/src/sync.rs')
| -rw-r--r-- | talpid-windows/src/sync.rs | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/talpid-windows/src/sync.rs b/talpid-windows/src/sync.rs index 7b4ed59be3..202c96524d 100644 --- a/talpid-windows/src/sync.rs +++ b/talpid-windows/src/sync.rs @@ -1,7 +1,7 @@ use std::{io, ptr}; use windows_sys::Win32::{ - Foundation::{CloseHandle, DuplicateHandle, BOOL, DUPLICATE_SAME_ACCESS, HANDLE}, - System::Threading::{CreateEventW, GetCurrentProcess, SetEvent}, + Foundation::{CloseHandle, BOOL, HANDLE}, + System::Threading::{CreateEventW, SetEvent}, }; /// Windows event object @@ -39,26 +39,6 @@ impl Event { pub fn as_raw(&self) -> HANDLE { self.0 } - - /// Duplicate the event object with `DuplicateHandle()` - pub fn duplicate(&self) -> io::Result<Event> { - let mut new_event = 0; - let status = unsafe { - DuplicateHandle( - GetCurrentProcess(), - self.0, - GetCurrentProcess(), - &mut new_event, - 0, - 0, - DUPLICATE_SAME_ACCESS, - ) - }; - if status == 0 { - return Err(io::Error::last_os_error()); - } - Ok(Event(new_event)) - } } impl Drop for Event { |
