fix, win privacy mode, broker process

Signed-off-by: dignow <linlong1265@gmail.com>
This commit is contained in:
dignow
2023-07-08 15:26:24 +08:00
parent 84d7115e36
commit 1648895156
7 changed files with 33 additions and 2 deletions

View File

@@ -59,6 +59,12 @@ struct WindowHandlers {
impl Drop for WindowHandlers {
fn drop(&mut self) {
self.reset();
}
}
impl WindowHandlers {
fn reset(&mut self) {
unsafe {
if self.hthread != 0 {
CloseHandle(self.hthread as _);
@@ -257,6 +263,10 @@ pub fn start() -> ResultType<()> {
Ok(())
}
pub fn stop() {
WND_HANDLERS.lock().unwrap().reset();
}
unsafe fn inject_dll<'a>(hproc: HANDLE, hthread: HANDLE, dll_file: &'a str) -> ResultType<()> {
let dll_file_utf16: Vec<u16> = dll_file.encode_utf16().chain(Some(0).into_iter()).collect();