Closed vlabo closed 5 months ago
In The DRIVER_OBJECT struct
DRIVER_OBJECT
pub struct DRIVER_OBJECT { pub Type: i16, pub Size: i16, pub DeviceObject: *mut DEVICE_OBJECT, pub Flags: u32, pub DriverStart: *mut ::core::ffi::c_void, pub DriverSize: u32, pub DriverSection: *mut ::core::ffi::c_void, pub DriverExtension: *mut DRIVER_EXTENSION, pub DriverName: super::super::Win32::Foundation::UNICODE_STRING, pub HardwareDatabase: *mut super::super::Win32::Foundation::UNICODE_STRING, pub FastIoDispatch: *mut FAST_IO_DISPATCH, pub DriverInit: *mut DRIVER_INITIALIZE, pub DriverStartIo: *mut DRIVER_STARTIO, pub DriverUnload: *mut DRIVER_UNLOAD, pub MajorFunction: [*mut DRIVER_DISPATCH; 28], }
DriverUnload -> *mut DRIVER_UNLOAD aka: mut Option<unsafe extern "system" fn(driverobject: const DRIVER_OBJECT)> Should be just Option<...>
DriverUnload
*mut DRIVER_UNLOAD
Option<...>
The same for DriverInit, DriverStartIo and MajorFunction
DriverInit
DriverStartIo
MajorFunction
The correct version
pub struct DRIVER_OBJECT { ... pub DriverInit: DRIVER_INITIALIZE, pub DriverStartIo: DRIVER_STARTIO, pub DriverUnload: DRIVER_UNLOAD, pub MajorFunction: [DRIVER_DISPATCH; 28], }
In previous version this issue was not present, but the function prototype where missing arguments. https://github.com/microsoft/wdkmetadata/issues/47
Should be fixed with https://github.com/microsoft/wdkmetadata/issues/67.
In The
DRIVER_OBJECT
structDriverUnload
->*mut DRIVER_UNLOAD
aka: mut Option<unsafe extern "system" fn(driverobject: const DRIVER_OBJECT)> Should be justOption<...>
The same for
DriverInit
,DriverStartIo
andMajorFunction
The correct version
In previous version this issue was not present, but the function prototype where missing arguments. https://github.com/microsoft/wdkmetadata/issues/47