<div class="content" name="BaseInitiateSystemShutdownEx" uuid="0e5da40b-7b77-47c5-be56-9133a96f7d0f"><p>The <b>BaseInitiateSystemShutdownEx<span>
</span></b>method is used to initiate the shutdown of the remote computer with
the reason for initiating the shutdown given as a parameter to the call.<a id="Appendix_A_Target_6"></a><a aria-label="Product behavior note 6" href="226cc244-36f0-441f-8ce9-57e616e8409b#Appendix_A_6" data-linktype="relative-path">&lt;6&gt;</a></p><dl>
<dd>
<div><pre> unsigned long BaseInitiateSystemShutdownEx(
   [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
 );
</pre></div>
</dd></dl><p><b>ServerName: </b>The custom <a href="7a7ca3c2-1346-417b-93e8-e8940a524da6#gt_8a7f6700-8311-45bc-af10-82e10accd331" data-linktype="relative-path">RPC</a> binding <a href="7a7ca3c2-1346-417b-93e8-e8940a524da6#gt_5044babb-08e3-4bb9-bc12-fe8f542b05ee" data-linktype="relative-path">handle</a> (<a href="c9a7064d-27c8-4886-ab14-fe884166a240" data-linktype="relative-path">PREGISTRY_SERVER_NAME (section 2.2.1)</a>).</p><p><b>lpMessage: </b>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.</p><p><b>dwTimeout: </b>Number of seconds to wait before
shutting down.</p><p><b>bForceAppsClosed: </b>If TRUE, all applications
SHOULD be terminated unconditionally.</p><p><b>bRebootAfterShutdown: </b>If TRUE, the system
SHOULD shutdown and reboot. If FALSE, the system SHOULD only shut down.</p><p><b>dwReason: </b>Reason for initiating the shutdown
(section <a href="d74aa51d-d481-4dc5-b0a2-750871916106" data-linktype="relative-path">2.3</a>). The <b>dwReason</b>
SHOULD be used for log entries for the shutdown event.</p><p><b>Return Values: </b>The method returns
ERROR_SUCCESS (0x00000000) on success; otherwise, it returns a nonzero error
code.</p><p>On receiving this call, the server MUST perform the
following validation step:</p><ul><li><p><span><span> 
</span></span>Verify that the caller has sufficient privileges to shut down the
computer; otherwise, the server MUST return ERROR_ACCESS_DENIED. </p>
</li></ul></div>