91980b77cbad957d05f5d70681ce8b5bcfeaffff
[reactos.git] / reactos / ntoskrnl / ex / power.c
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS kernel
4 * FILE: ntoskrnl/ex/power.c
5 * PURPOSE: Power managment
6 * PROGRAMMER: David Welch (welch@cwcom.net)
7 * UPDATE HISTORY:
8 * Created 22/05/98
9 * Added reboot support 30/01/99
10 */
11
12 /* INCLUDES *****************************************************************/
13
14 #include <ddk/ntddk.h>
15 #include <internal/ps.h>
16 #include <internal/io.h>
17 #include <internal/mm.h>
18
19 #include <internal/debug.h>
20
21 /* FUNCTIONS *****************************************************************/
22
23 NTSTATUS STDCALL
24 NtSetSystemPowerState(VOID)
25 {
26 UNIMPLEMENTED;
27 }
28
29
30 NTSTATUS STDCALL
31 NtShutdownSystem(IN SHUTDOWN_ACTION Action)
32 {
33 if (Action > ShutdownPowerOff)
34 return STATUS_INVALID_PARAMETER;
35
36 IoShutdownRegisteredDevices();
37 CmShutdownRegistry();
38 IoShutdownRegisteredFileSystems();
39 PiShutdownProcessManager();
40 MiShutdownMemoryManager();
41
42 if (Action == ShutdownNoReboot)
43 {
44 #if 0
45 /* Switch off */
46 HalReturnToFirmware (FIRMWARE_OFF);
47 #endif
48 }
49 else if (Action == ShutdownReboot)
50 {
51 HalReturnToFirmware (FIRMWARE_REBOOT);
52 }
53 else
54 {
55 HalReturnToFirmware (FIRMWARE_HALT);
56 }
57
58 return STATUS_SUCCESS;
59 }
60
61 /* EOF */
62