InitiateShutdown, can't understand a value passed to the function

331 views Asked by At

I don't understand the difference between shutting down a computer and powering off a computer with this function. I'm looking at https://msdn.microsoft.com/en-us/library/windows/desktop/aa376872(v=vs.85).aspx
Specifically, I don't understand SHUTDOWN_NOREBOOT.

  • SHUTDOWN_NOREBOOT
    0x00000010 (0x10)
    The computer is shut down but is not powered down or rebooted.
  • SHUTDOWN_POWEROFF
    0x00000008 (0x8)
    The computer is shut down and powered down.
  • SHUTDOWN_RESTART
    0x00000004 (0x4)
    The computer is shut down and rebooted.

If the computer is not powered down nor is it going to be rebooted, then what is the purpose? Is SHUTDOWN_NOREBOOT synonymous with having the computer sleep?

1

There are 1 answers

2
zwol On BEST ANSWER

The documentation for the equivalent option for ExitWindowsEx, EWX_SHUTDOWN, is a bit clearer. (Emphasis mine)

Shuts down the system to a point at which it is safe to turn off the power. All file buffers have been flushed to disk, and all running processes have stopped.

In days of yore, PCs did not have the ability to turn themselves off, and there was no EWX_POWEROFF option. When you shut down Windows, it would either drop you back into DOS, or (if there was no outer DOS environment) it would put up a black screen with orange text reading "It's now safe to turn off your computer." That was your cue to flip the big red switch on the side of the case.

Nowadays, this shut-down mode is obsolete but preserved for backward compatibility. I wouldn't be surprised if Windows 10 could still bring up the "It's now safe to turn off your computer" screen.