Tracking Wake Source in Usermode driver!

Hi Gurus,

I am implementing one feature in my user mode driver where I need to know Wake Up source. The device which made the system to wake up.

I need to enable the feature depending on the wake source.

Can anybody suggest if any powercallback/API to check this?

We can trap keyboard and mouse event in Service but I don’t want to go for that as I have to implement service in addition to the driver and keyboard/mouse may not be only wake sources.

Thanks

I need to know Wake Up source

Interesting question. I seem to recall that this isn’t something that’s possible to do reliably from the OS, at least not without specific BIOS changes.

For example, there’s a callback that you can use for a USB driver for devices that support waking the system… you can be called back if YOUR device was the one that woke the system. However, I seem to recall that this callback isn’t 100% reliable, it’s more like a guess or a hint.

I’ll be happy to discover that I’m wrong, but that’s what I seem to recall from my distant memory of this issue. Sorry to not have anything more definitive to share.

Peter

Thanks, Peter for the reply.

For example, there’s a callback that you can use for a USB driver for devices that support waking the system… you can be called back if YOUR device was the one that woke the system. However, I seem to recall that this callback isn’t 100% reliable, it’s more like a guess or a hint.

Yes, I agree there is one in “IPowerPolicyCallbackWakeFromSx::OnWakeFromSxTriggered” which gets triggered when your device is wake up source. I am not sure about reliability.

But my question still remains.

AFAIK there is no documented way to query for the wake source in either UM or KM. At best, your wait wake request in the driver completed with success, but that is not definitive.

d