aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrzej Janik <[email protected]>2020-02-10 20:56:09 +0100
committerAndrzej Janik <[email protected]>2020-02-10 20:56:09 +0100
commit35caa53c3f185842f3625e5f32d7cb16b6ba646f (patch)
treeaec4713af095238ea196d1956372e57375d9818e
parent5ec4c5cf727cb42d039f22575771beecac79870d (diff)
downloadZLUDA-35caa53c3f185842f3625e5f32d7cb16b6ba646f.tar.gz
ZLUDA-35caa53c3f185842f3625e5f32d7cb16b6ba646f.zip
Clean up slightly
-rw-r--r--notcuda_redirect/src/lib.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/notcuda_redirect/src/lib.rs b/notcuda_redirect/src/lib.rs
index 0eab6ed..49b3bbe 100644
--- a/notcuda_redirect/src/lib.rs
+++ b/notcuda_redirect/src/lib.rs
@@ -40,21 +40,19 @@ unsafe extern "system" fn NotCudaLoadLibraryExW(
#[no_mangle]
unsafe extern "system" fn DllMain(_: *const u8, dwReason: u32, _: *const u8) -> i32 {
if dwReason == DLL_PROCESS_ATTACH {
- let mut load_lib_ex = LoadLibraryExW as *mut _;
DetourRestoreAfterWith();
DetourTransactionBegin();
DetourUpdateThread(GetCurrentThread());
DetourAttach(
- &mut load_lib_ex,
+ std::mem::transmute(&mut LOAD_LIBRARY_EX),
NotCudaLoadLibraryExW as *mut _,
);
DetourTransactionCommit();
- LOAD_LIBRARY_EX = std::mem::transmute(load_lib_ex);
} else if dwReason == DLL_PROCESS_DETACH {
DetourTransactionBegin();
DetourUpdateThread(GetCurrentThread());
DetourDetach(
- &mut (LOAD_LIBRARY_EX as *mut _),
+ std::mem::transmute(&mut LOAD_LIBRARY_EX),
NotCudaLoadLibraryExW as *mut _,
);
DetourTransactionCommit();