mirror of
https://github.com/djhackersdev/bemanitools.git
synced 2026-08-22 00:14:03 -05:00
iidx-ezusb1/2 exit hook: Replace duplicate code with util function
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#include "hook/table.h"
|
||||
|
||||
#include "util/defs.h"
|
||||
#include "util/proc.h"
|
||||
|
||||
static BOOL STDCALL my_DeviceIoControl(
|
||||
HANDLE fd,
|
||||
@@ -163,12 +164,7 @@ static BOOL STDCALL my_DeviceIoControl(
|
||||
|
||||
/* Don't use ExitProcess. This might result in deadlocks
|
||||
on newer games which rely more on multi threading */
|
||||
HANDLE hnd;
|
||||
hnd = OpenProcess(
|
||||
SYNCHRONIZE | PROCESS_TERMINATE,
|
||||
TRUE,
|
||||
GetCurrentProcessId());
|
||||
TerminateProcess(hnd, 0);
|
||||
proc_terminate_current_process(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "hook/table.h"
|
||||
|
||||
#include "util/defs.h"
|
||||
#include "util/proc.h"
|
||||
|
||||
#define IOCTL_VEND_USB_REQ 0x220024
|
||||
|
||||
@@ -124,12 +125,7 @@ static BOOL STDCALL my_DeviceIoControl(
|
||||
|
||||
/* Don't use ExitProcess. This might result in deadlocks
|
||||
on newer games which rely more on multi threading */
|
||||
HANDLE hnd;
|
||||
hnd = OpenProcess(
|
||||
SYNCHRONIZE | PROCESS_TERMINATE,
|
||||
TRUE,
|
||||
GetCurrentProcessId());
|
||||
TerminateProcess(hnd, 0);
|
||||
proc_terminate_current_process(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user