Author: tkreuzer Date: Tue Mar 9 01:17:56 2010 New Revision: 46020
URL: http://svn.reactos.org/svn/reactos?rev=46020&view=rev Log: - Move some definitions from wdm.h to ntpoapi.h - Add ALIGN_DOWN_BY, ALIGN_UP_BY, ALIGN_DOWN_POINTER_BY, ALIGN_UP_POINTER_BY - fix pshpack1.h inclusion - PCHAR -> PSTR in RtlAssert
Modified: branches/header-work/include/ddk/ntpoapi.h branches/header-work/include/ddk/wdm.h
Modified: branches/header-work/include/ddk/ntpoapi.h URL: http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/ntpoapi.... ============================================================================== --- branches/header-work/include/ddk/ntpoapi.h [iso-8859-1] (original) +++ branches/header-work/include/ddk/ntpoapi.h [iso-8859-1] Tue Mar 9 01:17:56 2010 @@ -152,6 +152,108 @@ UCHAR NumPerfStates; PROCESSOR_PERF_LEVEL PerfLevel[1]; } PROCESSOR_STATE_HANDLER2, *PPROCESSOR_STATE_HANDLER2; + +/* Power States/Levels */ +typedef enum _SYSTEM_POWER_STATE { + PowerSystemUnspecified, + PowerSystemWorking, + PowerSystemSleeping1, + PowerSystemSleeping2, + PowerSystemSleeping3, + PowerSystemHibernate, + PowerSystemShutdown, + PowerSystemMaximum +} SYSTEM_POWER_STATE, *PSYSTEM_POWER_STATE; +#define POWER_SYSTEM_MAXIMUM PowerSystemMaximum + +typedef enum _DEVICE_POWER_STATE { + PowerDeviceUnspecified, + PowerDeviceD0, + PowerDeviceD1, + PowerDeviceD2, + PowerDeviceD3, + PowerDeviceMaximum +} DEVICE_POWER_STATE, *PDEVICE_POWER_STATE; + +typedef union _POWER_STATE { + SYSTEM_POWER_STATE SystemState; + DEVICE_POWER_STATE DeviceState; +} POWER_STATE, *PPOWER_STATE; + +typedef enum _POWER_STATE_TYPE { + SystemPowerState = 0, + DevicePowerState +} POWER_STATE_TYPE, *PPOWER_STATE_TYPE; + + +typedef enum _POWER_INFORMATION_LEVEL { + SystemPowerPolicyAc, + SystemPowerPolicyDc, + VerifySystemPolicyAc, + VerifySystemPolicyDc, + SystemPowerCapabilities, + SystemBatteryState, + SystemPowerStateHandler, + ProcessorStateHandler, + SystemPowerPolicyCurrent, + AdministratorPowerPolicy, + SystemReserveHiberFile, + ProcessorInformation, + SystemPowerInformation, + ProcessorStateHandler2, + LastWakeTime, + LastSleepTime, + SystemExecutionState, + SystemPowerStateNotifyHandler, + ProcessorPowerPolicyAc, + ProcessorPowerPolicyDc, + VerifyProcessorPowerPolicyAc, + VerifyProcessorPowerPolicyDc, + ProcessorPowerPolicyCurrent, + SystemPowerStateLogging, + SystemPowerLoggingEntry, + SetPowerSettingValue, + NotifyUserPowerSetting, + PowerInformationLevelUnused0, + PowerInformationLevelUnused1, + SystemVideoState, + TraceApplicationPowerMessage, + TraceApplicationPowerMessageEnd, + ProcessorPerfStates, + ProcessorIdleStates, + ProcessorCap, + SystemWakeSource, + SystemHiberFileInformation, + TraceServicePowerMessage, + ProcessorLoad, + PowerShutdownNotification, + MonitorCapabilities, + SessionPowerInit, + SessionDisplayState, + PowerRequestCreate, + PowerRequestAction, + GetPowerRequestList, + ProcessorInformationEx, + NotifyUserModeLegacyPowerEvent, + GroupPark, + ProcessorIdleDomains, + WakeTimerList, + SystemHiberFileSize, + PowerInformationLevelMaximum +} POWER_INFORMATION_LEVEL; + +typedef enum { + PowerActionNone, + PowerActionReserved, + PowerActionSleep, + PowerActionHibernate, + PowerActionShutdown, + PowerActionShutdownReset, + PowerActionShutdownOff, + PowerActionWarmEject +} POWER_ACTION, *PPOWER_ACTION; + +
NTSYSCALLAPI NTSTATUS
Modified: branches/header-work/include/ddk/wdm.h URL: http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/wdm.h?re... ============================================================================== --- branches/header-work/include/ddk/wdm.h [iso-8859-1] (original) +++ branches/header-work/include/ddk/wdm.h [iso-8859-1] Tue Mar 9 01:17:56 2010 @@ -2129,17 +2129,29 @@ /* * Alignment Macros */ -#define ALIGN_DOWN(s, t) \ - ((ULONG)(s) & ~(sizeof(t) - 1)) - -#define ALIGN_UP(s, t) \ - (ALIGN_DOWN(((ULONG)(s) + sizeof(t) - 1), t)) - -#define ALIGN_DOWN_POINTER(p, t) \ - ((PVOID)((ULONG_PTR)(p) & ~((ULONG_PTR)sizeof(t) - 1))) - -#define ALIGN_UP_POINTER(p, t) \ - (ALIGN_DOWN_POINTER(((ULONG_PTR)(p) + sizeof(t) - 1), t)) +#define ALIGN_DOWN_BY(size, align) \ + ((ULONG_PTR)(size) & ~((ULONG_PTR)(align) - 1)) + +#define ALIGN_UP_BY(size, align) \ + (ALIGN_DOWN_BY(((ULONG_PTR)(size) + align - 1), align)) + +#define ALIGN_DOWN_POINTER_BY(ptr, align) \ + ((PVOID)ALIGN_DOWN_BY(ptr, align)) + +#define ALIGN_UP_POINTER_BY(ptr, alignment) \ + ((PVOID)ALIGN_UP_BY(ptr, align)) + +#define ALIGN_DOWN(size, type) \ + ALIGN_DOWN_BY(size, sizeof(type)) + +#define ALIGN_UP(size, type) \ + ALIGN_UP_BY(size, sizeof(type)) + +#define ALIGN_DOWN_POINTER(p, type) \ + ALIGN_DOWN_POINTER_BY(p, sizeof(type)) + +#define ALIGN_UP_POINTER(ptr, type) \ + ALIGN_UP_POINTER_BY(ptr, sizeof(type))
/* ULONG * BYTE_OFFSET( @@ -2944,76 +2956,6 @@ * Power Management Support Types * ******************************************************************************/
-/* Power States/Levels */ -typedef enum _SYSTEM_POWER_STATE { - PowerSystemUnspecified, - PowerSystemWorking, - PowerSystemSleeping1, - PowerSystemSleeping2, - PowerSystemSleeping3, - PowerSystemHibernate, - PowerSystemShutdown, - PowerSystemMaximum -} SYSTEM_POWER_STATE, *PSYSTEM_POWER_STATE; - -#define POWER_SYSTEM_MAXIMUM PowerSystemMaximum - -typedef enum _POWER_INFORMATION_LEVEL { - SystemPowerPolicyAc, - SystemPowerPolicyDc, - VerifySystemPolicyAc, - VerifySystemPolicyDc, - SystemPowerCapabilities, - SystemBatteryState, - SystemPowerStateHandler, - ProcessorStateHandler, - SystemPowerPolicyCurrent, - AdministratorPowerPolicy, - SystemReserveHiberFile, - ProcessorInformation, - SystemPowerInformation, - ProcessorStateHandler2, - LastWakeTime, - LastSleepTime, - SystemExecutionState, - SystemPowerStateNotifyHandler, - ProcessorPowerPolicyAc, - ProcessorPowerPolicyDc, - VerifyProcessorPowerPolicyAc, - VerifyProcessorPowerPolicyDc, - ProcessorPowerPolicyCurrent -} POWER_INFORMATION_LEVEL; - -typedef enum { - PowerActionNone, - PowerActionReserved, - PowerActionSleep, - PowerActionHibernate, - PowerActionShutdown, - PowerActionShutdownReset, - PowerActionShutdownOff, - PowerActionWarmEject -} POWER_ACTION, *PPOWER_ACTION; - -typedef enum _DEVICE_POWER_STATE { - PowerDeviceUnspecified, - PowerDeviceD0, - PowerDeviceD1, - PowerDeviceD2, - PowerDeviceD3, - PowerDeviceMaximum -} DEVICE_POWER_STATE, *PDEVICE_POWER_STATE; - -typedef union _POWER_STATE { - SYSTEM_POWER_STATE SystemState; - DEVICE_POWER_STATE DeviceState; -} POWER_STATE, *PPOWER_STATE; - -typedef enum _POWER_STATE_TYPE { - SystemPowerState = 0, - DevicePowerState -} POWER_STATE_TYPE, *PPOWER_STATE_TYPE; - typedef VOID (DDKAPI *PREQUEST_POWER_COMPLETE)( IN struct _DEVICE_OBJECT *DeviceObject, @@ -3480,7 +3422,6 @@ #define CM_RESOURCE_DMA_TYPE_B 0x0020 #define CM_RESOURCE_DMA_TYPE_F 0x0040
-#include <pshpack1.h> typedef struct _CM_PARTIAL_RESOURCE_LIST { USHORT Version; USHORT Revision; @@ -3499,6 +3440,7 @@ CM_FULL_RESOURCE_DESCRIPTOR List[1]; } CM_RESOURCE_LIST, *PCM_RESOURCE_LIST;
+#include <pshpack1.h> typedef struct _CM_INT13_DRIVE_PARAMETER { USHORT DriveSelect; ULONG MaxCylinders; @@ -4145,7 +4087,7 @@ IN PVOID FailedAssertion, IN PVOID FileName, IN ULONG LineNumber, - IN PCHAR Message); + IN PSTR Message);
/* VOID * RtlCopyMemory( @@ -4202,7 +4144,7 @@ VOID NTAPI RtlFreeUnicodeString( - IN PUNICODE_STRING UnicodeString); + IN OUT PUNICODE_STRING UnicodeString);
NTSYSAPI NTSTATUS @@ -4216,7 +4158,7 @@ NTAPI RtlInitUnicodeString( IN OUT PUNICODE_STRING DestinationString, - IN PCWSTR SourceString); + IN PCWSTR SourceString OPTIONAL);
/* VOID * RtlMoveMemory(