what should I do when deal with power IRP on system hibernation

Hello

I design a storage class filter driver in XP sp2. I use this class
filter driver to build a RAID using lower physical hard disk.So I hide the
real physical hard disk in my filter driver and create a report a RAID
object to operation system.
Now, it can work very well when operantion system is working on. But
when system is going to hibernate,it crashs dowm.
In my design, I complete all the system and device set power IRP with
STATUS_SUCCESS. My driver can work correct when system is going to sleep,
but the system can not hibernate. When I trace my driver using WinDBG,I
fount that all the power IRPs were completed succeed but after the last IRP
was finished, the system was crashed. WinDBG tell me that the system crash
ocure in BOOTVID.dll.
So, I want to kown that what should I do when deal with power IRP on
system hibernation correctly in my design?

Thank you!

God will bless you and your family!
Wayne Gong
xxxxx@yahoo.com.cn

Is your faked out raid disk the boot disk? If so, how do you boot from this RAID disk? If your RAID disk is not the boot device, this should not affect how the OS boots or restores from hibernate. If you need further help, then you should send the output of !analyze -v after the machine has crashed.

d

Thanks for your message.
I boot from the raid disk with the help of option ROM. OS can boot and shut down from this raid disk.
I got a lot of message from !analyze -v in WinDBG. It says that there is something wrong with BOOTVID.DLL. What’s OS doing when she using BOOTVID.dll in hibernating.

By the way, when I trace my driver, I found that when system hibernating, the RAID pdo did not receive a Device set-power IRP. What’s wrong with it? Does I need to call PoRequestPowerIrp when I handle the System set-power IRP? My driver is a storage class filter driver, I think it’s not the power policy owner driver of raid disk pdo.

> Now, it can work very well when operantion system is working on. But

when system is going to hibernate,it crashs dowm.

Correct. I think that this is because Windows cannot write hiberfil to your
RAID.

Hiberfil (and also kernel crash dump) writing is done using a very special
path, and this is one of the main causes why the usual Windows software RAIDs
(NT4-style and Dynamic Disk) do not support SystemRoot to be on any other RAID
kind then a mirror, and also do not support pagefile/hiberfil creation on any
other RAID kind then a mirror (the MEMORY.DMP file is created from a pagefile
by renaming it on the next boot following the crash).

Note that the mirror will be broken in pagefile and hiberfil.

So, the correct way is to prohibit pagefile/hiberfil creation in your RAID on
anything then a mirror kind of RAID. I think you can do this by failing
IRP_MN_DEVICE_USAGE_NOTIFICATION or doing something related to this IRP.

Supporting hiberfil on, say, stripe set is THE task.

First of all, hiberfil is loaded by NTLDR before (actually instead) of the
kernel, so, it is loaded by int 13h, and, to support it on your RAID, you will
need a real-mode int 13h interceptor installed yourself before NTLDR.

Second, hiberfil writing is done using very, very special path in the storage
port driver - or the special helper driver for the storage port. I think that
even interrupts are not allowed in this path, and this “dump driver” uses
polling instead. The CPU is obviously well-heated during hiberfil writing, it
is noticeable that the laptop’s CPU fan increases its speed during this
operation.


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com