how to tell if dump mode or hiber mode

Is there a way to tell from a storport driver if I am in dump mode or hiber mode, preferably from DriverEntry? I know if I’m being called in dump/hiber mode, but not which of the two.

I’m guessing not as it doesn’t seem to be documented anywhere, but it would be useful to know. In dump mode I need to patch the DebugPrint hooks, but in hiber mode I don’t (and doing so causes double prints).

Thanks

James

Which OS version is this for? If Win 2012, the PORT_CONFIGURATION_INFORMATION has a member “DumpMode” which will provide this information. Of course, this will be in the HwStorInitialize routine.
For versions prior to Win 2012, I do not think there is a means to identify this.

Regards,
Girish.

On 15 February 2013 12:00, James Harper wrote:
> Is there a way to tell from a storport driver if I am in dump mode or hiber mode, preferably from DriverEntry? I know if I’m being called in dump/hiber mode, but not which of the two.
>
> I’m guessing not as it doesn’t seem to be documented anywhere, but it would be useful to know. In dump mode I need to patch the DebugPrint hooks, but in hiber mode I don’t (and doing so causes double prints).
>

Happily there is a way :slight_smile: Look at the registry path you’re given and
your service should have been prefixed with either hiber_ or dump_.

Paul


Paul Durrant
http://www.linkedin.com/in/pdurrant

> > Is there a way to tell from a storport driver if I am in dump mode or hiber

> mode, preferably from DriverEntry? I know if I’m being called in dump/hiber
> mode, but not which of the two.
>
> I’m guessing not as it doesn’t seem to be documented anywhere, but it
> would be useful to know. In dump mode I need to patch the DebugPrint
> hooks, but in hiber mode I don’t (and doing so causes double prints).
>

Happily there is a way :slight_smile: Look at the registry path you’re given and
your service should have been prefixed with either hiber_ or dump_.

RegistryPath passed to DriverEntry is always NULL in either mode

James

>

Which OS version is this for? If Win 2012, the
PORT_CONFIGURATION_INFORMATION has a member “DumpMode” which
will provide this information. Of course, this will be in the HwStorInitialize
routine.
For versions prior to Win 2012, I do not think there is a means to identify this.

Windows 8 is where I really care about it because by default 8 will hibernate instead of shut down, so having it not work would be a pain.

The other alternative is that I don’t claim to support hibernate… seems like the sort of thing WLK might take exception to though.

James

“James Harper” wrote in message news:xxxxx@ntdev…

RegistryPath passed to DriverEntry is always NULL in either mode

How can RegistryPath be NULL ? I think RegistryPath is never NULL. If yes,
what type of driver do I write to achieve that ?

//Daniel

>

“James Harper” wrote in message news:xxxxx@ntdev…
>RegistryPath passed to DriverEntry is always NULL in either mode

How can RegistryPath be NULL ? I think RegistryPath is never NULL. If yes,
what type of driver do I write to achieve that ?

The RegistryPath passed to DriverEntry is NULL in either of dump mode or hiber mode. From http://msdn.microsoft.com/en-us/library/windows/hardware/ff564084(v=vs.85).aspx

“The operating system passes NULL arguments to the miniport driver’s DriverEntry routine.”

My testing on Windows 2000 - 2012 confirms this.

James

Any time you get the crash dump driver (from one of the storage models)
it is NULL. The normal invocation is fine, but the dump.

Don Burn
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr

xxxxx@resplendence.com” wrote in message
news:xxxxx@ntdev:

> “James Harper” wrote in message news:xxxxx@ntdev…
> >RegistryPath passed to DriverEntry is always NULL in either mode
>
> How can RegistryPath be NULL ? I think RegistryPath is never NULL. If yes,
> what type of driver do I write to achieve that ?
>
> //Daniel

> >

> Which OS version is this for? If Win 2012, the
> PORT_CONFIGURATION_INFORMATION has a member “DumpMode”
which
> will provide this information. Of course, this will be in the HwStorInitialize
> routine.
> For versions prior to Win 2012, I do not think there is a means to identify
this.
>

Windows 8 is where I really care about it because by default 8 will hibernate
instead of shut down, so having it not work would be a pain.

The other alternative is that I don’t claim to support hibernate… seems like
the sort of thing WLK might take exception to though.

I can call AuxKlibGetBugCheckData() - if the BugCheckCode == 0 then it probably isn’t a bug check.

James

Actually in my case I have an export driver linked to my miniport. The
registry path to its DllInitialize is prefixed appropriately.

Paul
On Feb 15, 2013 11:14 PM, “James Harper”
wrote:

> > > Is there a way to tell from a storport driver if I am in dump mode or
> hiber
> > > mode, preferably from DriverEntry? I know if I’m being called in
> dump/hiber
> > > mode, but not which of the two.
> > >
> > > I’m guessing not as it doesn’t seem to be documented anywhere, but it
> > > would be useful to know. In dump mode I need to patch the DebugPrint
> > > hooks, but in hiber mode I don’t (and doing so causes double prints).
> > >
> >
> > Happily there is a way :slight_smile: Look at the registry path you’re given and
> > your service should have been prefixed with either hiber_ or dump_.
> >
>
> RegistryPath passed to DriverEntry is always NULL in either mode
>
> James
>
>
>
> —
> NTDEV is sponsored by OSR
>
> OSR is HIRING!! See http://www.osr.com/careers
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>


The DumpMode flag mentioned previously is available for Win8 (http://msdn.microsoft.com/en-us/library/windows/hardware/ff563901(v=vs.85).aspx)