- Code: Select all
/* Load boot start drivers */
IopInitializeBootDrivers ();//call DriverEntry () for each driver
//When all drivers are initialized, call IopReinitializeBootDrivers()
/* Call back drivers that asked for */
IopReinitializeBootDrivers (); //call DriverReinitializationRoutine () in those drivers which registered by means of IoRegisterBootDriverReinitialization ()
From all drivers DriverReinitializationRoutine () is only at HAL (from HalpAddDevice ()) and at disk_new.sys (call from DriverEntry ()).
HAL launches IopEnumerateDevice () to create devices, and also relations between parent and child (found on the bus) devices (when the stack consists of several devices).
Are for this purpose used (in particular) IRP_MN_QUERY_DEVICE_RELATIONS and IRP_MN_QUERY_ID (for determination IDs: DeviceID, HardwareID, CompatibleID, InstanceID).
The parent device receives these IDs from child and should define what driver to use for the child device.
By the current moment for this purpose call IopInstallCriticalDevice () which takes a driver name compared ID from section "CriticalDeviceDatabase" in the registry.
For example: HKLM, "SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\*PNP0A03", "Service", 0x00000000, "pci" -
ID "*PNP0A03" there corresponds the driver "pci".
All is good, when we load LiveCD because by the time of start IopReinitializeBootDrivers () the section "CriticalDeviceDatabase" already is available in the registry.
In difference from BootCD. It is the first start of system and in the registry there are no records. At us is "txtsetup.sif" (section [HardwareIdsDatabase]) during the initial moment of loading (freeldr).
But call IopInstallCriticalDevice ()... There are no records in the register (CriticalDeviceDatabase).
What to do?