The following is the source code, in fact, in 98, only the last example of EXITWINDOWEX, the previous is to obtain permissions.
Token_Privileges TKP, TKPNewButignored; Handle HDLTokenHandle; Luid Tmpluid; Bool Rc; DWORD LBUFFERNEEDED;
Handle HDLProcessHandle = getCurrentProcess (); rc = :: OpenProcessToken (HDLProcessHandle, Token_Adjust_privileges | token_Query, & HDLTokenhandle);
rc = LookupPrivilegeValue ( "", "SeShutdownPrivilege", & tmpLuid); tkp.PrivilegeCount = 1; // One privilege to set tkp.Privileges [0] .Luid = tmpLuid; tkp.Privileges [0] .Attributes = SE_PRIVILEGE_ENABLED; rc = :: AdjustTokenPrivilegeg (HDLTokenHandle, False, & Tkp, Sizeof (TkpnewButInored), & TkpnewButInored, & lbufferneed;
EXITWINDOWSEX (EWX_REBOOT, 0);