Driver Structure

本文详细介绍了Windows NT环境下驱动程序的加载、初始化、请求处理及动态卸载流程。包括DriverEntry入口点的功能、设备驱动如何处理IRP请求、动态卸载的指示方式等关键技术点。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1,Driver Loading and Initialization
NT drivers are dynamically loaded,in NT 4,drivers are almost loaded during system bootup, When a driver is loaded,the IO Mangaer calls its DriverEntry entry point.It is during DriverEntry processing that a driver performs internal initilization and locates and initializes hardware that it will control.On return from DriverEntry with success,the IO Manager begins passing IO requests to the driver.


2,Request Processing for Device Drivers
Dispatch Routine Processing:For example,when the IO Manager has an IRP with  an IRP_MJ_READ function code for a particular driver to process,it calls driver's dispatch
read entry point.As parameters to the driver's dispatch entry point,the IO Manager  passes a point to the device object to which the request is directed and a pointer to the 
IRP that describes the request. 


3,Dynamic unloading:

A driver indicates to the IO Manager that it can be dynamically unloade by supplying a pointer to an unload entry point in its Driver Object.



4,A driver's DriverEntry entry point is called by the IO Manager only once,regardless of the number of devices the driver will control.DriverEntry is called at IRQL PASSIVE_LEVEL in the context of the system process.
The typical steps that a driver performs at the DriverEntry include the following:
(1)locate physical hardware devices that the driver will control
(2)Create one or more Device Objects
(3)Claim hardware resources to be used by the driver .
(4)Export other driver entry points.
(5)Connect to interrupts and register a DpcForIsr
(6)For DMA devices,describe the device's characteristics and get an Adapter Object
(7)Do whatever initialization and setup is necessary to make the devices under the device's control ready for processing

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值