3.2.4.3 BaseInitiateShutdownEx (Opnum 2)

The BaseInitiateShutdownEx method is used to initiate the shutdown of the remote computer.<11>

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

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.

dwReason: Reason for initiating the shutdown (section 2.3).

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

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. <12>