理解驱动对象(DriverObject)
来源:互联网 发布:淘宝出售假货申诉材料 编辑:程序博客网 时间:2024/05/01 16:10
每个驱动程序都会有唯一一个驱动对象表示,驱动对象是对驱动程序的实例化。她由Ring0层的执行体组件中的IO管理器负责加载,并且每个驱动只加载一个实例。在wdm.h头文件中。DriverObject结构如下:
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. // PVOID DriverStart; ULONG DriverSize; PVOID DriverSection; PDRIVER_EXTENSION DriverExtension; // // The driver name field is used by the error log thread // determine the name of the driver that an I/O request is/was bound. // UNICODE_STRING DriverName; // // The following section is for registry support. Thise is a pointer // to the path to the hardware information in the registry // PUNICODE_STRING HardwareDatabase; // // The following section contains the optional pointer to an array of // alternate entry points to a driver for "fast I/O" support. Fast I/O // is performed by invoking the driver routine directly with separate // parameters, rather than using the standard IRP call mechanism. Note // that these functions may only be used for synchronous I/O, and when // the file is cached. // PFAST_IO_DISPATCH FastIoDispatch; // // The following section describes the entry points to this particular // driver. Note that the major function dispatch table must be the last // field in the object so that it remains extensible. // PDRIVER_INITIALIZE DriverInit; PDRIVER_STARTIO DriverStartIo; PDRIVER_UNLOAD DriverUnload; PDRIVER_DISPATCH MajorFunction[IRP_MJ_MAXIMUM_FUNCTION + 1];} DRIVER_OBJECT;
DeviceObject:每个驱动会有一个或者多个设备对象。这些设备对象通过链表的方式组织。每个设备对象有一个nextDevice的指针指向链表的下一个设备对象。但是注意:驱动对象里面的这个DeviceObject相当于设备链表的头节点。他指向的是:本驱动程序自己创建的第一个设备对象。
DriverName:驱动的名字
DriverStartIO:处理多个irp的时候。需要这个来序列化。
DriverUnload:卸载驱动的时候的回调函数。
Driverextension:驱动的扩展。和设备的扩展差不多。
majorFunction:IRP派遣函数。这个感觉也相当于回调。只不过是向操作系统注册IRP的处理函数。
Flag:标志位。
0 0
- 理解驱动对象(DriverObject)
- 遍历所有驱动的名_根据本驱动对象的成员(DriverObject->DriverSection)_对应LDR_DATA_TABLE_ENTRY结构体_双向链表使用
- DriverObject与DeviceObject关系
- 驱动对象(DRIVER_OBJECT)
- 驱动杂记1:对驱动对象,设备对象,设备栈的理解
- WDF驱动学习:驱动对象,设备对象(一)
- WDF驱动学习:驱动对象,设备对象(二)
- wifi驱动的理解(1)——驱动架构
- wifi驱动的理解(1)——驱动架构
- wifi驱动的理解(1)——驱动架构
- DriverObject->DriverSection结构体LDR_DATA_TABLE_ENTRY中的结构
- 面向对象的程序设计(理解对象)
- JS面向对象(一)-----------理解对象
- DM9000驱动理解三(中断函数)
- Linux I2C驱动个人理解(一)
- Linux I2C驱动个人理解(二)
- 面向对象理解(1)
- js 对象理解(1)
- 2014.4新版uboot启动流程分析
- system("color aa")
- java零开始之第一篇:环境变量设置
- Linux 命令大全
- 临时
- 理解驱动对象(DriverObject)
- 用c语言实现 计算一个字符串中单词的个数
- 点击table中的某一个td,获得这个tr的所有数据
- Git分支管理策略
- HTML5语义标签的实践(blog页面)
- Swoole:重新定义PHP
- Warning: Error creating LLDB target at path '/Users/yifangrd/Library/Developer/Xcode/DerivedData/YFF
- ajax动态显示当前时间
- hdu1698 Just a Hook