mirror of
https://github.com/vosen/ZLUDA.git
synced 2025-08-31 14:48:42 +00:00
Add tests for injecting into CLR process
This commit is contained in:
parent
9923a36b76
commit
c869a0d611
6 changed files with 54 additions and 6 deletions
|
@ -10,7 +10,7 @@ extern "system" {
|
|||
|
||||
fn main() {
|
||||
let nvcuda = unsafe { LoadLibraryA(b"C:\\Windows\\System32\\nvcuda.dll\0".as_ptr()) };
|
||||
let cuInit = unsafe { GetProcAddress(nvcuda, b"cuInit\0".as_ptr()) };
|
||||
let cuInit = unsafe { mem::transmute::<_, unsafe extern "system" fn(u32) -> u32>(cuInit) };
|
||||
unsafe { cuInit(0) };
|
||||
let cu_init = unsafe { GetProcAddress(nvcuda, b"cuInit\0".as_ptr()) };
|
||||
let cu_init = unsafe { mem::transmute::<_, unsafe extern "system" fn(u32) -> u32>(cu_init) };
|
||||
unsafe { cu_init(0) };
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue