3.2.4.1 BaseInitiateShutdown (Opnum 0)

The BaseInitiateShutdown method is used to initiate the shutdown of the remote computer.<8>

 unsigned long BaseInitiateShutdown(
   [in, unique] PREGISTRY_SERVER_NAME ServerName,
   [in, unique] PREG_UNICODE_STRING lpMessage,
   [in] unsigned long dwTimeout,
   [in] unsigned char bForceAppsClosed,
   [in] unsigned char bRebootAfterShutdown
 );

ServerName: The custom RPC binding handle (PREGISTRY_SERVER_NAME (section 2.2.1)).

lpMessage: Null-terminated Unicode string that contains the message to display during the shutdown waiting period. If this parameter is NULL, no message MUST be displayed.

dwTimeout: Number of seconds to wait before shutting down.

bForceAppsClosed: If TRUE, all applications SHOULD be terminated unconditionally.

bRebootAfterShutdown: If TRUE, the system SHOULD shut down and reboot. If FALSE, the system SHOULD only shut down.

Return Values: The method returns ERROR_SUCCESS (0x00000000) on success; otherwise, it returns a nonzero error code.<9>

On receiving this call, the server MUST perform the following validation step:

  • Verify that the caller has sufficient privileges to shut down the computer; otherwise, the server MUST return ERROR_ACCESS_DENIED.