c++ - SetSuspendState() API never returns in Win8 -
let me explain problem statement:
in vc++ project want insert logic send system (windows 8) sleep state programatically & resume back.
i'm doing (copying code snippet) ::
int wait = 100; large_integer waittime; waittime.quadpart = wait; waittime.quadpart *= -10000000; handle htimer = createwaitabletimer(null, false, null); if(0 == setwaitabletimer(htimer, &waittime, 0, null, null, true)) { res = false; return res; } if(0 == setsuspendstate(false, false, false)) { res = false; return res; } the system going sleep (monitor getting turned off).
here, want resume sleep state after setsuspendstate() api call. but see setsuspendstate() call not @ returning. control struck @ setsuspendstate() call & doesn't return back.
however, if forcefully bring system power , see come function "setsuspendstate()" doesn't return in code.
can please me figure out why setsuspendstate() not returning & how fix problem. in advance.
ps: i'm using vs remote debugger mechanism achieve sleep state.
i imagine call setsuspendstate results in remote debug server being shutdown. when call setsuspendstate system starts shutdown, , involves notifying applications system going down. when happens, applications expected terminate. can expect lose connection remote debugger.
Comments
Post a Comment