WDM Driver Object and Device Object
Defined in wdm.h:
typedef struct _DRIVER_OBJECT
{
CSHORT Type;
CSHORT Size;
PDEVICE_OBJECT DeviceObject; // link list maintained by IO manager
…
PDRIVER_EXTENSION DriverExtension; // AddDevice
…
PUNICODE_STRING HardwareDatabase; //registry key for the device
…
PDRIVER_STARTIO DriverStartIo; // function processes IO request
…
PDRIVER_DISPATCH MajorFunction; // table of pointers to functions to handle io request
} DRIVER_OBJECT, *PDRIVER_OBJECT;
typedef struct _DEVICE_OBJECT
{
PDRIVER_OBJECT DriverObject;
PDEVICE_OBECT NextDevice;
…
RIRP CurrentIrp; // used by IRP queue routines
ULONG flags; // DO_BUFFERED_IO, etc
ULONG Characteristics; // FILE_REMOVABLE_MEDIA
PVOID DeviceExtension; // device instance specific data
…
DEVICE_TYPE DeviceType;
CCHAR StackSize;
…
} DEVICE_OBJECT, *PDEVICE_OBJECT;
