ReactOS  0.4.15-dev-1367-g07cc0b5
exfuncs.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Executive Functions *
3  ******************************************************************************/
4 
6 #define ExInterlockedIncrementLong(Addend,Lock) Exfi386InterlockedIncrementLong(Addend)
7 #define ExInterlockedDecrementLong(Addend,Lock) Exfi386InterlockedDecrementLong(Addend)
8 #define ExInterlockedExchangeUlong(Target, Value, Lock) Exfi386InterlockedExchangeUlong(Target, Value)
9 
10 #define ExAcquireSpinLock(Lock, OldIrql) KeAcquireSpinLock((Lock), (OldIrql))
11 #define ExReleaseSpinLock(Lock, OldIrql) KeReleaseSpinLock((Lock), (OldIrql))
12 #define ExAcquireSpinLockAtDpcLevel(Lock) KeAcquireSpinLockAtDpcLevel(Lock)
13 #define ExReleaseSpinLockFromDpcLevel(Lock) KeReleaseSpinLockFromDpcLevel(Lock)
14 
15 #define ExInitializeSListHead InitializeSListHead
16 
17 #if defined(_NTHAL_) && defined(_X86_)
18 
20 VOID
22 ExiAcquireFastMutex(
23  IN OUT PFAST_MUTEX FastMutex);
24 
26 VOID
28 ExiReleaseFastMutex(
29  IN OUT PFAST_MUTEX FastMutex);
30 
32 BOOLEAN
35  IN OUT PFAST_MUTEX FastMutex);
36 
37 #define ExAcquireFastMutex ExiAcquireFastMutex
38 #define ExReleaseFastMutex ExiReleaseFastMutex
39 #define ExTryToAcquireFastMutex ExiTryToAcquireFastMutex
40 
41 #else
42 
43 #if (NTDDI_VERSION >= NTDDI_WIN2K)
44 
46 _IRQL_saves_global_(OldIrql, FastMutex)
48 VOID
52  PFAST_MUTEX FastMutex);
53 
57 VOID
61  PFAST_MUTEX FastMutex);
62 
64 _Success_(return!=FALSE)
66 _IRQL_saves_global_(OldIrql, FastMutex)
68 BOOLEAN
72  PFAST_MUTEX FastMutex);
73 
74 #endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */
75 
76 #endif /* defined(_NTHAL_) && defined(_X86_) */
77 
78 #if defined(_X86_)
79 #define ExInterlockedAddUlong ExfInterlockedAddUlong
80 #define ExInterlockedInsertHeadList ExfInterlockedInsertHeadList
81 #define ExInterlockedInsertTailList ExfInterlockedInsertTailList
82 #define ExInterlockedRemoveHeadList ExfInterlockedRemoveHeadList
83 #define ExInterlockedPopEntryList ExfInterlockedPopEntryList
84 #define ExInterlockedPushEntryList ExfInterlockedPushEntryList
85 #endif /* defined(_X86_) */
86 
87 #ifdef _X86_
88 
89 #ifdef _WIN2K_COMPAT_SLIST_USAGE
90 
95  _Inout_ PSLIST_HEADER SListHead,
98 
101 FASTCALL
103  _Inout_ PSLIST_HEADER SListHead,
105 
106 #else /* !_WIN2K_COMPAT_SLIST_USAGE */
107 
108 #define ExInterlockedPushEntrySList(SListHead, SListEntry, Lock) \
109  InterlockedPushEntrySList(SListHead, SListEntry)
110 
111 #define ExInterlockedPopEntrySList(SListHead, Lock) \
112  InterlockedPopEntrySList(SListHead)
113 
114 #endif /* _WIN2K_COMPAT_SLIST_USAGE */
115 
118 FASTCALL
120  _Inout_ PSLIST_HEADER SListHead);
121 
122 #ifdef NONAMELESSUNION
123 #define ExQueryDepthSList(SListHead) (SListHead)->s.Depth
124 #else
125 #define ExQueryDepthSList(SListHead) (SListHead)->Depth
126 #endif
127 
128 #else /* !_X86_ */
129 
133  _Inout_ PSLIST_HEADER SListHead,
135 
139  _Inout_ PSLIST_HEADER SListHead);
140 
144  _Inout_ PSLIST_HEADER SListHead);
145 
146 #if !defined(_NTSYSTEM_) && (defined(_NTDRIVER_) || defined(_NTDDK_) || defined(_NTIFS_) || defined(_NTHAL_) || defined(_NTOSP_))
148 USHORT
150 #else
152 USHORT
154 {
155 #ifdef _WIN64
156  return (USHORT)(SListHead->Alignment & 0xffff);
157 #else /* !_WIN64 */
158  return (USHORT)SListHead->Depth;
159 #endif /* _WIN64 */
160 }
161 #endif
162 
163 #define ExInterlockedPushEntrySList(SListHead, SListEntry, Lock) \
164  ExpInterlockedPushEntrySList(SListHead, SListEntry)
165 
166 #define ExInterlockedPopEntrySList(SListHead, Lock) \
167  ExpInterlockedPopEntrySList(SListHead)
168 
169 #define ExInterlockedFlushSList(SListHead) \
170  ExpInterlockedFlushSList(SListHead)
171 
172 #endif /* _X86_ */
173 
174 
175 #if defined(_WIN2K_COMPAT_SLIST_USAGE) && defined(_X86_)
176 
179 PVOID
180 NTAPI
181 ExAllocateFromPagedLookasideList(
183 
186 VOID
187 NTAPI
188 ExFreeToPagedLookasideList(
190  _In_ PVOID Entry);
191 
192 #else /* !_WIN2K_COMPAT_SLIST_USAGE */
193 
195 static __inline
196 PVOID
197 ExAllocateFromPagedLookasideList(
199 {
200  PVOID Entry;
201 
202  Lookaside->L.TotalAllocates++;
203 #ifdef NONAMELESSUNION
204  Entry = InterlockedPopEntrySList(&Lookaside->L.u.ListHead);
205  if (Entry == NULL) {
206  Lookaside->L.u2.AllocateMisses++;
207  Entry = (Lookaside->L.u4.Allocate)(Lookaside->L.Type,
208  Lookaside->L.Size,
209  Lookaside->L.Tag);
210  }
211 #else /* NONAMELESSUNION */
212  Entry = InterlockedPopEntrySList(&Lookaside->L.ListHead);
213  if (Entry == NULL) {
214  Lookaside->L.AllocateMisses++;
215  Entry = (Lookaside->L.Allocate)(Lookaside->L.Type,
216  Lookaside->L.Size,
217  Lookaside->L.Tag);
218  }
219 #endif /* NONAMELESSUNION */
220  return Entry;
221 }
222 
224 static __inline
225 VOID
226 ExFreeToPagedLookasideList(
228  _In_ PVOID Entry)
229 {
230  Lookaside->L.TotalFrees++;
231 #ifdef NONAMELESSUNION
232  if (ExQueryDepthSList(&Lookaside->L.u.ListHead) >= Lookaside->L.Depth) {
233  Lookaside->L.u3.FreeMisses++;
234  (Lookaside->L.u5.Free)(Entry);
235  } else {
237  }
238 #else /* NONAMELESSUNION */
239  if (ExQueryDepthSList(&Lookaside->L.ListHead) >= Lookaside->L.Depth) {
240  Lookaside->L.FreeMisses++;
241  (Lookaside->L.Free)(Entry);
242  } else {
244  }
245 #endif /* NONAMELESSUNION */
246 }
247 
248 #endif /* _WIN2K_COMPAT_SLIST_USAGE */
249 
250 
251 /* ERESOURCE_THREAD
252  * ExGetCurrentResourceThread(
253  * VOID);
254  */
255 #define ExGetCurrentResourceThread() ((ULONG_PTR)PsGetCurrentThread())
256 
257 #define ExReleaseResource(R) (ExReleaseResourceLite(R))
258 
259 /* VOID
260  * ExInitializeWorkItem(
261  * IN PWORK_QUEUE_ITEM Item,
262  * IN PWORKER_THREAD_ROUTINE Routine,
263  * IN PVOID Context)
264  */
265 #define ExInitializeWorkItem(Item, Routine, Context) \
266 { \
267  (Item)->WorkerRoutine = Routine; \
268  (Item)->Parameter = Context; \
269  (Item)->List.Flink = NULL; \
270 }
271 
273 VOID
275  _Out_ PFAST_MUTEX FastMutex)
276 {
277  FastMutex->Count = FM_LOCK_BIT;
278  FastMutex->Owner = NULL;
279  FastMutex->Contention = 0;
280  KeInitializeEvent(&FastMutex->Event, SynchronizationEvent, FALSE);
281  return;
282 }
283 
285 $if (_NTDDK_)
286 static __inline PVOID
287 ExAllocateFromZone(
288  IN PZONE_HEADER Zone)
289 {
290  PVOID Result = (PVOID)Zone->FreeList.Next;
291  if (Zone->FreeList.Next)
292  Zone->FreeList.Next = Zone->FreeList.Next->Next;
293  return Result;
294 }
295 
296 static __inline PVOID
298  IN PZONE_HEADER Zone,
299  IN PVOID Block)
300 {
301  ((PSINGLE_LIST_ENTRY) Block)->Next = Zone->FreeList.Next;
302  Zone->FreeList.Next = ((PSINGLE_LIST_ENTRY) Block);
303  return ((PSINGLE_LIST_ENTRY) Block)->Next;
304 }
305 
306 /*
307  * PVOID
308  * ExInterlockedAllocateFromZone(
309  * IN PZONE_HEADER Zone,
310  * IN PKSPIN_LOCK Lock)
311  */
312 #define ExInterlockedAllocateFromZone(Zone, Lock) \
313  ((PVOID) ExInterlockedPopEntryList(&Zone->FreeList, Lock))
314 
315 /* PVOID
316  * ExInterlockedFreeToZone(
317  * IN PZONE_HEADER Zone,
318  * IN PVOID Block,
319  * IN PKSPIN_LOCK Lock);
320  */
321 #define ExInterlockedFreeToZone(Zone, Block, Lock) \
322  ExInterlockedPushEntryList(&(Zone)->FreeList, (PSINGLE_LIST_ENTRY)(Block), Lock)
323 
324 /*
325  * BOOLEAN
326  * ExIsFullZone(
327  * IN PZONE_HEADER Zone)
328  */
329 #define ExIsFullZone(Zone) \
330  ((Zone)->FreeList.Next == (PSINGLE_LIST_ENTRY) NULL)
331 
332 /* BOOLEAN
333  * ExIsObjectInFirstZoneSegment(
334  * IN PZONE_HEADER Zone,
335  * IN PVOID Object);
336  */
337 #define ExIsObjectInFirstZoneSegment(Zone,Object) \
338  ((BOOLEAN)( ((PUCHAR)(Object) >= (PUCHAR)(Zone)->SegmentList.Next) && \
339  ((PUCHAR)(Object) < (PUCHAR)(Zone)->SegmentList.Next + \
340  (Zone)->TotalSegmentSize)) )
341 
342 #define ExAcquireResourceExclusive ExAcquireResourceExclusiveLite
343 #define ExAcquireResourceShared ExAcquireResourceSharedLite
344 #define ExConvertExclusiveToShared ExConvertExclusiveToSharedLite
345 #define ExDeleteResource ExDeleteResourceLite
346 #define ExInitializeResource ExInitializeResourceLite
347 #define ExIsResourceAcquiredExclusive ExIsResourceAcquiredExclusiveLite
348 #define ExIsResourceAcquiredShared ExIsResourceAcquiredSharedLite
349 #define ExIsResourceAcquired ExIsResourceAcquiredSharedLite
350 #define ExReleaseResourceForThread ExReleaseResourceForThreadLite
351 
352 #ifndef _M_IX86
353 #define RESULT_ZERO 0
354 #define RESULT_NEGATIVE 1
355 #define RESULT_POSITIVE 2
356 #endif
357 
358 typedef enum _INTERLOCKED_RESULT {
363 
364 #ifdef _X86_
365 
368 FASTCALL
369 Exfi386InterlockedIncrementLong(
371 
374 FASTCALL
375 Exfi386InterlockedDecrementLong(
377 
379 ULONG
380 FASTCALL
381 Exfi386InterlockedExchangeUlong(
383  _In_ ULONG Value);
384 
385 #endif
386 
387 $endif (_NTDDK_)
388 $if (_NTIFS_)
389 
390 #define ExDisableResourceBoost ExDisableResourceBoostLite
391 
392 VOID
393 NTAPI
395  _Out_ PEX_PUSH_LOCK PushLock);
396 $endif (_NTIFS_)
397 
398 #if (NTDDI_VERSION >= NTDDI_WIN2K)
399 $if (_WDMDDK_)
401 _Requires_lock_held_(_Global_critical_region_)
403 VOID
404 FASTCALL
407  PFAST_MUTEX FastMutex);
408 
410 _Requires_lock_held_(_Global_critical_region_)
412 VOID
413 FASTCALL
416  PFAST_MUTEX FastMutex);
417 
418 _Requires_lock_held_(_Global_critical_region_)
422 _When_(Wait!=0, _Post_satisfies_(return == 1))
425 BOOLEAN
426 NTAPI
430 
432 _Requires_lock_held_(_Global_critical_region_)
436 BOOLEAN
437 NTAPI
442  _In_ BOOLEAN Wait);
443 
445 _Requires_lock_held_(_Global_critical_region_)
449 BOOLEAN
450 NTAPI
453  _When_(return!=0, _Acquires_shared_lock_(*_Curr_))
455  _In_ BOOLEAN Wait);
456 
458 _Requires_lock_held_(_Global_critical_region_)
462 BOOLEAN
463 NTAPI
466  _When_(return!=0, _Acquires_lock_(*_Curr_))
468  _In_ BOOLEAN Wait);
469 
471  "No tag interferes with debugging.")
476  __drv_reportError("Must succeed pool allocations are forbidden. "
477  "Allocation failures cause a system crash"))
486 PVOID
487 NTAPI
491 
493  "No tag interferes with debugging.")
498  __drv_reportError("Must succeed pool allocations are forbidden. "
499  "Allocation failures cause a system crash"))
505 PVOID
506 NTAPI
510 
515  __drv_reportError("Must succeed pool allocations are forbidden. "
516  "Allocation failures cause a system crash"))
522 PVOID
523 NTAPI
527  _In_ ULONG Tag);
528 
529 #ifndef POOL_TAGGING
530 #define ExAllocatePoolWithQuotaTag(a,b,c) ExAllocatePoolWithQuota(a,b)
531 #endif
532 
537  __drv_reportError("Must succeed pool allocations are forbidden. "
538  "Allocation failures cause a system crash"))
544 _Function_class_(ALLOCATE_FUNCTION)
546 PVOID
547 NTAPI
551  _In_ ULONG Tag);
552 
553 #ifndef POOL_TAGGING
554 #define ExAllocatePoolWithTag(a,b,c) ExAllocatePool(a,b)
555 #endif
556 
561  __drv_reportError("Must succeed pool allocations are forbidden. "
562  "Allocation failures cause a system crash"))
569 PVOID
570 NTAPI
574  _In_ ULONG Tag,
576 
582  __drv_reportError("Must succeed pool allocations are forbidden. "
583  "Allocation failures cause a system crash"))
589 PVOID
590 NTAPI
591 ExAllocatePoolZero(
594  _In_ ULONG Tag)
595 {
597 
599 
600  if (Allocation != NULL) {
602  }
603 
604  return Allocation;
605 }
606 
612  __drv_reportError("Must succeed pool allocations are forbidden. "
613  "Allocation failures cause a system crash"))
619 PVOID
620 NTAPI
621 ExAllocatePoolUninitialized(
624  _In_ ULONG Tag)
625 {
627 }
628 
634  __drv_reportError("Must succeed pool allocations are forbidden. "
635  "Allocation failures cause a system crash"))
641 PVOID
642 NTAPI
643 ExAllocatePoolQuotaZero (
646  _In_ ULONG Tag)
647 {
649 
651 
652  if (Allocation != NULL) {
654  }
655 
656  return Allocation;
657 }
658 
664  __drv_reportError("Must succeed pool allocations are forbidden. "
665  "Allocation failures cause a system crash"))
671 PVOID
672 NTAPI
673 ExAllocatePoolQuotaUninitialized(
676  _In_ ULONG Tag)
677 {
679 }
680 
686  __drv_reportError("Must succeed pool allocations are forbidden. "
687  "Allocation failures cause a system crash"))
693 PVOID
694 NTAPI
695 ExAllocatePoolPriorityZero(
698  _In_ ULONG Tag,
700 {
702 
704 
705  if (Allocation != NULL) {
707  }
708 
709  return Allocation;
710 }
711 
717  __drv_reportError("Must succeed pool allocations are forbidden. "
718  "Allocation failures cause a system crash"))
724 PVOID
725 NTAPI
726 ExAllocatePoolPriorityUninitialized(
729  _In_ ULONG Tag,
731 {
733 }
734 
737 VOID
738 NTAPI
741 
744 NTSTATUS
745 NTAPI
747  _Outptr_ PCALLBACK_OBJECT *CallbackObject,
751 
753 VOID
754 NTAPI
757 
760 VOID
761 NTAPI
764 
767 NTSTATUS
768 NTAPI
771 
773 _Function_class_(FREE_FUNCTION)
775 VOID
776 NTAPI
777 ExFreePool(
779 
782 VOID
783 NTAPI
786  _In_ ULONG Tag);
787 
790 ULONG
791 NTAPI
794 
798 NTAPI
800 
803 ULONG
804 NTAPI
807 
810 VOID
811 NTAPI
814  _In_opt_ PALLOCATE_FUNCTION Allocate,
815  _In_opt_ PFREE_FUNCTION Free,
816  _In_ ULONG Flags,
817  _In_ SIZE_T Size,
818  _In_ ULONG Tag,
819  _In_ USHORT Depth);
820 
823 VOID
824 NTAPI
827  _In_opt_ PALLOCATE_FUNCTION Allocate,
828  _In_opt_ PFREE_FUNCTION Free,
829  _In_ ULONG Flags,
830  _In_ SIZE_T Size,
831  _In_ ULONG Tag,
832  _In_ USHORT Depth);
833 
836 NTSTATUS
837 NTAPI
840 
843 NTAPI
848 
849 #if !defined(_M_IX86)
850 #define ExInterlockedAddLargeStatistic(Addend, Increment) \
851  (VOID)InterlockedAdd64(&(Addend)->QuadPart, Increment)
852 #else
853 #define ExInterlockedAddLargeStatistic(Addend, Increment) \
854  (VOID)_InterlockedAddLargeStatistic((PLONGLONG)&(Addend)->QuadPart, Increment)
855 #endif
856 
858 ULONG
859 FASTCALL
864 
865 #if defined(_M_IX86)
866 
868 LONGLONG
869 FASTCALL
870 ExfInterlockedCompareExchange64(
872  _In_ PLONGLONG Exchange,
873  _In_ PLONGLONG Comperand);
874 
875 #define ExInterlockedCompareExchange64(Destination, Exchange, Comperand, Lock) \
876  ExfInterlockedCompareExchange64(Destination, Exchange, Comperand)
877 
878 #else
879 
880 #define ExInterlockedCompareExchange64(Destination, Exchange, Comperand, Lock) \
881  InterlockedCompareExchange64(Destination, *(Exchange), *(Comperand))
882 
883 #endif /* defined(_M_IX86) */
884 
887 FASTCALL
889  _Inout_ PLIST_ENTRY ListHead,
892 
895 FASTCALL
897  _Inout_ PLIST_ENTRY ListHead,
900 
903 FASTCALL
905  _Inout_ PSINGLE_LIST_ENTRY ListHead,
907 
910 FASTCALL
912  _Inout_ PSINGLE_LIST_ENTRY ListHead,
915 
918 FASTCALL
920  _Inout_ PLIST_ENTRY ListHead,
922 
925 BOOLEAN
926 NTAPI
928  _In_ ULONG ProcessorFeature);
929 
932 BOOLEAN
933 NTAPI
936 
939 ULONG
940 NTAPI
943 
944 #define ExIsResourceAcquiredLite ExIsResourceAcquiredSharedLite
945 
947 VOID
948 NTAPI
950  _In_ PLARGE_INTEGER LocalTime,
951  _Out_ PLARGE_INTEGER SystemTime);
952 
953 #if (NTDDI_VERSION >= NTDDI_WINBLUE)
954 
955 #define EX_TIMER_HIGH_RESOLUTION 0x4
956 #define EX_TIMER_NO_WAKE 0x8
957 #define EX_TIMER_UNLIMITED_TOLERANCE ((LONGLONG)-1)
958 #define EX_TIMER_NOTIFICATION (1UL << 31)
959 
961 PEX_TIMER
962 NTAPI
967 
969 BOOLEAN
970 NTAPI
971 ExSetTimer(
976 
978 BOOLEAN
979 NTAPI
983 
985 BOOLEAN
986 NTAPI
990  _In_ BOOLEAN Wait,
992 
994 VOID
997 {
998  ASSERT(FALSE);
999 }
1000 
1001 #endif // NTDDI_WINBLUE
1002 
1005 VOID
1006 NTAPI
1008  _In_ PCALLBACK_OBJECT CallbackObject,
1011 
1014 VOID
1015 NTAPI
1019 
1023 VOID
1024 NTAPI
1026  _In_ NTSTATUS Status);
1027 
1030 PVOID
1031 NTAPI
1033  _Inout_ PCALLBACK_OBJECT CallbackObject,
1036 
1039 NTSTATUS
1040 NTAPI
1043 
1045 _Requires_lock_held_(_Global_critical_region_)
1047 VOID
1048 NTAPI
1050  _Inout_ _Requires_lock_held_(*_Curr_) _Releases_lock_(*_Curr_)
1053 
1054 _Requires_lock_held_(_Global_critical_region_)
1059 VOID
1060 FASTCALL
1063 
1066 VOID
1067 NTAPI
1071 
1074 ULONG
1075 NTAPI
1077  _In_ ULONG DesiredTime,
1079 
1081 VOID
1082 NTAPI
1084  _In_ PLARGE_INTEGER SystemTime,
1085  _Out_ PLARGE_INTEGER LocalTime);
1086 
1089 VOID
1090 NTAPI
1092  _Inout_ PVOID CbRegistration);
1093 
1094 $endif (_WDMDDK_)
1095 $if (_NTDDK_)
1097 NTSTATUS
1098 NTAPI
1099 ExExtendZone(
1100  _Inout_ PZONE_HEADER Zone,
1103 
1105 NTSTATUS
1106 NTAPI
1108  _Out_ PZONE_HEADER Zone,
1109  _In_ ULONG BlockSize,
1110  _Inout_ PVOID InitialSegment,
1111  _In_ ULONG InitialSegmentSize);
1112 
1115 NTSTATUS
1116 NTAPI
1118  _Inout_ PZONE_HEADER Zone,
1122 
1125 NTSTATUS
1126 NTAPI
1127 ExUuidCreate(
1128  _Out_ UUID *Uuid);
1129 
1133 VOID
1134 NTAPI
1136 
1140 VOID
1141 NTAPI
1143 
1144 $endif (_NTDDK_)
1145 $if (_NTIFS_)
1146 
1149 SIZE_T
1150 NTAPI
1152  _In_ PVOID PoolBlock,
1154 
1156 VOID
1157 ExAdjustLookasideDepth(VOID);
1158 
1161 VOID
1162 NTAPI
1165 $endif (_NTIFS_)
1166 #endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */
1167 
1168 $if (_WDMDDK_ || _NTIFS_)
1169 #if (NTDDI_VERSION >= NTDDI_WINXP)
1170 $endif (_WDMDDK_ || _NTIFS_)
1171 $if (_WDMDDK_)
1172 
1174 _Post_satisfies_(return == 0 || return == 1)
1176 BOOLEAN
1177 FASTCALL
1179  _Inout_ PEX_RUNDOWN_REF RunRef);
1180 
1182 VOID
1183 FASTCALL
1185  _Out_ PEX_RUNDOWN_REF RunRef);
1186 
1188 VOID
1189 FASTCALL
1191  _Inout_ PEX_RUNDOWN_REF RunRef);
1192 
1194 VOID
1195 FASTCALL
1197  _Inout_ PEX_RUNDOWN_REF RunRef);
1198 
1200 VOID
1201 FASTCALL
1203  _Out_ PEX_RUNDOWN_REF RunRef);
1204 
1206 BOOLEAN
1207 NTAPI
1209  __drv_strictTypeMatch(__drv_typeExpr) _In_ SUITE_TYPE SuiteType);
1210 
1212 VOID
1213 FASTCALL
1215  _Inout_ PEX_RUNDOWN_REF RunRef);
1216 $endif (_WDMDDK_)
1217 $if (_NTIFS_)
1218 
1220 FASTCALL
1222  _Inout_ PSLIST_HEADER ListHead,
1225  _In_ ULONG Count);
1226 $endif (_NTIFS_)
1227 $if (_WDMDDK_ || _NTIFS_)
1228 #endif /* (NTDDI_VERSION >= NTDDI_WINXP) */
1229 $endif (_WDMDDK_ || _NTIFS_)
1230 
1231 $if (_WDMDDK_)
1232 #if (NTDDI_VERSION >= NTDDI_WINXPSP2)
1233 
1235 _Post_satisfies_(return == 0 || return == 1)
1237 BOOLEAN
1238 FASTCALL
1239 ExAcquireRundownProtectionEx(
1240  _Inout_ PEX_RUNDOWN_REF RunRef,
1241  _In_ ULONG Count);
1242 
1244 VOID
1245 FASTCALL
1247  _Inout_ PEX_RUNDOWN_REF RunRef,
1248  _In_ ULONG Count);
1249 
1250 #endif /* (NTDDI_VERSION >= NTDDI_WINXPSP2) */
1251 
1252 #if (NTDDI_VERSION >= NTDDI_WS03SP1)
1253 
1258 NTAPI
1260  __drv_strictTypeMatch(__drv_typeExpr) _In_ POOL_TYPE PoolType,
1262 
1265 SIZE_T
1266 NTAPI
1268 
1270 _Acquires_lock_(_Global_critical_region_)
1272 PVOID
1273 NTAPI
1277 
1279 _Acquires_lock_(_Global_critical_region_)
1281 PVOID
1282 NTAPI
1286 
1288 _Acquires_lock_(_Global_critical_region_)
1290 PVOID
1291 NTAPI
1295 
1297 _Releases_lock_(_Global_critical_region_)
1299 VOID
1300 FASTCALL
1302  _Inout_ _Requires_lock_held_(*_Curr_) _Releases_lock_(*_Curr_)
1304 
1307 VOID
1308 NTAPI
1310  _Out_ PEX_RUNDOWN_REF_CACHE_AWARE RunRefCacheAware,
1312 
1315 VOID
1316 NTAPI
1318  _Inout_ PEX_RUNDOWN_REF_CACHE_AWARE RunRefCacheAware);
1319 
1321 _Post_satisfies_(return == 0 || return == 1)
1323 BOOLEAN
1324 FASTCALL
1325 ExAcquireRundownProtectionCacheAware(
1326  _Inout_ PEX_RUNDOWN_REF_CACHE_AWARE RunRefCacheAware);
1327 
1329 VOID
1330 FASTCALL
1332  _Inout_ PEX_RUNDOWN_REF_CACHE_AWARE RunRefCacheAware);
1333 
1335 _Post_satisfies_(return == 0 || return == 1)
1337 BOOLEAN
1338 FASTCALL
1339 ExAcquireRundownProtectionCacheAwareEx(
1340  _Inout_ PEX_RUNDOWN_REF_CACHE_AWARE RunRefCacheAware,
1341  _In_ ULONG Count);
1342 
1344 VOID
1345 FASTCALL
1348  _In_ ULONG Count);
1349 
1351 VOID
1352 FASTCALL
1355 
1357 VOID
1358 FASTCALL
1360  _Inout_ PEX_RUNDOWN_REF_CACHE_AWARE RunRefCacheAware);
1361 
1363 VOID
1364 FASTCALL
1366  _Inout_ PEX_RUNDOWN_REF_CACHE_AWARE RunRefCacheAware);
1367 
1368 #endif /* (NTDDI_VERSION >= NTDDI_WS03SP1) */
1369 
1370 #if (NTDDI_VERSION >= NTDDI_VISTA)
1371 
1374 NTSTATUS
1375 NTAPI
1376 ExInitializeLookasideListEx(
1378  _In_opt_ PALLOCATE_FUNCTION_EX Allocate,
1379  _In_opt_ PFREE_FUNCTION_EX Free,
1381  _In_ ULONG Flags,
1382  _In_ SIZE_T Size,
1383  _In_ ULONG Tag,
1384  _In_ USHORT Depth);
1385 
1388 VOID
1389 NTAPI
1390 ExDeleteLookasideListEx(
1392 
1395 VOID
1396 NTAPI
1397 ExFlushLookasideListEx(
1399 
1400 #ifdef _MSC_VER
1401 #pragma warning(push)
1402 #pragma warning(disable:__WARNING_MEMORY_NOT_ACQUIRED)
1403 #endif
1404 
1409 PVOID
1410 ExAllocateFromLookasideListEx(
1412 {
1413  PVOID Entry;
1414 
1415  Lookaside->L.TotalAllocates += 1;
1416 #ifdef NONAMELESSUNION
1417  Entry = InterlockedPopEntrySList(&Lookaside->L.u.ListHead);
1418  if (Entry == NULL) {
1419  Lookaside->L.u2.AllocateMisses += 1;
1420  Entry = (Lookaside->L.u4.AllocateEx)(Lookaside->L.Type,
1421  Lookaside->L.Size,
1422  Lookaside->L.Tag,
1423  Lookaside);
1424  }
1425 #else /* NONAMELESSUNION */
1426  Entry = InterlockedPopEntrySList(&Lookaside->L.ListHead);
1427  if (Entry == NULL) {
1428  Lookaside->L.AllocateMisses += 1;
1429  Entry = (Lookaside->L.AllocateEx)(Lookaside->L.Type,
1430  Lookaside->L.Size,
1431  Lookaside->L.Tag,
1432  Lookaside);
1433  }
1434 #endif /* NONAMELESSUNION */
1435  return Entry;
1436 }
1437 
1438 #ifdef _MSC_VER
1439 #pragma warning(pop)
1440 #endif
1441 
1444 VOID
1445 ExFreeToLookasideListEx(
1448 {
1449  Lookaside->L.TotalFrees += 1;
1450  if (ExQueryDepthSList(&Lookaside->L.ListHead) >= Lookaside->L.Depth) {
1451  Lookaside->L.FreeMisses += 1;
1452  (Lookaside->L.FreeEx)(Entry, Lookaside);
1453  } else {
1455  }
1456  return;
1457 }
1458 
1459 #endif /* (NTDDI_VERSION >= NTDDI_VISTA) */
1460 
1461 #if (NTDDI_VERSION >= NTDDI_WIN7)
1462 
1465 VOID
1466 NTAPI
1467 ExSetResourceOwnerPointerEx(
1470  _In_ ULONG Flags);
1471 
1472 #define FLAG_OWNER_POINTER_IS_THREAD 0x1
1473 
1474 #endif /* (NTDDI_VERSION >= NTDDI_WIN7) */
1475 
1480 static __inline
1481 PVOID
1482 ExAllocateFromNPagedLookasideList(
1484 {
1485  PVOID Entry;
1486 
1487  Lookaside->L.TotalAllocates++;
1488 #ifdef NONAMELESSUNION
1489 #if defined(_WIN2K_COMPAT_SLIST_USAGE) && defined(_X86_)
1490  Entry = ExInterlockedPopEntrySList(&Lookaside->L.u.ListHead,
1491  &Lookaside->Lock__ObsoleteButDoNotDelete);
1492 #else
1493  Entry = InterlockedPopEntrySList(&Lookaside->L.u.ListHead);
1494 #endif
1495  if (Entry == NULL) {
1496  Lookaside->L.u2.AllocateMisses++;
1497  Entry = (Lookaside->L.u4.Allocate)(Lookaside->L.Type,
1498  Lookaside->L.Size,
1499  Lookaside->L.Tag);
1500  }
1501 #else /* NONAMELESSUNION */
1502 #if defined(_WIN2K_COMPAT_SLIST_USAGE) && defined(_X86_)
1504  &Lookaside->Lock__ObsoleteButDoNotDelete);
1505 #else
1506  Entry = InterlockedPopEntrySList(&Lookaside->L.ListHead);
1507 #endif
1508  if (Entry == NULL) {
1509  Lookaside->L.AllocateMisses++;
1510  Entry = (Lookaside->L.Allocate)(Lookaside->L.Type,
1511  Lookaside->L.Size,
1512  Lookaside->L.Tag);
1513  }
1514 #endif /* NONAMELESSUNION */
1515  return Entry;
1516 }
1517 
1519 static __inline
1520 VOID
1521 ExFreeToNPagedLookasideList(
1524 {
1525  Lookaside->L.TotalFrees++;
1526 #ifdef NONAMELESSUNION
1527  if (ExQueryDepthSList(&Lookaside->L.u.ListHead) >= Lookaside->L.Depth) {
1528  Lookaside->L.u3.FreeMisses++;
1529  (Lookaside->L.u5.Free)(Entry);
1530  } else {
1531 #if defined(_WIN2K_COMPAT_SLIST_USAGE) && defined(_X86_)
1532  ExInterlockedPushEntrySList(&Lookaside->L.u.ListHead,
1534  &Lookaside->Lock__ObsoleteButDoNotDelete);
1535 #else
1537 #endif
1538  }
1539 #else /* NONAMELESSUNION */
1540  if (ExQueryDepthSList(&Lookaside->L.ListHead) >= Lookaside->L.Depth) {
1541  Lookaside->L.FreeMisses++;
1542  (Lookaside->L.Free)(Entry);
1543  } else {
1544 #if defined(_WIN2K_COMPAT_SLIST_USAGE) && defined(_X86_)
1547  &Lookaside->Lock__ObsoleteButDoNotDelete);
1548 #else
1550 #endif
1551  }
1552 #endif /* NONAMELESSUNION */
1553 }
1554 
1555 $endif (_WDMDDK_)
enum _INTERLOCKED_RESULT INTERLOCKED_RESULT
BOOLEAN NTAPI ExAcquireSharedWaitForExclusive(IN PERESOURCE Resource, IN BOOLEAN Wait)
Definition: resource.c:1217
if(ExQueryDepthSList(&Lookaside->L.ListHead) >=Lookaside->L.Depth)
Definition: exfuncs.h:239
ULONG NTAPI ExGetExclusiveWaiterCount(IN PERESOURCE Resource)
Definition: resource.c:1535
ULONG_PTR ERESOURCE_THREAD
Definition: extypes.h:208
#define IN
Definition: typedefs.h:39
#define ExInterlockedPushEntrySList(SListHead, SListEntry, Lock)
Definition: exfuncs.h:163
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION _In_ ULONG _In_ SIZE_T _In_ ULONG _In_ USHORT Depth
Definition: exfuncs.h:814
return
Definition: dirsup.c:529
#define _Must_inspect_result_
Definition: no_sal2.h:62
NTKERNELAPI VOID NTAPI ExSystemTimeToLocalTime(_In_ PLARGE_INTEGER SystemTime, _Out_ PLARGE_INTEGER LocalTime)
_IRQL_requires_(APC_LEVEL) _IRQL_restores_global_(OldIrql
VOID NTAPI ExQueueWorkItem(IN PWORK_QUEUE_ITEM WorkItem, IN WORK_QUEUE_TYPE QueueType)
Definition: work.c:711
_IRQL_requires_max_(PASSIVE_LEVEL) NTSYSCALLAPI NTSTATUS NTAPI NtCreateEvent(_Out_ PHANDLE EventHandle
Definition: Messaging.c:64
VOID NTAPI ExInitializePagedLookasideList(IN PPAGED_LOOKASIDE_LIST Lookaside, IN PALLOCATE_FUNCTION Allocate OPTIONAL, IN PFREE_FUNCTION Free OPTIONAL, IN ULONG Flags, IN SIZE_T Size, IN ULONG Tag, IN USHORT Depth)
Definition: lookas.c:270
NTKERNELAPI PSLIST_ENTRY ExpInterlockedPopEntrySList(_Inout_ PSLIST_HEADER SListHead)
NTSTATUS NTAPI ExReinitializeResourceLite(IN PERESOURCE Resource)
Definition: resource.c:1756
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ _In_ _Strict_type_match_ POOL_TYPE _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_opt_ ULONG _Out_ WDFLOOKASIDE * Lookaside
Definition: wdfmemory.h:407
NTKERNELAPI VOID NTAPI ExDeleteNPagedLookasideList(_Inout_ PNPAGED_LOOKASIDE_LIST Lookaside)
_Must_inspect_result_ _In_ WDFQUEUE _In_opt_ WDFREQUEST _In_opt_ WDFFILEOBJECT _Inout_opt_ PWDF_REQUEST_PARAMETERS Parameters
Definition: wdfio.h:863
NTKERNELAPI VOID FASTCALL ExRundownCompleted(_Out_ PEX_RUNDOWN_REF RunRef)
_In_ PVOID Entry
Definition: exfuncs.h:229
BOOLEAN NTAPI ExIsProcessorFeaturePresent(IN ULONG ProcessorFeature)
Definition: sysinfo.c:363
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY ListEnd
Definition: exfuncs.h:1223
Definition: ntbasedef.h:629
#define _Interlocked_operand_
Definition: no_sal2.h:410
#define ExInterlockedFlushSList(SListHead)
Definition: exfuncs.h:169
NTKERNELAPI VOID FASTCALL ExReleaseRundownProtectionEx(_Inout_ PEX_RUNDOWN_REF RunRef, _In_ ULONG Count)
_Must_inspect_result_ _Success_(return!=FALSE) _IRQL_raises_(APC_LEVEL) _IRQL_saves_global_(OldIrql
NTKERNELAPI VOID FASTCALL ExReleaseRundownProtection(_Inout_ PEX_RUNDOWN_REF RunRef)
$endif(_WDMDDK_) $if(_NTDDK_) static __inline PVOID ExAllocateFromZone(IN PZONE_HEADER Zone)
Definition: exfuncs.h:284
_In_ SIZE_T RunRefSize
Definition: exfuncs.h:1311
_In_ PVOID OwnerPointer
Definition: exfuncs.h:1070
_In_ PCALLBACK_FUNCTION _In_opt_ PVOID CallbackContext
Definition: exfuncs.h:1034
_In_ BOOLEAN Create
Definition: pstypes.h:519
NTKERNELAPI PSINGLE_LIST_ENTRY FASTCALL ExInterlockedPushEntryList(_Inout_ PSINGLE_LIST_ENTRY ListHead, _Inout_ __drv_aliasesMem PSINGLE_LIST_ENTRY ListEntry, _Inout_ _Requires_lock_not_held_(*_Curr_) PKSPIN_LOCK Lock)
_In_ WDFDPC _In_ BOOLEAN Wait
Definition: wdfdpc.h:167
VOID NTAPI ExDisableResourceBoostLite(IN PERESOURCE Resource)
Definition: resource.c:1501
#define ExAllocatePoolWithQuotaTag(a, b, c)
Definition: exfuncs.h:530
NTKERNELAPI VOID FASTCALL ExRundownCompletedCacheAware(_Inout_ PEX_RUNDOWN_REF_CACHE_AWARE RunRefCacheAware)
VOID NTAPI ExConvertExclusiveToSharedLite(IN PERESOURCE Resource)
Definition: resource.c:1402
PVOID NTAPI ExEnterCriticalRegionAndAcquireResourceShared(IN PERESOURCE Resource)
Definition: resource.c:2218
LONG NTSTATUS
Definition: precomp.h:26
BOOLEAN FASTCALL ExiTryToAcquireFastMutex(PFAST_MUTEX FastMutex)
Definition: fmutex.c:77
#define ExAcquireRundownProtection
Definition: ex.h:128
#define _NTIFS_
Definition: ifssupp.h:20
#define _Outptr_
Definition: no_sal2.h:262
#define ExRaiseStatus
Definition: ntoskrnl.h:102
NTSTATUS ExInitializeResourceLite(PULONG res)
Definition: env_spec_w32.h:641
NTSTATUS NTAPI ExDeleteResourceLite(IN PERESOURCE Resource)
Definition: resource.c:1456
#define ExInterlockedPopEntrySList(SListHead, Lock)
Definition: exfuncs.h:166
_Requires_lock_held_(_Global_critical_region_) _Requires_lock_not_held_(*Resource) _When_(Wait!=0
_Acquires_shared_lock_(Vcb->Resource)) FINISHED FatAcquireSharedVcb(IN PIRP_CONTEXT IrpContext
_In_ LARGE_INTEGER _In_ ULONG Period
Definition: kefuncs.h:1324
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:361
NTSTATUS NTAPI ExCreateCallback(OUT PCALLBACK_OBJECT *CallbackObject, IN POBJECT_ATTRIBUTES ObjectAttributes, IN BOOLEAN Create, IN BOOLEAN AllowMultipleCallbacks)
Definition: callback.c:361
Definition: ecma_167.h:138
#define _WDMDDK_
Definition: wdm.template.h:26
__drv_preferredFunction("ExAllocatePoolWithTag", "No tag interferes with debugging.") __drv_allocatesMem(Mem) _When_((PoolType &PagedPool) !=0
KPROCESSOR_MODE NTAPI ExGetPreviousMode(VOID)
Definition: sysinfo.c:3066
KSPIN_LOCK * PKSPIN_LOCK
Definition: env_spec_w32.h:73
_Acquires_exclusive_lock_(Vcb->Resource)) FINISHED FatAcquireExclusiveVcb_Real(IN PIRP_CONTEXT IrpContext
NTKERNELAPI PLIST_ENTRY FASTCALL ExInterlockedInsertTailList(_Inout_ PLIST_ENTRY ListHead, _Inout_ __drv_aliasesMem PLIST_ENTRY ListEntry, _Inout_ _Requires_lock_not_held_(*_Curr_) PKSPIN_LOCK Lock)
Allocation
Definition: exfuncs.h:598
NTKERNELAPI VOID FASTCALL ExInitializeRundownProtection(_Out_ PEX_RUNDOWN_REF RunRef)
#define FASTCALL
Definition: nt_native.h:50
FastMutex NTKERNELAPI VOID FASTCALL ExAcquireFastMutex(_Inout_ _Requires_lock_not_held_(*_Curr_) _Acquires_lock_(*_Curr_) PFAST_MUTEX FastMutex)
IN OUT PLONG Addend
Definition: CrNtStubs.h:22
#define DECLSPEC_NORETURN
Definition: ntbasedef.h:176
_In_ PCALLBACK_FUNCTION CallbackFunction
Definition: exfuncs.h:1034
#define _IRQL_raises_(irql)
Definition: driverspecs.h:211
_In_opt_ PALLOCATE_FUNCTION Allocate
Definition: exfuncs.h:814
ULONG NTAPI ExSetTimerResolution(IN ULONG DesiredTime, IN BOOLEAN SetResolution)
Definition: time.c:131
VOID FASTCALL ExReleaseFastMutexUnsafe(IN OUT PFAST_MUTEX FastMutex)
Definition: fmutex.c:86
PSLIST_ENTRY WINAPI InterlockedPopEntrySList(PSLIST_HEADER ListHead)
Definition: interlocked.c:55
#define _In_opt_
Definition: no_sal2.h:212
#define RESULT_NEGATIVE
Definition: exfuncs.h:354
NTKERNELAPI BOOLEAN NTAPI ExVerifySuite(__drv_strictTypeMatch(__drv_typeExpr) _In_ SUITE_TYPE SuiteType)
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION Free
Definition: exfuncs.h:814
VOID NTAPI ExFreeCacheAwareRundownProtection(IN PEX_RUNDOWN_REF_CACHE_AWARE RunRefCacheAware)
Definition: rundown.c:646
struct LOOKASIDE_ALIGN _NPAGED_LOOKASIDE_LIST * PNPAGED_LOOKASIDE_LIST
VOID NTAPI ExUnregisterCallback(IN PVOID CallbackRegistrationHandle)
Definition: callback.c:636
_Acquires_exclusive_lock_ Resource _Post_satisfies_(return==1)) _When_(Wait
FastMutex NTKERNELAPI VOID FASTCALL ExReleaseFastMutex(_Inout_ _Requires_lock_held_(*_Curr_) _Releases_lock_(*_Curr_) PFAST_MUTEX FastMutex)
BOOLEAN NTAPI ExAcquireResourceExclusiveLite(IN PERESOURCE Resource, IN BOOLEAN Wait)
Definition: resource.c:770
__GNU_EXTENSION typedef __int64 * PLONGLONG
Definition: ntbasedef.h:383
ERESOURCE * PERESOURCE
Definition: env_spec_w32.h:595
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
#define FALSE
Definition: types.h:117
long LONG
Definition: pedump.c:60
struct _EX_TIMER * PEX_TIMER
Definition: extypes.h:291
FORCEINLINE VOID ExInitializeSetTimerParameters(_Out_ PEXT_SET_PARAMETERS Parameters)
Definition: exfuncs.h:995
enum _EX_POOL_PRIORITY EX_POOL_PRIORITY
#define _Releases_lock_(a)
Definition: btrfs_drv.h:208
_Acquires_shared_lock_ _Curr_ PERESOURCE Resource
Definition: exfuncs.h:440
__drv_allocatesMem(Mem) _When_((PoolType &PagedPool) !=0
#define __drv_aliasesMem
Definition: btrfs_drv.h:205
unsigned char BOOLEAN
VOID NTAPI ExInitializeRundownProtectionCacheAware(IN PEX_RUNDOWN_REF_CACHE_AWARE RunRefCacheAware, IN SIZE_T Size)
Definition: rundown.c:667
_In_ POBJECT_ATTRIBUTES _In_ BOOLEAN _In_ BOOLEAN AllowMultipleCallbacks
Definition: exfuncs.h:748
NTKERNELAPI VOID FASTCALL ExReInitializeRundownProtectionCacheAware(_Inout_ PEX_RUNDOWN_REF_CACHE_AWARE RunRefCacheAware)
NTKERNELAPI PSINGLE_LIST_ENTRY FASTCALL ExInterlockedPopEntryList(_Inout_ PSINGLE_LIST_ENTRY ListHead, _Inout_ _Requires_lock_not_held_(*_Curr_) PKSPIN_LOCK Lock)
BOOLEAN NTAPI ExIsResourceAcquiredExclusiveLite(IN PERESOURCE Resource)
Definition: resource.c:1619
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:426
#define _Out_
Definition: no_sal2.h:160
NTKERNELAPI PEX_TIMER NTAPI ExAllocateTimer(_In_opt_ PEXT_CALLBACK Callback, _In_opt_ PVOID CallbackContext, _In_ ULONG Attributes)
VOID NTAPI ExDeletePagedLookasideList(IN PPAGED_LOOKASIDE_LIST Lookaside)
Definition: lookas.c:194
#define NTKERNELAPI
#define ExInitializePushLock
Definition: ex.h:987
NTKERNELAPI VOID FASTCALL ExWaitForRundownProtectionReleaseCacheAware(IN OUT PEX_RUNDOWN_REF_CACHE_AWARE RunRef)
return succeed
Definition: scsi.h:3736
NTKERNELAPI NTSTATUS ExUuidCreate(OUT UUID *Uuid)
Definition: uuid.c:379
NTKERNELAPI VOID FASTCALL ExWaitForRundownProtectionRelease(_Inout_ PEX_RUNDOWN_REF RunRef)
int __cdecl system(_In_opt_z_ const char *_Command)
void * PVOID
Definition: retypes.h:9
_In_ __drv_freesMem(Entry) PVOID Entry)
Definition: exfuncs.h:1447
_Inout_ PVOID Segment
Definition: exfuncs.h:1101
_Must_inspect_result_ FastMutex NTKERNELAPI BOOLEAN FASTCALL ExTryToAcquireFastMutex(_Inout_ _Requires_lock_not_held_(*_Curr_) _Acquires_lock_(*_Curr_) PFAST_MUTEX FastMutex)
#define RESULT_ZERO
Definition: exfuncs.h:353
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:406
Status
Definition: gdiplustypes.h:24
int64_t LONGLONG
Definition: typedefs.h:68
#define _Requires_lock_not_held_(a)
Definition: btrfs_drv.h:214
VOID NTAPI ExNotifyCallback(IN PCALLBACK_OBJECT CallbackObject, IN PVOID Argument1, IN PVOID Argument2)
Definition: callback.c:467
ULONG NTAPI ExGetSharedWaiterCount(IN PERESOURCE Resource)
Definition: resource.c:1558
__drv_reportError("Must succeed pool allocations are forbidden. " "Allocation failures cause a system crash")) _When_((PoolType &(NonPagedPoolMustSucceed|POOL_RAISE_IF_ALLOCATION_FAILURE))
NTKERNELAPI VOID FASTCALL ExReInitializeRundownProtection(_Inout_ PEX_RUNDOWN_REF RunRef)
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
void Cancel(int sigNum)
Definition: shell.c:481
VOID NTAPI ExInitializeNPagedLookasideList(IN PNPAGED_LOOKASIDE_LIST Lookaside, IN PALLOCATE_FUNCTION Allocate OPTIONAL, IN PFREE_FUNCTION Free OPTIONAL, IN ULONG Flags, IN SIZE_T Size, IN ULONG Tag, IN USHORT Depth)
Definition: lookas.c:218
_Out_ PBOOLEAN QuotaCharged
Definition: exfuncs.h:1153
#define ASSERT(a)
Definition: mode.c:45
_INTERLOCKED_RESULT
Definition: exfuncs.h:358
INT POOL_TYPE
Definition: typedefs.h:78
VOID FASTCALL ExAcquireFastMutexUnsafe(IN OUT PFAST_MUTEX FastMutex)
Definition: fmutex.c:75
_Post_maybenull_ _Must_inspect_result_ _When_((PoolType &(NonPagedPoolMustSucceed|POOL_RAISE_IF_ALLOCATION_FAILURE)) !=0, _Post_notnull_) _Post_writable_byte_size_(NumberOfBytes) NTKERNELAPI PVOID NTAPI ExAllocatePool(__drv_strictTypeMatch(__drv_typeExpr) _In_ POOL_TYPE PoolType
SIZE_T NTAPI ExSizeOfRundownProtectionCacheAware(VOID)
Definition: rundown.c:725
#define _Ret_maybenull_
Definition: no_sal2.h:328
NTKERNELAPI BOOLEAN NTAPI ExDeleteTimer(_In_ PEX_TIMER Timer, _In_ BOOLEAN Cancel, _In_ BOOLEAN Wait, _In_opt_ PEXT_DELETE_PARAMETERS Parameters)
FORCEINLINE VOID ExInitializeFastMutex(_Out_ PFAST_MUTEX FastMutex)
Definition: exfuncs.h:274
#define FM_LOCK_BIT
Definition: iotypes.h:1406
NTKERNELAPI PLIST_ENTRY FASTCALL ExInterlockedRemoveHeadList(_Inout_ PLIST_ENTRY ListHead, _Inout_ _Requires_lock_not_held_(*_Curr_) PKSPIN_LOCK Lock)
#define _Post_maybenull_
Definition: sal.h:706
_In_ PUNICODE_STRING _Inout_ PUNICODE_STRING Destination
Definition: rtlfuncs.h:2937
#define PSLIST_ENTRY
Definition: rtltypes.h:134
FORCEINLINE USHORT ExQueryDepthSList(_In_ PSLIST_HEADER SListHead)
Definition: exfuncs.h:153
#define _Inout_
Definition: no_sal2.h:162
_Post_maybenull_ _Must_inspect_result_ _In_ SIZE_T NumberOfBytes
Definition: exfuncs.h:490
VOID FASTCALL ExReleaseResourceLite(IN PERESOURCE Resource)
Definition: resource.c:1817
CCHAR KPROCESSOR_MODE
Definition: ketypes.h:7
NTKERNELAPI ULONG FASTCALL ExInterlockedAddUlong(_Inout_ PULONG Addend, _In_ ULONG Increment, _Inout_ _Requires_lock_not_held_(*_Curr_) PKSPIN_LOCK Lock)
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ _Strict_type_match_ POOL_TYPE _In_opt_ ULONG PoolTag
Definition: wdfmemory.h:159
PSLIST_ENTRY FASTCALL InterlockedPushListSList(_Inout_ PSLIST_HEADER ListHead, _Inout_ __drv_aliasesMem PSLIST_ENTRY List, _Inout_ PSLIST_ENTRY ListEnd, _In_ ULONG Count)
_In_ ERESOURCE_THREAD ResourceThreadId
Definition: exfuncs.h:1052
VOID NTAPI ExRaiseAccessViolation(VOID)
Definition: harderr.c:310
NTKERNELAPI BOOLEAN NTAPI ExSetTimer(_In_ PEX_TIMER Timer, _In_ LONGLONG DueTime, _In_ LONGLONG Period, _In_opt_ PEXT_SET_PARAMETERS Parameters)
#define _Post_notnull_
Definition: sal.h:701
enum _WORK_QUEUE_TYPE WORK_QUEUE_TYPE
_In_ WDFINTERRUPT _In_ WDF_INTERRUPT_POLICY _In_ WDF_INTERRUPT_PRIORITY Priority
Definition: wdfinterrupt.h:651
char * PBOOLEAN
Definition: retypes.h:11
#define _IRQL_restores_global_(kind, param)
Definition: driverspecs.h:217
static __inline PVOID ExFreeToZone(IN PZONE_HEADER Zone, IN PVOID Block)
Definition: exfuncs.h:297
VOID NTAPI ExRaiseDatatypeMisalignment(VOID)
Definition: harderr.c:332
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:790
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1223
#define ExAllocatePoolWithTag(a, b, c)
Definition: exfuncs.h:554
NTKERNELAPI VOID NTAPI ExLocalTimeToSystemTime(_In_ PLARGE_INTEGER LocalTime, _Out_ PLARGE_INTEGER SystemTime)
#define ExAllocatePool(type, size)
Definition: fbtusb.h:44
NTKERNELAPI BOOLEAN NTAPI ExCancelTimer(_Inout_ PEX_TIMER Timer, _In_opt_ PEXT_CANCEL_PARAMETERS Parameters)
_Must_inspect_result_ _In_ WDFCMRESLIST List
Definition: wdfresource.h:550
_In_ ACCESS_MASK _In_opt_ POBJECT_ATTRIBUTES ObjectAttributes
Definition: exfuncs.h:165
_Inout_ PVOID _In_ ULONG SegmentSize
Definition: exfuncs.h:1101
Definition: typedefs.h:119
VOID FASTCALL ExReleaseResourceAndLeaveCriticalRegion(IN PERESOURCE Resource)
Definition: resource.c:2278
NTSTATUS NTAPI ExInterlockedExtendZone(PZONE_HEADER Zone, PVOID Segment, ULONG SegmentSize, PKSPIN_LOCK Lock)
Definition: zone.c:73
PEX_RUNDOWN_REF_CACHE_AWARE NTAPI ExAllocateCacheAwareRundownProtection(IN POOL_TYPE PoolType, IN ULONG Tag)
Definition: rundown.c:562
NTKERNELAPI PSLIST_ENTRY FASTCALL InterlockedPushEntrySList(IN PSLIST_HEADER ListHead, IN PSLIST_ENTRY ListEntry)
Definition: interlocked.c:82
#define _Function_class_(n)
Definition: no_sal2.h:398
VOID NTAPI ExSetResourceOwnerPointer(IN PERESOURCE Resource, IN PVOID OwnerPointer)
Definition: resource.c:2045
NTKERNELAPI VOID FASTCALL ExReleaseRundownProtectionCacheAware(_Inout_ PEX_RUNDOWN_REF_CACHE_AWARE RunRefCacheAware)
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
#define _Pre_notnull_
Definition: no_sal2.h:516
#define RESULT_POSITIVE
Definition: exfuncs.h:355
PVOID NTAPI ExAllocatePoolWithQuota(IN POOL_TYPE PoolType, IN SIZE_T NumberOfBytes)
Definition: expool.c:2893
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
Definition: wdfdevice.h:4061
#define P(row, col)
_In_ WDFINTERRUPT _In_ PFN_WDF_INTERRUPT_SYNCHRONIZE Callback
Definition: wdfinterrupt.h:456
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
PVOID NTAPI ExEnterCriticalRegionAndAcquireSharedWaitForExclusive(IN PERESOURCE Resource)
Definition: resource.c:2249
#define _In_
Definition: no_sal2.h:158
EXT_CALLBACK * PEXT_CALLBACK
Definition: extypes.h:303
BOOLEAN NTAPI ExAcquireSharedStarveExclusive(IN PERESOURCE Resource, IN BOOLEAN Wait)
Definition: resource.c:1063
ULONG_PTR SIZE_T
Definition: typedefs.h:80
struct _SINGLE_LIST_ENTRY * PSINGLE_LIST_ENTRY
* PFAST_MUTEX
Definition: extypes.h:17
_In_ BOOLEAN SetResolution
Definition: exfuncs.h:1078
NTKERNELAPI PLIST_ENTRY FASTCALL ExInterlockedInsertHeadList(_Inout_ PLIST_ENTRY ListHead, _Inout_ __drv_aliasesMem PLIST_ENTRY ListEntry, _Inout_ _Requires_lock_not_held_(*_Curr_) PKSPIN_LOCK Lock)
#define KeInitializeEvent(pEvt, foo, foo2)
Definition: env_spec_w32.h:477
NTKERNELAPI PSLIST_ENTRY ExpInterlockedFlushSList(_Inout_ PSLIST_HEADER SListHead)
unsigned short USHORT
Definition: pedump.c:61
CALLBACK_FUNCTION * PCALLBACK_FUNCTION
Definition: extypes.h:96
_In_opt_ PVOID _In_opt_ PVOID Argument2
Definition: exfuncs.h:1009
SIZE_T NTAPI ExQueryPoolBlockSize(IN PVOID PoolBlock, OUT PBOOLEAN QuotaCharged)
Definition: expool.c:2877
#define FORCEINLINE
Definition: wdftypes.h:67
#define _Post_writable_byte_size_(s)
Definition: no_sal2.h:542
PVOID NTAPI ExAllocatePoolWithTagPriority(IN POOL_TYPE PoolType, IN SIZE_T NumberOfBytes, IN ULONG Tag, IN EX_POOL_PRIORITY Priority)
Definition: expool.c:2907
unsigned int * PULONG
Definition: retypes.h:1
#define NULL
Definition: types.h:112
NTKERNELAPI LARGE_INTEGER NTAPI ExInterlockedAddLargeInteger(_Inout_ PLARGE_INTEGER Addend, _In_ LARGE_INTEGER Increment, _Inout_ _Requires_lock_not_held_(*_Curr_) PKSPIN_LOCK Lock)
NTKERNELAPI PSLIST_ENTRY ExpInterlockedPushEntrySList(_Inout_ PSLIST_HEADER SListHead, _Inout_ __drv_aliasesMem PSLIST_ENTRY SListEntry)
_In_ WDFTIMER _In_ LONGLONG DueTime
Definition: wdftimer.h:187
enum _SUITE_TYPE SUITE_TYPE
_In_ WDFIOTARGET Target
Definition: wdfrequest.h:306
BOOLEAN NTAPI ExAcquireResourceSharedLite(IN PERESOURCE Resource, IN BOOLEAN Wait)
Definition: resource.c:885
$if(_WDMDDK_) _IRQL_raises_(APC_LEVEL) _IRQL_saves_global_(OldIrql
Definition: ke.h:1
NTKERNELAPI NTSTATUS NTAPI ExInitializeZone(_Out_ PZONE_HEADER Zone, _In_ ULONG BlockSize, _Inout_ PVOID InitialSegment, _In_ ULONG InitialSegmentSize)
#define _Literal_
Definition: no_sal2.h:400
PVOID NTAPI ExRegisterCallback(IN PCALLBACK_OBJECT CallbackObject, IN PCALLBACK_FUNCTION CallbackFunction, IN PVOID CallbackContext)
Definition: callback.c:556
#define OUT
Definition: typedefs.h:40
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWAITLOCK * Lock
Definition: wdfsync.h:124
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ _Strict_type_match_ POOL_TYPE PoolType
Definition: wdfdevice.h:3810
PVOID NTAPI ExEnterCriticalRegionAndAcquireResourceExclusive(IN PERESOURCE Resource)
Definition: resource.c:2189
unsigned int ULONG
Definition: retypes.h:1
ULONG NTAPI ExIsResourceAcquiredSharedLite(IN PERESOURCE Resource)
Definition: resource.c:1658
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
VOID NTAPI ExReleaseResourceForThreadLite(IN PERESOURCE Resource, IN ERESOURCE_THREAD Thread)
Definition: resource.c:1844
#define POOL_QUOTA_FAIL_INSTEAD_OF_RAISE
#define POOL_RAISE_IF_ALLOCATION_FAILURE
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
_Must_inspect_result_ _In_ PWDF_WORKITEM_CONFIG _In_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWORKITEM * WorkItem
Definition: wdfworkitem.h:110
int failures
Definition: ehframes.cpp:20
#define _Acquires_lock_(lock)
struct LOOKASIDE_ALIGN _PAGED_LOOKASIDE_LIST * PPAGED_LOOKASIDE_LIST
IN OUT PLONG IN OUT PLONG Addend IN OUT PLONG IN LONG Increment
Definition: CrNtStubs.h:42
NTKERNELAPI VOID FASTCALL ExReleaseRundownProtectionCacheAwareEx(_Inout_ PEX_RUNDOWN_REF_CACHE_AWARE RunRef, _In_ ULONG Count)
signed int * PLONG
Definition: retypes.h:5
#define APC_LEVEL
Definition: env_spec_w32.h:695
NTSTATUS NTAPI ExExtendZone(PZONE_HEADER Zone, PVOID Segment, ULONG SegmentSize)
Definition: zone.c:23
#define _NTDDK_
base of all file and directory entries
Definition: entries.h:82
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
_Must_inspect_result_ _In_ PFLT_CALLBACK_DATA _In_ PFLT_DEFERRED_IO_WORKITEM_ROUTINE _In_ WORK_QUEUE_TYPE QueueType
Definition: fltkernel.h:1977
_In_opt_ PVOID Argument1
Definition: exfuncs.h:1009
#define _IRQL_saves_global_(kind, param)
Definition: driverspecs.h:219
#define _Inout_opt_
Definition: no_sal2.h:216
_Must_inspect_result_ _In_ WDFDMAENABLER _In_ _In_opt_ PWDF_OBJECT_ATTRIBUTES Attributes
_Post_maybenull_ _Must_inspect_result_ _In_ SIZE_T _In_ ULONG _In_ __drv_strictTypeMatch(__drv_typeExpr) EX_POOL_PRIORITY Priority)