Re: Windows Shutdown
- Posted by "Louis Puster" <Louis at cwshop.com> Oct 19, 2003
- 491 views
The Windows shutdown process is very buggy. It works differently from one computer to the next. A small assembly language program that will shutdown, logoff, play sounds, open and close a CDROM, an entertaining and educational screensaver, and much more is called WIZMO and can be found at GRC.COM. (This guy does EVERYTHING in assembly language, even his own Web server and TCP/IP drivers.) Louis. *********** REPLY SEPARATOR *********** On 10/18/2003 at 1:16 PM Christopher B wrote: > > >Hello to all, > >I have been using the following code at the end of this message to try >and shutdown windows, but unfortunately it only logs the user off, and >not completely shutdown the PC. I did some research on the MSN website, >and I found out to shut down or restart the system, the calling process >must use the AdjustTokenPrivileges function to enable the >SE_SHUTDOWN_NAME privilege. The problem is I do not have a clue on how >to do that. Can anyone help out with this? > >constant USER32 = open_dll("user32") > >constant SHUTDOWNEX = define_c_func(USER32, "ExitWindowsEx", {C_UINT, >C_LONG}, C_INT) >global constant > > EWX_FORCE = 4, > EWX_LOGOFF = 0, > EWX_POWEROFF = 8, > EWX_REBOOT = 2, > EWX_SHUTDOWN = 1 > > >global procedure win32_shutdown(integer shutdown_type) > integer x > x = c_func(SHUTDOWNEX, {shutdown_type, 0}) >end procedure > >Thanks in advance, >Chris