I know that one can call the following API to hibernate the system:
SetSuspendState(TRUE, FALSE, FALSE);
But is there any way to find out if "real" hibernation is available for the current Windows user?
Here's what I mean:
If an admin calls:
powercfg.exe /hibernate off
the API above will put system into a Sleep mode. So how do you know (from a C++ program) that this will happen instead of hibernation?
I'm not sure if there's a group policy that can prohibit a user from hibernating a computer connected to an Active Directory?
Edit I am aware of the (dated)
IsPwrHibernateAllowed
API. I find that it doesn't work: it still returns the same result even ifpowercfg.exe /hibernate off
was called. Am I doing something wrong there? Can someone explain whyIsPwrHibernateAllowed
doesn't work for me?