diff options
| author | pravic <[email protected]> | 2016-04-12 16:39:37 +0300 |
|---|---|---|
| committer | pravic <[email protected]> | 2016-04-12 16:39:37 +0300 |
| commit | 28ff216899e95a6a9756bcbe580f28ed8ce61228 (patch) | |
| tree | bbf00e3c5f3b440db5ddb3f86b6d3a893349cee0 /src/driver_object.rs | |
| parent | git ignore (diff) | |
| download | winapi-kmd-rs-28ff216899e95a6a9756bcbe580f28ed8ce61228.tar.xz winapi-kmd-rs-28ff216899e95a6a9756bcbe580f28ed8ce61228.zip | |
Windows Kernel-Mode library
Diffstat (limited to 'src/driver_object.rs')
| -rw-r--r-- | src/driver_object.rs | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/driver_object.rs b/src/driver_object.rs new file mode 100644 index 0000000..82a87e7 --- /dev/null +++ b/src/driver_object.rs @@ -0,0 +1,34 @@ +//! Driver Object. + +use ::{NTSTATUS, UNICODE_STRING}; +use ::device_object::*; +use ::irp::IRP; + + +pub type PDRIVER_INITIALIZE = Option<extern "system" fn (_self: &mut DRIVER_OBJECT, &UNICODE_STRING) -> NTSTATUS>; +pub type PDRIVER_STARTIO = Option<extern "system" fn (_self: &mut DRIVER_OBJECT, &IRP)>; +pub type PDRIVER_UNLOAD = Option<extern "system" fn (_self: &mut DRIVER_OBJECT)>; + + +/// Represents the image of a loaded kernel-mode driver. +#[repr(C)] +pub struct DRIVER_OBJECT +{ + pub Type: u16, + pub Size: u16, + pub DeviceObject: *mut DEVICE_OBJECT, + pub Flags: u32, + pub DriverStart: *const u8, + pub DriverSize: u32, + pub DriverSection: *const u8, + pub DriverExtension: *mut u8, + pub DriverName: UNICODE_STRING, + pub HardwareDatabase: *const UNICODE_STRING, + pub FastIoDispatch: *mut u8, + pub DriverInit: PDRIVER_INITIALIZE, + pub DriverStartIo: PDRIVER_STARTIO, + /// The entry point for the driver's Unload routine, if any. + pub DriverUnload: PDRIVER_UNLOAD, + /// A dispatch table consisting of an array of entry points for the driver's `DispatchXxx` routines. + pub MajorFunction: [PDRIVER_DISPATCH; 28], +} |