Win 8/10 "Fast startup": signal "Wake from hibernate" to driver?

Our KMDF based driver family has a problem with the “Fast startup” feature of Windows 8/10.

Beside device file interfaces, application programs use also a control file interface of the driver to register and un-register themselfes (the driver is non-pnp here).
IF “Fast startup” is enabled, these things happen in the Shutdown / Power-On cycle (as desgined):

  1. applications are terminated in a quick way without beeing notified
    so apps do not “un-register” on their own. Perhaps processes are killed without a WM_ENDSESSION message … I’m not the application programmer.

  2. On Power-On, the driver is not reloaded, but is restored in the state as he was at hibernation time. DriverEntry() is not called. So the internal driver state is not notified about the “Startup” event, the data structures related to the killed application can not be cleaned up.

  3. the device power state is of course signaled with pnpPowerCallbacks.EvtDeviceD0Entry/Exit()
    But since our driver family contains also non-pnp drivers for virtual devices, I can not rely
    on PnP power events.

So what I need: an “Startup” event which is signaled to the driver in analogy to “DriverEntry()”, not to the devices.

In http://blogs.msdn.com/b/b8/archive/2011/09/08/delivering-fast-boot-times-in-windows-8.aspx
“Delivering fast boot times in Windows 8” there’s the sentence
“Another important thing to note about Windows 8?s fast startup mode is that, while we don?t do a full ?Plug & Play? enumeration of all drivers, we still do initialize drivers in this mode.”

What means “driver initialization” here ?

If I seem to be stupid: were can I read about the inside details of “Fast startup” ?

thanks for reading,
Joerg Hoppe, PEAK-System Technik

Hi Joerg,

Your understanding of “fast startup” seems to be already good enough.
It indeed is hibernation, legacy drivers will stay in the memory, their DriverEntry won’t be called again and apps may be killed (though it is unlikely that WM_ENDSESSION is not sent).

Legacy drivers can subscribe to \Callback\PowerState to receive power state notifications:

https://msdn.microsoft.com/en-us/library/windows/hardware/ff564933(v=vs.85).aspx

Legacy (and any other) drivers *must* correctly handle cancellation of pending i/o which can occur when apps are killed.

Regards,
– pa

You’re using wrong method of letting the driver know the application exited.

Your driver needs to free its application-related resources when it gets IRP_MJ_CLOSE. And support IRP cancellation, if the IRPs can pend for indeterminate time.