ReactOS  r74223
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 
55 _IRQL_restores_global_(OldIrql, FastMutex)
57 VOID
61  PFAST_MUTEX FastMutex);
62 
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(
189  _Inout_ PPAGED_LOOKASIDE_LIST Lookaside,
190  _In_ PVOID Entry);
191 
192 #else /* !_WIN2K_COMPAT_SLIST_USAGE */
193 
195 static __inline
196 PVOID
197 ExAllocateFromPagedLookasideList(
198  _Inout_ PPAGED_LOOKASIDE_LIST Lookaside)
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(
227  _Inout_ PPAGED_LOOKASIDE_LIST Lookaside,
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 {
236  InterlockedPushEntrySList(&Lookaside->L.u.ListHead, (PSLIST_ENTRY)Entry);
237  }
238 #else /* NONAMELESSUNION */
239  if (ExQueryDepthSList(&Lookaside->L.ListHead) >= Lookaside->L.Depth) {
240  Lookaside->L.FreeMisses++;
241  (Lookaside->L.Free)(Entry);
242  } else {
243  InterlockedPushEntrySList(&Lookaside->L.ListHead, (PSLIST_ENTRY)Entry);
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_)
433 _When_(Wait!=0, _Post_satisfies_(return == 1))
436 BOOLEAN
437 NTAPI
441  PERESOURCE Resource,
442  _In_ BOOLEAN Wait);
443 
445 _Requires_lock_held_(_Global_critical_region_)
446 _When_(Wait!=0, _Post_satisfies_(return == 1))
447 _When_(Wait==0, _Post_satisfies_(return == 0 || return == 1) _Must_inspect_result_)
449 BOOLEAN
450 NTAPI
453  _When_(return!=0, _Acquires_shared_lock_(*_Curr_))
454  PERESOURCE Resource,
455  _In_ BOOLEAN Wait);
456 
458 _Requires_lock_held_(_Global_critical_region_)
459 _When_(Wait!=0, _Post_satisfies_(return == 1))
460 _When_(Wait==0, _Post_satisfies_(return == 0 || return == 1) _Must_inspect_result_)
462 BOOLEAN
463 NTAPI
466  _When_(return!=0, _Acquires_lock_(*_Curr_))
467  PERESOURCE Resource,
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"))
478 _When_((PoolType & (NonPagedPoolMustSucceed |
481 _When_((PoolType & (NonPagedPoolMustSucceed |
482  POOL_RAISE_IF_ALLOCATION_FAILURE)) != 0,
486 PVOID
487 NTAPI
491 
493  "No tag interferes with debugging.")
495 _When_((PoolType & PagedPool) != 0, _IRQL_requires_max_(APC_LEVEL))
496 _When_((PoolType & PagedPool) == 0, _IRQL_requires_max_(DISPATCH_LEVEL))
497 _When_((PoolType & NonPagedPoolMustSucceed) != 0,
498  __drv_reportError("Must succeed pool allocations are forbidden. "
499  "Allocation failures cause a system crash"))
500 _When_((PoolType & POOL_QUOTA_FAIL_INSTEAD_OF_RAISE) != 0,
502 _When_((PoolType & POOL_QUOTA_FAIL_INSTEAD_OF_RAISE) == 0, _Post_notnull_)
503 _Post_writable_byte_size_(NumberOfBytes)
505 PVOID
506 NTAPI
508  __drv_strictTypeMatch(__drv_typeExpr) _In_ POOL_TYPE PoolType,
509  _In_ SIZE_T NumberOfBytes);
510 
512 _When_((PoolType & PagedPool) != 0, _IRQL_requires_max_(APC_LEVEL))
513 _When_((PoolType & PagedPool) == 0, _IRQL_requires_max_(DISPATCH_LEVEL))
514 _When_((PoolType & NonPagedPoolMustSucceed) != 0,
515  __drv_reportError("Must succeed pool allocations are forbidden. "
516  "Allocation failures cause a system crash"))
517 _When_((PoolType & POOL_QUOTA_FAIL_INSTEAD_OF_RAISE) != 0,
519 _When_((PoolType & POOL_QUOTA_FAIL_INSTEAD_OF_RAISE) == 0, _Post_notnull_)
520 _Post_writable_byte_size_(NumberOfBytes)
522 PVOID
523 NTAPI
524 ExAllocatePoolWithQuotaTag(
525  _In_ __drv_strictTypeMatch(__drv_typeExpr) POOL_TYPE PoolType,
526  _In_ SIZE_T NumberOfBytes,
527  _In_ ULONG Tag);
528 
529 #ifndef POOL_TAGGING
530 #define ExAllocatePoolWithQuotaTag(a,b,c) ExAllocatePoolWithQuota(a,b)
531 #endif
532 
534 _When_((PoolType & PagedPool) != 0, _IRQL_requires_max_(APC_LEVEL))
535 _When_((PoolType & PagedPool) == 0, _IRQL_requires_max_(DISPATCH_LEVEL))
536 _When_((PoolType & NonPagedPoolMustSucceed) != 0,
537  __drv_reportError("Must succeed pool allocations are forbidden. "
538  "Allocation failures cause a system crash"))
539 _When_((PoolType & (NonPagedPoolMustSucceed | POOL_RAISE_IF_ALLOCATION_FAILURE)) == 0,
541 _When_((PoolType & (NonPagedPoolMustSucceed | POOL_RAISE_IF_ALLOCATION_FAILURE)) != 0,
543 _Post_writable_byte_size_(NumberOfBytes)
544 _Function_class_(ALLOCATE_FUNCTION)
546 PVOID
547 NTAPI
548 ExAllocatePoolWithTag(
549  _In_ __drv_strictTypeMatch(__drv_typeExpr) POOL_TYPE PoolType,
550  _In_ SIZE_T NumberOfBytes,
551  _In_ ULONG Tag);
552 
553 #ifndef POOL_TAGGING
554 #define ExAllocatePoolWithTag(a,b,c) ExAllocatePool(a,b)
555 #endif
556 
558 _When_((PoolType & PagedPool) != 0, _IRQL_requires_max_(APC_LEVEL))
559 _When_((PoolType & PagedPool) == 0, _IRQL_requires_max_(DISPATCH_LEVEL))
560 _When_((PoolType & NonPagedPoolMustSucceed) != 0,
561  __drv_reportError("Must succeed pool allocations are forbidden. "
562  "Allocation failures cause a system crash"))
563 _When_((PoolType & (NonPagedPoolMustSucceed | POOL_RAISE_IF_ALLOCATION_FAILURE)) == 0,
565 _When_((PoolType & (NonPagedPoolMustSucceed | POOL_RAISE_IF_ALLOCATION_FAILURE)) != 0,
567 _Post_writable_byte_size_(NumberOfBytes)
569 PVOID
570 NTAPI
572  _In_ __drv_strictTypeMatch(__drv_typeCond) POOL_TYPE PoolType,
573  _In_ SIZE_T NumberOfBytes,
574  _In_ ULONG Tag,
576 
579 VOID
580 NTAPI
582  _Inout_ _Requires_lock_held_(*_Curr_) PERESOURCE Resource);
583 
586 NTSTATUS
587 NTAPI
589  _Outptr_ PCALLBACK_OBJECT *CallbackObject,
593 
595 VOID
596 NTAPI
598  _Inout_ PNPAGED_LOOKASIDE_LIST Lookaside);
599 
602 VOID
603 NTAPI
605  _Inout_ PPAGED_LOOKASIDE_LIST Lookaside);
606 
609 NTSTATUS
610 NTAPI
612  _Inout_ PERESOURCE Resource);
613 
615 _Function_class_(FREE_FUNCTION)
617 VOID
618 NTAPI
619 ExFreePool(
621 
624 VOID
625 NTAPI
628  _In_ ULONG Tag);
629 
632 ULONG
633 NTAPI
635  _In_ PERESOURCE Resource);
636 
640 NTAPI
642 
645 ULONG
646 NTAPI
648  _In_ PERESOURCE Resource);
649 
652 VOID
653 NTAPI
655  _Out_ PNPAGED_LOOKASIDE_LIST Lookaside,
656  _In_opt_ PALLOCATE_FUNCTION Allocate,
657  _In_opt_ PFREE_FUNCTION Free,
658  _In_ ULONG Flags,
659  _In_ SIZE_T Size,
660  _In_ ULONG Tag,
661  _In_ USHORT Depth);
662 
665 VOID
666 NTAPI
668  _Out_ PPAGED_LOOKASIDE_LIST Lookaside,
669  _In_opt_ PALLOCATE_FUNCTION Allocate,
670  _In_opt_ PFREE_FUNCTION Free,
671  _In_ ULONG Flags,
672  _In_ SIZE_T Size,
673  _In_ ULONG Tag,
674  _In_ USHORT Depth);
675 
678 NTSTATUS
679 NTAPI
681  _Out_ PERESOURCE Resource);
682 
685 NTAPI
690 
691 #if !defined(_M_IX86)
692 #define ExInterlockedAddLargeStatistic(Addend, Increment) \
693  (VOID)InterlockedAdd64(&(Addend)->QuadPart, Increment)
694 #else
695 #define ExInterlockedAddLargeStatistic(Addend, Increment) \
696  (VOID)_InterlockedAddLargeStatistic((PLONGLONG)&(Addend)->QuadPart, Increment)
697 #endif
698 
700 ULONG
701 FASTCALL
703  _Inout_ PULONG Addend,
704  _In_ ULONG Increment,
706 
707 #if defined(_M_IX86)
708 
710 LONGLONG
711 FASTCALL
712 ExfInterlockedCompareExchange64(
714  _In_ PLONGLONG Exchange,
715  _In_ PLONGLONG Comperand);
716 
717 #define ExInterlockedCompareExchange64(Destination, Exchange, Comperand, Lock) \
718  ExfInterlockedCompareExchange64(Destination, Exchange, Comperand)
719 
720 #else
721 
722 #define ExInterlockedCompareExchange64(Destination, Exchange, Comperand, Lock) \
723  InterlockedCompareExchange64(Destination, *(Exchange), *(Comperand))
724 
725 #endif /* defined(_M_IX86) */
726 
729 FASTCALL
731  _Inout_ PLIST_ENTRY ListHead,
734 
737 FASTCALL
739  _Inout_ PLIST_ENTRY ListHead,
742 
745 FASTCALL
747  _Inout_ PSINGLE_LIST_ENTRY ListHead,
749 
752 FASTCALL
754  _Inout_ PSINGLE_LIST_ENTRY ListHead,
757 
760 FASTCALL
762  _Inout_ PLIST_ENTRY ListHead,
764 
767 BOOLEAN
768 NTAPI
770  _In_ ULONG ProcessorFeature);
771 
774 BOOLEAN
775 NTAPI
777  _In_ PERESOURCE Resource);
778 
781 ULONG
782 NTAPI
784  _In_ PERESOURCE Resource);
785 
786 #define ExIsResourceAcquiredLite ExIsResourceAcquiredSharedLite
787 
789 VOID
790 NTAPI
792  _In_ PLARGE_INTEGER LocalTime,
793  _Out_ PLARGE_INTEGER SystemTime);
794 
797 VOID
798 NTAPI
800  _In_ PCALLBACK_OBJECT CallbackObject,
803 
806 VOID
807 NTAPI
811 
815 VOID
816 NTAPI
819 
822 PVOID
823 NTAPI
825  _Inout_ PCALLBACK_OBJECT CallbackObject,
828 
831 NTSTATUS
832 NTAPI
834  _Inout_ PERESOURCE Resource);
835 
837 _Requires_lock_held_(_Global_critical_region_)
839 VOID
840 NTAPI
843  PERESOURCE Resource,
845 
846 _Requires_lock_held_(_Global_critical_region_)
847 _Requires_lock_held_(*Resource)
848 _Releases_lock_(*Resource)
851 VOID
852 FASTCALL
854  _Inout_ PERESOURCE Resource);
855 
858 VOID
859 NTAPI
861  _Inout_ PERESOURCE Resource,
863 
866 ULONG
867 NTAPI
869  _In_ ULONG DesiredTime,
871 
873 VOID
874 NTAPI
876  _In_ PLARGE_INTEGER SystemTime,
877  _Out_ PLARGE_INTEGER LocalTime);
878 
881 VOID
882 NTAPI
884  _Inout_ PVOID CbRegistration);
885 
887 $if (_NTDDK_)
889 NTSTATUS
890 NTAPI
892  _Inout_ PZONE_HEADER Zone,
895 
897 NTSTATUS
898 NTAPI
900  _Out_ PZONE_HEADER Zone,
901  _In_ ULONG BlockSize,
902  _Inout_ PVOID InitialSegment,
903  _In_ ULONG InitialSegmentSize);
904 
907 NTSTATUS
908 NTAPI
910  _Inout_ PZONE_HEADER Zone,
911  _Inout_ PVOID Segment,
912  _In_ ULONG SegmentSize,
914 
917 NTSTATUS
918 NTAPI
920  _Out_ UUID *Uuid);
921 
925 VOID
926 NTAPI
928 
932 VOID
933 NTAPI
935 
936 $endif (_NTDDK_)
937 $if (_NTIFS_)
938 
941 SIZE_T
942 NTAPI
944  _In_ PVOID PoolBlock,
946 
948 VOID
949 ExAdjustLookasideDepth(VOID);
950 
953 VOID
954 NTAPI
956  _In_ PERESOURCE Resource);
957 $endif (_NTIFS_)
958 #endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */
959 
960 $if (_WDMDDK_ || _NTIFS_)
961 #if (NTDDI_VERSION >= NTDDI_WINXP)
963 $if (_WDMDDK_)
964 
966 _Post_satisfies_(return == 0 || return == 1)
968 BOOLEAN
969 FASTCALL
971  _Inout_ PEX_RUNDOWN_REF RunRef);
972 
974 VOID
975 FASTCALL
977  _Out_ PEX_RUNDOWN_REF RunRef);
978 
980 VOID
981 FASTCALL
983  _Inout_ PEX_RUNDOWN_REF RunRef);
984 
986 VOID
987 FASTCALL
989  _Inout_ PEX_RUNDOWN_REF RunRef);
990 
992 VOID
993 FASTCALL
995  _Out_ PEX_RUNDOWN_REF RunRef);
996 
998 BOOLEAN
999 NTAPI
1001  __drv_strictTypeMatch(__drv_typeExpr) _In_ SUITE_TYPE SuiteType);
1002 
1004 VOID
1005 FASTCALL
1007  _Inout_ PEX_RUNDOWN_REF RunRef);
1008 $endif (_WDMDDK_)
1009 $if (_NTIFS_)
1010 
1012 FASTCALL
1014  _Inout_ PSLIST_HEADER ListHead,
1017  _In_ ULONG Count);
1018 $endif (_NTIFS_)
1019 $if (_WDMDDK_ || _NTIFS_)
1020 #endif /* (NTDDI_VERSION >= NTDDI_WINXP) */
1021 $endif (_WDMDDK_ || _NTIFS_)
1022 
1023 $if (_WDMDDK_)
1024 #if (NTDDI_VERSION >= NTDDI_WINXPSP2)
1025 
1027 _Post_satisfies_(return == 0 || return == 1)
1029 BOOLEAN
1030 FASTCALL
1031 ExAcquireRundownProtectionEx(
1032  _Inout_ PEX_RUNDOWN_REF RunRef,
1033  _In_ ULONG Count);
1034 
1036 VOID
1037 FASTCALL
1039  _Inout_ PEX_RUNDOWN_REF RunRef,
1040  _In_ ULONG Count);
1041 
1042 #endif /* (NTDDI_VERSION >= NTDDI_WINXPSP2) */
1043 
1044 #if (NTDDI_VERSION >= NTDDI_WS03SP1)
1045 
1050 NTAPI
1052  __drv_strictTypeMatch(__drv_typeExpr) _In_ POOL_TYPE PoolType,
1054 
1057 SIZE_T
1058 NTAPI
1060 
1062 _Acquires_lock_(_Global_critical_region_)
1064 PVOID
1065 NTAPI
1068  PERESOURCE Resource);
1069 
1071 _Acquires_lock_(_Global_critical_region_)
1073 PVOID
1074 NTAPI
1077  PERESOURCE Resource);
1078 
1080 _Acquires_lock_(_Global_critical_region_)
1082 PVOID
1083 NTAPI
1086  PERESOURCE Resource);
1087 
1089 _Releases_lock_(_Global_critical_region_)
1091 VOID
1092 FASTCALL
1094  _Inout_ _Requires_lock_held_(*_Curr_) _Releases_lock_(*_Curr_)
1095  PERESOURCE Resource);
1096 
1099 VOID
1100 NTAPI
1102  _Out_ PEX_RUNDOWN_REF_CACHE_AWARE RunRefCacheAware,
1104 
1107 VOID
1108 NTAPI
1110  _Inout_ PEX_RUNDOWN_REF_CACHE_AWARE RunRefCacheAware);
1111 
1113 _Post_satisfies_(return == 0 || return == 1)
1115 BOOLEAN
1116 FASTCALL
1117 ExAcquireRundownProtectionCacheAware(
1118  _Inout_ PEX_RUNDOWN_REF_CACHE_AWARE RunRefCacheAware);
1119 
1121 VOID
1122 FASTCALL
1124  _Inout_ PEX_RUNDOWN_REF_CACHE_AWARE RunRefCacheAware);
1125 
1127 _Post_satisfies_(return == 0 || return == 1)
1129 BOOLEAN
1130 FASTCALL
1131 ExAcquireRundownProtectionCacheAwareEx(
1132  _Inout_ PEX_RUNDOWN_REF_CACHE_AWARE RunRefCacheAware,
1133  _In_ ULONG Count);
1134 
1136 VOID
1137 FASTCALL
1140  _In_ ULONG Count);
1141 
1143 VOID
1144 FASTCALL
1147 
1149 VOID
1150 FASTCALL
1152  _Inout_ PEX_RUNDOWN_REF_CACHE_AWARE RunRefCacheAware);
1153 
1155 VOID
1156 FASTCALL
1158  _Inout_ PEX_RUNDOWN_REF_CACHE_AWARE RunRefCacheAware);
1159 
1160 #endif /* (NTDDI_VERSION >= NTDDI_WS03SP1) */
1161 
1162 #if (NTDDI_VERSION >= NTDDI_VISTA)
1163 
1166 NTSTATUS
1167 NTAPI
1168 ExInitializeLookasideListEx(
1169  _Out_ PLOOKASIDE_LIST_EX Lookaside,
1170  _In_opt_ PALLOCATE_FUNCTION_EX Allocate,
1171  _In_opt_ PFREE_FUNCTION_EX Free,
1172  _In_ POOL_TYPE PoolType,
1173  _In_ ULONG Flags,
1174  _In_ SIZE_T Size,
1175  _In_ ULONG Tag,
1176  _In_ USHORT Depth);
1177 
1180 VOID
1181 NTAPI
1182 ExDeleteLookasideListEx(
1183  _Inout_ PLOOKASIDE_LIST_EX Lookaside);
1184 
1187 VOID
1188 NTAPI
1189 ExFlushLookasideListEx(
1190  _Inout_ PLOOKASIDE_LIST_EX Lookaside);
1191 
1192 #ifdef _MSC_VER
1193 #pragma warning(push)
1194 #pragma warning(disable:__WARNING_MEMORY_NOT_ACQUIRED)
1195 #endif
1196 
1201 PVOID
1202 ExAllocateFromLookasideListEx(
1203  _Inout_ PLOOKASIDE_LIST_EX Lookaside)
1204 {
1205  PVOID Entry;
1206 
1207  Lookaside->L.TotalAllocates += 1;
1208 #ifdef NONAMELESSUNION
1209  Entry = InterlockedPopEntrySList(&Lookaside->L.u.ListHead);
1210  if (Entry == NULL) {
1211  Lookaside->L.u2.AllocateMisses += 1;
1212  Entry = (Lookaside->L.u4.AllocateEx)(Lookaside->L.Type,
1213  Lookaside->L.Size,
1214  Lookaside->L.Tag,
1215  Lookaside);
1216  }
1217 #else /* NONAMELESSUNION */
1218  Entry = InterlockedPopEntrySList(&Lookaside->L.ListHead);
1219  if (Entry == NULL) {
1220  Lookaside->L.AllocateMisses += 1;
1221  Entry = (Lookaside->L.AllocateEx)(Lookaside->L.Type,
1222  Lookaside->L.Size,
1223  Lookaside->L.Tag,
1224  Lookaside);
1225  }
1226 #endif /* NONAMELESSUNION */
1227  return Entry;
1228 }
1229 
1230 #ifdef _MSC_VER
1231 #pragma warning(pop)
1232 #endif
1233 
1236 VOID
1237 ExFreeToLookasideListEx(
1238  _Inout_ PLOOKASIDE_LIST_EX Lookaside,
1239  _In_ __drv_freesMem(Entry) PVOID Entry)
1240 {
1241  Lookaside->L.TotalFrees += 1;
1242  if (ExQueryDepthSList(&Lookaside->L.ListHead) >= Lookaside->L.Depth) {
1243  Lookaside->L.FreeMisses += 1;
1244  (Lookaside->L.FreeEx)(Entry, Lookaside);
1245  } else {
1246  InterlockedPushEntrySList(&Lookaside->L.ListHead, (PSLIST_ENTRY)Entry);
1247  }
1248  return;
1249 }
1250 
1251 #endif /* (NTDDI_VERSION >= NTDDI_VISTA) */
1252 
1253 #if (NTDDI_VERSION >= NTDDI_WIN7)
1254 
1257 VOID
1258 NTAPI
1259 ExSetResourceOwnerPointerEx(
1260  _Inout_ PERESOURCE Resource,
1261  _In_ PVOID OwnerPointer,
1262  _In_ ULONG Flags);
1263 
1264 #define FLAG_OWNER_POINTER_IS_THREAD 0x1
1265 
1266 #endif /* (NTDDI_VERSION >= NTDDI_WIN7) */
1267 
1268 __drv_allocatesMem(Mem)
1271 _Post_writable_byte_size_(Lookaside->L.Size)
1272 static __inline
1273 PVOID
1274 ExAllocateFromNPagedLookasideList(
1275  _Inout_ PNPAGED_LOOKASIDE_LIST Lookaside)
1276 {
1277  PVOID Entry;
1278 
1279  Lookaside->L.TotalAllocates++;
1280 #ifdef NONAMELESSUNION
1281 #if defined(_WIN2K_COMPAT_SLIST_USAGE) && defined(_X86_)
1282  Entry = ExInterlockedPopEntrySList(&Lookaside->L.u.ListHead,
1283  &Lookaside->Lock__ObsoleteButDoNotDelete);
1284 #else
1285  Entry = InterlockedPopEntrySList(&Lookaside->L.u.ListHead);
1286 #endif
1287  if (Entry == NULL) {
1288  Lookaside->L.u2.AllocateMisses++;
1289  Entry = (Lookaside->L.u4.Allocate)(Lookaside->L.Type,
1290  Lookaside->L.Size,
1291  Lookaside->L.Tag);
1292  }
1293 #else /* NONAMELESSUNION */
1294 #if defined(_WIN2K_COMPAT_SLIST_USAGE) && defined(_X86_)
1295  Entry = ExInterlockedPopEntrySList(&Lookaside->L.ListHead,
1296  &Lookaside->Lock__ObsoleteButDoNotDelete);
1297 #else
1298  Entry = InterlockedPopEntrySList(&Lookaside->L.ListHead);
1299 #endif
1300  if (Entry == NULL) {
1301  Lookaside->L.AllocateMisses++;
1302  Entry = (Lookaside->L.Allocate)(Lookaside->L.Type,
1303  Lookaside->L.Size,
1304  Lookaside->L.Tag);
1305  }
1306 #endif /* NONAMELESSUNION */
1307  return Entry;
1308 }
1309 
1311 static __inline
1312 VOID
1313 ExFreeToNPagedLookasideList(
1314  _Inout_ PNPAGED_LOOKASIDE_LIST Lookaside,
1316 {
1317  Lookaside->L.TotalFrees++;
1318 #ifdef NONAMELESSUNION
1319  if (ExQueryDepthSList(&Lookaside->L.u.ListHead) >= Lookaside->L.Depth) {
1320  Lookaside->L.u3.FreeMisses++;
1321  (Lookaside->L.u5.Free)(Entry);
1322  } else {
1323 #if defined(_WIN2K_COMPAT_SLIST_USAGE) && defined(_X86_)
1324  ExInterlockedPushEntrySList(&Lookaside->L.u.ListHead,
1325  (PSLIST_ENTRY)Entry,
1326  &Lookaside->Lock__ObsoleteButDoNotDelete);
1327 #else
1328  InterlockedPushEntrySList(&Lookaside->L.u.ListHead, (PSLIST_ENTRY)Entry);
1329 #endif
1330  }
1331 #else /* NONAMELESSUNION */
1332  if (ExQueryDepthSList(&Lookaside->L.ListHead) >= Lookaside->L.Depth) {
1333  Lookaside->L.FreeMisses++;
1334  (Lookaside->L.Free)(Entry);
1335  } else {
1336 #if defined(_WIN2K_COMPAT_SLIST_USAGE) && defined(_X86_)
1337  ExInterlockedPushEntrySList(&Lookaside->L.ListHead,
1338  (PSLIST_ENTRY)Entry,
1339  &Lookaside->Lock__ObsoleteButDoNotDelete);
1340 #else
1341  InterlockedPushEntrySList(&Lookaside->L.ListHead, (PSLIST_ENTRY)Entry);
1342 #endif
1343  }
1344 #endif /* NONAMELESSUNION */
1345 }
1346 
1347 $endif (_WDMDDK_)
enum _INTERLOCKED_RESULT INTERLOCKED_RESULT
DWORD *typedef PVOID
Definition: winlogon.h:52
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
#define _Post_maybenull_
Definition: no_sal2.h:458
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:656
#define _Must_inspect_result_
Definition: no_sal2.h:314
NTKERNELAPI VOID NTAPI ExSystemTimeToLocalTime(_In_ PLARGE_INTEGER SystemTime, _Out_ PLARGE_INTEGER LocalTime)
_IRQL_requires_(APC_LEVEL) _IRQL_restores_global_(OldIrql
#define _Requires_lock_not_held_(lock)
Definition: no_sal2.h:705
VOID NTAPI ExQueueWorkItem(IN PWORK_QUEUE_ITEM WorkItem, IN WORK_QUEUE_TYPE QueueType)
Definition: work.c:716
_IRQL_requires_max_(PASSIVE_LEVEL) NTSYSCALLAPI NTSTATUS NTAPI NtCreateEvent(_Out_ PHANDLE EventHandle
Definition: event.c:401
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:274
NTKERNELAPI PSLIST_ENTRY ExpInterlockedPopEntrySList(_Inout_ PSLIST_HEADER SListHead)
NTSTATUS NTAPI ExReinitializeResourceLite(IN PERESOURCE Resource)
Definition: resource.c:1756
NTKERNELAPI VOID NTAPI ExDeleteNPagedLookasideList(_Inout_ PNPAGED_LOOKASIDE_LIST Lookaside)
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:288
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY ListEnd
Definition: exfuncs.h:1015
Definition: ntbasedef.h:627
#define _Interlocked_operand_
Definition: no_sal2.h:309
#define ExInterlockedFlushSList(SListHead)
Definition: exfuncs.h:169
Definition: bidi.c:75
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
Definition: mapping.c:279
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:1103
_In_ PVOID OwnerPointer
Definition: exfuncs.h:862
_In_ PCALLBACK_FUNCTION _In_opt_ PVOID CallbackContext
Definition: exfuncs.h:826
_Must_inspect_result_ _In_ ULONG PoolTag
Definition: exfuncs.h:1053
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)
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
BOOLEAN FASTCALL ExiTryToAcquireFastMutex(PFAST_MUTEX FastMutex)
Definition: fmutex.c:77
_In_ KPRIORITY Priority
Definition: kefuncs.h:516
#define ExAcquireRundownProtection
Definition: ex.h:120
#define _NTIFS_
Definition: ifssupp.h:20
#define _Outptr_
Definition: no_sal2.h:396
#define ExRaiseStatus
Definition: ntoskrnl.h:94
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
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
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
#define _WDMDDK_
Definition: wdm.template.h:26
#define _Post_notnull_
Definition: no_sal2.h:460
KPROCESSOR_MODE NTAPI ExGetPreviousMode(VOID)
Definition: sysinfo.c:2603
KSPIN_LOCK * PKSPIN_LOCK
Definition: env_spec_w32.h:73
_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
NTKERNELAPI PLIST_ENTRY FASTCALL ExInterlockedInsertTailList(_Inout_ PLIST_ENTRY ListHead, _Inout_ __drv_aliasesMem PLIST_ENTRY ListEntry, _Inout_ _Requires_lock_not_held_(*_Curr_) PKSPIN_LOCK Lock)
VOID NTAPI ExInitializeRundownProtectionCacheAware(IN PEX_RUNDOWN_REF_CACHE_AWARE RunRefCacheAware, IN SIZE_T Count)
Definition: rundown.c:493
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:168
_In_ PCALLBACK_FUNCTION CallbackFunction
Definition: exfuncs.h:826
_In_opt_ PALLOCATE_FUNCTION Allocate
Definition: exfuncs.h:656
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:213
#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:656
VOID NTAPI ExFreeCacheAwareRundownProtection(IN PEX_RUNDOWN_REF_CACHE_AWARE RunRefCacheAware)
Definition: rundown.c:482
struct LOOKASIDE_ALIGN _NPAGED_LOOKASIDE_LIST * PNPAGED_LOOKASIDE_LIST
_In_ BOOLEAN Create
Definition: pstypes.h:512
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)
#define _Post_writable_byte_size_(size)
Definition: no_sal2.h:467
BOOLEAN NTAPI ExAcquireResourceExclusiveLite(IN PERESOURCE Resource, IN BOOLEAN Wait)
Definition: resource.c:770
_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
__GNU_EXTENSION typedef __int64 * PLONGLONG
Definition: ntbasedef.h:381
#define _Acquires_shared_lock_(lock)
Definition: no_sal2.h:679
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
#define _Acquires_lock_(lock)
Definition: no_sal2.h:677
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 __drv_aliasesMem
Definition: driverspecs.h:238
long LONG
Definition: pedump.c:60
enum _EX_POOL_PRIORITY EX_POOL_PRIORITY
_Acquires_shared_lock_ _Curr_ PERESOURCE Resource
Definition: exfuncs.h:440
_In_ POBJECT_ATTRIBUTES _In_ BOOLEAN _In_ BOOLEAN AllowMultipleCallbacks
Definition: exfuncs.h:590
smooth NULL
Definition: ftsmooth.c:464
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
#define FORCEINLINE
Definition: ntbasedef.h:213
#define _Out_
Definition: no_sal2.h:323
VOID NTAPI ExDeletePagedLookasideList(IN PPAGED_LOOKASIDE_LIST Lookaside)
Definition: lookas.c:198
#define NTKERNELAPI
#define ExInitializePushLock
Definition: ex.h:943
NTKERNELAPI VOID FASTCALL ExWaitForRundownProtectionReleaseCacheAware(IN OUT PEX_RUNDOWN_REF_CACHE_AWARE RunRef)
NTKERNELAPI NTSTATUS ExUuidCreate(OUT UUID *Uuid)
Definition: uuid.c:303
NTKERNELAPI VOID FASTCALL ExWaitForRundownProtectionRelease(_Inout_ PEX_RUNDOWN_REF RunRef)
return(0)
int __cdecl system(_In_opt_z_ const char *_Command)
_In_ __drv_freesMem(Entry) PVOID Entry)
Definition: exfuncs.h:1239
_Inout_ PVOID Segment
Definition: exfuncs.h:893
_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
UINTN Size
Definition: acefiex.h:550
int64_t LONGLONG
Definition: typedefs.h:67
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
unsigned char BOOLEAN
NTKERNELAPI VOID FASTCALL ExReInitializeRundownProtection(_Inout_ PEX_RUNDOWN_REF RunRef)
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:222
_Inout_ PVOID Lookaside
Definition: fltkernel.h:2532
_Out_ PBOOLEAN QuotaCharged
Definition: exfuncs.h:945
_INTERLOCKED_RESULT
Definition: exfuncs.h:358
INT POOL_TYPE
Definition: typedefs.h:77
VOID FASTCALL ExAcquireFastMutexUnsafe(IN OUT PFAST_MUTEX FastMutex)
Definition: fmutex.c:75
SIZE_T NTAPI ExSizeOfRundownProtectionCacheAware(VOID)
Definition: rundown.c:506
#define _Ret_maybenull_
Definition: no_sal2.h:590
FORCEINLINE VOID ExInitializeFastMutex(_Out_ PFAST_MUTEX FastMutex)
Definition: exfuncs.h:274
#define FM_LOCK_BIT
Definition: iotypes.h:1377
NTKERNELAPI PLIST_ENTRY FASTCALL ExInterlockedRemoveHeadList(_Inout_ PLIST_ENTRY ListHead, _Inout_ _Requires_lock_not_held_(*_Curr_) PKSPIN_LOCK Lock)
_In_ PUNICODE_STRING _Inout_ PUNICODE_STRING Destination
Definition: rtlfuncs.h:2875
#define PSLIST_ENTRY
Definition: rtltypes.h:130
FORCEINLINE USHORT ExQueryDepthSList(_In_ PSLIST_HEADER SListHead)
Definition: exfuncs.h:153
#define _Inout_
Definition: no_sal2.h:244
VOID FASTCALL ExReleaseResourceLite(IN PERESOURCE Resource)
Definition: resource.c:1817
CCHAR KPROCESSOR_MODE
Definition: ketypes.h:7
_Must_inspect_result_ typedef _In_ ULONG _In_ BOOLEAN Target
Definition: iotypes.h:1067
NTKERNELAPI ULONG FASTCALL ExInterlockedAddUlong(_Inout_ PULONG Addend, _In_ ULONG Increment, _Inout_ _Requires_lock_not_held_(*_Curr_) PKSPIN_LOCK Lock)
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:844
VOID NTAPI ExRaiseAccessViolation(VOID)
Definition: harderr.c:284
enum _WORK_QUEUE_TYPE WORK_QUEUE_TYPE
char * PBOOLEAN
Definition: retypes.h:11
static __inline PVOID ExFreeToZone(IN PZONE_HEADER Zone, IN PVOID Block)
Definition: exfuncs.h:297
VOID NTAPI ExRaiseDatatypeMisalignment(VOID)
Definition: harderr.c:306
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
#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
_In_ ACCESS_MASK _In_opt_ POBJECT_ATTRIBUTES ObjectAttributes
Definition: exfuncs.h:165
_Inout_ PVOID _In_ ULONG SegmentSize
Definition: exfuncs.h:893
Definition: typedefs.h:118
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:468
_Inout_ __drv_aliasesMem PSLIST_ENTRY List
Definition: exfuncs.h:1015
NTKERNELAPI PSLIST_ENTRY FASTCALL InterlockedPushEntrySList(IN PSLIST_HEADER ListHead, IN PSLIST_ENTRY ListEntry)
Definition: interlocked.c:82
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:496
#define RESULT_POSITIVE
Definition: exfuncs.h:355
PVOID NTAPI ExAllocatePoolWithQuota(IN POOL_TYPE PoolType, IN SIZE_T NumberOfBytes)
Definition: expool.c:2573
UINTN UINT8 Value
Definition: acefiex.h:725
Status
Definition: gdiplustypes.h:24
#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:204
BOOLEAN NTAPI ExAcquireSharedStarveExclusive(IN PERESOURCE Resource, IN BOOLEAN Wait)
Definition: resource.c:1063
ULONG_PTR SIZE_T
Definition: typedefs.h:79
#define _IRQL_restores_global_(kind, param)
Definition: no_sal2.h:654
struct _SINGLE_LIST_ENTRY * PSINGLE_LIST_ENTRY
* PFAST_MUTEX
Definition: extypes.h:17
_In_ BOOLEAN SetResolution
Definition: exfuncs.h:870
LONG NTSTATUS
Definition: DriverTester.h:11
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
#define _IRQL_saves_global_(kind, param)
Definition: no_sal2.h:656
_In_opt_ PVOID _In_opt_ PVOID Argument2
Definition: exfuncs.h:801
SIZE_T NTAPI ExQueryPoolBlockSize(IN PVOID PoolBlock, OUT PBOOLEAN QuotaCharged)
Definition: expool.c:2557
_Inout_ PVOID _In_ ULONG _Inout_ _Requires_lock_not_held_ _Curr_ PKSPIN_LOCK Lock
Definition: exfuncs.h:913
PVOID NTAPI ExAllocatePoolWithTagPriority(IN POOL_TYPE PoolType, IN SIZE_T NumberOfBytes, IN ULONG Tag, IN EX_POOL_PRIORITY Priority)
Definition: expool.c:2587
unsigned int * PULONG
Definition: retypes.h:1
NTKERNELAPI LARGE_INTEGER NTAPI ExInterlockedAddLargeInteger(_Inout_ PLARGE_INTEGER Addend, _In_ LARGE_INTEGER Increment, _Inout_ _Requires_lock_not_held_(*_Curr_) PKSPIN_LOCK Lock)
__drv_reportError("Must succeed pool allocations are forbidden. ""Allocation failures cause a system crash")) _When_((PoolType &(NonPagedPoolMustSucceed|POOL_RAISE_IF_ALLOCATION_FAILURE))
NTKERNELAPI PSLIST_ENTRY ExpInterlockedPushEntrySList(_Inout_ PSLIST_HEADER SListHead, _Inout_ __drv_aliasesMem PSLIST_ENTRY SListEntry)
_In_ BOOLEAN Wait
Definition: cctypes.h:23
enum _SUITE_TYPE SUITE_TYPE
BOOLEAN NTAPI ExAcquireResourceSharedLite(IN PERESOURCE Resource, IN BOOLEAN Wait)
Definition: resource.c:885
#define _Acquires_exclusive_lock_(lock)
Definition: no_sal2.h:676
$if(_WDMDDK_) _IRQL_raises_(APC_LEVEL) _IRQL_saves_global_(OldIrql
Definition: ke.h:1
IN ULONG IN ULONG Tag
Definition: evtlib.h:153
NTKERNELAPI NTSTATUS NTAPI ExInitializeZone(_Out_ PZONE_HEADER Zone, _In_ ULONG BlockSize, _Inout_ PVOID InitialSegment, _In_ ULONG InitialSegmentSize)
__drv_preferredFunction("ExAllocatePoolWithTag","No tag interferes with debugging.") __drv_allocatesMem(Mem) _When_((PoolType &PagedPool)!=0
#define _Releases_lock_(lock)
Definition: no_sal2.h:699
#define _Literal_
Definition: no_sal2.h:310
PVOID NTAPI ExRegisterCallback(IN PCALLBACK_OBJECT CallbackObject, IN PCALLBACK_FUNCTION CallbackFunction, IN PVOID CallbackContext)
Definition: callback.c:556
#define OUT
Definition: typedefs.h:40
#define FALSE
Definition: numbers.c:16
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
__drv_allocatesMem(Mem) _When_((PoolType &PagedPool)!=0
Definition: exfuncs.h:1197
#define _IRQL_raises_(irql)
Definition: no_sal2.h:648
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:1097
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
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
#define _Function_class_(x)
Definition: no_sal2.h:202
_In_opt_ PVOID Argument1
Definition: exfuncs.h:801
#define _Inout_opt_
Definition: no_sal2.h:258
#define P(a, b, c, d, e, x)
_Post_maybenull_ _Must_inspect_result_ _In_ SIZE_T _In_ ULONG _In_ __drv_strictTypeMatch(__drv_typeExpr) EX_POOL_PRIORITY Priority)