reactos/sdk/include/ndk/potypes.h

152 lines
3 KiB
C
Raw Normal View History

/*++ NDK Version: 0098
Copyright (c) Alex Ionescu. All rights reserved.
Header Name:
potypes.h
Abstract:
Type definitions for the Power Subystem
Author:
Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006
--*/
#ifndef _POTYPES_H
#define _POTYPES_H
//
// Dependencies
//
- Update NDK to remove zwfuncs.h and place the native functions in their respective xxfuncs.h instead, so that applications can now include only what they need. Add more xxfuncs.h files for every API. - Make the NDK smarter so that using #define NTOS_MODE_USER isn't needed anymore: the NDK can now auto-detect the presence of windows.h or ntddk.h and make the appropriate decision. - re-arrange ntndk.h to include all types in alphabetical order, and then all functions, regardless of um/kmode usage. - Make each file auto-detect if this is NTOS_MODE_USER or not and include each files it needs, instead of depending on a predefined order inside ntndk.h This way, any file can be included from both user-mode or kmode as simply as #include <iofuncs.h>, wthout any adtional work. - Update FIXME list with these changes and delay NDK release date since my trip is lasting a day longer. - Fix ntsecapi.h to define UNICODE_STRING, like it does in the PSDK. - Fix apps including ntsecapi + winternl.h These two cause a conflict even on PSDK and shouldn't be included together. - Make winlogon include only the NDK files it needs (2) instead of the whole NDK, as test for this faster newly supported method. - Remove some NDK apps from the FIXME list (the ones that weren't being built/are on my rewrite branch/are better off including the whole NDK instead of file-by-file). - Update debug.h to define RtlAssert and DbgPrint in case the NDK or DDK aren't already included, which will allow some of the apps to stop using the NDK solely for DPRINT/DPRINT1. Diabled for now since a lot of code needs to be changed to #include <debug.h> *After* they include the other headers. (so that the anti-double-definition check can work). svn path=/trunk/; revision=19538
2005-11-25 00:17:40 +00:00
#include <umtypes.h>
#ifndef NTOS_MODE_USER
#include <ntpoapi.h>
#endif
#ifdef NTOS_MODE_USER
//
// Information Structures for NtPowerInformation
// Copied from ddk\ntpoapi.h
//
typedef struct _SYSTEM_POWER_INFORMATION
{
ULONG MaxIdlenessAllowed;
ULONG Idleness;
ULONG TimeRemaining;
UCHAR CoolingMode;
} SYSTEM_POWER_INFORMATION, *PSYSTEM_POWER_INFORMATION;
#endif
//
// Docking states
//
typedef enum _SYSTEM_DOCK_STATE
{
SystemDockStateUnknown,
SystemUndocked,
SystemDocked
} SYSTEM_DOCK_STATE, *PSYSTEM_DOCK_STATE;
#ifndef NTOS_MODE_USER
//
// Processor Power State Data
//
struct _PROCESSOR_POWER_STATE;
typedef
VOID
(FASTCALL *PPROCESSOR_IDLE_FUNCTION)(
struct _PROCESSOR_POWER_STATE *PState);
typedef struct _PROCESSOR_POWER_STATE
{
PPROCESSOR_IDLE_FUNCTION IdleFunction;
ULONG Idle0KernelTimeLimit;
ULONG Idle0LastTime;
PVOID IdleHandlers;
PVOID IdleState;
ULONG IdleHandlersCount;
ULONGLONG LastCheck;
PROCESSOR_IDLE_TIMES IdleTimes;
ULONG IdleTime1;
ULONG PromotionCheck;
ULONG IdleTime2;
UCHAR CurrentThrottle;
UCHAR ThermalThrottleLimit;
UCHAR CurrentThrottleIndex;
UCHAR ThermalThrottleIndex;
ULONG LastKernelUserTime;
ULONG PerfIdleTime;
ULONGLONG DebugDelta;
ULONG DebugCount;
ULONG LastSysTime;
ULONGLONG TotalIdleStateTime[3];
ULONG TotalIdleTransitions[3];
ULONGLONG PreviousC3StateTime;
UCHAR KneeThrottleIndex;
UCHAR ThrottleLimitIndex;
UCHAR PerfStatesCount;
UCHAR ProcessorMinThrottle;
UCHAR ProcessorMaxThrottle;
UCHAR LastBusyPercentage;
UCHAR LastC3Percentage;
UCHAR LastAdjustedBusyPercentage;
ULONG PromotionCount;
ULONG DemotionCount;
ULONG ErrorCount;
ULONG RetryCount;
ULONG Flags;
LARGE_INTEGER PerfCounterFrequency;
ULONG PerfTickCount;
KTIMER PerfTimer;
KDPC PerfDpc;
PROCESSOR_PERF_STATE *PerfStates;
PVOID PerfSetThrottle;
ULONG LastC3KernelUserTime;
ULONG Spare1[1];
} PROCESSOR_POWER_STATE, *PPROCESSOR_POWER_STATE;
//
// Device Notification Structure
//
typedef struct _PO_DEVICE_NOTIFY
{
LIST_ENTRY Link;
PDEVICE_OBJECT TargetDevice;
UCHAR WakeNeeded;
UCHAR OrderLevel;
PDEVICE_OBJECT DeviceObject;
PVOID Node;
PUSHORT DeviceName;
PUSHORT DriverName;
ULONG ChildCount;
ULONG ActiveChild;
} PO_DEVICE_NOTIFY, *PPO_DEVICE_NOTIFY;
//
// Power IRP Queue
//
typedef struct _PO_IRP_QUEUE
{
PIRP CurrentIrp;
PIRP PendingIrpList;
} PO_IRP_QUEUE, *PPO_IRP_QUEUE;
//
// Power IRP Manager
//
typedef struct _PO_IRP_MANAGER
{
PO_IRP_QUEUE DeviceIrpQueue;
PO_IRP_QUEUE SystemIrpQueue;
} PO_IRP_MANAGER, *PPO_IRP_MANAGER;
#endif // !NTOS_MODE_USER
#endif // _POTYPES_H