windows-drivers-rs
windows-drivers-rs copied to clipboard
Driver installation crashes when using `EvtIoInternalDeviceControl`
I'm trying to use the repo to write a keyboard driver - https://github.com/lurebat/interustception
My problem is as such:
When using WDF_IO_QUEUE_CONFIG
, everything is fine as long as I use EvtIoDeviceControl
.
But as soon as I try to set EvtIoInternalDeviceControl
, installing hangs forever. The setup file in C:\windows\inf writes binary gibberish.
The callback function has the correct signature, and marked with
#[no_mangle]
#[link_section = "PAGE"]
pub unsafe extern "C"
I can gurantee the object is initialized correctly (as I have debug prints). The device_create functions returns with a successful code, it hangs later on when trying to start the device.
I even tried marking all of my user-made functions with link_section=PAGE, and I suspect it might be something in this area, or something deallocates before it needs to - but I can't figure it out.
The callback isn't even called as far as I can tell - breakpoints don't set, prints don't print, etc.
I haven't found anything online on a similar problem, and at this point I'm desperate - so maybe it's the framework or rust.
Even ideas to how to debug it would be great help.
Thanks!