mirror of
https://github.com/vosen/ZLUDA.git
synced 2025-04-21 08:58:53 +03:00
Clean up slightly
This commit is contained in:
@ -40,21 +40,19 @@ unsafe extern "system" fn NotCudaLoadLibraryExW(
|
|||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
unsafe extern "system" fn DllMain(_: *const u8, dwReason: u32, _: *const u8) -> i32 {
|
unsafe extern "system" fn DllMain(_: *const u8, dwReason: u32, _: *const u8) -> i32 {
|
||||||
if dwReason == DLL_PROCESS_ATTACH {
|
if dwReason == DLL_PROCESS_ATTACH {
|
||||||
let mut load_lib_ex = LoadLibraryExW as *mut _;
|
|
||||||
DetourRestoreAfterWith();
|
DetourRestoreAfterWith();
|
||||||
DetourTransactionBegin();
|
DetourTransactionBegin();
|
||||||
DetourUpdateThread(GetCurrentThread());
|
DetourUpdateThread(GetCurrentThread());
|
||||||
DetourAttach(
|
DetourAttach(
|
||||||
&mut load_lib_ex,
|
std::mem::transmute(&mut LOAD_LIBRARY_EX),
|
||||||
NotCudaLoadLibraryExW as *mut _,
|
NotCudaLoadLibraryExW as *mut _,
|
||||||
);
|
);
|
||||||
DetourTransactionCommit();
|
DetourTransactionCommit();
|
||||||
LOAD_LIBRARY_EX = std::mem::transmute(load_lib_ex);
|
|
||||||
} else if dwReason == DLL_PROCESS_DETACH {
|
} else if dwReason == DLL_PROCESS_DETACH {
|
||||||
DetourTransactionBegin();
|
DetourTransactionBegin();
|
||||||
DetourUpdateThread(GetCurrentThread());
|
DetourUpdateThread(GetCurrentThread());
|
||||||
DetourDetach(
|
DetourDetach(
|
||||||
&mut (LOAD_LIBRARY_EX as *mut _),
|
std::mem::transmute(&mut LOAD_LIBRARY_EX),
|
||||||
NotCudaLoadLibraryExW as *mut _,
|
NotCudaLoadLibraryExW as *mut _,
|
||||||
);
|
);
|
||||||
DetourTransactionCommit();
|
DetourTransactionCommit();
|
||||||
|
Reference in New Issue
Block a user