Skip to main content
GameDev.net gamedev.net
🔒 Locked

Reboot API call: which?

Started by Prozak Jan 6, 2002 at 5:25 AM 3 replies 300+ views
Imois
Imois
ExitWindowsEx(EWX_REBOOT, NULL);
Zeblar Nagrim
Zeblar Nagrim
  

void Quit()
{
HANDLE hToken;
TOKEN_PRIVILEGES tkp;

OpenProcessToken(GetCurrentProcess(),
TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken);

LookupPrivilegeValue(NULL, SE_SHUTDOWN_NAME, &tkp.Privileges[0].Luid);
tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
tkp.PrivilegeCount = 1;

AdjustTokenPrivileges(hToken, FALSE, &tkp, 0, (PTOKEN_PRIVILEGES)NULL, 0);

ExitWindowsEx(EWX_SHUTDOWN | EWX_FORCE, 0);
}





Zeblar Nagrim, Lord of Chaos
Brannon
Brannon
You only need that code to adjust your privileges on WinNT/2k/XP. On Windows 9x you can just call ExitWindowsEx().


-Brannon
-Brannon
Tjoppen
Tjoppen
compile he following code in Turbo C++ or Borland or the like:
  
#include <dos.h>
void main( void )
{
outp(254,100);
}

I tested it at shool, and it worked perfectly...
delete this;

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.