noun: IRP; PDO; FiDO1; FDO;
The Windows kernel design itself is not interacting with the device. The device driver detects the connected device, which provides a client-side feature interface that communicates indirectly with the Windows kernel. Windows provides an abstract device support interface to call the driver model. The driver developer's job is to provide a specific requirement to implement the device that the interface already supports.
。 Equipment stack (device stack)
Each time the device is driven, a device stack is generated.
I/O Request
(1) Write a request
Win Api:writefile
(2) Read request
Win Api:readfile
(3) device I/O control
Win Api:deviceiocontrol
IRP:I/O Request Packet
typedef struct _IRP { . . PMDL mdladdress; ULONG Flags; Union { struct _irp *masterirp; PVOID systembuffer; } AssociatedIrp, ... . Io_status_block IoStatus; Kprocessor_mode Requestormode; BOOLEAN pendingreturned; . BOOLEAN Cancel; KIRQL cancelirql; Pdriver_cancel Cancelroutine; PVOID UserBuffer; Union { struct { . . Union { Kdevice_queue_entry devicequeueentry; struct { PVOID drivercontext[4]; }; }; . . Pethread Thread; . List_entry listentry; . . } Overlay, ... } Tail;} IRP, *PIRP;
IRP structure See "IRP"
Fido:filter Device Object (Upper)
Fdo:functional Device Object
Fido:filter Device Object (Lower)
Pdo:physical Device Object
Reference documents:
1. Programming the Microsoft Windows Driver Model (2nd)
1Chapter 2-basic Structure of a WDM Driver >> how the System Finds and Loads Drivers
Windows Driver Development-Fundamentals 2