ReactOS 0.4.15-dev-5884-gab5aff5
shutdown.c
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS kernel
4 * FILE: ntoskrnl/ex/shutdown.c
5 * PURPOSE: Power managment
6 *
7 * PROGRAMMERS: David Welch (welch@cwcom.net)
8 */
9
10/* INCLUDES *****************************************************************/
11
12#include <ntoskrnl.h>
13
14#define NDEBUG
15#include <debug.h>
16
17/* PRIVATE FUNCTIONS *********************************************************/
18
19VOID
22{
23 /* Dereference the hard-error port and process objects */
25 {
28 }
30 {
33 }
34}
35
36/* FUNCTIONS *****************************************************************/
37
38/*
39 * @implemented
40 */
44{
45 POWER_ACTION PowerAction;
46
47 /* Convert to power action */
49 {
50 PowerAction = PowerActionShutdown;
51 }
52 else if (Action == ShutdownReboot)
53 {
54 PowerAction = PowerActionShutdownReset;
55 }
56 else if (Action == ShutdownPowerOff)
57 {
58 PowerAction = PowerActionShutdownOff;
59 }
60 else
61 {
63 }
64
65 /* Now call the power manager */
66 DPRINT("Setting state to: %lx\n", PowerAction);
67 return NtSetSystemPowerState(PowerAction,
72}
73
74/* EOF */
LONG NTSTATUS
Definition: precomp.h:26
#define NULL
Definition: types.h:112
PVOID ExpDefaultErrorPort
Definition: harderr.c:18
PEPROCESS ExpDefaultErrorPortProcess
Definition: harderr.c:19
@ ShutdownReboot
Definition: extypes.h:177
@ ShutdownPowerOff
Definition: extypes.h:178
@ ShutdownNoReboot
Definition: extypes.h:176
enum _SHUTDOWN_ACTION SHUTDOWN_ACTION
VOID NTAPI ExShutdownSystem(VOID)
Definition: shutdown.c:21
NTSTATUS NTAPI NtShutdownSystem(IN SHUTDOWN_ACTION Action)
Definition: shutdown.c:43
NTSTATUS NTAPI NtSetSystemPowerState(IN POWER_ACTION SystemAction, IN SYSTEM_POWER_STATE MinSystemState, IN ULONG Flags)
Definition: power.c:992
@ PowerSystemSleeping3
Definition: ntpoapi.h:39
#define POWER_ACTION_OVERRIDE_APPS
Definition: ntpoapi.h:416
POWER_ACTION
Definition: ntpoapi.h:122
@ PowerActionShutdownOff
Definition: ntpoapi.h:129
@ PowerActionShutdown
Definition: ntpoapi.h:127
@ PowerActionShutdownReset
Definition: ntpoapi.h:128
#define POWER_ACTION_DISABLE_WAKES
Definition: ntpoapi.h:419
#define POWER_ACTION_CRITICAL
Definition: ntpoapi.h:420
#define DPRINT
Definition: sndvol32.h:71
#define NTAPI
Definition: typedefs.h:36
#define IN
Definition: typedefs.h:39
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
_In_ WDFIOTARGET _In_ _Strict_type_match_ WDF_IO_TARGET_SENT_IO_ACTION Action
Definition: wdfiotarget.h:510
#define ObDereferenceObject
Definition: obfuncs.h:203