Author: akhaldi
Date: Sat Mar 20 12:47:30 2010
New Revision: 46284
URL:
http://svn.reactos.org/svn/reactos?rev=46284&view=rev
Log:
[XDK]
- Move several definitions to their appropriate places.
- Add FIELD_OFFSET, FIELD_SIZE, POOL_TAGGING, IF_DEBUG, IF_NTOS_DEBUG, LOOKASIDE_CHECK,
KIPI_COUNTS, KTIMER_ACTUAL_LENGTH, LOGICAL_PROCESSOR_RELATIONSHIP, LTP_PC_SMT,
SYSTEM_LOGICAL_PROCESSOR_INFORMATION, NUMA_NODE_RELATIONSHIP, GROUP_RELATIONSHIP,
SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX, SINGLE_GROUP_LEGACY_API,
KMESSAGE_SERVICE_ROUTINE, KSEMAPHORE_ACTUAL_LENGTH and several missing CACHE_*,
PROCESSOR_* and KAPC_* definitions.
- Group some related definitions.
- Base several ASSERT_* macros on NT_ASSERT instead of ASSERT.
[WDM]
- Update wdm.h to reflect XDK changes.
Modified:
branches/header-work/include/ddk/wdm.h
branches/header-work/include/xdk/extypes.h
branches/header-work/include/xdk/iotypes.h
branches/header-work/include/xdk/ketypes.h
branches/header-work/include/xdk/mmfuncs.h
branches/header-work/include/xdk/mmtypes.h
branches/header-work/include/xdk/wdm.template.h
Modified: branches/header-work/include/ddk/wdm.h
URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/wdm.h?r…
==============================================================================
--- branches/header-work/include/ddk/wdm.h [iso-8859-1] (original)
+++ branches/header-work/include/ddk/wdm.h [iso-8859-1] Sat Mar 20 12:47:30 2010
@@ -506,6 +506,109 @@
MaximumMode
} MODE;
+#define CACHE_FULLY_ASSOCIATIVE 0xFF
+
+#define EVENT_QUERY_STATE (0x0001)
+#define EVENT_MODIFY_STATE (0x0002)
+#define EVENT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x3)
+
+#define LTP_PC_SMT 0x1
+
+#if (NTDDI_VERSION < NTDDI_WIN7) || defined(_X86_) || !defined(NT_PROCESSOR_GROUPS)
+#define SINGLE_GROUP_LEGACY_API 1
+#endif
+
+#define SEMAPHORE_QUERY_STATE (0x0001)
+#define SEMAPHORE_MODIFY_STATE (0x0002)
+#define SEMAPHORE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x3)
+
+typedef enum _LOGICAL_PROCESSOR_RELATIONSHIP {
+ RelationProcessorCore,
+ RelationNumaNode,
+ RelationCache,
+ RelationProcessorPackage,
+ RelationGroup,
+ RelationAll = 0xffff
+} LOGICAL_PROCESSOR_RELATIONSHIP;
+
+typedef enum _PROCESSOR_CACHE_TYPE {
+ CacheUnified,
+ CacheInstruction,
+ CacheData,
+ CacheTrace
+} PROCESSOR_CACHE_TYPE;
+
+typedef struct _CACHE_DESCRIPTOR {
+ UCHAR Level;
+ UCHAR Associativity;
+ USHORT LineSize;
+ ULONG Size;
+ PROCESSOR_CACHE_TYPE Type;
+} CACHE_DESCRIPTOR, *PCACHE_DESCRIPTOR;
+
+typedef struct _SYSTEM_LOGICAL_PROCESSOR_INFORMATION {
+ ULONG_PTR ProcessorMask;
+ LOGICAL_PROCESSOR_RELATIONSHIP Relationship;
+ union {
+ struct {
+ UCHAR Flags;
+ } ProcessorCore;
+ struct {
+ ULONG NodeNumber;
+ } NumaNode;
+ CACHE_DESCRIPTOR Cache;
+ ULONGLONG Reserved[2];
+ } DUMMYUNIONNAME;
+} SYSTEM_LOGICAL_PROCESSOR_INFORMATION, *PSYSTEM_LOGICAL_PROCESSOR_INFORMATION;
+
+typedef struct _PROCESSOR_RELATIONSHIP {
+ UCHAR Flags;
+ UCHAR Reserved[21];
+ USHORT GroupCount;
+ GROUP_AFFINITY GroupMask[ANYSIZE_ARRAY];
+} PROCESSOR_RELATIONSHIP, *PPROCESSOR_RELATIONSHIP;
+
+typedef struct _NUMA_NODE_RELATIONSHIP {
+ ULONG NodeNumber;
+ UCHAR Reserved[20];
+ GROUP_AFFINITY GroupMask;
+} NUMA_NODE_RELATIONSHIP, *PNUMA_NODE_RELATIONSHIP;
+
+typedef struct _CACHE_RELATIONSHIP {
+ UCHAR Level;
+ UCHAR Associativity;
+ USHORT LineSize;
+ ULONG CacheSize;
+ PROCESSOR_CACHE_TYPE Type;
+ UCHAR Reserved[20];
+ GROUP_AFFINITY GroupMask;
+} CACHE_RELATIONSHIP, *PCACHE_RELATIONSHIP;
+
+typedef struct _PROCESSOR_GROUP_INFO {
+ UCHAR MaximumProcessorCount;
+ UCHAR ActiveProcessorCount;
+ UCHAR Reserved[38];
+ KAFFINITY ActiveProcessorMask;
+} PROCESSOR_GROUP_INFO, *PPROCESSOR_GROUP_INFO;
+
+typedef struct _GROUP_RELATIONSHIP {
+ USHORT MaximumGroupCount;
+ USHORT ActiveGroupCount;
+ UCHAR Reserved[20];
+ PROCESSOR_GROUP_INFO GroupInfo[ANYSIZE_ARRAY];
+} GROUP_RELATIONSHIP, *PGROUP_RELATIONSHIP;
+
+typedef struct _SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX {
+ LOGICAL_PROCESSOR_RELATIONSHIP Relationship;
+ ULONG Size;
+ union {
+ PROCESSOR_RELATIONSHIP Processor;
+ NUMA_NODE_RELATIONSHIP NumaNode;
+ CACHE_RELATIONSHIP Cache;
+ GROUP_RELATIONSHIP Group;
+ } DUMMYUNIONNAME;
+} SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX, *PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX;;
+
/* Processor features */
#define PF_FLOATING_POINT_PRECISION_ERRATA 0
#define PF_FLOATING_POINT_EMULATED 1
@@ -528,8 +631,7 @@
#define MAXIMUM_WAIT_OBJECTS 64
-#define ASSERT_APC(Object) \
- ASSERT((Object)->Type == ApcObject)
+#define ASSERT_APC(Object) NT_ASSERT((Object)->Type == ApcObject)
#define ASSERT_DPC(Object) \
ASSERT(((Object)->Type == 0) || \
@@ -537,25 +639,25 @@
((Object)->Type == ThreadedDpcObject))
#define ASSERT_GATE(object) \
- ASSERT((((object)->Header.Type & KOBJECT_TYPE_MASK) == GateObject) || \
- (((object)->Header.Type & KOBJECT_TYPE_MASK) ==
EventSynchronizationObject))
+ NT_ASSERT((((object)->Header.Type & KOBJECT_TYPE_MASK) == GateObject) || \
+ (((object)->Header.Type & KOBJECT_TYPE_MASK) ==
EventSynchronizationObject))
#define ASSERT_DEVICE_QUEUE(Object) \
- ASSERT((Object)->Type == DeviceQueueObject)
+ NT_ASSERT((Object)->Type == DeviceQueueObject)
#define ASSERT_TIMER(E) \
- ASSERT(((E)->Header.Type == TimerNotificationObject) || \
- ((E)->Header.Type == TimerSynchronizationObject))
+ NT_ASSERT(((E)->Header.Type == TimerNotificationObject) || \
+ ((E)->Header.Type == TimerSynchronizationObject))
#define ASSERT_MUTANT(E) \
- ASSERT((E)->Header.Type == MutantObject)
+ NT_ASSERT((E)->Header.Type == MutantObject)
#define ASSERT_SEMAPHORE(E) \
- ASSERT((E)->Header.Type == SemaphoreObject)
+ NT_ASSERT((E)->Header.Type == SemaphoreObject)
#define ASSERT_EVENT(E) \
- ASSERT(((E)->Header.Type == NotificationEvent) || \
- ((E)->Header.Type == SynchronizationEvent))
+ NT_ASSERT(((E)->Header.Type == NotificationEvent) || \
+ ((E)->Header.Type == SynchronizationEvent))
#define DPC_NORMAL 0
#define DPC_THREADED 1
@@ -591,7 +693,7 @@
#define MAXIMUM_PROCESSORS MAXIMUM_PROC_PER_GROUP
/* Exception Records */
-#define EXCEPTION_NONCONTINUABLE 1
+#define EXCEPTION_NONCONTINUABLE 1
#define EXCEPTION_MAXIMUM_PARAMETERS 15
typedef struct _EXCEPTION_RECORD {
@@ -792,8 +894,26 @@
#define THREAD_WAIT_OBJECTS 3
typedef VOID
+(NTAPI KSTART_ROUTINE)(
+ IN PVOID StartContext);
+typedef KSTART_ROUTINE *PKSTART_ROUTINE;
+
+typedef VOID
(NTAPI *PKINTERRUPT_ROUTINE)(
VOID);
+
+typedef BOOLEAN
+(NTAPI KSERVICE_ROUTINE)(
+ IN struct _KINTERRUPT *Interrupt,
+ IN PVOID ServiceContext);
+typedef KSERVICE_ROUTINE *PKSERVICE_ROUTINE;
+
+typedef BOOLEAN
+(NTAPI KMESSAGE_SERVICE_ROUTINE)(
+ IN struct _KINTERRUPT *Interrupt,
+ IN PVOID ServiceContext,
+ IN ULONG MessageID);
+typedef KMESSAGE_SERVICE_ROUTINE *PKMESSAGE_SERVICE_ROUTINE;
typedef enum _KD_OPTION {
KD_OPTION_SET_BLOCK_ENABLE,
@@ -801,9 +921,9 @@
typedef VOID
(NTAPI *PKNORMAL_ROUTINE)(
- IN PVOID NormalContext,
- IN PVOID SystemArgument1,
- IN PVOID SystemArgument2);
+ IN PVOID NormalContext OPTIONAL,
+ IN PVOID SystemArgument1 OPTIONAL,
+ IN PVOID SystemArgument2 OPTIONAL);
typedef VOID
(NTAPI *PKRUNDOWN_ROUTINE)(
@@ -812,10 +932,10 @@
typedef VOID
(NTAPI *PKKERNEL_ROUTINE)(
IN struct _KAPC *Apc,
- IN OUT PKNORMAL_ROUTINE *NormalRoutine,
- IN OUT PVOID *NormalContext,
- IN OUT PVOID *SystemArgument1,
- IN OUT PVOID *SystemArgument2);
+ IN OUT PKNORMAL_ROUTINE *NormalRoutine OPTIONAL,
+ IN OUT PVOID *NormalContext OPTIONAL,
+ IN OUT PVOID *SystemArgument1 OPTIONAL,
+ IN OUT PVOID *SystemArgument2 OPTIONAL);
typedef struct _KAPC {
UCHAR Type;
@@ -836,6 +956,14 @@
BOOLEAN Inserted;
} KAPC, *PKAPC, *RESTRICTED_POINTER PRKAPC;
+#define KAPC_OFFSET_TO_SPARE_BYTE0 FIELD_OFFSET(KAPC, SpareByte0)
+#define KAPC_OFFSET_TO_SPARE_BYTE1 FIELD_OFFSET(KAPC, SpareByte1)
+#define KAPC_OFFSET_TO_SPARE_LONG FIELD_OFFSET(KAPC, SpareLong0)
+#define KAPC_OFFSET_TO_SYSTEMARGUMENT1 FIELD_OFFSET(KAPC, SystemArgument1)
+#define KAPC_OFFSET_TO_SYSTEMARGUMENT2 FIELD_OFFSET(KAPC, SystemArgument2)
+#define KAPC_OFFSET_TO_APCSTATEINDEX FIELD_OFFSET(KAPC, ApcStateIndex)
+#define KAPC_ACTUAL_LENGTH (FIELD_OFFSET(KAPC, Inserted) + sizeof(BOOLEAN))
+
typedef struct _KDEVICE_QUEUE_ENTRY {
LIST_ENTRY DeviceListEntry;
ULONG SortKey;
@@ -847,10 +975,27 @@
typedef VOID
(NTAPI *PKIPI_WORKER)(
- IN PKIPI_CONTEXT PacketContext,
- IN PVOID Parameter1,
- IN PVOID Parameter2,
- IN PVOID Parameter3);
+ IN OUT PKIPI_CONTEXT PacketContext,
+ IN PVOID Parameter1 OPTIONAL,
+ IN PVOID Parameter2 OPTIONAL,
+ IN PVOID Parameter3 OPTIONAL);
+
+typedef struct _KIPI_COUNTS {
+ ULONG Freeze;
+ ULONG Packet;
+ ULONG DPC;
+ ULONG APC;
+ ULONG FlushSingleTb;
+ ULONG FlushMultipleTb;
+ ULONG FlushEntireTb;
+ ULONG GenericCall;
+ ULONG ChangeColor;
+ ULONG SweepDcache;
+ ULONG SweepIcache;
+ ULONG SweepIcacheRange;
+ ULONG FlushIoBuffers;
+ ULONG GratuitousDPC;
+} KIPI_COUNTS, *PKIPI_COUNTS;
typedef ULONG_PTR
(NTAPI *PKIPI_BROADCAST_WORKER)(
@@ -921,9 +1066,9 @@
typedef VOID
(NTAPI *PKDEFERRED_ROUTINE)(
IN struct _KDPC *Dpc,
- IN PVOID DeferredContext,
- IN PVOID SystemArgument1,
- IN PVOID SystemArgument2);
+ IN PVOID DeferredContext OPTIONAL,
+ IN PVOID SystemArgument1 OPTIONAL,
+ IN PVOID SystemArgument2 OPTIONAL);
typedef enum _KDPC_IMPORTANCE {
LowImportance,
@@ -941,7 +1086,7 @@
PVOID DeferredContext;
PVOID SystemArgument1;
PVOID SystemArgument2;
- volatile PVOID DpcData;
+ volatile PVOID DpcData;
} KDPC, *PKDPC, *RESTRICTED_POINTER PRKDPC;
typedef struct _KDPC_WATCHDOG_INFORMATION {
@@ -1053,6 +1198,8 @@
LONG Limit;
} KSEMAPHORE, *PKSEMAPHORE, *RESTRICTED_POINTER PRKSEMAPHORE;
+#define KSEMAPHORE_ACTUAL_LENGTH (FIELD_OFFSET(KSEMAPHORE, Limit) + sizeof(LONG))
+
typedef struct _KGATE {
DISPATCHER_HEADER Header;
} KGATE, *PKGATE, *RESTRICTED_POINTER PRKGATE;
@@ -1092,6 +1239,14 @@
#endif
ULONG Period;
} KTIMER, *PKTIMER, *RESTRICTED_POINTER PRKTIMER;
+
+typedef enum _LOCK_OPERATION {
+ IoReadAccess,
+ IoWriteAccess,
+ IoModifyAccess
+} LOCK_OPERATION;
+
+#define KTIMER_ACTUAL_LENGTH (FIELD_OFFSET(KTIMER, Period) + sizeof(LONG))
typedef BOOLEAN
(NTAPI *PKSYNCHRONIZE_ROUTINE)(
@@ -1120,6 +1275,26 @@
NEC98x86,
EndAlternatives
} ALTERNATIVE_ARCHITECTURE_TYPE;
+
+#ifndef _X86_
+
+#ifndef IsNEC_98
+#define IsNEC_98 (FALSE)
+#endif
+
+#ifndef IsNotNEC_98
+#define IsNotNEC_98 (TRUE)
+#endif
+
+#ifndef SetNEC_98
+#define SetNEC_98
+#endif
+
+#ifndef SetNotNEC_98
+#define SetNotNEC_98
+#endif
+
+#endif
typedef struct _KSYSTEM_TIME {
ULONG LowPart;
@@ -1353,12 +1528,6 @@
NormalPagePriority = 16,
HighPagePriority = 32
} MM_PAGE_PRIORITY;
-
-typedef enum _LOCK_OPERATION {
- IoReadAccess,
- IoWriteAccess,
- IoModifyAccess
-} LOCK_OPERATION;
typedef enum _MM_SYSTEM_SIZE {
MmSmallSystem,
@@ -1498,6 +1667,13 @@
typedef struct _GENERAL_LOOKASIDE_POOL {
GENERAL_LOOKASIDE_LAYOUT
} GENERAL_LOOKASIDE_POOL, *PGENERAL_LOOKASIDE_POOL;
+
+#define LOOKASIDE_CHECK(f) \
+ C_ASSERT(FIELD_OFFSET(GENERAL_LOOKASIDE,f) ==
FIELD_OFFSET(GENERAL_LOOKASIDE_POOL,f))
+
+LOOKASIDE_CHECK(TotalFrees);
+LOOKASIDE_CHECK(Tag);
+LOOKASIDE_CHECK(Future);
typedef struct _PAGED_LOOKASIDE_LIST {
GENERAL_LOOKASIDE L;
@@ -3450,10 +3626,6 @@
HANDLE UniqueThread;
} CLIENT_ID, *PCLIENT_ID;
-typedef VOID
-(NTAPI *PKSTART_ROUTINE)(
- IN PVOID StartContext);
-
typedef struct _VPB {
CSHORT Type;
CSHORT Size;
@@ -5321,12 +5493,6 @@
typedef NTSTATUS
(NTAPI *PMM_DLL_UNLOAD)(
VOID);
-
-typedef BOOLEAN
-(NTAPI KSERVICE_ROUTINE)(
- IN struct _KINTERRUPT *Interrupt,
- IN PVOID ServiceContext);
-typedef KSERVICE_ROUTINE *PKSERVICE_ROUTINE;
typedef VOID
(NTAPI *PIO_TIMER_ROUTINE)(
@@ -8653,6 +8819,22 @@
#define ALIGN_UP_POINTER(ptr, type) \
ALIGN_UP_POINTER_BY(ptr, sizeof(type))
+#ifndef FIELD_OFFSET
+#define FIELD_OFFSET(type, field) ((ULONG)&(((type *)0)->field))
+#endif
+
+#ifndef FIELD_SIZE
+#define FIELD_SIZE(type, field) (sizeof(((type *)0)->field))
+#endif
+
+#define POOL_TAGGING 1
+
+#if DBG
+#define IF_DEBUG if (TRUE)
+#else
+#define IF_DEBUG if (FALSE)
+#endif /* DBG */
+
/* ULONG
* BYTE_OFFSET(
* IN PVOID Va)
@@ -13396,14 +13578,6 @@
#define DIRECTORY_CREATE_SUBDIRECTORY (0x0008)
#define DIRECTORY_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0xF)
-#define EVENT_QUERY_STATE (0x0001)
-#define EVENT_MODIFY_STATE (0x0002)
-#define EVENT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x3)
-
-#define SEMAPHORE_QUERY_STATE (0x0001)
-#define SEMAPHORE_MODIFY_STATE (0x0002)
-#define SEMAPHORE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x3)
-
#define SYMBOLIC_LINK_QUERY 0x0001
#define SYMBOLIC_LINK_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0x1)
@@ -13412,7 +13586,12 @@
#define DUPLICATE_SAME_ATTRIBUTES 0x00000004
/* Global debug flag */
+#if DEVL
extern ULONG NtGlobalFlag;
+#define IF_NTOS_DEBUG(FlagName) if (NtGlobalFlag & (FLG_ ## FlagName))
+#else
+#define IF_NTOS_DEBUG(FlagName) if(FALSE)
+#endif
#ifndef _TRACEHANDLE_DEFINED
#define _TRACEHANDLE_DEFINED
Modified: branches/header-work/include/xdk/extypes.h
URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/xdk/extypes…
==============================================================================
--- branches/header-work/include/xdk/extypes.h [iso-8859-1] (original)
+++ branches/header-work/include/xdk/extypes.h [iso-8859-1] Sat Mar 20 12:47:30 2010
@@ -131,6 +131,13 @@
GENERAL_LOOKASIDE_LAYOUT
} GENERAL_LOOKASIDE_POOL, *PGENERAL_LOOKASIDE_POOL;
+#define LOOKASIDE_CHECK(f) \
+ C_ASSERT(FIELD_OFFSET(GENERAL_LOOKASIDE,f) ==
FIELD_OFFSET(GENERAL_LOOKASIDE_POOL,f))
+
+LOOKASIDE_CHECK(TotalFrees);
+LOOKASIDE_CHECK(Tag);
+LOOKASIDE_CHECK(Future);
+
typedef struct _PAGED_LOOKASIDE_LIST {
GENERAL_LOOKASIDE L;
#if !defined(_AMD64_) && !defined(_IA64_)
Modified: branches/header-work/include/xdk/iotypes.h
URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/xdk/iotypes…
==============================================================================
--- branches/header-work/include/xdk/iotypes.h [iso-8859-1] (original)
+++ branches/header-work/include/xdk/iotypes.h [iso-8859-1] Sat Mar 20 12:47:30 2010
@@ -324,10 +324,6 @@
HANDLE UniqueProcess;
HANDLE UniqueThread;
} CLIENT_ID, *PCLIENT_ID;
-
-typedef VOID
-(NTAPI *PKSTART_ROUTINE)(
- IN PVOID StartContext);
typedef struct _VPB {
CSHORT Type;
@@ -2197,12 +2193,6 @@
(NTAPI *PMM_DLL_UNLOAD)(
VOID);
-typedef BOOLEAN
-(NTAPI KSERVICE_ROUTINE)(
- IN struct _KINTERRUPT *Interrupt,
- IN PVOID ServiceContext);
-typedef KSERVICE_ROUTINE *PKSERVICE_ROUTINE;
-
typedef VOID
(NTAPI *PIO_TIMER_ROUTINE)(
IN struct _DEVICE_OBJECT *DeviceObject,
Modified: branches/header-work/include/xdk/ketypes.h
URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/xdk/ketypes…
==============================================================================
--- branches/header-work/include/xdk/ketypes.h [iso-8859-1] (original)
+++ branches/header-work/include/xdk/ketypes.h [iso-8859-1] Sat Mar 20 12:47:30 2010
@@ -11,6 +11,109 @@
UserMode,
MaximumMode
} MODE;
+
+#define CACHE_FULLY_ASSOCIATIVE 0xFF
+
+#define EVENT_QUERY_STATE (0x0001)
+#define EVENT_MODIFY_STATE (0x0002)
+#define EVENT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x3)
+
+#define LTP_PC_SMT 0x1
+
+#if (NTDDI_VERSION < NTDDI_WIN7) || defined(_X86_) || !defined(NT_PROCESSOR_GROUPS)
+#define SINGLE_GROUP_LEGACY_API 1
+#endif
+
+#define SEMAPHORE_QUERY_STATE (0x0001)
+#define SEMAPHORE_MODIFY_STATE (0x0002)
+#define SEMAPHORE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x3)
+
+typedef enum _LOGICAL_PROCESSOR_RELATIONSHIP {
+ RelationProcessorCore,
+ RelationNumaNode,
+ RelationCache,
+ RelationProcessorPackage,
+ RelationGroup,
+ RelationAll = 0xffff
+} LOGICAL_PROCESSOR_RELATIONSHIP;
+
+typedef enum _PROCESSOR_CACHE_TYPE {
+ CacheUnified,
+ CacheInstruction,
+ CacheData,
+ CacheTrace
+} PROCESSOR_CACHE_TYPE;
+
+typedef struct _CACHE_DESCRIPTOR {
+ UCHAR Level;
+ UCHAR Associativity;
+ USHORT LineSize;
+ ULONG Size;
+ PROCESSOR_CACHE_TYPE Type;
+} CACHE_DESCRIPTOR, *PCACHE_DESCRIPTOR;
+
+typedef struct _SYSTEM_LOGICAL_PROCESSOR_INFORMATION {
+ ULONG_PTR ProcessorMask;
+ LOGICAL_PROCESSOR_RELATIONSHIP Relationship;
+ union {
+ struct {
+ UCHAR Flags;
+ } ProcessorCore;
+ struct {
+ ULONG NodeNumber;
+ } NumaNode;
+ CACHE_DESCRIPTOR Cache;
+ ULONGLONG Reserved[2];
+ } DUMMYUNIONNAME;
+} SYSTEM_LOGICAL_PROCESSOR_INFORMATION, *PSYSTEM_LOGICAL_PROCESSOR_INFORMATION;
+
+typedef struct _PROCESSOR_RELATIONSHIP {
+ UCHAR Flags;
+ UCHAR Reserved[21];
+ USHORT GroupCount;
+ GROUP_AFFINITY GroupMask[ANYSIZE_ARRAY];
+} PROCESSOR_RELATIONSHIP, *PPROCESSOR_RELATIONSHIP;
+
+typedef struct _NUMA_NODE_RELATIONSHIP {
+ ULONG NodeNumber;
+ UCHAR Reserved[20];
+ GROUP_AFFINITY GroupMask;
+} NUMA_NODE_RELATIONSHIP, *PNUMA_NODE_RELATIONSHIP;
+
+typedef struct _CACHE_RELATIONSHIP {
+ UCHAR Level;
+ UCHAR Associativity;
+ USHORT LineSize;
+ ULONG CacheSize;
+ PROCESSOR_CACHE_TYPE Type;
+ UCHAR Reserved[20];
+ GROUP_AFFINITY GroupMask;
+} CACHE_RELATIONSHIP, *PCACHE_RELATIONSHIP;
+
+typedef struct _PROCESSOR_GROUP_INFO {
+ UCHAR MaximumProcessorCount;
+ UCHAR ActiveProcessorCount;
+ UCHAR Reserved[38];
+ KAFFINITY ActiveProcessorMask;
+} PROCESSOR_GROUP_INFO, *PPROCESSOR_GROUP_INFO;
+
+typedef struct _GROUP_RELATIONSHIP {
+ USHORT MaximumGroupCount;
+ USHORT ActiveGroupCount;
+ UCHAR Reserved[20];
+ PROCESSOR_GROUP_INFO GroupInfo[ANYSIZE_ARRAY];
+} GROUP_RELATIONSHIP, *PGROUP_RELATIONSHIP;
+
+typedef struct _SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX {
+ LOGICAL_PROCESSOR_RELATIONSHIP Relationship;
+ ULONG Size;
+ union {
+ PROCESSOR_RELATIONSHIP Processor;
+ NUMA_NODE_RELATIONSHIP NumaNode;
+ CACHE_RELATIONSHIP Cache;
+ GROUP_RELATIONSHIP Group;
+ } DUMMYUNIONNAME;
+} SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX, *PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX;;
/* Processor features */
#define PF_FLOATING_POINT_PRECISION_ERRATA 0
@@ -34,8 +137,7 @@
#define MAXIMUM_WAIT_OBJECTS 64
-#define ASSERT_APC(Object) \
- ASSERT((Object)->Type == ApcObject)
+#define ASSERT_APC(Object) NT_ASSERT((Object)->Type == ApcObject)
#define ASSERT_DPC(Object) \
ASSERT(((Object)->Type == 0) || \
@@ -43,25 +145,25 @@
((Object)->Type == ThreadedDpcObject))
#define ASSERT_GATE(object) \
- ASSERT((((object)->Header.Type & KOBJECT_TYPE_MASK) == GateObject) || \
- (((object)->Header.Type & KOBJECT_TYPE_MASK) ==
EventSynchronizationObject))
+ NT_ASSERT((((object)->Header.Type & KOBJECT_TYPE_MASK) == GateObject) || \
+ (((object)->Header.Type & KOBJECT_TYPE_MASK) ==
EventSynchronizationObject))
#define ASSERT_DEVICE_QUEUE(Object) \
- ASSERT((Object)->Type == DeviceQueueObject)
+ NT_ASSERT((Object)->Type == DeviceQueueObject)
#define ASSERT_TIMER(E) \
- ASSERT(((E)->Header.Type == TimerNotificationObject) || \
- ((E)->Header.Type == TimerSynchronizationObject))
+ NT_ASSERT(((E)->Header.Type == TimerNotificationObject) || \
+ ((E)->Header.Type == TimerSynchronizationObject))
#define ASSERT_MUTANT(E) \
- ASSERT((E)->Header.Type == MutantObject)
+ NT_ASSERT((E)->Header.Type == MutantObject)
#define ASSERT_SEMAPHORE(E) \
- ASSERT((E)->Header.Type == SemaphoreObject)
+ NT_ASSERT((E)->Header.Type == SemaphoreObject)
#define ASSERT_EVENT(E) \
- ASSERT(((E)->Header.Type == NotificationEvent) || \
- ((E)->Header.Type == SynchronizationEvent))
+ NT_ASSERT(((E)->Header.Type == NotificationEvent) || \
+ ((E)->Header.Type == SynchronizationEvent))
#define DPC_NORMAL 0
#define DPC_THREADED 1
@@ -97,7 +199,7 @@
#define MAXIMUM_PROCESSORS MAXIMUM_PROC_PER_GROUP
/* Exception Records */
-#define EXCEPTION_NONCONTINUABLE 1
+#define EXCEPTION_NONCONTINUABLE 1
#define EXCEPTION_MAXIMUM_PARAMETERS 15
typedef struct _EXCEPTION_RECORD {
@@ -298,8 +400,26 @@
#define THREAD_WAIT_OBJECTS 3
typedef VOID
+(NTAPI KSTART_ROUTINE)(
+ IN PVOID StartContext);
+typedef KSTART_ROUTINE *PKSTART_ROUTINE;
+
+typedef VOID
(NTAPI *PKINTERRUPT_ROUTINE)(
VOID);
+
+typedef BOOLEAN
+(NTAPI KSERVICE_ROUTINE)(
+ IN struct _KINTERRUPT *Interrupt,
+ IN PVOID ServiceContext);
+typedef KSERVICE_ROUTINE *PKSERVICE_ROUTINE;
+
+typedef BOOLEAN
+(NTAPI KMESSAGE_SERVICE_ROUTINE)(
+ IN struct _KINTERRUPT *Interrupt,
+ IN PVOID ServiceContext,
+ IN ULONG MessageID);
+typedef KMESSAGE_SERVICE_ROUTINE *PKMESSAGE_SERVICE_ROUTINE;
typedef enum _KD_OPTION {
KD_OPTION_SET_BLOCK_ENABLE,
@@ -307,9 +427,9 @@
typedef VOID
(NTAPI *PKNORMAL_ROUTINE)(
- IN PVOID NormalContext,
- IN PVOID SystemArgument1,
- IN PVOID SystemArgument2);
+ IN PVOID NormalContext OPTIONAL,
+ IN PVOID SystemArgument1 OPTIONAL,
+ IN PVOID SystemArgument2 OPTIONAL);
typedef VOID
(NTAPI *PKRUNDOWN_ROUTINE)(
@@ -318,10 +438,10 @@
typedef VOID
(NTAPI *PKKERNEL_ROUTINE)(
IN struct _KAPC *Apc,
- IN OUT PKNORMAL_ROUTINE *NormalRoutine,
- IN OUT PVOID *NormalContext,
- IN OUT PVOID *SystemArgument1,
- IN OUT PVOID *SystemArgument2);
+ IN OUT PKNORMAL_ROUTINE *NormalRoutine OPTIONAL,
+ IN OUT PVOID *NormalContext OPTIONAL,
+ IN OUT PVOID *SystemArgument1 OPTIONAL,
+ IN OUT PVOID *SystemArgument2 OPTIONAL);
typedef struct _KAPC {
UCHAR Type;
@@ -342,6 +462,14 @@
BOOLEAN Inserted;
} KAPC, *PKAPC, *RESTRICTED_POINTER PRKAPC;
+#define KAPC_OFFSET_TO_SPARE_BYTE0 FIELD_OFFSET(KAPC, SpareByte0)
+#define KAPC_OFFSET_TO_SPARE_BYTE1 FIELD_OFFSET(KAPC, SpareByte1)
+#define KAPC_OFFSET_TO_SPARE_LONG FIELD_OFFSET(KAPC, SpareLong0)
+#define KAPC_OFFSET_TO_SYSTEMARGUMENT1 FIELD_OFFSET(KAPC, SystemArgument1)
+#define KAPC_OFFSET_TO_SYSTEMARGUMENT2 FIELD_OFFSET(KAPC, SystemArgument2)
+#define KAPC_OFFSET_TO_APCSTATEINDEX FIELD_OFFSET(KAPC, ApcStateIndex)
+#define KAPC_ACTUAL_LENGTH (FIELD_OFFSET(KAPC, Inserted) + sizeof(BOOLEAN))
+
typedef struct _KDEVICE_QUEUE_ENTRY {
LIST_ENTRY DeviceListEntry;
ULONG SortKey;
@@ -353,10 +481,27 @@
typedef VOID
(NTAPI *PKIPI_WORKER)(
- IN PKIPI_CONTEXT PacketContext,
- IN PVOID Parameter1,
- IN PVOID Parameter2,
- IN PVOID Parameter3);
+ IN OUT PKIPI_CONTEXT PacketContext,
+ IN PVOID Parameter1 OPTIONAL,
+ IN PVOID Parameter2 OPTIONAL,
+ IN PVOID Parameter3 OPTIONAL);
+
+typedef struct _KIPI_COUNTS {
+ ULONG Freeze;
+ ULONG Packet;
+ ULONG DPC;
+ ULONG APC;
+ ULONG FlushSingleTb;
+ ULONG FlushMultipleTb;
+ ULONG FlushEntireTb;
+ ULONG GenericCall;
+ ULONG ChangeColor;
+ ULONG SweepDcache;
+ ULONG SweepIcache;
+ ULONG SweepIcacheRange;
+ ULONG FlushIoBuffers;
+ ULONG GratuitousDPC;
+} KIPI_COUNTS, *PKIPI_COUNTS;
typedef ULONG_PTR
(NTAPI *PKIPI_BROADCAST_WORKER)(
@@ -427,9 +572,9 @@
typedef VOID
(NTAPI *PKDEFERRED_ROUTINE)(
IN struct _KDPC *Dpc,
- IN PVOID DeferredContext,
- IN PVOID SystemArgument1,
- IN PVOID SystemArgument2);
+ IN PVOID DeferredContext OPTIONAL,
+ IN PVOID SystemArgument1 OPTIONAL,
+ IN PVOID SystemArgument2 OPTIONAL);
typedef enum _KDPC_IMPORTANCE {
LowImportance,
@@ -447,7 +592,7 @@
PVOID DeferredContext;
PVOID SystemArgument1;
PVOID SystemArgument2;
- volatile PVOID DpcData;
+ volatile PVOID DpcData;
} KDPC, *PKDPC, *RESTRICTED_POINTER PRKDPC;
typedef struct _KDPC_WATCHDOG_INFORMATION {
@@ -559,6 +704,8 @@
LONG Limit;
} KSEMAPHORE, *PKSEMAPHORE, *RESTRICTED_POINTER PRKSEMAPHORE;
+#define KSEMAPHORE_ACTUAL_LENGTH (FIELD_OFFSET(KSEMAPHORE, Limit) + sizeof(LONG))
+
typedef struct _KGATE {
DISPATCHER_HEADER Header;
} KGATE, *PKGATE, *RESTRICTED_POINTER PRKGATE;
@@ -598,6 +745,14 @@
#endif
ULONG Period;
} KTIMER, *PKTIMER, *RESTRICTED_POINTER PRKTIMER;
+
+typedef enum _LOCK_OPERATION {
+ IoReadAccess,
+ IoWriteAccess,
+ IoModifyAccess
+} LOCK_OPERATION;
+
+#define KTIMER_ACTUAL_LENGTH (FIELD_OFFSET(KTIMER, Period) + sizeof(LONG))
typedef BOOLEAN
(NTAPI *PKSYNCHRONIZE_ROUTINE)(
@@ -626,6 +781,26 @@
NEC98x86,
EndAlternatives
} ALTERNATIVE_ARCHITECTURE_TYPE;
+
+#ifndef _X86_
+
+#ifndef IsNEC_98
+#define IsNEC_98 (FALSE)
+#endif
+
+#ifndef IsNotNEC_98
+#define IsNotNEC_98 (TRUE)
+#endif
+
+#ifndef SetNEC_98
+#define SetNEC_98
+#endif
+
+#ifndef SetNotNEC_98
+#define SetNotNEC_98
+#endif
+
+#endif
typedef struct _KSYSTEM_TIME {
ULONG LowPart;
Modified: branches/header-work/include/xdk/mmfuncs.h
URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/xdk/mmfuncs…
==============================================================================
--- branches/header-work/include/xdk/mmfuncs.h [iso-8859-1] (original)
+++ branches/header-work/include/xdk/mmfuncs.h [iso-8859-1] Sat Mar 20 12:47:30 2010
@@ -26,6 +26,22 @@
#define ALIGN_UP_POINTER(ptr, type) \
ALIGN_UP_POINTER_BY(ptr, sizeof(type))
+
+#ifndef FIELD_OFFSET
+#define FIELD_OFFSET(type, field) ((ULONG)&(((type *)0)->field))
+#endif
+
+#ifndef FIELD_SIZE
+#define FIELD_SIZE(type, field) (sizeof(((type *)0)->field))
+#endif
+
+#define POOL_TAGGING 1
+
+#if DBG
+#define IF_DEBUG if (TRUE)
+#else
+#define IF_DEBUG if (FALSE)
+#endif /* DBG */
/* ULONG
* BYTE_OFFSET(
Modified: branches/header-work/include/xdk/mmtypes.h
URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/xdk/mmtypes…
==============================================================================
--- branches/header-work/include/xdk/mmtypes.h [iso-8859-1] (original)
+++ branches/header-work/include/xdk/mmtypes.h [iso-8859-1] Sat Mar 20 12:47:30 2010
@@ -130,12 +130,6 @@
HighPagePriority = 32
} MM_PAGE_PRIORITY;
-typedef enum _LOCK_OPERATION {
- IoReadAccess,
- IoWriteAccess,
- IoModifyAccess
-} LOCK_OPERATION;
-
typedef enum _MM_SYSTEM_SIZE {
MmSmallSystem,
MmMediumSystem,
Modified: branches/header-work/include/xdk/wdm.template.h
URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/xdk/wdm.tem…
==============================================================================
--- branches/header-work/include/xdk/wdm.template.h [iso-8859-1] (original)
+++ branches/header-work/include/xdk/wdm.template.h [iso-8859-1] Sat Mar 20 12:47:30 2010
@@ -237,14 +237,6 @@
#define DIRECTORY_CREATE_SUBDIRECTORY (0x0008)
#define DIRECTORY_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0xF)
-#define EVENT_QUERY_STATE (0x0001)
-#define EVENT_MODIFY_STATE (0x0002)
-#define EVENT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x3)
-
-#define SEMAPHORE_QUERY_STATE (0x0001)
-#define SEMAPHORE_MODIFY_STATE (0x0002)
-#define SEMAPHORE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x3)
-
#define SYMBOLIC_LINK_QUERY 0x0001
#define SYMBOLIC_LINK_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0x1)
@@ -253,7 +245,12 @@
#define DUPLICATE_SAME_ATTRIBUTES 0x00000004
/* Global debug flag */
+#if DEVL
extern ULONG NtGlobalFlag;
+#define IF_NTOS_DEBUG(FlagName) if (NtGlobalFlag & (FLG_ ## FlagName))
+#else
+#define IF_NTOS_DEBUG(FlagName) if(FALSE)
+#endif
#ifndef _TRACEHANDLE_DEFINED
#define _TRACEHANDLE_DEFINED