ReactOS 0.4.15-dev-8109-gd7be748
power.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS Kernel
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: ntoskrnl/po/power.c
5 * PURPOSE: Power Manager
6 * PROGRAMMERS: Casper S. Hornstrup (chorns@users.sourceforge.net)
7 * Herv� Poussineau (hpoussin@reactos.com)
8 */
9
10/* INCLUDES ******************************************************************/
11
12#include <ntoskrnl.h>
13#define NDEBUG
14#include <debug.h>
15
16/* GLOBALS *******************************************************************/
17
19{
24
30
31/* PRIVATE FUNCTIONS *********************************************************/
32
33static WORKER_THREAD_ROUTINE PopPassivePowerCall;
35static
36VOID
40{
42 PIO_STACK_LOCATION IoStack;
43
45
48
50}
51
54static
56PopPresentIrp(
57 _In_ PIO_STACK_LOCATION NextStack,
59{
61 BOOLEAN CallAtPassiveLevel;
63 PWORK_QUEUE_ITEM WorkQueueItem;
64
65 ASSERT(NextStack->MajorFunction == IRP_MJ_POWER);
66
67 DeviceObject = NextStack->DeviceObject;
68
69 /* Determine whether the IRP must be handled at PASSIVE_LEVEL.
70 * Only SET_POWER to working state can happen at raised IRQL. */
71 CallAtPassiveLevel = TRUE;
72 if ((NextStack->MinorFunction == IRP_MN_SET_POWER) &&
74 {
75 if (NextStack->Parameters.Power.Type == DevicePowerState &&
76 NextStack->Parameters.Power.State.DeviceState == PowerDeviceD0)
77 {
78 CallAtPassiveLevel = FALSE;
79 }
80 if (NextStack->Parameters.Power.Type == SystemPowerState &&
81 NextStack->Parameters.Power.State.SystemState == PowerSystemWorking)
82 {
83 CallAtPassiveLevel = FALSE;
84 }
85 }
86
87 if (CallAtPassiveLevel)
88 {
89 /* We need to fit a work item into the DriverContext below */
90 C_ASSERT(sizeof(Irp->Tail.Overlay.DriverContext) >= sizeof(WORK_QUEUE_ITEM));
91
93 {
94 /* Already at passive, call next driver directly */
96 }
97
98 /* Need to schedule a work item and return pending */
99 NextStack->Control |= SL_PENDING_RETURNED;
100
101 WorkQueueItem = (PWORK_QUEUE_ITEM)&Irp->Tail.Overlay.DriverContext;
102 ExInitializeWorkItem(WorkQueueItem,
104 Irp);
105 ExQueueWorkItem(WorkQueueItem, DelayedWorkQueue);
106
107 return STATUS_PENDING;
108 }
109
110 /* Direct call. Raise IRQL in debug to catch invalid paged memory access. */
111#if DBG
112 {
115#endif
116
118
119#if DBG
121 }
122#endif
123
124 return Status;
125}
126
127static IO_COMPLETION_ROUTINE PopRequestPowerIrpCompletion;
128
129static
131NTAPI
134 _In_ PIRP Irp,
135 _In_reads_opt_(_Inexpressible_("varies")) PVOID Context)
136{
140
143
144 PowerState.DeviceState = (ULONG_PTR)Stack->Parameters.Others.Argument3;
145
147 {
148 CompletionRoutine(Stack->Parameters.Others.Argument1,
149 (UCHAR)(ULONG_PTR)Stack->Parameters.Others.Argument2,
151 Stack->Parameters.Others.Argument4,
152 &Irp->IoStatus);
153 }
154
156 IoFreeIrp(Irp);
158
160}
161
162VOID
163NTAPI
165{
166 //UNIMPLEMENTED;
167}
168
171{
175 PIRP Irp;
177
180 FALSE);
181
184 NULL,
185 0,
186 NULL,
187 &Event,
190
194 IrpSp->Parameters.Power.State.SystemState = SystemState;
195 IrpSp->Parameters.Power.ShutdownType = PowerAction;
196
197 Status = PoCallDriver(DeviceObject, Irp);
198 if (Status == STATUS_PENDING)
199 {
201 Executive,
203 FALSE,
204 NULL);
206 }
207
208 return Status;
209}
210
213{
217 PIRP Irp;
219
222 FALSE);
223
226 NULL,
227 0,
228 NULL,
229 &Event,
232
236 IrpSp->Parameters.Power.State.SystemState = SystemState;
237 IrpSp->Parameters.Power.ShutdownType = PowerAction;
238
239 Status = PoCallDriver(DeviceObject, Irp);
240 if (Status == STATUS_PENDING)
241 {
243 Executive,
245 FALSE,
246 NULL);
248 }
249
250 return Status;
251}
252
256{
257 PPOWER_STATE_TRAVERSE_CONTEXT PowerStateContext = Context;
258 PDEVICE_OBJECT TopDeviceObject;
260
261 DPRINT("PopQuerySystemPowerStateTraverse(%p, %p)\n", DeviceNode, Context);
262
264 return STATUS_SUCCESS;
265
266 if (DeviceNode->Flags & DNF_LEGACY_DRIVER)
267 return STATUS_SUCCESS;
268
269 TopDeviceObject = IoGetAttachedDeviceReference(DeviceNode->PhysicalDeviceObject);
270
271 Status = PopSendQuerySystemPowerState(TopDeviceObject,
272 PowerStateContext->SystemPowerState,
273 PowerStateContext->PowerAction);
274 if (!NT_SUCCESS(Status))
275 {
276 DPRINT1("Device '%wZ' failed IRP_MN_QUERY_POWER\n", &DeviceNode->InstancePath);
277 }
278 ObDereferenceObject(TopDeviceObject);
279
280#if 0
281 return Status;
282#else
283 return STATUS_SUCCESS;
284#endif
285}
286
290{
291 PPOWER_STATE_TRAVERSE_CONTEXT PowerStateContext = Context;
292 PDEVICE_OBJECT TopDeviceObject;
294
295 DPRINT("PopSetSystemPowerStateTraverse(%p, %p)\n", DeviceNode, Context);
296
298 return STATUS_SUCCESS;
299
300 if (DeviceNode->PhysicalDeviceObject == PowerStateContext->PowerDevice)
301 return STATUS_SUCCESS;
302
303 if (DeviceNode->Flags & DNF_LEGACY_DRIVER)
304 return STATUS_SUCCESS;
305
306 TopDeviceObject = IoGetAttachedDeviceReference(DeviceNode->PhysicalDeviceObject);
307 if (TopDeviceObject == PowerStateContext->PowerDevice)
308 {
309 ObDereferenceObject(TopDeviceObject);
310 return STATUS_SUCCESS;
311 }
312
313 Status = PopSendSetSystemPowerState(TopDeviceObject,
314 PowerStateContext->SystemPowerState,
315 PowerStateContext->PowerAction);
316 if (!NT_SUCCESS(Status))
317 {
318 DPRINT1("Device '%wZ' failed IRP_MN_SET_POWER\n", &DeviceNode->InstancePath);
319 }
320
321 ObDereferenceObject(TopDeviceObject);
322
323#if 0
324 return Status;
325#else
326 return STATUS_SUCCESS;
327#endif
328}
329
331NTAPI
333{
338 POWER_STATE_TRAVERSE_CONTEXT PowerContext;
339
341 if (!NT_SUCCESS(Status))
342 {
343 DPRINT1("No system power driver available\n");
344 Fdo = NULL;
345 }
346 else
347 {
349 if (Fdo == DeviceObject)
350 {
351 DPRINT("An FDO was not attached\n");
352 return STATUS_UNSUCCESSFUL;
353 }
354 }
355
356 /* Set up context */
357 PowerContext.PowerAction = PowerAction;
358 PowerContext.SystemPowerState = PowerState;
359 PowerContext.PowerDevice = Fdo;
360
361 /* Query for system power change */
365 &PowerContext);
366
368 if (!NT_SUCCESS(Status))
369 {
370 DPRINT1("Query system power state failed; changing state anyway\n");
371 }
372
373 /* Set system power change */
377 &PowerContext);
378
380
382
383 if (Fdo != NULL)
384 {
385 if (PowerAction != PowerActionShutdownReset)
387
389 }
390
391 return Status;
392}
393
394CODE_SEG("INIT")
396NTAPI
398{
400 PCHAR CommandLine;
401 BOOLEAN ForceAcpiDisable = FALSE;
402
403 /* Check if this is phase 1 init */
404 if (BootPhase == 1)
405 {
407 /* Register power button notification */
410 (PVOID)&GUID_DEVICE_SYS_BUTTON,
415 if (!NT_SUCCESS(Status))
416 return FALSE;
417
418 /* Register lid notification */
421 (PVOID)&GUID_DEVICE_LID,
426 if (!NT_SUCCESS(Status))
427 return FALSE;
428
429 /* Register battery notification */
432 (PVOID)&GUID_DEVICE_BATTERY,
437
438 return NT_SUCCESS(Status);
439 }
440
441 /* Initialize the power capabilities */
443
444 /* Get the Command Line */
445 CommandLine = KeLoaderBlock->LoadOptions;
446
447 /* Upcase it */
448 _strupr(CommandLine);
449
450 /* Check for ACPI disable */
451 if (strstr(CommandLine, "NOACPI")) ForceAcpiDisable = TRUE;
452
453 if (ForceAcpiDisable)
454 {
455 /* Set the ACPI State to False if it's been forced that way */
457 }
458 else
459 {
460 /* Otherwise check if the LoaderBlock has a ACPI Table */
462 }
463
464 /* Enable shutdown by power button */
465 if (PopAcpiPresent)
467
468 /* Initialize volume support */
471
472 /* Initialize support for dope */
474
475 /* Initialize support for shutdown waits and work-items */
477
478 return TRUE;
479}
480
481VOID
482NTAPI
484{
485 DPRINT1("PerfIdle function: %p\n", PowerState);
486}
487
488VOID
489NTAPI
494{
495 /* Call the Perf Idle function */
497}
498
499VOID
502{
503 /* FIXME: Extremly naive implementation */
505}
506
507CODE_SEG("INIT")
508VOID
509NTAPI
511{
512 /* Initialize the Power State */
513 RtlZeroMemory(&Prcb->PowerState, sizeof(Prcb->PowerState));
514 Prcb->PowerState.Idle0KernelTimeLimit = 0xFFFFFFFF;
515 Prcb->PowerState.CurrentThrottle = 100;
516 Prcb->PowerState.CurrentThrottleIndex = 0;
517 Prcb->PowerState.IdleFunction = PopIdle0;
518
519 /* Initialize the Perf DPC and Timer */
520 KeInitializeDpc(&Prcb->PowerState.PerfDpc, PopPerfIdleDpc, Prcb);
521 KeSetTargetProcessorDpc(&Prcb->PowerState.PerfDpc, Prcb->Number);
522 KeInitializeTimerEx(&Prcb->PowerState.PerfTimer, SynchronizationTimer);
523}
524
525/* PUBLIC FUNCTIONS **********************************************************/
526
527/*
528 * @unimplemented
529 */
531NTAPI
533{
536}
537
538/*
539 * @unimplemented
540 */
542NTAPI
544 IN ULONG Unknown1,
545 IN ULONG Unknown2,
549{
552}
553
554/*
555 * @unimplemented
556 */
557VOID
558NTAPI
560 IN ULONG BugCheckCode,
561 IN ULONG_PTR BugCheckParameter1,
562 IN ULONG_PTR BugCheckParameter2,
563 IN ULONG_PTR BugCheckParameter3,
564 IN ULONG_PTR BugCheckParameter4)
565{
566 DPRINT1("PoShutdownBugCheck called\n");
567
568 /* FIXME: Log error if requested */
569 /* FIXME: Initiate a shutdown */
570
571 /* Bugcheck the system */
572 KeBugCheckEx(BugCheckCode,
573 BugCheckParameter1,
574 BugCheckParameter2,
575 BugCheckParameter3,
576 BugCheckParameter4);
577}
578
579/*
580 * @unimplemented
581 */
582VOID
583NTAPI
585 IN ULONG Flags,
588 IN ULONG PageTag)
589{
591 return;
592}
593
594/*
595 * @implemented
596 */
599NTAPI
600PoCallDriver(
603{
604 PIO_STACK_LOCATION NextStack;
605
607
609 ASSERT(Irp);
610
611 NextStack = IoGetNextIrpStackLocation(Irp);
612 ASSERT(NextStack->MajorFunction == IRP_MJ_POWER);
613
614 /* Set DeviceObject for PopPresentIrp */
615 NextStack->DeviceObject = DeviceObject;
616
617 /* Only QUERY_POWER and SET_POWER use special handling */
618 if (NextStack->MinorFunction != IRP_MN_SET_POWER &&
619 NextStack->MinorFunction != IRP_MN_QUERY_POWER)
620 {
622 }
623
624 /* Call the next driver, either directly or at PASSIVE_LEVEL */
625 return PopPresentIrp(NextStack, Irp);
626}
627
628/*
629 * @unimplemented
630 */
631PULONG
632NTAPI
637{
639 return NULL;
640}
641
642/*
643 * @unimplemented
644 */
645PVOID
646NTAPI
649{
651 return NULL;
652}
653
654/*
655 * @implemented
656 */
658NTAPI
666{
667 PDEVICE_OBJECT TopDeviceObject;
669 PIRP Irp;
670
675
676 /* Always call the top of the device stack */
678
679 Irp = IoAllocateIrp(TopDeviceObject->StackSize + 2, FALSE);
680 if (!Irp)
681 {
682 ObDereferenceObject(TopDeviceObject);
684 }
685
686 Irp->IoStatus.Status = STATUS_NOT_SUPPORTED;
687 Irp->IoStatus.Information = 0;
688
690
692 Stack->Parameters.Others.Argument1 = DeviceObject;
693 Stack->Parameters.Others.Argument2 = (PVOID)(ULONG_PTR)MinorFunction;
694 Stack->Parameters.Others.Argument3 = (PVOID)(ULONG_PTR)PowerState.DeviceState;
695 Stack->Parameters.Others.Argument4 = Context;
696 Stack->DeviceObject = TopDeviceObject;
698
700 Stack->MajorFunction = IRP_MJ_POWER;
701 Stack->MinorFunction = MinorFunction;
703 {
704 Stack->Parameters.WaitWake.PowerState = PowerState.SystemState;
705 }
706 else
707 {
708 Stack->Parameters.Power.Type = DevicePowerState;
709 Stack->Parameters.Power.State = PowerState;
710 }
711
712 if (pIrp != NULL)
713 *pIrp = Irp;
714
716 PoCallDriver(TopDeviceObject, Irp);
717
718 /* Always return STATUS_PENDING. The completion routine
719 * will call CompletionFunction and complete the Irp.
720 */
721 return STATUS_PENDING;
722}
723
724/*
725 * @unimplemented
726 */
728NTAPI
732{
733 POWER_STATE ps;
734
736
737 ps.SystemState = PowerSystemWorking; // Fully on
738 ps.DeviceState = PowerDeviceD0; // Fully on
739
740 return ps;
741}
742
743/*
744 * @unimplemented
745 */
746VOID
747NTAPI
749{
751}
752
753/*
754 * @unimplemented
755 */
756VOID
757NTAPI
759{
761}
762
763/*
764 * @unimplemented
765 */
766VOID
767NTAPI
769{
771}
772
773/*
774 * @unimplemented
775 */
777NTAPI
780 IN ULONG Flags,
782{
785}
786
787/*
788 * @unimplemented
789 */
791NTAPI
797{
800
801 PAGED_CODE();
802
803 DPRINT("NtPowerInformation(PowerInformationLevel 0x%x, InputBuffer 0x%p, "
804 "InputBufferLength 0x%x, OutputBuffer 0x%p, OutputBufferLength 0x%x)\n",
805 PowerInformationLevel,
808
810 {
812 {
815 }
817 {
819 }
820 _SEH2_END;
821 }
822
823 switch (PowerInformationLevel)
824 {
826 {
828
829 if (InputBuffer != NULL)
833
835 {
836 /* Just zero the struct (and thus set BatteryState->BatteryPresent = FALSE) */
837 RtlZeroMemory(BatteryState, sizeof(SYSTEM_BATTERY_STATE));
838 BatteryState->EstimatedTime = MAXULONG;
840// BatteryState->AcOnLine = TRUE;
841// BatteryState->MaxCapacity = ;
842// BatteryState->RemainingCapacity = ;
843
845 }
847 {
849 }
850 _SEH2_END;
851
852 break;
853 }
854
856 {
858
859 if (InputBuffer != NULL)
863
865 {
869
871 }
873 {
875 }
876 _SEH2_END;
877
878 break;
879 }
880
882 {
884
885 if (InputBuffer != NULL)
889
890 /* FIXME: return structures for all processors */
891
893 {
894 /* FIXME: some values are hardcoded */
895 PowerInformation->Number = 0;
896 PowerInformation->MaxMhz = 1000;
897 PowerInformation->CurrentMhz = KeGetCurrentPrcb()->MHz;
898 PowerInformation->MhzLimit = 1000;
899 PowerInformation->MaxIdleState = 0;
900 PowerInformation->CurrentIdleState = 0;
901
903 }
905 {
907 }
908 _SEH2_END;
909
910 break;
911 }
912
913 default:
915 DPRINT1("PowerInformationLevel 0x%x is UNIMPLEMENTED! Have a nice day.\n",
916 PowerInformationLevel);
917 break;
918 }
919
920 return Status;
921}
922
924NTAPI
927{
930}
931
933NTAPI
935{
937 return FALSE;
938}
939
941NTAPI
943{
946}
947
949NTAPI
952{
956 PAGED_CODE();
957
958 /* Validate flags */
959 if (esFlags & ~(ES_CONTINUOUS | ES_USER_PRESENT))
960 {
961 /* Fail the request */
963 }
964
965 /* Check for user parameters */
967 {
968 /* Protect the probes */
970 {
971 /* Check if the pointer is valid */
973 }
975 {
976 /* It isn't -- fail */
978 }
979 _SEH2_END;
980 }
981
982 /* Save the previous state, always masking in the continous flag */
983 PreviousState = Thread->PowerState | ES_CONTINUOUS;
984
985 /* Check if we need to update the power state */
986 if (esFlags & ES_CONTINUOUS) Thread->PowerState = (UCHAR)esFlags;
987
988 /* Protect the write back to user mode */
990 {
991 /* Return the previous flags */
993 }
995 {
996 /* Something's wrong, fail */
998 }
999 _SEH2_END;
1000
1001 /* All is good */
1002 return STATUS_SUCCESS;
1003}
1004
1006NTAPI
1009 IN ULONG Flags)
1010{
1014 ULONG Dummy;
1015
1016 /* Check for invalid parameter combinations */
1019 (SystemAction > PowerActionWarmEject) ||
1020 (SystemAction < PowerActionReserved) ||
1028 {
1029 DPRINT1("NtSetSystemPowerState: Bad parameters!\n");
1030 DPRINT1(" SystemAction: 0x%x\n", SystemAction);
1031 DPRINT1(" MinSystemState: 0x%x\n", MinSystemState);
1032 DPRINT1(" Flags: 0x%x\n", Flags);
1034 }
1035
1036 /* Check for user caller */
1037 if (PreviousMode != KernelMode)
1038 {
1039 /* Check for shutdown permission */
1041 {
1042 /* Not granted */
1043 DPRINT1("ERROR: Privilege not held for shutdown\n");
1045 }
1046
1047 /* Do it as a kernel-mode caller for consistency with system state */
1048 return ZwSetSystemPowerState(SystemAction, MinSystemState, Flags);
1049 }
1050
1051 /* Read policy settings (partial shutdown vs. full shutdown) */
1052 if (SystemAction == PowerActionShutdown) PopReadShutdownPolicy();
1053
1054 /* Disable lazy flushing of registry */
1055 DPRINT("Stopping lazy flush\n");
1057
1058 /* Setup the power action */
1059 Action.Action = SystemAction;
1060 Action.Flags = Flags;
1061
1062 /* Notify callbacks */
1063 DPRINT("Notifying callbacks\n");
1065
1066 /* Swap in any worker thread stacks */
1067 DPRINT("Swapping worker threads\n");
1069
1070 /* Make our action global */
1071 PopAction = Action;
1072
1073 /* Start power loop */
1075 while (TRUE)
1076 {
1077 /* Break out if there's nothing to do */
1078 if (Action.Action == PowerActionNone) break;
1079
1080 /* Check for first-pass or restart */
1081 if (Status == STATUS_CANCELLED)
1082 {
1083 /* Check for shutdown action */
1087 {
1088 /* Set the action */
1090 }
1091
1092 /* Now we are good to go */
1094 }
1095
1096 /* Check if we're still in an invalid status */
1097 if (!NT_SUCCESS(Status)) break;
1098
1099 /* Flush all volumes and the registry */
1100 DPRINT("Flushing volumes\n");
1102
1103#ifndef NEWCC
1104 /* Flush dirty cache pages */
1105 /* XXX: Is that still mandatory? As now we'll wait on lazy writer to complete? */
1107 DPRINT("Cache flushed %lu pages\n", Dummy);
1108#else
1109 Dummy = 0;
1110#endif
1111
1112 /* Set IRP for drivers */
1114 if (PopAction.Shutdown)
1115 {
1116 DPRINT("Queueing shutdown thread\n");
1117 /* Check if we are running in the system context */
1119 {
1120 /* We're not, so use a worker thread for shutdown */
1123 NULL);
1124
1126
1127 /* Spend us -- when we wake up, the system is good to go down */
1130 goto Exit;
1131
1132 }
1133 else
1134 {
1135 /* Do the shutdown inline */
1137 }
1138 }
1139
1140 /* You should not have made it this far */
1141 // ASSERTMSG("System is still up and running?!\n", FALSE);
1142 DPRINT1("System is still up and running, you may not have chosen a yet supported power option: %u\n", PopAction.Action);
1143 break;
1144 }
1145
1146Exit:
1147 /* We're done, return */
1148 return Status;
1149}
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
#define PAGED_CODE()
#define CODE_SEG(...)
#define STATUS_PRIVILEGE_NOT_HELD
Definition: DriverTester.h:9
@ DeviceNode
Definition: Node.h:9
unsigned char BOOLEAN
PRTL_UNICODE_STRING_BUFFER PULONG PULONG Unknown4
Type
Definition: Type.h:7
char * strstr(char *String1, char *String2)
Definition: utclib.c:653
#define VOID
Definition: acefi.h:82
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
#define UNIMPLEMENTED
Definition: debug.h:118
#define __drv_aliasesMem
Definition: btrfs_drv.h:203
_In_ ULONG _In_ BOOLEAN LogError
Definition: classpnp.h:1311
VOID NTAPI CmSetLazyFlushState(IN BOOLEAN Enable)
Definition: cmlazy.c:446
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES IN DWORD IN DWORD IN DWORD Unknown5
Definition: conport.c:39
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES IN DWORD Unknown3
Definition: conport.c:37
_In_ PIRP Irp
Definition: csq.h:116
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
VOID NTAPI KeInitializeDpc(IN PKDPC Dpc, IN PKDEFERRED_ROUTINE DeferredRoutine, IN PVOID DeferredContext)
Definition: dpc.c:712
VOID NTAPI KeSetTargetProcessorDpc(IN PKDPC Dpc, IN CCHAR Number)
Definition: dpc.c:971
_In_ PIO_STACK_LOCATION IrpSp
Definition: create.c:4137
#define ULONG_PTR
Definition: config.h:101
#define _IRQL_requires_same_
Definition: driverspecs.h:232
#define _IRQL_requires_max_(irql)
Definition: driverspecs.h:230
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
UCHAR KIRQL
Definition: env_spec_w32.h:591
#define KeRaiseIrql(irql, oldIrql)
Definition: env_spec_w32.h:597
#define KeWaitForSingleObject(pEvt, foo, a, b, c)
Definition: env_spec_w32.h:478
#define KeInitializeEvent(pEvt, foo, foo2)
Definition: env_spec_w32.h:477
#define KeLowerIrql(oldIrql)
Definition: env_spec_w32.h:602
#define KeGetCurrentIrql()
Definition: env_spec_w32.h:706
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
#define KeInitializeSpinLock(sl)
Definition: env_spec_w32.h:604
VOID NTAPI ProbeForRead(IN CONST VOID *Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:102
VOID NTAPI ProbeForWrite(IN PVOID Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:143
#define _SEH2_END
Definition: filesup.c:22
#define _SEH2_TRY
Definition: filesup.c:19
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
Definition: fltkernel.h:2653
FxIrp * pIrp
Status
Definition: gdiplustypes.h:25
VOID FASTCALL KeInitializeGuardedMutex(OUT PKGUARDED_MUTEX GuardedMutex)
Definition: gmutex.c:31
VOID NTAPI HalProcessorIdle(VOID)
Definition: processor.c:83
#define KeGetCurrentThread
Definition: hal.h:55
LONG NTAPI ExSystemExceptionFilter(VOID)
Definition: harderr.c:349
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define C_ASSERT(e)
Definition: intsafe.h:73
#define IoSetCompletionRoutine(_Irp, _CompletionRoutine, _Context, _InvokeOnSuccess, _InvokeOnError, _InvokeOnCancel)
Definition: irp.cpp:490
PLOADER_PARAMETER_BLOCK KeLoaderBlock
Definition: krnlinit.c:29
if(dx< 0)
Definition: linetemp.h:194
#define ASSERT(a)
Definition: mode.c:44
static OUT PIO_STATUS_BLOCK IoStatusBlock
Definition: pipe.c:75
#define _Inout_
Definition: ms_sal.h:378
#define _Use_decl_annotations_
Definition: ms_sal.h:275
#define _Outptr_opt_
Definition: ms_sal.h:429
#define _In_reads_opt_(size)
Definition: ms_sal.h:320
#define _In_
Definition: ms_sal.h:308
#define _In_opt_
Definition: ms_sal.h:309
#define _Analysis_assume_(expr)
Definition: ms_sal.h:2901
#define KernelMode
Definition: asm.h:34
FORCEINLINE struct _KPRCB * KeGetCurrentPrcb(VOID)
Definition: ketypes.h:1161
#define KeGetPreviousMode()
Definition: ketypes.h:1115
#define DNF_LEGACY_DRIVER
Definition: iotypes.h:182
NTSYSCALLAPI NTSTATUS NTAPI ZwSetSystemPowerState(_In_ POWER_ACTION SystemAction, _In_ SYSTEM_POWER_STATE MinSystemState, _In_ ULONG Flags)
#define FASTCALL
Definition: nt_native.h:50
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
@ NotificationEvent
@ SynchronizationTimer
#define IoSkipCurrentIrpStackLocation(Irp)
Definition: ntifs_ex.h:421
NTSTATUS CcRosFlushDirtyPages(ULONG Target, PULONG Count, BOOLEAN Wait, BOOLEAN CalledFromLazy)
Definition: view.c:308
PCALLBACK_OBJECT PowerStateCallback
Definition: callback.c:29
VOID NTAPI ExNotifyCallback(IN PCALLBACK_OBJECT CallbackObject, IN PVOID Argument1, IN PVOID Argument2)
Definition: callback.c:467
#define IopInitDeviceTreeTraverseContext( _DeviceTreeTraverseContext, _DeviceNode, _Action, _Context)
Definition: io.h:229
NTSTATUS IopGetSystemPowerDeviceObject(IN PDEVICE_OBJECT *DeviceObject)
NTSTATUS IopTraverseDeviceTree(PDEVICETREE_TRAVERSE_CONTEXT Context)
PDEVICE_NODE IopRootDeviceNode
Definition: devnode.c:18
ULONG NTAPI KeSuspendThread(PKTHREAD Thread)
Definition: thrdobj.c:601
const LUID SeShutdownPrivilege
Definition: priv.c:38
PDEVICE_OBJECT NTAPI IoGetAttachedDeviceReference(PDEVICE_OBJECT DeviceObject)
Definition: device.c:1406
PIRP NTAPI IoBuildSynchronousFsdRequest(IN ULONG MajorFunction, IN PDEVICE_OBJECT DeviceObject, IN PVOID Buffer, IN ULONG Length, IN PLARGE_INTEGER StartingOffset, IN PKEVENT Event, IN PIO_STATUS_BLOCK IoStatusBlock)
Definition: irp.c:1069
PIRP NTAPI IoAllocateIrp(IN CCHAR StackSize, IN BOOLEAN ChargeQuota)
Definition: irp.c:615
#define IoCallDriver
Definition: irp.c:1225
VOID NTAPI IoFreeIrp(IN PIRP Irp)
Definition: irp.c:1666
PVOID NTAPI PoRegisterSystemState(IN PVOID StateHandle, IN EXECUTION_STATE Flags)
Definition: power.c:647
VOID NTAPI PopPerfIdleDpc(IN PKDPC Dpc, IN PVOID DeferredContext, IN PVOID SystemArgument1, IN PVOID SystemArgument2)
Definition: power.c:490
NTSTATUS NTAPI PoCancelDeviceNotify(IN PVOID NotifyBlock)
Definition: power.c:532
NTSTATUS PopSetSystemPowerStateTraverse(PDEVICE_NODE DeviceNode, PVOID Context)
Definition: power.c:288
VOID NTAPI PoSetHiberRange(IN PVOID HiberContext, IN ULONG Flags, IN OUT PVOID StartPage, IN ULONG Length, IN ULONG PageTag)
Definition: power.c:584
BOOLEAN PopAcpiPresent
Definition: power.c:26
POWER_STATE NTAPI PoSetPowerState(IN PDEVICE_OBJECT DeviceObject, IN POWER_STATE_TYPE Type, IN POWER_STATE State)
Definition: power.c:729
VOID NTAPI PoStartNextPowerIrp(IN PIRP Irp)
Definition: power.c:758
NTSTATUS PopSendQuerySystemPowerState(PDEVICE_OBJECT DeviceObject, SYSTEM_POWER_STATE SystemState, POWER_ACTION PowerAction)
Definition: power.c:170
NTSTATUS NTAPI NtInitiatePowerAction(IN POWER_ACTION SystemAction, IN SYSTEM_POWER_STATE MinSystemState, IN ULONG Flags, IN BOOLEAN Asynchronous)
Definition: power.c:778
VOID NTAPI PoShutdownBugCheck(IN BOOLEAN LogError, IN ULONG BugCheckCode, IN ULONG_PTR BugCheckParameter1, IN ULONG_PTR BugCheckParameter2, IN ULONG_PTR BugCheckParameter3, IN ULONG_PTR BugCheckParameter4)
Definition: power.c:559
PULONG NTAPI PoRegisterDeviceForIdleDetection(IN PDEVICE_OBJECT DeviceObject, IN ULONG ConservationIdleTime, IN ULONG PerformanceIdleTime, IN DEVICE_POWER_STATE State)
Definition: power.c:633
BOOLEAN NTAPI PoInitSystem(IN ULONG BootPhase)
Definition: power.c:397
struct _POWER_STATE_TRAVERSE_CONTEXT * PPOWER_STATE_TRAVERSE_CONTEXT
BOOLEAN NTAPI NtIsSystemResumeAutomatic(VOID)
Definition: power.c:934
VOID NTAPI PoUnregisterSystemState(IN PVOID StateHandle)
Definition: power.c:768
NTSTATUS NTAPI PoRegisterDeviceNotify(OUT PVOID Unknown0, IN ULONG Unknown1, IN ULONG Unknown2, IN ULONG Unknown3, IN PVOID Unknown4, IN PVOID Unknown5)
Definition: power.c:543
NTSTATUS NTAPI NtRequestWakeupLatency(IN LATENCY_TIME Latency)
Definition: power.c:942
NTSTATUS NTAPI NtSetThreadExecutionState(IN EXECUTION_STATE esFlags, OUT EXECUTION_STATE *PreviousFlags)
Definition: power.c:950
WORK_QUEUE_ITEM PopShutdownWorkItem
Definition: power.c:28
VOID NTAPI PopCleanupPowerState(IN PPOWER_STATE PowerState)
Definition: power.c:164
struct _POWER_STATE_TRAVERSE_CONTEXT POWER_STATE_TRAVERSE_CONTEXT
NTSTATUS PopSendSetSystemPowerState(PDEVICE_OBJECT DeviceObject, SYSTEM_POWER_STATE SystemState, POWER_ACTION PowerAction)
Definition: power.c:212
VOID NTAPI PopPerfIdle(PPROCESSOR_POWER_STATE PowerState)
Definition: power.c:483
NTSTATUS PopQuerySystemPowerStateTraverse(PDEVICE_NODE DeviceNode, PVOID Context)
Definition: power.c:254
SYSTEM_POWER_CAPABILITIES PopCapabilities
Definition: power.c:29
static IO_COMPLETION_ROUTINE PopRequestPowerIrpCompletion
Definition: power.c:127
NTSTATUS NTAPI NtSetSystemPowerState(IN POWER_ACTION SystemAction, IN SYSTEM_POWER_STATE MinSystemState, IN ULONG Flags)
Definition: power.c:1007
NTSTATUS NTAPI PoRequestPowerIrp(_In_ PDEVICE_OBJECT DeviceObject, _In_ UCHAR MinorFunction, _In_ POWER_STATE PowerState, _In_opt_ PREQUEST_POWER_COMPLETE CompletionFunction, _In_opt_ __drv_aliasesMem PVOID Context, _Outptr_opt_ PIRP *pIrp)
Definition: power.c:659
NTSTATUS NTAPI PopSetSystemPowerState(SYSTEM_POWER_STATE PowerState, POWER_ACTION PowerAction)
Definition: power.c:332
static WORKER_THREAD_ROUTINE PopPassivePowerCall
Definition: power.c:33
NTSTATUS NTAPI NtPowerInformation(IN POWER_INFORMATION_LEVEL PowerInformationLevel, IN PVOID InputBuffer OPTIONAL, IN ULONG InputBufferLength, OUT PVOID OutputBuffer OPTIONAL, IN ULONG OutputBufferLength)
Definition: power.c:792
VOID NTAPI PoInitializePrcb(IN PKPRCB Prcb)
Definition: power.c:510
NTSTATUS NTAPI NtGetDevicePowerState(IN HANDLE Device, IN PDEVICE_POWER_STATE PowerState)
Definition: power.c:925
VOID NTAPI PoSetSystemState(IN EXECUTION_STATE Flags)
Definition: power.c:748
PDEVICE_NODE PopSystemPowerDeviceNode
Definition: power.c:25
POP_POWER_ACTION PopAction
Definition: power.c:27
VOID FASTCALL PopIdle0(IN PPROCESSOR_POWER_STATE PowerState)
Definition: power.c:501
BOOLEAN NTAPI SeSinglePrivilegeCheck(_In_ LUID PrivilegeValue, _In_ KPROCESSOR_MODE PreviousMode)
Checks if a single privilege is present in the context of the calling thread.
Definition: priv.c:744
_In_ SYSTEM_POWER_STATE MinSystemState
Definition: ntpoapi.h:303
#define POWER_ACTION_UI_ALLOWED
Definition: ntpoapi.h:415
_In_ SYSTEM_POWER_STATE _In_ ULONG _In_ BOOLEAN Asynchronous
Definition: ntpoapi.h:305
@ PowerSystemMaximum
Definition: ntpoapi.h:42
@ PowerSystemUnspecified
Definition: ntpoapi.h:35
@ PowerSystemWorking
Definition: ntpoapi.h:36
enum _POWER_STATE_TYPE POWER_STATE_TYPE
struct SYSTEM_BATTERY_STATE * PSYSTEM_BATTERY_STATE
@ DevicePowerState
Definition: ntpoapi.h:63
struct SYSTEM_POWER_CAPABILITIES * PSYSTEM_POWER_CAPABILITIES
#define POWER_ACTION_LOCK_CONSOLE
Definition: ntpoapi.h:418
#define POWER_ACTION_QUERY_ALLOWED
Definition: ntpoapi.h:414
#define POWER_ACTION_OVERRIDE_APPS
Definition: ntpoapi.h:416
_Out_ EXECUTION_STATE * PreviousFlags
Definition: ntpoapi.h:288
POWER_ACTION
Definition: ntpoapi.h:122
@ PowerActionShutdownOff
Definition: ntpoapi.h:129
@ PowerActionNone
Definition: ntpoapi.h:123
@ PowerActionShutdown
Definition: ntpoapi.h:127
@ PowerActionShutdownReset
Definition: ntpoapi.h:128
@ PowerActionWarmEject
Definition: ntpoapi.h:130
@ PowerActionReserved
Definition: ntpoapi.h:124
enum _DEVICE_POWER_STATE * PDEVICE_POWER_STATE
enum _POWER_INFORMATION_LEVEL POWER_INFORMATION_LEVEL
@ PowerDeviceD0
Definition: ntpoapi.h:49
enum _DEVICE_POWER_STATE DEVICE_POWER_STATE
enum _SYSTEM_POWER_STATE SYSTEM_POWER_STATE
#define POWER_ACTION_LIGHTEST_FIRST
Definition: ntpoapi.h:417
#define POWER_ACTION_DISABLE_WAKES
Definition: ntpoapi.h:419
@ SystemBatteryState
Definition: ntpoapi.h:72
@ SystemPowerCapabilities
Definition: ntpoapi.h:71
@ ProcessorInformation
Definition: ntpoapi.h:78
#define POWER_ACTION_CRITICAL
Definition: ntpoapi.h:420
struct _PROCESSOR_POWER_INFORMATION * PPROCESSOR_POWER_INFORMATION
#define STATUS_SYSTEM_SHUTDOWN
Definition: ntstatus.h:855
#define STATUS_INVALID_PARAMETER_2
Definition: ntstatus.h:476
#define STATUS_PENDING
Definition: ntstatus.h:82
#define STATUS_NOT_SUPPORTED
Definition: ntstatus.h:423
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:239
NTSTATUS NTAPI IoRegisterPlugPlayNotification(_In_ IO_NOTIFICATION_EVENT_CATEGORY EventCategory, _In_ ULONG EventCategoryFlags, _In_opt_ PVOID EventCategoryData, _In_ PDRIVER_OBJECT DriverObject, _In_ PDRIVER_NOTIFICATION_CALLBACK_ROUTINE CallbackRoutine, _Inout_opt_ PVOID Context, _Out_ PVOID *NotificationEntry)
Definition: pnpnotify.c:345
LIST_ENTRY PopVolumeDevices
Definition: povolume.c:27
VOID NTAPI PopInitShutdownList(VOID)
Definition: poshtdwn.c:35
VOID NTAPI PopReadShutdownPolicy(VOID)
Definition: poshtdwn.c:303
@ PolicyDeviceBattery
Definition: po.h:40
@ PolicyDeviceSystemButton
Definition: po.h:38
NTSTATUS NTAPI PopAddRemoveSysCapsCallback(IN PVOID NotificationStructure, IN PVOID Context)
Definition: events.c:147
KSPIN_LOCK PopDopeGlobalLock
Definition: povolume.c:28
VOID NTAPI PopFlushVolumes(IN BOOLEAN ShuttingDown)
Definition: povolume.c:227
KGUARDED_MUTEX PopVolumeLock
Definition: povolume.c:26
VOID NTAPI PopGracefulShutdown(IN PVOID Context)
Definition: poshtdwn.c:232
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:165
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:66
#define _SEH2_YIELD(__stmt)
Definition: pseh2_64.h:168
PEPROCESS PsInitialSystemProcess
Definition: psmgr.c:50
VOID NTAPI KeBugCheckEx(_In_ ULONG BugCheckCode, _In_ ULONG_PTR BugCheckParameter1, _In_ ULONG_PTR BugCheckParameter2, _In_ ULONG_PTR BugCheckParameter3, _In_ ULONG_PTR BugCheckParameter4)
Definition: rtlcompat.c:108
_CRTIMP char *__cdecl _strupr(_Inout_z_ char *_String)
#define ASSERT_IRQL_LESS_OR_EQUAL(x)
Definition: debug.h:251
#define ProbeForWriteUlong(Ptr)
Definition: probe.h:36
#define STATUS_MORE_PROCESSING_REQUIRED
Definition: shellext.h:68
#define STATUS_SUCCESS
Definition: shellext.h:65
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:69
#define DPRINT
Definition: sndvol32.h:73
static void Exit(void)
Definition: sock.c:1330
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
BOOLEAN BatteryPresent
Definition: ntpoapi.h:386
BOOLEAN SystemBatteriesPresent
Definition: ntpoapi.h:374
PDEVICE_OBJECT PhysicalDeviceObject
Definition: iotypes.h:892
PDEVICE_OBJECT DeviceObject
Definition: iotypes.h:3223
struct _IO_STACK_LOCATION::@3983::@4019 Power
union _IO_STACK_LOCATION::@1568 Parameters
Definition: ketypes.h:699
PLOADER_PARAMETER_EXTENSION Extension
Definition: arc.h:559
UCHAR IrpMinor
Definition: po.h:233
POWER_ACTION Action
Definition: po.h:229
BOOLEAN Shutdown
Definition: po.h:228
SYSTEM_POWER_STATE SystemPowerState
Definition: power.c:20
POWER_ACTION PowerAction
Definition: power.c:21
PDEVICE_OBJECT PowerDevice
Definition: power.c:22
VOID NTAPI KeInitializeTimerEx(OUT PKTIMER Timer, IN TIMER_TYPE Type)
Definition: timerobj.c:244
#define MAXULONG
Definition: typedefs.h:251
uint32_t * PULONG
Definition: typedefs.h:59
#define UNIMPLEMENTED_ONCE
Definition: typedefs.h:30
#define NTAPI
Definition: typedefs.h:36
void * PVOID
Definition: typedefs.h:50
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
char * PCHAR
Definition: typedefs.h:51
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
#define STATUS_CANCELLED
Definition: udferr_usr.h:170
DEVICE_POWER_STATE DeviceState
Definition: ntpoapi.h:58
SYSTEM_POWER_STATE SystemState
Definition: ntpoapi.h:57
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_In_ WDF_POWER_DEVICE_STATE PreviousState
Definition: wdfdevice.h:829
_In_ WDFDEVICE _In_ PWDF_DEVICE_POWER_CAPABILITIES PowerCapabilities
Definition: wdfdevice.h:3886
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ WDF_DEVICE_POWER_STATE PowerState
Definition: wdfdevice.h:3034
_In_ UCHAR _In_ UCHAR MinorFunction
Definition: wdfdevice.h:1699
_Must_inspect_result_ _In_ PWDF_DPC_CONFIG _In_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFDPC * Dpc
Definition: wdfdpc.h:112
_Must_inspect_result_ _In_ WDFDEVICE Fdo
Definition: wdffdo.h:461
_In_ WDFREQUEST _In_ size_t OutputBufferLength
Definition: wdfio.h:320
_In_ WDFREQUEST _In_ size_t _In_ size_t InputBufferLength
Definition: wdfio.h:322
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR OutputBuffer
Definition: wdfiotarget.h:863
_In_ WDFIOTARGET _In_ _Strict_type_match_ WDF_IO_TARGET_SENT_IO_ACTION Action
Definition: wdfiotarget.h:510
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR InputBuffer
Definition: wdfiotarget.h:953
_In_ WDFREQUEST _In_ PIO_STACK_LOCATION Stack
Definition: wdfrequest.h:639
_In_ WDFREQUEST _In_opt_ PFN_WDF_REQUEST_COMPLETION_ROUTINE CompletionRoutine
Definition: wdfrequest.h:895
int WINAPI StartPage(_In_ HDC)
VOID NTAPI ExQueueWorkItem(IN PWORK_QUEUE_ITEM WorkItem, IN WORK_QUEUE_TYPE QueueType)
Definition: work.c:723
VOID NTAPI ExSwapinWorkerThreads(IN BOOLEAN AllowSwap)
Definition: work.c:637
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
#define ExInitializeWorkItem(Item, Routine, Context)
Definition: exfuncs.h:265
@ DelayedWorkQueue
Definition: extypes.h:190
@ CriticalWorkQueue
Definition: extypes.h:189
struct _WORK_QUEUE_ITEM * PWORK_QUEUE_ITEM
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetNextIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2695
FORCEINLINE VOID IoSetNextIrpStackLocation(_Inout_ PIRP Irp)
Definition: iofuncs.h:2680
_In_ ULONG _In_opt_ PVOID _In_ PDRIVER_OBJECT _In_ PDRIVER_NOTIFICATION_CALLBACK_ROUTINE _Inout_opt_ __drv_aliasesMem PVOID _Outptr_result_nullonfailure_ _At_ * NotificationEntry(return==0, __drv_allocatesMem(Mem))) PVOID *NotificationEntry
#define SL_PENDING_RETURNED
Definition: iotypes.h:3325
#define IRP_MN_WAIT_WAKE
#define DO_POWER_PAGABLE
@ EventCategoryDeviceInterfaceChange
Definition: iotypes.h:1226
#define IRP_MN_SET_POWER
#define IRP_MJ_POWER
_In_ SYSTEM_POWER_STATE SystemPowerState
Definition: iotypes.h:7519
#define IRP_MN_QUERY_POWER
#define PNPNOTIFY_DEVICE_INTERFACE_INCLUDE_EXISTING_INTERFACES
Definition: iotypes.h:1239
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:778
@ Executive
Definition: ketypes.h:415
CCHAR KPROCESSOR_MODE
Definition: ketypes.h:7
_In_opt_ PVOID _In_opt_ PVOID SystemArgument1
Definition: ketypes.h:688
_In_opt_ PVOID DeferredContext
Definition: ketypes.h:687
_In_opt_ PVOID _In_opt_ PVOID _In_opt_ PVOID SystemArgument2
Definition: ketypes.h:689
#define ObDereferenceObject
Definition: obfuncs.h:203
_In_ ULONG _In_ ULONG PerformanceIdleTime
Definition: pofuncs.h:25
_In_ UCHAR _In_ POWER_STATE _In_opt_ PREQUEST_POWER_COMPLETE CompletionFunction
Definition: pofuncs.h:44
_In_ ULONG ConservationIdleTime
Definition: pofuncs.h:24
LATENCY_TIME
Definition: potypes.h:215
REQUEST_POWER_COMPLETE * PREQUEST_POWER_COMPLETE
Definition: potypes.h:469
ULONG EXECUTION_STATE
Definition: potypes.h:213
#define ES_USER_PRESENT
Definition: potypes.h:210
#define ES_CONTINUOUS
Definition: potypes.h:211
#define PsGetCurrentProcess
Definition: psfuncs.h:17
_Inout_opt_ PVOID Parameter
Definition: rtltypes.h:323
_In_ KPROCESSOR_MODE PreviousMode
Definition: sefuncs.h:103
unsigned char UCHAR
Definition: xmlstorage.h:181