Code: Select all
// HANDLE iBuffer = CreateEvent(NULL, FALSE, FALSE, L"");
let event_handle: windows::Win32::Foundation::HANDLE =
unsafe { CreateEventA(None, false, false, s!("")).unwrap() };
// TPCANStatus stsResult = CAN_SetValue(PcanHandle, PCAN_RECEIVE_EVENT, &iBuffer, sizeof(iBuffer));
let status: PcanStatus = unsafe {
dbg!(PCAN_LIBRARY.CAN_SetValue(
channel,
PCAN_RECEIVE_EVENT as u8,
event_handle.0,
std::mem::size_of::<windows::Win32::Foundation::HANDLE>() as u32,
// std::mem::size_of_val(&event_handle) as u32,
))
}.into();
Is there anything obvious that I'm doing wrong?