Index: dll/win32/advapi32/misc/shutdown.c =================================================================== --- dll/win32/advapi32/misc/shutdown.c (revision 57523) +++ dll/win32/advapi32/misc/shutdown.c (working copy) @@ -28,7 +28,7 @@ /********************************************************************** * AbortSystemShutdownA * - * @unimplemented + * see AbortSystemShutdownW */ BOOL WINAPI AbortSystemShutdownA(LPCSTR lpMachineName) @@ -110,23 +110,49 @@ BOOL bRebootAfterShutdown, DWORD dwReason) { - SHUTDOWN_ACTION Action = ShutdownNoReboot; + SHUTDOWN_ACTION action; NTSTATUS Status; + int timeout; - if (lpMachineName) + /* Convert to milliseconds so we can use the value + later on */ + if (dwTimeout > 0) { - /* FIXME: remote machine shutdown not supported yet */ - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + timeout = dwTimeout * 1000; } - - if (dwTimeout) + + if (lpMachineName != NULL) { + /* FIXME: Remote system shutdown not supported yet */ + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; } - - Status = NtShutdownSystem(Action); + 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; + } + + Status = NtShutdownSystem(action); + } + + /* If there was a problem shutting down */ + if (Status != STATUS_SUCCESS) + { + SetLastError(RtlNtStatusToDosError(Status)); + return FALSE; + } + SetLastError(RtlNtStatusToDosError(Status)); - return FALSE; + + return TRUE; } /****************************************************************************** @@ -186,7 +212,9 @@ bRebootAfterShutdown, dwReason); LastError = GetLastError(); - if (lpMachineName) + + /* Clears the values of both strings */ + if (lpMachineName) RtlFreeUnicodeString(&MachineNameW); if (lpMessage) @@ -215,7 +243,7 @@ /****************************************************************************** * InitiateShutdownA [ADVAPI32.@] * - * @unimplamented + * see InitiateShutdownW */ DWORD WINAPI InitiateShutdownA(LPSTR lpMachineName,