Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2005 Aug : Shutdown problems on XP

www.cryer.info
Managed Newsgroup Archive

Shutdown problems on XP

Subject:Shutdown problems on XP
Posted by:"RGreen" (rgreen@nospam.org)
Date:Wed, 10 Aug 2005 12:04:10 +0200

Hello!

I have developed a service that is running under the administrator account.
One of the operations the service does is to shutdown the system everynight.
I use the WinApi

ExitWindowsEx(EWX_POWEROFF, 0);


Before I call this function I open the process token, adjust the token
privileges with SeShutdownPrivilege and blah, blah, blah. The service works
fine and shutdowns the system fine but ONLY if there is a user logged on the
system at this time. If there are no user logged, the function is executed
and returns a nonzero value (shutdown OK) but the system actually does not
shutdown. Asking the newsgroups I was told to go to the registry key

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon

and set ShutdownWithoutLogon to 1, but the problem persists.

Any idea what is going on here?

Glossary

Replies:

www.cryer.info
Managed Newsgroup Archive