>communicate with hardware directly.It will be through the virtual bus driver.It means that even during
the crash dump,bus driver should be loaded ,followed by miniport driver.
The crash dump path is very much limited.
Surely the crash dump path cannot load anything.
Also, it cannot allocate memory. It is executed on HIGH_LEVEL. It cannot accept interrupts. And so on.
The only support Windows provides to you is the 2phase protocol of crash dump drivers.
On phase 1 in the init path, you respond to some “get dump pointers” IOCTL, returning the DMA common buffer and the hardware register addresses for the dump path. The OS saves this information, and load the second instance of your driver just to do dumps. The DriverEntry of this second instance is not called after load.
On phase 2 when the actual dump occurs, the OS calls DriverEntry of the second dump instance, passing there the information gathered at phase 1. The driver is expected to quickly program the hardware according to this data (yes, the same hardware instance) and then execute writes, using polling instead of interrupts.
Everything is undocumented, surely, and, surely, everything was reworked in Vista.
I remember there was some disk encryption open source code (TrueCrypt?) which can be studied as the sample of pre-Vista (at least) crash dump filter.
SCSIPORT+DISKDUMP implement all of this for miniports, so, just the second instance of the miniport is loaded and then activated (using usual HwFindAdapter+HwInitialize) and used during the dump.
I think STORPORT also does this, but this requires the second instance of the miniport to be loaded and not initialized till the dump will occur.
So, you have the task of a) determining whether this miniport instance is a dump instance and b) running some quick simplified procedure of hardware accesses for the dump path, bypassing the bus driver at all.
–
Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com