On Wed, 14 Apr 2004 14:30:37 +0200, "Andreas Håkansson" <andy.h (at)
telia.com> wrote:
Brady,
Goblins? Your doing it wrong? Please provide us with a bit more
information,
such as the API declaration and call as well as any errors you might be
getting etc
so we wont have to play the guessing game =)
I'm using the WindowsController class from The KPD-Team at
http://www.mentalis.org/.
The declarations are, in only the necessary detail:
public enum RestartOptions {
Reboot = 2,
}
[ DllImport( "user32.dll", EntryPoint="ExitWindowsEx",
CharSet=CharSet.Ansi )]
private static extern int ExitWindowsEx(int uFlags, int dwReserved);
....
EnableToken("SeShutdownPrivilege");
if (ExitWindowsEx(RestartOptions.Reboot | EWX_FORCE, 0) == 0)
throw new Exception.......
I'm not getting an exception, so it looks like the call is
'apparently' working. The strangest is that the application restarts,
not the system.