Writing Reinitialize Routines

< BACK  NEXT >
[oR]

Intermediate-level drivers loading at system boot time may need to delay their initialization until one or more lower-level drivers have finished loading. If the loading of the drivers is under central control, the load sequence can be fixed by setting various Registry entries at installation. But if the drivers are supplied by different vendors, the load order may be indeterminate. In the latter case, the intermediate driver must register and implement a Reinitialize routine.

Execution Context

If the DriverEntry routine discovers that it can't finish its initialization because system bootstrapping hasn't yet gone far enough, it can announce a Reinitialize routine by calling IoRegisterDriverReinitialization. The I/O Manager calls the Reinitialize routine at some later point during the bootstrap. As described in Table 6.3, the Reinitialize routine runs at PASSIVE_ LEVEL IRQL, which means it has access to paged system resources. Reinitialize routines are useful only for drivers that load automatically at system boot.

What a Reinitialize Routine Does

The Reinitialize routine can perform any driver initialization that the DriverEntry routine was unable to complete. If the Reinitialize routine discovers that the environment still isn't suitable, it can call IoRegisterDriverReinitialization again to reregister itself.

Table 6.3. Function Prototype for Reinitialize Routine
VOID Reinitialize IRQL == PASSIVE_LEVEL
Parameter Description
IN PDRIVER_OBJECT pDriverObject Pointer to driver object
IN PVOID Context Context block specified at registration
IN ULONG Count Zero-based count of reinitialization calls
Return value (void)

< BACK  NEXT >


The Windows 2000 Device Driver Book(c) A Guide for Programmers
The Windows 2000 Device Driver Book: A Guide for Programmers (2nd Edition)
ISBN: 0130204315
EAN: 2147483647
Year: 2000
Pages: 156

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net