fix(ubisoft): answer Orbit, login and process-only check-ins (#2460)

This commit is contained in:
K11MCH1 authored and GitHub committed 2026-11-11 07:49:18 -05:00
1 parent 45ef6b7d1a
commit b1a410ccd2
4 files changed
+131 -23

No files matched your search

+6
View File
@@ -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.