mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-26 00:06:02 +00:00
fix(ubisoft): answer Orbit, login and process-only check-ins (#2460)
This commit is contained in:
1 parent
45ef6b7d1a
commit
b1a410ccd2
4 files changed
+131
-23
No files matched your search
@@ -67,6 +67,7 @@ extern "system" {
|
||||
fn GetExitCodeProcess(h: HANDLE, code: *mut u32) -> i32;
|
||||
fn OpenProcess(access: u32, inherit: i32, pid: u32) -> HANDLE;
|
||||
fn ProcessIdToSessionId(pid: u32, session: *mut u32) -> i32;
|
||||
fn GetNamedPipeClientProcessId(pipe: HANDLE, pid: *mut u32) -> i32;
|
||||
fn GetCurrentProcessId() -> u32;
|
||||
}
|
||||
|
||||
@@ -134,6 +135,11 @@ impl Handle {
|
||||
pub fn set(&self) {
|
||||
unsafe { SetEvent(self.0) };
|
||||
}
|
||||
|
||||
pub fn client_pid(&self) -> Option<u32> {
|
||||
let mut pid = 0;
|
||||
(unsafe { GetNamedPipeClientProcessId(self.0, &mut pid) } != 0 && pid != 0).then_some(pid)
|
||||
}
|
||||
}
|
||||
|
||||
/// A new instance of the named pipe, waiting for its client; `None` when it cannot be created.
|
||||
|
||||
Reference in new issue
Block a user