ReactOS  0.4.14-dev-368-gfa26425
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 
19 VOID
20 NTAPI
22 {
23  /* Dereference the hard-error port and process objects */
25  {
28  }
30  {
33  }
34 }
35 
36 /* FUNCTIONS *****************************************************************/
37 
38 /*
39  * @implemented
40  */
42 NTAPI
44 {
45  POWER_ACTION PowerAction;
46 
47  /* Convert to power action */
48  if (Action == ShutdownNoReboot)
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 */
#define IN
Definition: typedefs.h:38
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
enum _SHUTDOWN_ACTION SHUTDOWN_ACTION
PEPROCESS ExpDefaultErrorPortProcess
Definition: harderr.c:21
#define POWER_ACTION_DISABLE_WAKES
Definition: ntpoapi.h:419
LONG NTSTATUS
Definition: precomp.h:26
VOID NTAPI ObDereferenceObject(IN PVOID Object)
Definition: obref.c:375
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
#define POWER_ACTION_OVERRIDE_APPS
Definition: ntpoapi.h:416
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
NTSTATUS NTAPI NtSetSystemPowerState(IN POWER_ACTION SystemAction, IN SYSTEM_POWER_STATE MinSystemState, IN ULONG Flags)
Definition: power.c:869
#define POWER_ACTION_CRITICAL
Definition: ntpoapi.h:420
_In_ PLIST_ENTRY _In_ PSTRING _In_ USHORT _In_opt_ PSTRING _In_opt_ PSTRING _In_ ULONG _In_ ULONG Action
Definition: fsrtlfuncs.h:738
POWER_ACTION
Definition: ntpoapi.h:122
NTSTATUS NTAPI NtShutdownSystem(IN SHUTDOWN_ACTION Action)
Definition: shutdown.c:43
VOID NTAPI ExShutdownSystem(VOID)
Definition: shutdown.c:21
PVOID ExpDefaultErrorPort
Definition: harderr.c:20