- 本节主要介绍驱动开发的一些基础知识。
1. 驱动程序的基本组成
1.1. 最经常见到的数据结构
a. DRIVER_OBJECT驱动对象
- // WDK中对驱动对象的定义
- // 每个驱动程序都会有一个唯一的驱动对象与之对应
- // 它是在驱动加载时被内核对象管理程序创建的
- typedef struct _DRIVER_OBJECT {
- CSHORT Type;
- CSHORT Size;
- //
- // The following links all of the devices created by a single driver
- // together on a list, and the Flags word provides an extensible flag
- // location for driver objects.
- //
- PDEVICE_OBJECT DeviceObject;
- ULONG Flags;
- //
- // The following section describes where the driver is loaded. The count
- // field is used to count the number of times the driver has had its
- // registered reinitialization routine invoked.