Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SetSuspendState() hangs up, why?

3 views
Skip to first unread message

nki00

unread,
Jan 26, 2012, 7:42:34 PM1/26/12
to
I was wondering why the following happens?

I need to log off users and then put computer to sleep. I do the following:

(Calling the following from the local system service):

WTSLogoffSession(WTS_CURRENT_SERVER_HANDLE, dwUserSessionID, TRUE);
SetSuspendState(FALSE, TRUE, FALSE);

But when I run this code on Windows Vista, SetSuspendState() hangs up and
never returns. At the same time the system does not enter sleep mode either.


0 new messages