Skip to content

Commit

Permalink
Fixes for #24
Browse files Browse the repository at this point in the history
  • Loading branch information
rnd-ash committed May 10, 2021
1 parent 6ecd4c8 commit 98ca22d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions app_rust/src/passthru.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,8 @@ impl PassthruDrv {
//type PassThruOpenFn = unsafe extern "stdcall" fn(name: *const libc::c_void, device_id: *mut u32) -> i32;
pub fn open(&mut self) -> Result<u32> {
let mut id: u32 = 0;
let name = CString::new("test").unwrap();
let res =
unsafe { (&self.open_fn)(name.as_ptr() as *const libc::c_void, &mut id as *mut u32) };
unsafe { (&self.open_fn)(std::ptr::null() as *const libc::c_void, &mut id as *mut u32) };
if res == 0x00 {
self.is_connected = true;
}
Expand Down

0 comments on commit 98ca22d

Please sign in to comment.