Added registry shutdown function CmShutdownRegistry()
[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/hal/io.h>
16 #include <internal/ps.h>
17 #include <internal/io.h>
18 #include <internal/mm.h>
19
20 #include <internal/debug.h>
21
22 /* FUNCTIONS *****************************************************************/
23
24 NTSTATUS STDCALL NtSetSystemPowerState(VOID)
25 {
26 UNIMPLEMENTED;
27 }
28
29
30 NTSTATUS STDCALL NtShutdownSystem(IN SHUTDOWN_ACTION Action)
31 {
32 if (Action > ShutdownPowerOff)
33 return STATUS_INVALID_PARAMETER;
34
35 IoShutdownRegisteredDevices();
36 CmShutdownRegistry();
37 IoShutdownRegisteredFileSystems();
38 PiShutdownProcessManager();
39 MiShutdownMemoryManager();
40
41 if (Action == ShutdownNoReboot)
42 {
43 #if 0
44 /* Switch off */
45 HalReturnToFirmware (FIRMWARE_OFF);
46 #endif
47 }
48 else if (Action == ShutdownReboot)
49 {
50 HalReturnToFirmware (FIRMWARE_REBOOT);
51 }
52 else
53 {
54 HalReturnToFirmware (FIRMWARE_HALT);
55 }
56
57 return STATUS_SUCCESS;
58 }
59
60 /* EOF */
61