I was wondering why the following happens?
I need to log off user and then put computer to sleep. I do the following:
(Calling the following from the local system service):
But when I run this code, SetSuspendState() hangs up and never returns. At the same time the system does not enter sleep mode either.Code:WTSLogoffSession(WTS_CURRENT_SERVER_HANDLE, dwUserSessionID, TRUE); SetSuspendState(FALSE, TRUE, FALSE);




Reply With Quote