0

I have a windows service that is supposed to reboot the machine if the system is locked or if the system is logged out.

The service runs fine when the system is locked, but does not want to reboot the machine if the system is logged out of.

The service is running under local system permissions.

I'm lost at why the service is not working correctly when the user chooses to logoff the machine, instead of locking it....

any ideas?

thanks

pithhelmet
  • 2,222
  • 6
  • 35
  • 60
  • You can attach a debugger to the service over the network without anyone logged onto the console to debug why this is happening. – Michael Burr Apr 18 '13 at 18:15
  • Is your code calling [ExitWindowsEx](http://msdn.microsoft.com/en-us/library/windows/desktop/aa376868%28v=vs.85%29.aspx)? If so, what is the error returned? – CoreTech Apr 18 '13 at 20:51
  • I seem to recall running across a race condition when doing something similar. How does the service detect logouts? – Harry Johnston Apr 26 '13 at 01:14
  • OK - here is the scoop.... there was an exception being thrown way up the stack of operation.... this exception was causing the code block that forces the reboot to be skipped.... i fixed the exception causing problem, and the machine boots correctly now. thanks to everyone! – pithhelmet May 21 '13 at 15:03

0 Answers0