阅读:1736回复:5
还有个有趣的问题 向各位请教
我的驱动以start=0的方式加载 我想在DriverEntry中用zwCreatefile打开一个文件 读里面的数据 但是这个时候文件系统还没有加载 这该怎么办啊
|
|
沙发#
发布于:2007-01-22 23:55
判断\\SystemRoot 成功后再去做
|
|
板凳#
发布于:2007-01-23 09:11
就是,死等,直到上帝bill创建整个世界.hehe
|
|
|
地板#
发布于:2007-01-23 09:21
死等是个好方法,不然就只有自己实现文件系统,磁盘系统,==,去做了,也许自己实现个MINI OS也是不错的选择.
|
|
|
地下室#
发布于:2007-01-23 10:24
死等的话我该怎么等 难道在DriverEntry中写个死循环判断\\SystemRoot 是否可以读? 但是这样的话整个系统都会卡在这里 因为此时系统只是单线程 后面驱动的DriverEntry都不会执行 文件系统又怎么能够初始化
|
|
5楼#
发布于:2007-01-23 17:27
Windows Driver Kit: Kernel-Mode Driver Architecture
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 the driver's Reinitialize routine. 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 run 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. See Also DRIVER_OBJECT, IoRegisterDriverReinitialization |
|
|