shutdown locally and SeRemoteShutdownPrivilege (see [MSDN-PRVLGECNSTS]) when performing the shutdown remotely. The caller calls ExitWindowsEx (see ) to perform the actual shutdown once all checks have been completed. BOOLEAN RpcWinStationShutdownSystem( [in] SERVER_HANDLE hServer, [out] DWORD* pResult, [in] DWORD ClientLogonId, [in] DWORD ShutdownFlags ); hServer: Handle to the server object. This is of type . The hServer MUST be obtained from a previous call to . pResult: Failure error code if the call to RpcWinStationShutdownSystem failed. If the call was successful, this parameter MUST be STATUS_SUCCESS (0x00000000). Value Meaning STATUS_SUCCESS The call succeeded. 0x00000000 STATUS_ACCESS_DENIED The caller does not have permission to shut down 0xC0000022 the system. ClientLogonId: The session requesting to shut down the system. Ignored when the RPC call is remote. ShutdownFlags: Shutdown flags. It MUST be any bitwise OR combination of the following flags. Value Meaning WSD_LOGOFF Forces sessions to logoff. 0x00000001 WSD_SHUTDOWN Shuts down the system. 0x00000002 WSD_REBOOT Reboots after shutdown. 0x00000004 WSD_POWEROFF Powers off after shutdown. 0x00000008 Return Values: Returns TRUE if the call succeeded, or FALSE if the method failed. On failure, pResult indicates the failure status code. Return Description 0x01 Successful completion. TRUE 0x00 Method call failed. FALSE
shutdown locally and SeRemoteShutdownPrivilege (see [MSDN-PRVLGECNSTS]) when performing the shutdown remotely. The caller calls ExitWindowsEx (see ) to perform the actual shutdown once all checks have been completed. BOOLEAN RpcWinStationShutdownSystem( [in] SERVER_HANDLE hServer, [out] DWORD* pResult, [in] DWORD ClientLogonId, [in] DWORD ShutdownFlags ); hServer: Handle to the server object. This is of type . The hServer MUST be obtained from a previous call to . pResult: Failure error code if the call to RpcWinStationShutdownSystem failed. If the call was successful, this parameter MUST be STATUS_SUCCESS (0x00000000). Value Meaning STATUS_SUCCESS 0x00000000 The call succeeded. STATUS_ACCESS_DENIED 0xC0000022 The caller does not have permission to shut down the system. ClientLogonId: The session requesting to shut down the system. Ignored when the RPC call is remote. ShutdownFlags: Shutdown flags. It MUST be any bitwise OR combination of the following flags. Value Meaning WSD_LOGOFF 0x00000001 Forces sessions to logoff. WSD_SHUTDOWN 0x00000002 Shuts down the system. WSD_REBOOT 0x00000004 Reboots after shutdown. WSD_POWEROFF 0x00000008 Powers off after shutdown. Return Values: Returns TRUE if the call succeeded, or FALSE if the method failed. On failure, pResult indicates the failure status code. Return Description 0x01 TRUE Successful completion. 0x00 FALSE Method call failed.