ReactOS  r75907
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 
29 
30 /* PRIVATE FUNCTIONS *********************************************************/
31 
32 static
34 NTAPI
36  IN PIRP Irp,
38 {
39  PIO_STACK_LOCATION Stack;
42 
43  Stack = IoGetCurrentIrpStackLocation(Irp);
44  CompletionRoutine = Context;
45 
46  PowerState.DeviceState = (ULONG_PTR)Stack->Parameters.Others.Argument3;
47  CompletionRoutine(Stack->Parameters.Others.Argument1,
48  (UCHAR)(ULONG_PTR)Stack->Parameters.Others.Argument2,
49  PowerState,
50  Stack->Parameters.Others.Argument4,
51  &Irp->IoStatus);
52 
54  IoFreeIrp(Irp);
55  ObDereferenceObject(DeviceObject);
56 
58 }
59 
60 VOID
61 NTAPI
63 {
64  //UNIMPLEMENTED;
65 }
66 
69 {
70  KEVENT Event;
73  PIRP Irp;
75 
76  KeInitializeEvent(&Event,
78  FALSE);
79 
81  DeviceObject,
82  NULL,
83  0,
84  NULL,
85  &Event,
86  &IoStatusBlock);
87  if (!Irp) return STATUS_INSUFFICIENT_RESOURCES;
88 
89  IrpSp = IoGetNextIrpStackLocation(Irp);
91  IrpSp->Parameters.Power.Type = SystemPowerState;
92  IrpSp->Parameters.Power.State.SystemState = SystemState;
93  IrpSp->Parameters.Power.ShutdownType = PowerAction;
94 
95  Status = PoCallDriver(DeviceObject, Irp);
96  if (Status == STATUS_PENDING)
97  {
98  KeWaitForSingleObject(&Event,
99  Executive,
100  KernelMode,
101  FALSE,
102  NULL);
103  Status = IoStatusBlock.Status;
104  }
105 
106  return Status;
107 }
108 
109 NTSTATUS
111 {
112  KEVENT Event;
115  PIRP Irp;
117 
118  KeInitializeEvent(&Event,
120  FALSE);
121 
123  DeviceObject,
124  NULL,
125  0,
126  NULL,
127  &Event,
128  &IoStatusBlock);
129  if (!Irp) return STATUS_INSUFFICIENT_RESOURCES;
130 
131  IrpSp = IoGetNextIrpStackLocation(Irp);
133  IrpSp->Parameters.Power.Type = SystemPowerState;
134  IrpSp->Parameters.Power.State.SystemState = SystemState;
135  IrpSp->Parameters.Power.ShutdownType = PowerAction;
136 
137  Status = PoCallDriver(DeviceObject, Irp);
138  if (Status == STATUS_PENDING)
139  {
140  KeWaitForSingleObject(&Event,
141  Executive,
142  KernelMode,
143  FALSE,
144  NULL);
145  Status = IoStatusBlock.Status;
146  }
147 
148  return Status;
149 }
150 
151 NTSTATUS
153  PVOID Context)
154 {
155  PPOWER_STATE_TRAVERSE_CONTEXT PowerStateContext = Context;
156  PDEVICE_OBJECT TopDeviceObject;
158 
159  DPRINT("PopQuerySystemPowerStateTraverse(%p, %p)\n", DeviceNode, Context);
160 
161  if (DeviceNode == IopRootDeviceNode)
162  return STATUS_SUCCESS;
163 
164  if (DeviceNode->Flags & DNF_LEGACY_DRIVER)
165  return STATUS_SUCCESS;
166 
167  TopDeviceObject = IoGetAttachedDeviceReference(DeviceNode->PhysicalDeviceObject);
168 
169  Status = PopSendQuerySystemPowerState(TopDeviceObject,
170  PowerStateContext->SystemPowerState,
171  PowerStateContext->PowerAction);
172  if (!NT_SUCCESS(Status))
173  {
174  DPRINT1("Device '%wZ' failed IRP_MN_QUERY_POWER\n", &DeviceNode->InstancePath);
175  }
176  ObDereferenceObject(TopDeviceObject);
177 
178 #if 0
179  return Status;
180 #else
181  return STATUS_SUCCESS;
182 #endif
183 }
184 
185 NTSTATUS
187  PVOID Context)
188 {
189  PPOWER_STATE_TRAVERSE_CONTEXT PowerStateContext = Context;
190  PDEVICE_OBJECT TopDeviceObject;
192 
193  DPRINT("PopSetSystemPowerStateTraverse(%p, %p)\n", DeviceNode, Context);
194 
195  if (DeviceNode == IopRootDeviceNode)
196  return STATUS_SUCCESS;
197 
198  if (DeviceNode->PhysicalDeviceObject == PowerStateContext->PowerDevice)
199  return STATUS_SUCCESS;
200 
201  if (DeviceNode->Flags & DNF_LEGACY_DRIVER)
202  return STATUS_SUCCESS;
203 
204  TopDeviceObject = IoGetAttachedDeviceReference(DeviceNode->PhysicalDeviceObject);
205  if (TopDeviceObject == PowerStateContext->PowerDevice)
206  {
207  ObDereferenceObject(TopDeviceObject);
208  return STATUS_SUCCESS;
209  }
210 
211  Status = PopSendSetSystemPowerState(TopDeviceObject,
212  PowerStateContext->SystemPowerState,
213  PowerStateContext->PowerAction);
214  if (!NT_SUCCESS(Status))
215  {
216  DPRINT1("Device '%wZ' failed IRP_MN_SET_POWER\n", &DeviceNode->InstancePath);
217  }
218 
219  ObDereferenceObject(TopDeviceObject);
220 
221 #if 0
222  return Status;
223 #else
224  return STATUS_SUCCESS;
225 #endif
226 }
227 
228 NTSTATUS
229 NTAPI
231 {
233  PDEVICE_OBJECT Fdo;
236  POWER_STATE_TRAVERSE_CONTEXT PowerContext;
237 
238  Status = IopGetSystemPowerDeviceObject(&DeviceObject);
239  if (!NT_SUCCESS(Status))
240  {
241  DPRINT1("No system power driver available\n");
242  Fdo = NULL;
243  }
244  else
245  {
246  Fdo = IoGetAttachedDeviceReference(DeviceObject);
247  if (Fdo == DeviceObject)
248  {
249  DPRINT("An FDO was not attached\n");
250  return STATUS_UNSUCCESSFUL;
251  }
252  }
253 
254  /* Set up context */
255  PowerContext.PowerAction = PowerAction;
256  PowerContext.SystemPowerState = PowerState;
257  PowerContext.PowerDevice = Fdo;
258 
259  /* Query for system power change */
263  &PowerContext);
264 
265  Status = IopTraverseDeviceTree(&Context);
266  if (!NT_SUCCESS(Status))
267  {
268  DPRINT1("Query system power state failed; changing state anyway\n");
269  }
270 
271  /* Set system power change */
275  &PowerContext);
276 
277  IopTraverseDeviceTree(&Context);
278 
280 
281  if (Fdo != NULL)
282  {
283  if (PowerAction != PowerActionShutdownReset)
284  PopSendSetSystemPowerState(Fdo, PowerState, PowerAction);
285 
286  ObDereferenceObject(Fdo);
287  }
288 
289  return Status;
290 }
291 
292 BOOLEAN
293 NTAPI
296 {
298  PCHAR CommandLine;
299  BOOLEAN ForceAcpiDisable = FALSE;
300 
301  /* Check if this is phase 1 init */
302  if (BootPhase == 1)
303  {
304  /* Register power button notification */
307  (PVOID)&GUID_DEVICE_SYS_BUTTON,
309  PhysicalDeviceObject->DriverObject,
311  NULL,
312  &NotificationEntry);
313 
314  /* Register lid notification */
317  (PVOID)&GUID_DEVICE_LID,
319  PhysicalDeviceObject->DriverObject,
321  NULL,
322  &NotificationEntry);
323  return TRUE;
324  }
325 
326  /* Get the Command Line */
327  CommandLine = KeLoaderBlock->LoadOptions;
328 
329  /* Upcase it */
330  _strupr(CommandLine);
331 
332  /* Check for ACPI disable */
333  if (strstr(CommandLine, "NOACPI")) ForceAcpiDisable = TRUE;
334 
335  if (ForceAcpiDisable)
336  {
337  /* Set the ACPI State to False if it's been forced that way */
339  }
340  else
341  {
342  /* Otherwise check if the LoaderBlock has a ACPI Table */
344  }
345 
346 
347  /* Initialize volume support */
350 
351  /* Initialize support for dope */
353 
354  /* Initialize support for shutdown waits and work-items */
356 
357  return TRUE;
358 }
359 
360 VOID
361 NTAPI
363 {
364  DPRINT1("PerfIdle function: %p\n", PowerState);
365 }
366 
367 VOID
368 NTAPI
373 {
374  /* Call the Perf Idle function */
375  PopPerfIdle(&((PKPRCB)DeferredContext)->PowerState);
376 }
377 
378 VOID
379 FASTCALL
381 {
382  /* FIXME: Extremly naive implementation */
384 }
385 
386 VOID
387 NTAPI
390 {
391  /* Initialize the Power State */
392  RtlZeroMemory(&Prcb->PowerState, sizeof(Prcb->PowerState));
393  Prcb->PowerState.Idle0KernelTimeLimit = 0xFFFFFFFF;
394  Prcb->PowerState.CurrentThrottle = 100;
395  Prcb->PowerState.CurrentThrottleIndex = 0;
396  Prcb->PowerState.IdleFunction = PopIdle0;
397 
398  /* Initialize the Perf DPC and Timer */
399  KeInitializeDpc(&Prcb->PowerState.PerfDpc, PopPerfIdleDpc, Prcb);
400  KeSetTargetProcessorDpc(&Prcb->PowerState.PerfDpc, Prcb->Number);
401  KeInitializeTimerEx(&Prcb->PowerState.PerfTimer, SynchronizationTimer);
402 }
403 
404 /* PUBLIC FUNCTIONS **********************************************************/
405 
406 /*
407  * @unimplemented
408  */
409 NTSTATUS
410 NTAPI
412 {
414  return STATUS_NOT_IMPLEMENTED;
415 }
416 
417 /*
418  * @unimplemented
419  */
420 NTSTATUS
421 NTAPI
423  IN ULONG Unknown1,
424  IN ULONG Unknown2,
425  IN ULONG Unknown3,
426  IN PVOID Unknown4,
427  IN PVOID Unknown5)
428 {
430  return STATUS_NOT_IMPLEMENTED;
431 }
432 
433 /*
434  * @unimplemented
435  */
436 VOID
437 NTAPI
439  IN ULONG BugCheckCode,
440  IN ULONG_PTR BugCheckParameter1,
441  IN ULONG_PTR BugCheckParameter2,
442  IN ULONG_PTR BugCheckParameter3,
443  IN ULONG_PTR BugCheckParameter4)
444 {
445  DPRINT1("PoShutdownBugCheck called\n");
446 
447  /* FIXME: Log error if requested */
448  /* FIXME: Initiate a shutdown */
449 
450  /* Bugcheck the system */
451  KeBugCheckEx(BugCheckCode,
452  BugCheckParameter1,
453  BugCheckParameter2,
454  BugCheckParameter3,
455  BugCheckParameter4);
456 }
457 
458 /*
459  * @unimplemented
460  */
461 VOID
462 NTAPI
463 PoSetHiberRange(IN PVOID HiberContext,
464  IN ULONG Flags,
466  IN ULONG Length,
467  IN ULONG PageTag)
468 {
470  return;
471 }
472 
473 /*
474  * @implemented
475  */
476 NTSTATUS
477 NTAPI
479  IN OUT PIRP Irp)
480 {
482 
483  /* Forward to Io -- FIXME! */
484  Status = IoCallDriver(DeviceObject, Irp);
485 
486  /* Return status */
487  return Status;
488 }
489 
490 /*
491  * @unimplemented
492  */
493 PULONG
494 NTAPI
499 {
501  return NULL;
502 }
503 
504 /*
505  * @unimplemented
506  */
507 PVOID
508 NTAPI
511 {
513  return NULL;
514 }
515 
516 /*
517  * @implemented
518  */
519 NTSTATUS
520 NTAPI
525  IN PVOID Context,
526  OUT PIRP *pIrp OPTIONAL)
527 {
528  PDEVICE_OBJECT TopDeviceObject;
529  PIO_STACK_LOCATION Stack;
530  PIRP Irp;
531 
532  if (MinorFunction != IRP_MN_QUERY_POWER
533  && MinorFunction != IRP_MN_SET_POWER
534  && MinorFunction != IRP_MN_WAIT_WAKE)
536 
537  /* Always call the top of the device stack */
538  TopDeviceObject = IoGetAttachedDeviceReference(DeviceObject);
539 
540  Irp = IoAllocateIrp(TopDeviceObject->StackSize + 2, FALSE);
541  if (!Irp)
542  {
543  ObDereferenceObject(TopDeviceObject);
545  }
546 
547  Irp->IoStatus.Status = STATUS_NOT_SUPPORTED;
548  Irp->IoStatus.Information = 0;
549 
551 
552  Stack = IoGetNextIrpStackLocation(Irp);
553  Stack->Parameters.Others.Argument1 = DeviceObject;
554  Stack->Parameters.Others.Argument2 = (PVOID)(ULONG_PTR)MinorFunction;
555  Stack->Parameters.Others.Argument3 = (PVOID)(ULONG_PTR)PowerState.DeviceState;
556  Stack->Parameters.Others.Argument4 = Context;
557  Stack->DeviceObject = TopDeviceObject;
559 
560  Stack = IoGetNextIrpStackLocation(Irp);
561  Stack->MajorFunction = IRP_MJ_POWER;
562  Stack->MinorFunction = MinorFunction;
563  if (MinorFunction == IRP_MN_WAIT_WAKE)
564  {
565  Stack->Parameters.WaitWake.PowerState = PowerState.SystemState;
566  }
567  else
568  {
569  Stack->Parameters.Power.Type = DevicePowerState;
570  Stack->Parameters.Power.State = PowerState;
571  }
572 
573  if (pIrp != NULL)
574  *pIrp = Irp;
575 
577  PoCallDriver(TopDeviceObject, Irp);
578 
579  /* Always return STATUS_PENDING. The completion routine
580  * will call CompletionFunction and complete the Irp.
581  */
582  return STATUS_PENDING;
583 }
584 
585 /*
586  * @unimplemented
587  */
589 NTAPI
593 {
594  POWER_STATE ps;
595 
597 
598  ps.SystemState = PowerSystemWorking; // Fully on
599  ps.DeviceState = PowerDeviceD0; // Fully on
600 
601  return ps;
602 }
603 
604 /*
605  * @unimplemented
606  */
607 VOID
608 NTAPI
610 {
612 }
613 
614 /*
615  * @unimplemented
616  */
617 VOID
618 NTAPI
620 {
622 }
623 
624 /*
625  * @unimplemented
626  */
627 VOID
628 NTAPI
630 {
632 }
633 
634 /*
635  * @unimplemented
636  */
637 NTSTATUS
638 NTAPI
641  IN ULONG Flags,
643 {
645  return STATUS_NOT_IMPLEMENTED;
646 }
647 
648 /*
649  * @unimplemented
650  */
651 NTSTATUS
652 NTAPI
656  OUT PVOID OutputBuffer OPTIONAL,
658 {
661 
662  PAGED_CODE();
663 
664  DPRINT("NtPowerInformation(PowerInformationLevel 0x%x, InputBuffer 0x%p, "
665  "InputBufferLength 0x%x, OutputBuffer 0x%p, OutputBufferLength 0x%x)\n",
666  PowerInformationLevel,
667  InputBuffer, InputBufferLength,
668  OutputBuffer, OutputBufferLength);
669 
670  if (PreviousMode != KernelMode)
671  {
672  _SEH2_TRY
673  {
674  ProbeForRead(InputBuffer, InputBufferLength, 1);
675  ProbeForWrite(OutputBuffer, OutputBufferLength, sizeof(ULONG));
676  }
678  {
680  }
681  _SEH2_END;
682  }
683 
684  switch (PowerInformationLevel)
685  {
686  case SystemBatteryState:
687  {
689 
690  if (InputBuffer != NULL)
692  if (OutputBufferLength < sizeof(SYSTEM_BATTERY_STATE))
694 
695  _SEH2_TRY
696  {
697  /* Just zero the struct (and thus set BatteryState->BatteryPresent = FALSE) */
698  RtlZeroMemory(BatteryState, sizeof(SYSTEM_BATTERY_STATE));
699  BatteryState->EstimatedTime = MAXULONG;
700 
701  Status = STATUS_SUCCESS;
702  }
704  {
705  Status = _SEH2_GetExceptionCode();
706  }
707  _SEH2_END;
708 
709  break;
710  }
711 
713  {
715 
716  if (InputBuffer != NULL)
718  if (OutputBufferLength < sizeof(SYSTEM_POWER_CAPABILITIES))
720 
721  _SEH2_TRY
722  {
723  /* Just zero the struct (and thus set PowerCapabilities->SystemBatteriesPresent = FALSE) */
724  RtlZeroMemory(PowerCapabilities, sizeof(SYSTEM_POWER_CAPABILITIES));
725  //PowerCapabilities->SystemBatteriesPresent = 0;
726 
727  Status = STATUS_SUCCESS;
728  }
730  {
731  Status = _SEH2_GetExceptionCode();
732  }
733  _SEH2_END;
734 
735  break;
736  }
737 
739  {
741 
742  if (InputBuffer != NULL)
744  if (OutputBufferLength < sizeof(PROCESSOR_POWER_INFORMATION))
746 
747  _SEH2_TRY
748  {
749  PowerInformation->Number = 0;
750  PowerInformation->MaxMhz = 1000;
751  PowerInformation->CurrentMhz = 1000;
752  PowerInformation->MhzLimit = 1000;
753  PowerInformation->MaxIdleState = 0;
754  PowerInformation->CurrentIdleState = 0;
755 
756  Status = STATUS_SUCCESS;
757  }
759  {
760  Status = _SEH2_GetExceptionCode();
761  }
762  _SEH2_END;
763 
764  break;
765  }
766 
767  default:
768  Status = STATUS_NOT_IMPLEMENTED;
769  DPRINT1("PowerInformationLevel 0x%x is UNIMPLEMENTED! Have a nice day.\n",
770  PowerInformationLevel);
771  break;
772  }
773 
774  return Status;
775 }
776 
777 NTSTATUS
778 NTAPI
781 {
783  return STATUS_NOT_IMPLEMENTED;
784 }
785 
786 BOOLEAN
787 NTAPI
789 {
791  return FALSE;
792 }
793 
794 NTSTATUS
795 NTAPI
797 {
799  return STATUS_NOT_IMPLEMENTED;
800 }
801 
802 NTSTATUS
803 NTAPI
806 {
810  PAGED_CODE();
811 
812  /* Validate flags */
813  if (esFlags & ~(ES_CONTINUOUS | ES_USER_PRESENT))
814  {
815  /* Fail the request */
817  }
818 
819  /* Check for user parameters */
820  if (PreviousMode != KernelMode)
821  {
822  /* Protect the probes */
823  _SEH2_TRY
824  {
825  /* Check if the pointer is valid */
826  ProbeForWriteUlong(PreviousFlags);
827  }
829  {
830  /* It isn't -- fail */
832  }
833  _SEH2_END;
834  }
835 
836  /* Save the previous state, always masking in the continous flag */
837  PreviousState = Thread->PowerState | ES_CONTINUOUS;
838 
839  /* Check if we need to update the power state */
840  if (esFlags & ES_CONTINUOUS) Thread->PowerState = (UCHAR)esFlags;
841 
842  /* Protect the write back to user mode */
843  _SEH2_TRY
844  {
845  /* Return the previous flags */
846  *PreviousFlags = PreviousState;
847  }
849  {
850  /* Something's wrong, fail */
852  }
853  _SEH2_END;
854 
855  /* All is good */
856  return STATUS_SUCCESS;
857 }
858 
859 NTSTATUS
860 NTAPI
863  IN ULONG Flags)
864 {
866  POP_POWER_ACTION Action = {0};
868  ULONG Dummy;
869 
870  /* Check for invalid parameter combinations */
871  if ((MinSystemState >= PowerSystemMaximum) ||
872  (MinSystemState <= PowerSystemUnspecified) ||
873  (SystemAction > PowerActionWarmEject) ||
874  (SystemAction < PowerActionReserved) ||
875  (Flags & ~(POWER_ACTION_QUERY_ALLOWED |
882  {
883  DPRINT1("NtSetSystemPowerState: Bad parameters!\n");
884  DPRINT1(" SystemAction: 0x%x\n", SystemAction);
885  DPRINT1(" MinSystemState: 0x%x\n", MinSystemState);
886  DPRINT1(" Flags: 0x%x\n", Flags);
888  }
889 
890  /* Check for user caller */
891  if (PreviousMode != KernelMode)
892  {
893  /* Check for shutdown permission */
894  if (!SeSinglePrivilegeCheck(SeShutdownPrivilege, PreviousMode))
895  {
896  /* Not granted */
897  DPRINT1("ERROR: Privilege not held for shutdown\n");
899  }
900 
901  /* Do it as a kernel-mode caller for consistency with system state */
902  return ZwSetSystemPowerState(SystemAction, MinSystemState, Flags);
903  }
904 
905  /* Read policy settings (partial shutdown vs. full shutdown) */
906  if (SystemAction == PowerActionShutdown) PopReadShutdownPolicy();
907 
908  /* Disable lazy flushing of registry */
909  DPRINT("Stopping lazy flush\n");
911 
912  /* Setup the power action */
913  Action.Action = SystemAction;
914  Action.Flags = Flags;
915 
916  /* Notify callbacks */
917  DPRINT("Notifying callbacks\n");
919 
920  /* Swap in any worker thread stacks */
921  DPRINT("Swapping worker threads\n");
923 
924  /* Make our action global */
925  PopAction = Action;
926 
927  /* Start power loop */
928  Status = STATUS_CANCELLED;
929  while (TRUE)
930  {
931  /* Break out if there's nothing to do */
932  if (Action.Action == PowerActionNone) break;
933 
934  /* Check for first-pass or restart */
935  if (Status == STATUS_CANCELLED)
936  {
937  /* Check for shutdown action */
938  if ((PopAction.Action == PowerActionShutdown) ||
939  (PopAction.Action == PowerActionShutdownReset) ||
940  (PopAction.Action == PowerActionShutdownOff))
941  {
942  /* Set the action */
943  PopAction.Shutdown = TRUE;
944  }
945 
946  /* Now we are good to go */
947  Status = STATUS_SUCCESS;
948  }
949 
950  /* Check if we're still in an invalid status */
951  if (!NT_SUCCESS(Status)) break;
952 
953 #ifndef NEWCC
954  /* Flush dirty cache pages */
955  CcRosFlushDirtyPages(-1, &Dummy, FALSE); //HACK: We really should wait here!
956 #else
957  Dummy = 0;
958 #endif
959 
960  /* Flush all volumes and the registry */
961  DPRINT("Flushing volumes, cache flushed %lu pages\n", Dummy);
962  PopFlushVolumes(PopAction.Shutdown);
963 
964  /* Set IRP for drivers */
965  PopAction.IrpMinor = IRP_MN_SET_POWER;
966  if (PopAction.Shutdown)
967  {
968  DPRINT("Queueing shutdown thread\n");
969  /* Check if we are running in the system context */
971  {
972  /* We're not, so use a worker thread for shutdown */
973  ExInitializeWorkItem(&PopShutdownWorkItem,
975  NULL);
976 
977  ExQueueWorkItem(&PopShutdownWorkItem, CriticalWorkQueue);
978 
979  /* Spend us -- when we wake up, the system is good to go down */
981  Status = STATUS_SYSTEM_SHUTDOWN;
982  goto Exit;
983 
984  }
985  else
986  {
987  /* Do the shutdown inline */
989  }
990  }
991 
992  /* You should not have made it this far */
993  // ASSERTMSG("System is still up and running?!", FALSE);
994  DPRINT1("System is still up and running, you may not have chosen a yet supported power option: %u\n", PopAction.Action);
995  break;
996  }
997 
998 Exit:
999  /* We're done, return */
1000  return Status;
1001 }
#define ProbeForWriteUlong(Ptr)
Definition: probe.h:36
DWORD *typedef PVOID
Definition: winlogon.h:52
signed char * PCHAR
Definition: retypes.h:7
NTSTATUS PopQuerySystemPowerStateTraverse(PDEVICE_NODE DeviceNode, PVOID Context)
Definition: power.c:152
PCALLBACK_OBJECT PowerStateCallback
Definition: callback.c:29
#define ASSERT_IRQL_LESS_OR_EQUAL(x)
Definition: debug.h:250
enum _POWER_STATE_TYPE POWER_STATE_TYPE
#define IN
Definition: typedefs.h:39
ULONG Flags
Definition: iotypes.h:836
#define STATUS_PRIVILEGE_NOT_HELD
Definition: DriverTester.h:9
#define TRUE
Definition: types.h:120
PDEVICE_OBJECT PhysicalDeviceObject
Definition: iotypes.h:839
_In_ UCHAR _In_ POWER_STATE PowerState
Definition: pofuncs.h:42
PDEVICE_NODE IopRootDeviceNode
Definition: pnpmgr.c:18
VOID NTAPI ExQueueWorkItem(IN PWORK_QUEUE_ITEM WorkItem, IN WORK_QUEUE_TYPE QueueType)
Definition: work.c:716
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES IN DWORD Unknown3
Definition: conport.c:35
VOID NTAPI ExSwapinWorkerThreads(IN BOOLEAN AllowSwap)
Definition: work.c:630
Type
Definition: Type.h:6
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:438
#define IRP_MN_QUERY_POWER
REQUEST_POWER_COMPLETE * PREQUEST_POWER_COMPLETE
Definition: potypes.h:404
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:225
_In_ ULONG _In_ BOOLEAN LogError
Definition: classpnp.h:1117
NTSTATUS IopTraverseDeviceTree(PDEVICETREE_TRAVERSE_CONTEXT Context)
Definition: pnpmgr.c:1393
#define STATUS_MORE_PROCESSING_REQUIRED
Definition: shellext.h:49
NTSTATUS NTAPI PoCallDriver(IN PDEVICE_OBJECT DeviceObject, IN OUT PIRP Irp)
Definition: power.c:478
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:1006
_In_ PIRP Irp
Definition: csq.h:116
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
POWER_ACTION Action
Definition: po.h:216
ACPI_EFI_DEVICE_PATH ACPI_EFI_HANDLE * Device
Definition: acefiex.h:649
return STATUS_SUCCESS
Definition: btrfs.c:2664
char * strstr(char *String1, char *String2)
Definition: utclib.c:653
UCHAR IrpMinor
Definition: po.h:220
PLOADER_PARAMETER_EXTENSION Extension
Definition: arc.h:512
#define POWER_ACTION_DISABLE_WAKES
Definition: ntpoapi.h:412
_In_ ULONG ConservationIdleTime
Definition: pofuncs.h:24
#define KeGetPreviousMode()
Definition: ketypes.h:1081
PULONG NTAPI PoRegisterDeviceForIdleDetection(IN PDEVICE_OBJECT DeviceObject, IN ULONG ConservationIdleTime, IN ULONG PerformanceIdleTime, IN DEVICE_POWER_STATE State)
Definition: power.c:495
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ ULONG _In_ ULONG _In_ ULONG OutputBufferLength
Definition: fltkernel.h:1374
#define POWER_ACTION_LOCK_CONSOLE
Definition: ntpoapi.h:411
BOOLEAN NTAPI SeSinglePrivilegeCheck(IN LUID PrivilegeValue, IN KPROCESSOR_MODE PreviousMode)
Definition: priv.c:524
#define PNPNOTIFY_DEVICE_INTERFACE_INCLUDE_EXISTING_INTERFACES
Definition: iotypes.h:1195
POWER_ACTION PowerAction
Definition: power.c:21
PDEVICE_NODE PopSystemPowerDeviceNode
Definition: power.c:25
VOID NTAPI ObDereferenceObject(IN PVOID Object)
Definition: obref.c:267
struct _IO_STACK_LOCATION::@3407::@3438 WaitWake
_In_ PLARGE_INTEGER _In_ ULONG _In_ BOOLEAN _In_ ULONG _Out_ PVOID _Out_ PIO_STATUS_BLOCK _In_ PDEVICE_OBJECT DeviceObject
Definition: npfs.h:636
_In_ SYSTEM_POWER_STATE MinSystemState
Definition: ntpoapi.h:296
NTSTATUS NTAPI KeWaitForSingleObject(IN PVOID Object, IN KWAIT_REASON WaitReason, IN KPROCESSOR_MODE WaitMode, IN BOOLEAN Alertable, IN PLARGE_INTEGER Timeout OPTIONAL)
Definition: wait.c:416
#define FASTCALL
Definition: nt_native.h:50
BOOLEAN PopAcpiPresent
Definition: power.c:26
enum _SYSTEM_POWER_STATE SYSTEM_POWER_STATE
VOID NTAPI PopCleanupPowerState(IN PPOWER_STATE PowerState)
Definition: power.c:62
VOID NTAPI ProbeForWrite(IN PVOID Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:143
VOID NTAPI PoUnregisterSystemState(IN PVOID StateHandle)
Definition: power.c:629
struct _IO_STACK_LOCATION::@3407::@3443 Others
CHAR InputBuffer[80]
Definition: conmgr.c:33
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:50
#define IoSetCompletionRoutine(_Irp, _CompletionRoutine, _Context, _InvokeOnSuccess, _InvokeOnError, _InvokeOnCancel)
Definition: irp.cpp:515
uint32_t ULONG_PTR
Definition: typedefs.h:64
int WINAPI StartPage(_In_ HDC)
NTSTATUS NTAPI PoCancelDeviceNotify(IN PVOID NotifyBlock)
Definition: power.c:411
VOID NTAPI PoSetSystemState(IN EXECUTION_STATE Flags)
Definition: power.c:609
ACPI_EFI_EVENT Event
Definition: acefiex.h:633
SYSTEM_POWER_STATE SystemState
Definition: ntpoapi.h:57
ULONG NTAPI KeSuspendThread(PKTHREAD Thread)
Definition: thrdobj.c:610
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
NTSTATUS NTAPI CcRosFlushDirtyPages(ULONG Target, PULONG Count, BOOLEAN Wait)
Definition: view.c:160
_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
LIST_ENTRY PopVolumeDevices
Definition: povolume.c:27
_In_ SYSTEM_POWER_STATE _In_ ULONG _In_ BOOLEAN Asynchronous
Definition: ntpoapi.h:296
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
struct _POWER_STATE_TRAVERSE_CONTEXT POWER_STATE_TRAVERSE_CONTEXT
#define FALSE
Definition: types.h:117
PEPROCESS PsInitialSystemProcess
Definition: psmgr.c:50
#define POWER_ACTION_OVERRIDE_APPS
Definition: ntpoapi.h:409
struct SYSTEM_POWER_CAPABILITIES * PSYSTEM_POWER_CAPABILITIES
PRTL_UNICODE_STRING_BUFFER PULONG PULONG Unknown4
#define _SEH2_END
Definition: pseh2_64.h:7
NTSTATUS PopSendQuerySystemPowerState(PDEVICE_OBJECT DeviceObject, SYSTEM_POWER_STATE SystemState, POWER_ACTION PowerAction)
Definition: power.c:68
WORK_QUEUE_ITEM PopShutdownWorkItem
Definition: power.c:28
#define PsGetCurrentProcess
Definition: psfuncs.h:17
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
FORCEINLINE VOID KeInitializeSpinLock(_Out_ PKSPIN_LOCK SpinLock)
Definition: kefuncs.h:251
NTSTATUS NTAPI NtInitiatePowerAction(IN POWER_ACTION SystemAction, IN SYSTEM_POWER_STATE MinSystemState, IN ULONG Flags, IN BOOLEAN Asynchronous)
Definition: power.c:639
VOID NTAPI PopReadShutdownPolicy(VOID)
Definition: poshtdwn.c:306
VOID NTAPI PopInitShutdownList(VOID)
Definition: poshtdwn.c:32
smooth NULL
Definition: ftsmooth.c:513
VOID NTAPI PoSetHiberRange(IN PVOID HiberContext, IN ULONG Flags, IN OUT PVOID StartPage, IN ULONG Length, IN ULONG PageTag)
Definition: power.c:463
#define STATUS_INVALID_PARAMETER_2
Definition: ntstatus.h:462
void DPRINT(...)
Definition: polytest.cpp:61
POP_POWER_ACTION PopAction
Definition: power.c:27
NTSTATUS NTAPI NtSetSystemPowerState(IN POWER_ACTION SystemAction, IN SYSTEM_POWER_STATE MinSystemState, IN ULONG Flags)
Definition: power.c:861
_Must_inspect_result_ __drv_aliasesMem _In_ PDEVICE_OBJECT _In_opt_ PVOID _In_ ULONG _Out_opt_ PVOID OutputBuffer
Definition: iofuncs.h:713
KGUARDED_MUTEX PopVolumeLock
Definition: povolume.c:26
#define POWER_ACTION_CRITICAL
Definition: ntpoapi.h:413
_Out_ EXECUTION_STATE * PreviousFlags
Definition: ntpoapi.h:281
PLOADER_PARAMETER_BLOCK KeLoaderBlock
Definition: krnlinit.c:29
VOID NTAPI HalProcessorIdle(VOID)
Definition: processor.c:83
PDEVICE_OBJECT NTAPI IoGetAttachedDeviceReference(PDEVICE_OBJECT DeviceObject)
Definition: device.c:1180
LATENCY_TIME
Definition: potypes.h:171
ULONG Flags
Definition: po.h:218
enum _DEVICE_POWER_STATE DEVICE_POWER_STATE
struct _POWER_STATE_TRAVERSE_CONTEXT * PPOWER_STATE_TRAVERSE_CONTEXT
_In_opt_ PVOID _In_opt_ PVOID SystemArgument1
Definition: ketypes.h:660
#define POWER_ACTION_QUERY_ALLOWED
Definition: ntpoapi.h:407
VOID NTAPI ExNotifyCallback(IN PCALLBACK_OBJECT CallbackObject, IN PVOID Argument1, IN PVOID Argument2)
Definition: callback.c:467
unsigned char BOOLEAN
_In_ KPROCESSOR_MODE PreviousMode
Definition: sefuncs.h:103
_In_ LARGE_INTEGER _In_opt_ PKDPC Dpc
Definition: kefuncs.h:524
enum _DEVICE_POWER_STATE * PDEVICE_POWER_STATE
#define ExInitializeWorkItem(Item, Routine, Context)
Definition: exfuncs.h:265
#define POWER_ACTION_UI_ALLOWED
Definition: ntpoapi.h:408
NTSYSCALLAPI NTSTATUS NTAPI ZwSetSystemPowerState(_In_ POWER_ACTION SystemAction, _In_ SYSTEM_POWER_STATE MinSystemState, _In_ ULONG Flags)
#define _SEH2_YIELD(STMT_)
Definition: pseh2_64.h:8
union _IO_STACK_LOCATION::@3407 Parameters
#define STATUS_PENDING
Definition: ntstatus.h:82
NTSTATUS NTAPI NtGetDevicePowerState(IN HANDLE Device, IN PDEVICE_POWER_STATE PowerState)
Definition: power.c:779
VOID NTAPI CmSetLazyFlushState(IN BOOLEAN Enable)
Definition: cmlazy.c:327
BOOLEAN NTAPI INIT_FUNCTION PoInitSystem(IN ULONG BootPhase)
Definition: power.c:295
static void Exit(void)
Definition: sock.c:1263
_In_ PLIST_ENTRY _In_ PSTRING _In_ USHORT _In_opt_ PSTRING _In_opt_ PSTRING _In_ ULONG _In_ ULONG Action
Definition: fsrtlfuncs.h:738
BOOLEAN NTAPI NtIsSystemResumeAutomatic(VOID)
Definition: power.c:788
enum _POWER_INFORMATION_LEVEL POWER_INFORMATION_LEVEL
#define STATUS_CANCELLED
Definition: udferr_usr.h:170
DEVICE_POWER_STATE DeviceState
Definition: ntpoapi.h:58
PDEVICE_OBJECT DeviceObject
Definition: iotypes.h:2841
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
Definition: fltkernel.h:2653
#define PAGED_CODE()
Definition: video.h:57
CCHAR KPROCESSOR_MODE
Definition: ketypes.h:7
Definition: Node.h:9
NTSTATUS IopGetSystemPowerDeviceObject(IN PDEVICE_OBJECT *DeviceObject)
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
unsigned char UCHAR
Definition: xmlstorage.h:181
#define IRP_MJ_POWER
NTSTATUS PopSendSetSystemPowerState(PDEVICE_OBJECT DeviceObject, SYSTEM_POWER_STATE SystemState, POWER_ACTION PowerAction)
Definition: power.c:110
VOID NTAPI ProbeForRead(IN CONST VOID *Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:102
NTSTATUS NTAPI NtRequestWakeupLatency(IN LATENCY_TIME Latency)
Definition: power.c:796
ULONG EXECUTION_STATE
Definition: potypes.h:169
VOID UINTN Length
Definition: acefiex.h:744
_In_ UCHAR _In_ POWER_STATE _In_opt_ PREQUEST_POWER_COMPLETE CompletionFunction
Definition: pofuncs.h:42
Definition: ketypes.h:672
POWER_ACTION
Definition: ntpoapi.h:122
#define DNF_LEGACY_DRIVER
Definition: iotypes.h:181
VOID NTAPI PopFlushVolumes(IN BOOLEAN ShuttingDown)
Definition: povolume.c:229
NTSTATUS NTAPI IoRegisterPlugPlayNotification(IN IO_NOTIFICATION_EVENT_CATEGORY EventCategory, IN ULONG EventCategoryFlags, IN PVOID EventCategoryData OPTIONAL, IN PDRIVER_OBJECT DriverObject, IN PDRIVER_NOTIFICATION_CALLBACK_ROUTINE CallbackRoutine, IN PVOID Context, OUT PVOID *NotificationEntry)
Definition: pnpnotify.c:250
#define IRP_MN_SET_POWER
_In_ UCHAR MinorFunction
Definition: pofuncs.h:42
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetNextIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2647
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ ULONG _In_ ULONG InputBufferLength
Definition: fltkernel.h:1372
UNICODE_STRING InstancePath
Definition: iotypes.h:842
Status
Definition: gdiplustypes.h:24
_In_opt_ PVOID _In_opt_ PVOID _In_opt_ PVOID SystemArgument2
Definition: ketypes.h:660
#define MAXULONG
Definition: typedefs.h:251
static NTSTATUS NTAPI PopRequestPowerIrpCompletion(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PVOID Context)
Definition: power.c:35
NTSTATUS NTAPI PoRegisterDeviceNotify(OUT PVOID Unknown0, IN ULONG Unknown1, IN ULONG Unknown2, IN ULONG Unknown3, IN PVOID Unknown4, IN PVOID Unknown5)
Definition: power.c:422
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
VOID NTAPI INIT_FUNCTION PoInitializePrcb(IN PKPRCB Prcb)
Definition: power.c:389
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2745
#define POWER_ACTION_LIGHTEST_FIRST
Definition: ntpoapi.h:410
_In_ PLARGE_INTEGER _In_opt_ PTIMER_APC_ROUTINE _In_opt_ PVOID _In_ BOOLEAN _In_opt_ LONG _Out_opt_ PBOOLEAN PreviousState
Definition: zwfuncs.h:428
struct SYSTEM_BATTERY_STATE * PSYSTEM_BATTERY_STATE
#define NT_SUCCESS(StatCode)
Definition: cmd.c:149
DWORD *typedef HANDLE
Definition: winlogon.h:52
const LUID SeShutdownPrivilege
Definition: priv.c:40
VOID FASTCALL KeInitializeGuardedMutex(OUT PKGUARDED_MUTEX GuardedMutex)
Definition: gmutex.c:31
LONG NTSTATUS
Definition: DriverTester.h:11
LONG NTAPI ExSystemExceptionFilter(VOID)
Definition: harderr.c:325
#define KeInitializeEvent(pEvt, foo, foo2)
Definition: env_spec_w32.h:477
_CRTIMP char *__cdecl _strupr(_Inout_z_ char *_String)
VOID NTAPI PoStartNextPowerIrp(IN PIRP Irp)
Definition: power.c:619
_In_ ULONG _In_ ULONG PerformanceIdleTime
Definition: pofuncs.h:24
#define ES_CONTINUOUS
Definition: potypes.h:167
VOID NTAPI PopPerfIdleDpc(IN PKDPC Dpc, IN PVOID DeferredContext, IN PVOID SystemArgument1, IN PVOID SystemArgument2)
Definition: power.c:369
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
VOID NTAPI PopGracefulShutdown(IN PVOID Context)
Definition: poshtdwn.c:244
#define _SEH2_TRY
Definition: pseh2_64.h:5
VOID FASTCALL PopIdle0(IN PPROCESSOR_POWER_STATE PowerState)
Definition: power.c:380
struct _IO_STACK_LOCATION::@3407::@3440 Power
_In_ PIRP _In_ PIO_STACK_LOCATION IrpSp
Definition: tdikrnl.h:1069
static OUT PIO_STATUS_BLOCK IoStatusBlock
Definition: pipe.c:75
unsigned int * PULONG
Definition: retypes.h:1
NTSTATUS NTAPI IoCallDriver(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: irp.c:1155
#define ES_USER_PRESENT
Definition: potypes.h:166
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:653
#define IoSkipCurrentIrpStackLocation(Irp)
Definition: ntifs_ex.h:421
#define DPRINT1
Definition: precomp.h:8
VOID NTAPI PopPerfIdle(PPROCESSOR_POWER_STATE PowerState)
Definition: power.c:362
VOID NTAPI KeSetTargetProcessorDpc(IN PKDPC Dpc, IN CCHAR Number)
Definition: dpc.c:970
NTSTATUS NTAPI PopAddRemoveSysCapsCallback(IN PVOID NotificationStructure, IN PVOID Context)
Definition: events.c:147
#define OUT
Definition: typedefs.h:40
VOID NTAPI IoFreeIrp(IN PIRP Irp)
Definition: irp.c:1589
PVOID PIRP
Definition: usb.h:38
struct tagContext Context
Definition: acpixf.h:1014
_In_ PIRP _In_opt_ PVOID _In_opt_ POPLOCK_WAIT_COMPLETE_ROUTINE CompletionRoutine
Definition: fsrtlfuncs.h:673
#define STATUS_NOT_SUPPORTED
Definition: ntstatus.h:409
unsigned int ULONG
Definition: retypes.h:1
#define UNIMPLEMENTED
Definition: debug.h:114
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
POWER_STATE NTAPI PoSetPowerState(IN PDEVICE_OBJECT DeviceObject, IN POWER_STATE_TYPE Type, IN POWER_STATE State)
Definition: power.c:590
#define ULONG_PTR
Definition: config.h:101
#define IRP_MN_WAIT_WAKE
PIRP NTAPI IoAllocateIrp(IN CCHAR StackSize, IN BOOLEAN ChargeQuota)
Definition: irp.c:552
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
KSPIN_LOCK PopDopeGlobalLock
Definition: povolume.c:28
NTSTATUS NTAPI PoRequestPowerIrp(IN PDEVICE_OBJECT DeviceObject, IN UCHAR MinorFunction, IN POWER_STATE PowerState, IN PREQUEST_POWER_COMPLETE CompletionFunction, IN PVOID Context, OUT PIRP *pIrp OPTIONAL)
Definition: power.c:521
PVOID NTAPI PoRegisterSystemState(IN PVOID StateHandle, IN EXECUTION_STATE Flags)
Definition: power.c:509
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:12
NTSTATUS NTAPI PopSetSystemPowerState(SYSTEM_POWER_STATE PowerState, POWER_ACTION PowerAction)
Definition: power.c:230
#define KeGetCurrentThread
Definition: hal.h:44
PDEVICE_OBJECT PowerDevice
Definition: power.c:22
VOID NTAPI KeInitializeDpc(IN PKDPC Dpc, IN PKDEFERRED_ROUTINE DeferredRoutine, IN PVOID DeferredContext)
Definition: dpc.c:711
SYSTEM_POWER_STATE SystemPowerState
Definition: power.c:20
BOOLEAN Shutdown
Definition: po.h:215
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES IN DWORD IN DWORD IN DWORD Unknown5
Definition: conport.c:35
NTSTATUS PopSetSystemPowerStateTraverse(PDEVICE_NODE DeviceNode, PVOID Context)
Definition: power.c:186
struct _PROCESSOR_POWER_INFORMATION * PPROCESSOR_POWER_INFORMATION
NTSTATUS NTAPI NtSetThreadExecutionState(IN EXECUTION_STATE esFlags, OUT EXECUTION_STATE *PreviousFlags)
Definition: power.c:804
FORCEINLINE VOID IoSetNextIrpStackLocation(_Inout_ PIRP Irp)
Definition: iofuncs.h:2632
IN HDEVINFO IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL
Definition: devinst.c:44
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:90
VOID NTAPI KeInitializeTimerEx(OUT PKTIMER Timer, IN TIMER_TYPE Type)
Definition: timerobj.c:244
#define IopInitDeviceTreeTraverseContext(_DeviceTreeTraverseContext, _DeviceNode, _Action,_Context)
Definition: io.h:224
#define STATUS_SYSTEM_SHUTDOWN
Definition: ntstatus.h:841
#define INIT_FUNCTION
Definition: ntoskrnl.h:11
_In_opt_ PVOID DeferredContext
Definition: ketypes.h:660