ReactOS  r75214
extypes.h
Go to the documentation of this file.
2 /******************************************************************************
3  * Executive Types *
4  ******************************************************************************/
7 #define EX_RUNDOWN_ACTIVE 0x1
8 #define EX_RUNDOWN_COUNT_SHIFT 0x1
9 #define EX_RUNDOWN_COUNT_INC (1 << EX_RUNDOWN_COUNT_SHIFT)
10 
11 typedef struct _FAST_MUTEX {
12  volatile LONG Count;
14  ULONG Contention;
15  KEVENT Event;
16  ULONG OldIrql;
18 
19 typedef enum _SUITE_TYPE {
37 } SUITE_TYPE;
38 
39 typedef enum _EX_POOL_PRIORITY {
50 
51 #if !defined(_WIN64) && (defined(_NTDDK_) || defined(_NTIFS_) || defined(_NDIS_))
52 #define LOOKASIDE_ALIGN
53 #else
54 #define LOOKASIDE_ALIGN DECLSPEC_CACHEALIGN
55 #endif
56 
58 
60 _Function_class_(ALLOCATE_FUNCTION)
61 typedef PVOID
62 (NTAPI *PALLOCATE_FUNCTION)(
65  _In_ ULONG Tag);
66 
68 _Function_class_(ALLOCATE_FUNCTION_EX)
69 typedef PVOID
70 (NTAPI *PALLOCATE_FUNCTION_EX)(
71  _In_ POOL_TYPE PoolType,
72  _In_ SIZE_T NumberOfBytes,
73  _In_ ULONG Tag,
74  _Inout_ PLOOKASIDE_LIST_EX Lookaside);
75 
77 _Function_class_(FREE_FUNCTION)
78 typedef VOID
79 (NTAPI *PFREE_FUNCTION)(
80  _In_ PVOID Buffer);
81 
83 _Function_class_(FREE_FUNCTION_EX)
84 typedef VOID
85 (NTAPI *PFREE_FUNCTION_EX)(
86  _In_ PVOID Buffer,
87  _Inout_ PLOOKASIDE_LIST_EX Lookaside);
88 
91 typedef VOID
97 
98 #define GENERAL_LOOKASIDE_LAYOUT \
99  _ANONYMOUS_UNION union { \
100  SLIST_HEADER ListHead; \
101  SINGLE_LIST_ENTRY SingleListHead; \
102  } DUMMYUNIONNAME; \
103  USHORT Depth; \
104  USHORT MaximumDepth; \
105  ULONG TotalAllocates; \
106  _ANONYMOUS_UNION union { \
107  ULONG AllocateMisses; \
108  ULONG AllocateHits; \
109  } DUMMYUNIONNAME2; \
110  ULONG TotalFrees; \
111  _ANONYMOUS_UNION union { \
112  ULONG FreeMisses; \
113  ULONG FreeHits; \
114  } DUMMYUNIONNAME3; \
115  POOL_TYPE Type; \
116  ULONG Tag; \
117  ULONG Size; \
118  _ANONYMOUS_UNION union { \
119  PALLOCATE_FUNCTION_EX AllocateEx; \
120  PALLOCATE_FUNCTION Allocate; \
121  } DUMMYUNIONNAME4; \
122  _ANONYMOUS_UNION union { \
123  PFREE_FUNCTION_EX FreeEx; \
124  PFREE_FUNCTION Free; \
125  } DUMMYUNIONNAME5; \
126  LIST_ENTRY ListEntry; \
127  ULONG LastTotalAllocates; \
128  _ANONYMOUS_UNION union { \
129  ULONG LastAllocateMisses; \
130  ULONG LastAllocateHits; \
131  } DUMMYUNIONNAME6; \
132  ULONG Future[2];
133 
137 
138 typedef struct _GENERAL_LOOKASIDE_POOL {
141 
142 #define LOOKASIDE_CHECK(f) \
143  C_ASSERT(FIELD_OFFSET(GENERAL_LOOKASIDE,f) == FIELD_OFFSET(GENERAL_LOOKASIDE_POOL,f))
144 
146 LOOKASIDE_CHECK(Tag);
147 LOOKASIDE_CHECK(Future);
148 
151 #if !defined(_AMD64_) && !defined(_IA64_)
153 #endif
155 
158 #if !defined(_AMD64_) && !defined(_IA64_)
160 #endif
162 
163 #define LOOKASIDE_MINIMUM_BLOCK_SIZE (RTL_SIZEOF_THROUGH_FIELD (SLIST_ENTRY, Next))
164 
165 typedef struct _LOOKASIDE_LIST_EX {
168 
169 #if (NTDDI_VERSION >= NTDDI_VISTA)
170 
171 #define EX_LOOKASIDE_LIST_EX_FLAGS_RAISE_ON_FAIL 0x00000001UL
172 #define EX_LOOKASIDE_LIST_EX_FLAGS_FAIL_NO_RAISE 0x00000002UL
173 
174 #define EX_MAXIMUM_LOOKASIDE_DEPTH_BASE 256
175 #define EX_MAXIMUM_LOOKASIDE_DEPTH_LIMIT 1024
176 
177 #endif /* (NTDDI_VERSION >= NTDDI_VISTA) */
178 
179 typedef struct _EX_RUNDOWN_REF {
180  _ANONYMOUS_UNION union {
181  volatile ULONG_PTR Count;
182  volatile PVOID Ptr;
183  } DUMMYUNIONNAME;
185 
187 
188 typedef enum _WORK_QUEUE_TYPE {
194 
196 _Function_class_(WORKER_THREAD_ROUTINE)
197 typedef VOID
198 (NTAPI WORKER_THREAD_ROUTINE)(
200 typedef WORKER_THREAD_ROUTINE *PWORKER_THREAD_ROUTINE;
201 
204  PWORKER_THREAD_ROUTINE WorkerRoutine;
205  volatile PVOID Parameter;
207 
209 
210 typedef struct _OWNER_ENTRY {
211  ERESOURCE_THREAD OwnerThread;
212  _ANONYMOUS_UNION union {
213  _ANONYMOUS_STRUCT struct {
217  } DUMMYSTRUCTNAME;
219  } DUMMYUNIONNAME;
221 
222 typedef struct _ERESOURCE {
224  POWNER_ENTRY OwnerTable;
234 #if defined(_WIN64)
236 #endif
237  _ANONYMOUS_UNION union {
240  } DUMMYUNIONNAME;
243 
244 /* ERESOURCE.Flag */
245 #define ResourceNeverExclusive 0x0010
246 #define ResourceReleaseByOtherThread 0x0020
247 #define ResourceOwnedExclusive 0x0080
248 
249 #define RESOURCE_HASH_TABLE_SIZE 64
250 
251 typedef struct _RESOURCE_HASH_ENTRY {
257 
271 
272 /* Global debug flag */
273 #if DEVL
275 #define IF_NTOS_DEBUG(FlagName) if (NtGlobalFlag & (FLG_##FlagName))
276 #else
277 #define IF_NTOS_DEBUG(FlagName) if(FALSE)
278 #endif
279 
281 $if (_NTDDK_)
282 typedef struct _ZONE_SEGMENT_HEADER {
283  SINGLE_LIST_ENTRY SegmentList;
284  PVOID Reserved;
286 
287 typedef struct _ZONE_HEADER {
293 
294 #define PROTECTED_POOL 0x80000000
295 
296 $endif (_NTDDK_)
297 $if (_NTIFS_)
298 #define INVALID_PROCESSOR_INDEX 0xffffffff
299 
300 #define EX_PUSH_LOCK ULONG_PTR
301 #define PEX_PUSH_LOCK PULONG_PTR
302 $endif (_NTIFS_)
DWORD *typedef PVOID
Definition: winlogon.h:52
KSPIN_LOCK SpinLock
Definition: extypes.h:241
ZONE_SEGMENT_HEADER
Definition: extypes.h:285
Definition: extypes.h:210
#define _IRQL_requires_same_
Definition: no_sal2.h:652
struct _RESOURCE_PERFORMANCE_DATA RESOURCE_PERFORMANCE_DATA
ULONG_PTR ERESOURCE_THREAD
Definition: extypes.h:208
ULONG_PTR CreatorBackTraceIndex
Definition: extypes.h:239
Definition: extypes.h:30
_IRQL_requires_same_ _Function_class_(ALLOCATE_FUNCTION) typedef PVOID(NTAPI *PALLOCATE_FUNCTION)(_In_ POOL_TYPE PoolType
struct LOOKASIDE_ALIGN _NPAGED_LOOKASIDE_LIST NPAGED_LOOKASIDE_LIST
LIST_ENTRY List
Definition: extypes.h:203
_IRQL_requires_same_ typedef _In_ ULONG _In_ UCHAR _In_ ULONGLONG _In_ ULONGLONG _In_opt_ PEVENT_FILTER_DESCRIPTOR _Inout_opt_ PVOID CallbackContext
Definition: wmitypes.h:55
struct _ERESOURCE ERESOURCE
ULONG ContentionCount
Definition: extypes.h:231
volatile ULONG_PTR Count
Definition: extypes.h:181
volatile PVOID Ptr
Definition: extypes.h:182
Definition: ntbasedef.h:627
volatile PKEVENT ExclusiveWaiters
Definition: extypes.h:228
POWNER_ENTRY OwnerTable
Definition: extypes.h:224
struct _EX_RUNDOWN_REF_CACHE_AWARE * PEX_RUNDOWN_REF_CACHE_AWARE
Definition: extypes.h:186
#define _ANONYMOUS_UNION
Definition: ntbasedef.h:30
LIST_ENTRY HashTable[RESOURCE_HASH_TABLE_SIZE]
Definition: extypes.h:269
struct _EX_RUNDOWN_REF EX_RUNDOWN_REF
_ANONYMOUS_STRUCT struct _OWNER_ENTRY::@3353::@3354 DUMMYSTRUCTNAME
#define _NTIFS_
Definition: ifssupp.h:20
SINGLE_LIST_ENTRY FreeList
Definition: extypes.h:288
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
_WORK_QUEUE_TYPE
Definition: extypes.h:188
#define _WDMDDK_
Definition: wdm.template.h:26
struct _ERESOURCE * PERESOURCE
LIST_ENTRY ListEntry
Definition: extypes.h:252
USHORT Flag
Definition: extypes.h:226
_In_ PVOID Parameter
Definition: ldrtypes.h:239
_IRQL_requires_same_ _In_ SIZE_T _In_ ULONG _Inout_ PLOOKASIDE_LIST_EX Lookaside
Definition: extypes.h:72
volatile PVOID Parameter
Definition: extypes.h:205
#define _In_opt_
Definition: no_sal2.h:213
struct _GENERAL_LOOKASIDE_POOL GENERAL_LOOKASIDE_POOL
struct LOOKASIDE_ALIGN _NPAGED_LOOKASIDE_LIST * PNPAGED_LOOKASIDE_LIST
_EX_POOL_PRIORITY
Definition: extypes.h:39
ULONG BlockSize
Definition: extypes.h:290
uint32_t ULONG_PTR
Definition: typedefs.h:64
struct LOOKASIDE_ALIGN _GENERAL_LOOKASIDE GENERAL_LOOKASIDE
ACPI_EFI_EVENT Event
Definition: acefiex.h:607
KSPIN_LOCK Lock__ObsoleteButDoNotDelete
Definition: extypes.h:159
ULONG TotalSegmentSize
Definition: extypes.h:291
SHORT ActiveCount
Definition: extypes.h:225
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
struct _OWNER_ENTRY OWNER_ENTRY
_IRQL_requires_same_ _In_opt_ PVOID Argument1
Definition: extypes.h:94
long LONG
Definition: pedump.c:60
struct LOOKASIDE_ALIGN _GENERAL_LOOKASIDE * PGENERAL_LOOKASIDE
short SHORT
Definition: pedump.c:59
#define CALLBACK_FUNCTION
Definition: mmsystem.h:150
enum _EX_POOL_PRIORITY EX_POOL_PRIORITY
struct _LOOKASIDE_LIST_EX * PLOOKASIDE_LIST_EX
Definition: extypes.h:57
LIST_ENTRY SystemResourcesList
Definition: extypes.h:223
struct _ZONE_HEADER * PZONE_HEADER
#define RESOURCE_HASH_TABLE_SIZE
Definition: extypes.h:249
ULONG IoPriorityBoosted
Definition: extypes.h:214
#define NTKERNELAPI
Definition: bufpool.h:45
Definition: bcd.h:200
struct _OWNER_ENTRY * POWNER_ENTRY
FAST_MUTEX
Definition: extypes.h:17
ULONG TableSize
Definition: extypes.h:218
_ANONYMOUS_UNION union _EX_RUNDOWN_REF::@3352 DUMMYUNIONNAME
ULONG OwnerCount
Definition: extypes.h:216
INT POOL_TYPE
Definition: typedefs.h:77
struct _LOOKASIDE_LIST_EX LOOKASIDE_LIST_EX
PVOID Address
Definition: extypes.h:238
ULONG NumberOfExclusiveWaiters
Definition: extypes.h:233
_SUITE_TYPE
Definition: extypes.h:19
Definition: extypes.h:251
_ANONYMOUS_UNION union _ERESOURCE::@3355 DUMMYUNIONNAME
ULONG Number
Definition: extypes.h:255
#define _Inout_
Definition: no_sal2.h:244
#define LOOKASIDE_CHECK(f)
Definition: extypes.h:142
#define LOOKASIDE_ALIGN
Definition: extypes.h:54
$if(_WDMDDK_||_NTDDK_)$endif(_WDMDDK_||_NTDDK_) $if(_WDMDDK_) typedef struct _FAST_MUTEX
Definition: extypes.h:1
enum _WORK_QUEUE_TYPE WORK_QUEUE_TYPE
struct _WORK_QUEUE_ITEM WORK_QUEUE_ITEM
IN REFCLSID IN PUNKNOWN IN POOL_TYPE PoolType
Definition: unknown.h:68
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:803
IN SIZE_T NumberOfBytes
Definition: ndis.h:3914
PWORKER_THREAD_ROUTINE WorkerRoutine
Definition: extypes.h:204
Definition: typedefs.h:118
LONG TotalFrees
Definition: memory.c:15
struct _GENERAL_LOOKASIDE_POOL * PGENERAL_LOOKASIDE_POOL
ULONG PVOID Reserved
Definition: ntimage.h:533
struct _ZONE_HEADER ZONE_HEADER
#define _ANONYMOUS_STRUCT
Definition: ntbasedef.h:56
_ANONYMOUS_UNION union _OWNER_ENTRY::@3353 DUMMYUNIONNAME
$endif(_WDMDDK_) $if(_NTDDK_) typedef struct _ZONE_SEGMENT_HEADER
Definition: extypes.h:280
#define _In_
Definition: no_sal2.h:204
_IRQL_requires_same_ _In_opt_ PVOID _In_opt_ PVOID Argument2
Definition: extypes.h:94
ULONG_PTR SIZE_T
Definition: typedefs.h:79
SINGLE_LIST_ENTRY SegmentList
Definition: extypes.h:289
* PFAST_MUTEX
Definition: extypes.h:17
struct LOOKASIDE_ALIGN _PAGED_LOOKASIDE_LIST PAGED_LOOKASIDE_LIST
unsigned short USHORT
Definition: pedump.c:61
struct _RESOURCE_PERFORMANCE_DATA * PRESOURCE_PERFORMANCE_DATA
CALLBACK_FUNCTION * PCALLBACK_FUNCTION
Definition: extypes.h:96
ULONG_PTR * PERESOURCE_THREAD
Definition: extypes.h:208
ULONG OwnerReferenced
Definition: extypes.h:215
PVOID Address
Definition: extypes.h:253
ULONG KSPIN_LOCK
Definition: env_spec_w32.h:72
OWNER_ENTRY OwnerEntry
Definition: extypes.h:229
_Out_writes_bytes_to_opt_ AbsoluteSecurityDescriptorSize PSECURITY_DESCRIPTOR _Inout_ PULONG _Out_writes_bytes_to_opt_ DaclSize PACL _Inout_ PULONG _Out_writes_bytes_to_opt_ SaclSize PACL _Inout_ PULONG _Out_writes_bytes_to_opt_ OwnerSize PSID Owner
Definition: rtlfuncs.h:1557
FAST_MUTEX Lock__ObsoleteButDoNotDelete
Definition: extypes.h:152
struct _EX_RUNDOWN_REF * PEX_RUNDOWN_REF
struct _WORK_QUEUE_ITEM * PWORK_QUEUE_ITEM
enum _SUITE_TYPE SUITE_TYPE
ERESOURCE_THREAD OwnerThread
Definition: extypes.h:211
GENERAL_LOOKASIDE L
Definition: extypes.h:150
struct _RESOURCE_HASH_ENTRY RESOURCE_HASH_ENTRY
IN ULONG IN ULONG Tag
Definition: evtlib.h:153
struct _RESOURCE_HASH_ENTRY * PRESOURCE_HASH_ENTRY
GENERAL_LOOKASIDE_POOL L
Definition: extypes.h:166
unsigned int ULONG
Definition: retypes.h:1
ULONG ActiveEntries
Definition: extypes.h:230
volatile PKSEMAPHORE SharedWaiters
Definition: extypes.h:227
* PZONE_SEGMENT_HEADER
Definition: extypes.h:285
ULONG NumberOfSharedWaiters
Definition: extypes.h:232
struct LOOKASIDE_ALIGN _PAGED_LOOKASIDE_LIST * PPAGED_LOOKASIDE_LIST
ULONG NtGlobalFlag
Definition: init.c:51
#define GENERAL_LOOKASIDE_LAYOUT
Definition: extypes.h:98
#define _NTDDK_
ULONG ContentionCount
Definition: extypes.h:254
GENERAL_LOOKASIDE L
Definition: extypes.h:157
WORKER_THREAD_ROUTINE * PWORKER_THREAD_ROUTINE
Definition: extypes.h:200