BOOL AbortSystemShutdown(lpszMachineName) | |||||
LPTSTR lpszMachineName; | /* name of machine to stop shutting down | */ |
The AbortSystemShutdown function stops a system shutdown started with the InitiateSystemShutdown function.
lpszMachineName
Points to the null-terminated string that specifies the network machine name of the machine where the shutdown will stop. If lpszMachineName is NULL or points to an empty string, the function stops the shutdown on the local machine.
The return value is TRUE if the function was successful, or FALSE if an error occurred. Use the GetLastError function to obtain extended error information. Common failures include invalid or inaccessible machine name or insufficient privilege.
This function can be used to stop a system shutdown started by the InitiateSystemShutdown function while that function is displaying the dialog box that prompts the user to log off (during the timeout time specified for InitiateSystemShutdown).
The calling process must have SeShutdownPrivilege to stop the shutdown the local machine. The caller must have SeRemoteShutdownPrivilege on the target machine to shut down a remote machine. By default, users will have privilege to shut down the machine they are logged onto, while administrators will have privilege to shut down a remote machine.
InitiateSystemShutdown