know it's a reboot rather than shutdown?

I understand I can call IoRegisterShutdownNotification to register for notification of an impending shutdown of the system.
But is there a way I can know it’s a reboot rather than a shutdown operation?

I’m running in a VM, and need to tell the host system to restart the VM if the user wanted to reboot.

Thanks.

If you get power irps then you can look at IRP_MN_SET_POWER/currenIrpStack->Parameters.Power.ShutdownType to determine if it’s a shutdown or a reboot.

GOOD one… I had *entirely* forgotten that… PowerActionShutdownOff versus …ah… something.

Nice reminder, Pradeep.

Peter
OSR

Thanks Pradeep.
Right now I don’t look at any power stuff, but I’ll give your solution a whirl.

So, it looks like that within the KMDF framework the way to do it is to register for the EvtDeviceD0Exit event and then call WdfDeviceGetSystemPowerAction which returns a POWER_ACTION, which I expect to be PowerActionShutdownReset when the systen is doing a restart.