Index: dll/win32/advapi32/misc/shutdown.c =================================================================== --- dll/win32/advapi32/misc/shutdown.c (revision 63303) +++ dll/win32/advapi32/misc/shutdown.c (working copy) @@ -113,33 +113,31 @@ BOOL bRebootAfterShutdown, DWORD dwReason) { - SHUTDOWN_ACTION action; NTSTATUS Status; - ULONG Timeout_ms; - /* Convert to milliseconds so we can use the value later on */ - Timeout_ms = dwTimeout * 1000; + TRACE("(%s, %s, %p, %d, %d, %p)\n", lpMachineName, lpMessage, dwTimeout, bForceAppsClosed, bRebootAfterShutdown, dwReason); + /* Check to make sure that the time out code is under + the maximum time out limit */ + if(dwTimeout > MAX_SHUTDOWN_TIMEOUT) + { + ERR("dwTimeout value (%d) larger than MAX_SHUTDOWN_TIMEOUT (%d)\n", dwTimeout, MAX_SHUTDOWN_TIMEOUT); + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + /* Determine if the user wants to shut down the local system, or a remote one */ if (lpMachineName != NULL) { - /* FIXME: Remote system shutdown not supported yet */ - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + FIXME("Remote system shut down not supported yet"); + SetLastError(ERROR_FAIL_SHUTDOWN); return FALSE; } else /* The local system is being used */ { - /* FIXME: Right now, only basic shutting down and rebooting - is supported */ - if(bRebootAfterShutdown == TRUE) - { - action = ShutdownReboot; - } - else - { - action = ShutdownNoReboot; - } + FIXME("Only basic shut down and reboot are currently supported"); - Status = NtShutdownSystem(action); + Status = NtShutdownSystem(bRebootAfterShutdown ? ShutdownReboot : ShutdownNoReboot); } SetLastError(RtlNtStatusToDosError(Status)); @@ -215,6 +213,10 @@ return rv; } +/* + Windows Vista or later +*/ +#if _WIN32_WINNT >= 0x0600 /****************************************************************************** * InitiateShutdownW [ADVAPI32.@] * @@ -297,5 +299,5 @@ SetLastError(LastError); return rv; } - +#endif /* _WIN32_WINNT >= 0x0600 */ /* EOF */