// EvtIoRead: The framework ensures the device is powered void MyRead(WDFQUEUE Queue, WDFREQUEST Request, size_t Length) NTSTATUS status = STATUS_SUCCESS; // ... access hardware ... WdfRequestComplete(Request, status);
– A mandatory, excellent framework for serious Windows kernel driver development. Just accept that you will still need to understand kernel internals; KMDF won't hide everything, but it will save your sanity. kernel-mode driver framework
If you are writing a new kernel-mode driver for Windows (excluding very specific graphics or storage miniports), you should be using KMDF . It turns a "write-a-bug-and-BSOD-the-system" discipline into a manageable, safe, and maintainable engineering task. // EvtIoRead: The framework ensures the device is
// EvtDeviceAdd: Create device, queues, and interrupts NTSTATUS MyDeviceAdd(WDFDEVICE Device) WDF_IO_QUEUE_CONFIG queueConfig; WDF_IO_QUEUE_CONFIG_INIT_DEFAULT_QUEUE(&queueConfig, WdfIoQueueDispatchSequential); queueConfig.EvtIoRead = MyRead; return WdfIoQueueCreate(Device, &queueConfig, WDF_NO_OBJECT_ATTRIBUTES, WDF_NO_HANDLE); size_t Length) NTSTATUS status = STATUS_SUCCESS