test001
驱动小牛
驱动小牛
  • 注册日期2006-11-12
  • 最后登录2008-11-07
  • 粉丝0
  • 关注0
  • 积分990分
  • 威望170点
  • 贡献值0点
  • 好评度169点
  • 原创分0分
  • 专家分0分
阅读:1282回复:2

请教wowocock老大!!!

楼主#
更多 发布于:2007-10-26 09:26
还是那个问题:我的驱动以start=0的方式加载,可是我想在DriverEntry中读取硬盘上的文件,但是这个时候文件系统还没有加载,所以无法读,我看了论坛上以前的帖子,可以在驱动的入口函数里判断DeviceObject->DeviceType 是否为文件系统类型的方法。于是我在入口函数里用起了一个线程,该线程里是一个死循环等待文件系统启动,可是我发现驱动加载后,系统就会死机。
  你说的注册Reinitialization的CALLBACK,怎么用,能具体说说吗?
  这个问题已经困扰我好几天了,实在是想不出什么办法,麻烦你帮忙解答一些!
  不胜感激!!!
wowocock
VIP专家组
VIP专家组
  • 注册日期2002-04-08
  • 最后登录2016-01-09
  • 粉丝16
  • 关注2
  • 积分601分
  • 威望1651点
  • 贡献值1点
  • 好评度1227点
  • 原创分1分
  • 专家分0分
沙发#
发布于:2007-10-26 11:47
IoRegisterBootDriverReinitialization
The IoRegisterBootDriverReinitialization routine is called by a boot driver to register the driver's reinitialization routine with the I/O manager to be called after all devices have been enumerated and started.

VOID
  IoRegisterBootDriverReinitialization(
    IN PDRIVER_OBJECT  DriverObject,
    IN PDRIVER_REINITIALIZE  DriverReinitializationRoutine,
    IN PVOID  Context
    );
Parameters
DriverObject
Pointer to the driver object for the boot driver to be reinitialized.
DriverReinitializationRoutine
Pointer to a caller-supplied reinitialization routine. This routine is defined as follows:
VOID
(*PDRIVER_REINITIALIZE) (
    IN struct _DRIVER_OBJECT *DriverObject,
    IN PVOID Context,
    IN ULONG Count
    );

The DriverReinitializationRoutine parameters are as follows:

DriverObject
Pointer to the file system filter driver's driver object.
Context
Optional context pointer.
Count
Number of times this routine has been called, including the current call.
Context
Optional context pointer to be passed to the driver's reinitialization routine.
Return Value
None

Headers
Declared in ntddk.h and ntifs.h. Include ntddk.h or ntifs.h.

Comments
A boot driver normally calls IoRegisterBootDriverReinitialization from its DriverEntry routine, which is executed during boot driver initialization. IoRegisterBootDriverReinitialization registers the driver's reinitialization callback routine to be called by the I/O manager after all devices have been enumerated and started. The DriverReinitializationRoutine is run in a system thread at IRQL = PASSIVE_LEVEL.

A driver should call IoRegisterBootDriverReinitialization only if its DriverEntry routine will return STATUS_SUCCESS.

If the DriverReinitializationRoutine uses the registry, the DriverEntry routine must include in IoRegisterBootDriverReinitialization's Context parameter a copy of the string to which DriverEntry's own RegistryPath parameter points.

The DriverEntry routine can call IoRegisterBootDriverReinitialization only once. If the reinitialization routine needs to be run more than once, the DriverReinitializationRoutine can call IoRegisterBootDriverReinitialization as many additional times as needed, using the Count parameter to keep track of the number of times the DriverReinitializationRoutine has been called.

Callers of IoRegisterBootDriverReinitialization must be running at IRQL = PASSIVE_LEVEL.
花开了,然后又会凋零,星星是璀璨的,可那光芒也会消失。在这样 一瞬间,人降生了,笑者,哭着,战斗,伤害,喜悦,悲伤憎恶,爱。一切都只是刹那间的邂逅,而最后都要归入死亡的永眠
test001
驱动小牛
驱动小牛
  • 注册日期2006-11-12
  • 最后登录2008-11-07
  • 粉丝0
  • 关注0
  • 积分990分
  • 威望170点
  • 贡献值0点
  • 好评度169点
  • 原创分0分
  • 专家分0分
板凳#
发布于:2007-10-26 12:02
wowocock老大,我已经看了ifs的帮助了,可是不知道具体怎么用IoRegisterBootDriverReinitialization函数,能给个范例吗?
游客

返回顶部