2010-03-13 00:34:48 +00:00
|
|
|
/******************************************************************************
|
|
|
|
* Executive Functions *
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
$if (_WDMDDK_)
|
|
|
|
#define ExInterlockedIncrementLong(Addend,Lock) Exfi386InterlockedIncrementLong(Addend)
|
|
|
|
#define ExInterlockedDecrementLong(Addend,Lock) Exfi386InterlockedDecrementLong(Addend)
|
|
|
|
#define ExInterlockedExchangeUlong(Target, Value, Lock) Exfi386InterlockedExchangeUlong(Target, Value)
|
|
|
|
|
|
|
|
#define ExAcquireSpinLock(Lock, OldIrql) KeAcquireSpinLock((Lock), (OldIrql))
|
|
|
|
#define ExReleaseSpinLock(Lock, OldIrql) KeReleaseSpinLock((Lock), (OldIrql))
|
|
|
|
#define ExAcquireSpinLockAtDpcLevel(Lock) KeAcquireSpinLockAtDpcLevel(Lock)
|
|
|
|
#define ExReleaseSpinLockFromDpcLevel(Lock) KeReleaseSpinLockFromDpcLevel(Lock)
|
|
|
|
|
|
|
|
#define ExInitializeSListHead InitializeSListHead
|
|
|
|
|
|
|
|
#if defined(_X86_)
|
|
|
|
#if defined(_NTHAL_)
|
|
|
|
#define ExAcquireFastMutex ExiAcquireFastMutex
|
|
|
|
#define ExReleaseFastMutex ExiReleaseFastMutex
|
|
|
|
#define ExTryToAcquireFastMutex ExiTryToAcquireFastMutex
|
|
|
|
#endif
|
|
|
|
#define ExInterlockedAddUlong ExfInterlockedAddUlong
|
|
|
|
#define ExInterlockedInsertHeadList ExfInterlockedInsertHeadList
|
|
|
|
#define ExInterlockedInsertTailList ExfInterlockedInsertTailList
|
|
|
|
#define ExInterlockedRemoveHeadList ExfInterlockedRemoveHeadList
|
|
|
|
#define ExInterlockedPopEntryList ExfInterlockedPopEntryList
|
|
|
|
#define ExInterlockedPushEntryList ExfInterlockedPushEntryList
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(_WIN64)
|
|
|
|
|
|
|
|
#if defined(_NTDRIVER_) || defined(_NTDDK_) || defined(_NTIFS_) || \
|
|
|
|
defined(_NTHAL_) || defined(_NTOSP_)
|
|
|
|
NTKERNELAPI
|
|
|
|
USHORT
|
|
|
|
ExQueryDepthSList(IN PSLIST_HEADER ListHead);
|
|
|
|
#else
|
|
|
|
FORCEINLINE
|
|
|
|
USHORT
|
|
|
|
ExQueryDepthSList(IN PSLIST_HEADER ListHead)
|
|
|
|
{
|
2010-03-18 22:45:30 +00:00
|
|
|
return (USHORT)(ListHead->Alignment & 0xffff);
|
2010-03-13 00:34:48 +00:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
PSLIST_ENTRY
|
|
|
|
ExpInterlockedFlushSList(
|
2010-03-18 22:45:30 +00:00
|
|
|
PSLIST_HEADER ListHead);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
PSLIST_ENTRY
|
|
|
|
ExpInterlockedPopEntrySList(
|
2010-03-18 22:45:30 +00:00
|
|
|
PSLIST_HEADER ListHead);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
PSLIST_ENTRY
|
|
|
|
ExpInterlockedPushEntrySList(
|
2010-03-18 22:45:30 +00:00
|
|
|
PSLIST_HEADER ListHead,
|
|
|
|
PSLIST_ENTRY ListEntry);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
#define ExInterlockedFlushSList(Head) \
|
|
|
|
ExpInterlockedFlushSList(Head)
|
|
|
|
#define ExInterlockedPopEntrySList(Head, Lock) \
|
|
|
|
ExpInterlockedPopEntrySList(Head)
|
|
|
|
#define ExInterlockedPushEntrySList(Head, Entry, Lock) \
|
|
|
|
ExpInterlockedPushEntrySList(Head, Entry)
|
|
|
|
|
2010-03-18 22:45:30 +00:00
|
|
|
#else /* !defined(_WIN64) */
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
#define ExQueryDepthSList(listhead) (listhead)->Depth
|
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
PSINGLE_LIST_ENTRY
|
|
|
|
FASTCALL
|
|
|
|
ExInterlockedFlushSList(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN PSLIST_HEADER ListHead);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
#if defined(_WIN2K_COMPAT_SLIST_USAGE) && defined(_X86_)
|
|
|
|
NTKERNELAPI
|
|
|
|
PSINGLE_LIST_ENTRY
|
|
|
|
FASTCALL
|
|
|
|
ExInterlockedPopEntrySList(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN PSLIST_HEADER ListHead,
|
|
|
|
IN PKSPIN_LOCK Lock);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
PSINGLE_LIST_ENTRY
|
|
|
|
FASTCALL
|
|
|
|
ExInterlockedPushEntrySList(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN PSLIST_HEADER ListHead,
|
|
|
|
IN PSINGLE_LIST_ENTRY ListEntry,
|
|
|
|
IN PKSPIN_LOCK Lock);
|
2010-03-13 00:34:48 +00:00
|
|
|
#else
|
|
|
|
#define ExInterlockedPopEntrySList(_ListHead, _Lock) \
|
|
|
|
InterlockedPopEntrySList(_ListHead)
|
|
|
|
#define ExInterlockedPushEntrySList(_ListHead, _ListEntry, _Lock) \
|
|
|
|
InterlockedPushEntrySList(_ListHead, _ListEntry)
|
2010-03-18 22:45:30 +00:00
|
|
|
#endif /* _WIN2K_COMPAT_SLIST_USAGE */
|
2010-03-13 00:34:48 +00:00
|
|
|
|
2010-03-18 22:45:30 +00:00
|
|
|
#endif /* !defined(_WIN64) */
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
/* ERESOURCE_THREAD
|
|
|
|
* ExGetCurrentResourceThread(
|
|
|
|
* VOID);
|
|
|
|
*/
|
|
|
|
#define ExGetCurrentResourceThread() ((ERESOURCE_THREAD)PsGetCurrentThread())
|
|
|
|
|
|
|
|
#define ExReleaseResource(R) (ExReleaseResourceLite(R))
|
|
|
|
|
|
|
|
/* VOID
|
|
|
|
* ExInitializeWorkItem(
|
|
|
|
* IN PWORK_QUEUE_ITEM Item,
|
|
|
|
* IN PWORKER_THREAD_ROUTINE Routine,
|
|
|
|
* IN PVOID Context)
|
|
|
|
*/
|
|
|
|
#define ExInitializeWorkItem(Item, Routine, Context) \
|
|
|
|
{ \
|
|
|
|
(Item)->WorkerRoutine = Routine; \
|
|
|
|
(Item)->Parameter = Context; \
|
|
|
|
(Item)->List.Flink = NULL; \
|
|
|
|
}
|
|
|
|
|
|
|
|
FORCEINLINE
|
|
|
|
VOID
|
|
|
|
ExInitializeFastMutex(
|
|
|
|
OUT PFAST_MUTEX FastMutex)
|
|
|
|
{
|
|
|
|
FastMutex->Count = FM_LOCK_BIT;
|
|
|
|
FastMutex->Owner = NULL;
|
|
|
|
FastMutex->Contention = 0;
|
|
|
|
KeInitializeEvent(&FastMutex->Event, SynchronizationEvent, FALSE);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
#if (NTDDI_VERSION >= NTDDI_WIN2K)
|
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
VOID
|
|
|
|
FASTCALL
|
|
|
|
ExAcquireFastMutex(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN OUT PFAST_MUTEX FastMutex);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
VOID
|
|
|
|
FASTCALL
|
|
|
|
ExReleaseFastMutex(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN OUT PFAST_MUTEX FastMutex);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
BOOLEAN
|
|
|
|
FASTCALL
|
|
|
|
ExTryToAcquireFastMutex(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN OUT PFAST_MUTEX FastMutex);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
VOID
|
|
|
|
FASTCALL
|
|
|
|
ExAcquireFastMutexUnsafe(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN OUT PFAST_MUTEX FastMutex);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
VOID
|
|
|
|
FASTCALL
|
|
|
|
ExReleaseFastMutexUnsafe(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN OUT PFAST_MUTEX FastMutex);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
ExAcquireResourceExclusiveLite(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN PERESOURCE Resource,
|
|
|
|
IN BOOLEAN Wait);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
ExAcquireResourceSharedLite(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN PERESOURCE Resource,
|
|
|
|
IN BOOLEAN Wait);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
ExAcquireSharedStarveExclusive(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN PERESOURCE Resource,
|
|
|
|
IN BOOLEAN Wait);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
ExAcquireSharedWaitForExclusive(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN PERESOURCE Resource,
|
|
|
|
IN BOOLEAN Wait);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
PVOID
|
|
|
|
NTAPI
|
|
|
|
ExAllocatePool(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN POOL_TYPE PoolType,
|
|
|
|
IN SIZE_T NumberOfBytes);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
#ifdef POOL_TAGGING
|
|
|
|
#define ExAllocatePool(p,n) ExAllocatePoolWithTag(p,n,' kdD')
|
|
|
|
#endif /* POOL_TAGGING */
|
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
PVOID
|
|
|
|
NTAPI
|
|
|
|
ExAllocatePoolWithQuota(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN POOL_TYPE PoolType,
|
|
|
|
IN SIZE_T NumberOfBytes);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
#ifdef POOL_TAGGING
|
|
|
|
#define ExAllocatePoolWithQuota(p,n) ExAllocatePoolWithQuotaTag(p,n,' kdD')
|
|
|
|
#endif /* POOL_TAGGING */
|
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
PVOID
|
|
|
|
NTAPI
|
|
|
|
ExAllocatePoolWithQuotaTag(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN POOL_TYPE PoolType,
|
|
|
|
IN SIZE_T NumberOfBytes,
|
|
|
|
IN ULONG Tag);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
#ifndef POOL_TAGGING
|
|
|
|
#define ExAllocatePoolWithQuotaTag(a,b,c) ExAllocatePoolWithQuota(a,b)
|
|
|
|
#endif /* POOL_TAGGING */
|
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
PVOID
|
|
|
|
NTAPI
|
|
|
|
ExAllocatePoolWithTag(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN POOL_TYPE PoolType,
|
|
|
|
IN SIZE_T NumberOfBytes,
|
|
|
|
IN ULONG Tag);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
PVOID
|
|
|
|
NTAPI
|
|
|
|
ExAllocatePoolWithTagPriority(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN POOL_TYPE PoolType,
|
|
|
|
IN SIZE_T NumberOfBytes,
|
|
|
|
IN ULONG Tag,
|
|
|
|
IN EX_POOL_PRIORITY Priority);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
ExConvertExclusiveToSharedLite(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN PERESOURCE Resource);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
ExCreateCallback(
|
2010-03-18 22:45:30 +00:00
|
|
|
OUT PCALLBACK_OBJECT *CallbackObject,
|
|
|
|
IN POBJECT_ATTRIBUTES ObjectAttributes,
|
|
|
|
IN BOOLEAN Create,
|
|
|
|
IN BOOLEAN AllowMultipleCallbacks);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
ExDeleteNPagedLookasideList(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN PNPAGED_LOOKASIDE_LIST Lookaside);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
ExDeletePagedLookasideList(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN PPAGED_LOOKASIDE_LIST Lookaside);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
ExDeleteResourceLite(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN PERESOURCE Resource);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
ExFreePool(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN PVOID P);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
#ifdef POOL_TAGGING
|
|
|
|
#define ExFreePool(P) ExFreePoolWithTag(P, 0)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
ExFreePoolWithTag(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN PVOID P,
|
|
|
|
IN ULONG Tag);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
ExGetExclusiveWaiterCount(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN PERESOURCE Resource);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
KPROCESSOR_MODE
|
|
|
|
NTAPI
|
2010-03-18 22:45:30 +00:00
|
|
|
ExGetPreviousMode(VOID);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
ExGetSharedWaiterCount(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN PERESOURCE Resource);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
ExInitializeNPagedLookasideList(
|
2010-03-18 22:45:30 +00:00
|
|
|
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);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
ExInitializePagedLookasideList(
|
2010-03-18 22:45:30 +00:00
|
|
|
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);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
ExInitializeResourceLite(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN PERESOURCE Resource);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
LARGE_INTEGER
|
|
|
|
NTAPI
|
|
|
|
ExInterlockedAddLargeInteger(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN PLARGE_INTEGER Addend,
|
|
|
|
IN LARGE_INTEGER Increment,
|
|
|
|
IN PKSPIN_LOCK Lock);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
#if defined(_WIN64)
|
|
|
|
#define ExInterlockedAddLargeStatistic(Addend, Increment) \
|
|
|
|
(VOID)InterlockedAdd64(&(Addend)->QuadPart, Increment)
|
|
|
|
#else
|
|
|
|
#define ExInterlockedAddLargeStatistic(Addend, Increment) \
|
|
|
|
_InterlockedAddLargeStatistic((PLONGLONG)&(Addend)->QuadPart, Increment)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
ULONG
|
|
|
|
FASTCALL
|
|
|
|
ExInterlockedAddUlong(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN PULONG Addend,
|
|
|
|
IN ULONG Increment,
|
|
|
|
PKSPIN_LOCK Lock);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
#if defined(_AMD64_) || defined(_IA64_)
|
2010-03-18 22:45:30 +00:00
|
|
|
|
2010-03-13 00:34:48 +00:00
|
|
|
#define ExInterlockedCompareExchange64(Destination, Exchange, Comperand, Lock) \
|
|
|
|
InterlockedCompareExchange64(Destination, *(Exchange), *(Comperand))
|
2010-03-18 22:45:30 +00:00
|
|
|
|
2010-03-13 00:34:48 +00:00
|
|
|
#elif defined(_X86_)
|
2010-03-18 22:45:30 +00:00
|
|
|
|
2010-03-13 00:34:48 +00:00
|
|
|
NTKERNELAPI
|
|
|
|
LONGLONG
|
|
|
|
FASTCALL
|
|
|
|
ExfInterlockedCompareExchange64(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN OUT LONGLONG volatile *Destination,
|
|
|
|
IN PLONGLONG Exchange,
|
|
|
|
IN PLONGLONG Comperand);
|
|
|
|
|
2010-03-13 00:34:48 +00:00
|
|
|
#define ExInterlockedCompareExchange64(Destination, Exchange, Comperand, Lock) \
|
|
|
|
ExfInterlockedCompareExchange64(Destination, Exchange, Comperand)
|
2010-03-18 22:45:30 +00:00
|
|
|
|
2010-03-13 00:34:48 +00:00
|
|
|
#else
|
2010-03-18 22:45:30 +00:00
|
|
|
|
2010-03-13 00:34:48 +00:00
|
|
|
NTKERNELAPI
|
|
|
|
LONGLONG
|
|
|
|
FASTCALL
|
|
|
|
ExInterlockedCompareExchange64(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN OUT LONGLONG volatile *Destination,
|
|
|
|
IN PLONGLONG Exchange,
|
|
|
|
IN PLONGLONG Comparand,
|
|
|
|
IN PKSPIN_LOCK Lock);
|
|
|
|
|
|
|
|
#endif /* defined(_AMD64_) || defined(_IA64_) */
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
PLIST_ENTRY
|
|
|
|
FASTCALL
|
|
|
|
ExInterlockedInsertHeadList(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN PLIST_ENTRY ListHead,
|
|
|
|
IN PLIST_ENTRY ListEntry,
|
|
|
|
IN PKSPIN_LOCK Lock);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
PLIST_ENTRY
|
|
|
|
FASTCALL
|
|
|
|
ExInterlockedInsertTailList(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN PLIST_ENTRY ListHead,
|
|
|
|
IN PLIST_ENTRY ListEntry,
|
|
|
|
IN PKSPIN_LOCK Lock);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
PSINGLE_LIST_ENTRY
|
|
|
|
FASTCALL
|
|
|
|
ExInterlockedPopEntryList(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN PSINGLE_LIST_ENTRY ListHead,
|
|
|
|
IN PKSPIN_LOCK Lock);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
PSINGLE_LIST_ENTRY
|
|
|
|
FASTCALL
|
|
|
|
ExInterlockedPushEntryList(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN PSINGLE_LIST_ENTRY ListHead,
|
|
|
|
IN PSINGLE_LIST_ENTRY ListEntry,
|
|
|
|
IN PKSPIN_LOCK Lock);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
PLIST_ENTRY
|
|
|
|
FASTCALL
|
|
|
|
ExInterlockedRemoveHeadList(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN PLIST_ENTRY ListHead,
|
|
|
|
IN PKSPIN_LOCK Lock);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
ExIsProcessorFeaturePresent(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN ULONG ProcessorFeature);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
ExIsResourceAcquiredExclusiveLite(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN PERESOURCE Resource);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
ExIsResourceAcquiredSharedLite(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN PERESOURCE Resource);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
#define ExIsResourceAcquiredLite ExIsResourceAcquiredSharedLite
|
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
ExLocalTimeToSystemTime(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN PLARGE_INTEGER LocalTime,
|
|
|
|
OUT PLARGE_INTEGER SystemTime);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
ExNotifyCallback(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN PCALLBACK_OBJECT CallbackObject,
|
|
|
|
IN PVOID Argument1,
|
|
|
|
IN PVOID Argument2);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
ExQueueWorkItem(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN PWORK_QUEUE_ITEM WorkItem,
|
|
|
|
IN WORK_QUEUE_TYPE QueueType);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
DECLSPEC_NORETURN
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
ExRaiseStatus(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN NTSTATUS Status);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
PVOID
|
|
|
|
NTAPI
|
|
|
|
ExRegisterCallback(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN PCALLBACK_OBJECT CallbackObject,
|
|
|
|
IN PCALLBACK_FUNCTION CallbackFunction,
|
|
|
|
IN PVOID CallbackContext);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
ExReinitializeResourceLite(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN PERESOURCE Resource);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
ExReleaseResourceForThreadLite(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN PERESOURCE Resource,
|
|
|
|
IN ERESOURCE_THREAD ResourceThreadId);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
VOID
|
|
|
|
FASTCALL
|
|
|
|
ExReleaseResourceLite(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN PERESOURCE Resource);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
ExSetResourceOwnerPointer(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN PERESOURCE Resource,
|
|
|
|
IN PVOID OwnerPointer);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
ExSetTimerResolution(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN ULONG DesiredTime,
|
|
|
|
IN BOOLEAN SetResolution);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
ExSystemTimeToLocalTime(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN PLARGE_INTEGER SystemTime,
|
|
|
|
OUT PLARGE_INTEGER LocalTime);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
ExUnregisterCallback(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN PVOID CbRegistration);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
2010-03-18 22:45:30 +00:00
|
|
|
#endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
#if (NTDDI_VERSION >= NTDDI_WINXP)
|
2010-03-18 22:45:30 +00:00
|
|
|
|
2010-03-13 00:34:48 +00:00
|
|
|
NTKERNELAPI
|
|
|
|
BOOLEAN
|
|
|
|
FASTCALL
|
|
|
|
ExAcquireRundownProtection(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN OUT PEX_RUNDOWN_REF RunRef);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
VOID
|
|
|
|
FASTCALL
|
|
|
|
ExInitializeRundownProtection(
|
2010-03-18 22:45:30 +00:00
|
|
|
OUT PEX_RUNDOWN_REF RunRef);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
VOID
|
|
|
|
FASTCALL
|
|
|
|
ExReInitializeRundownProtection(
|
2010-03-18 22:45:30 +00:00
|
|
|
OUT PEX_RUNDOWN_REF RunRef);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
VOID
|
|
|
|
FASTCALL
|
|
|
|
ExReleaseRundownProtection(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN OUT PEX_RUNDOWN_REF RunRef);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
VOID
|
|
|
|
FASTCALL
|
|
|
|
ExRundownCompleted(
|
2010-03-18 22:45:30 +00:00
|
|
|
OUT PEX_RUNDOWN_REF RunRef);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
ExVerifySuite(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN SUITE_TYPE SuiteType);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
VOID
|
|
|
|
FASTCALL
|
|
|
|
ExWaitForRundownProtectionRelease(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN OUT PEX_RUNDOWN_REF RunRef);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
2010-03-18 22:45:30 +00:00
|
|
|
#endif /* (NTDDI_VERSION >= NTDDI_WINXP) */
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
#if (NTDDI_VERSION >= NTDDI_WINXPSP2)
|
2010-03-18 22:45:30 +00:00
|
|
|
|
2010-03-13 00:34:48 +00:00
|
|
|
NTKERNELAPI
|
|
|
|
BOOLEAN
|
|
|
|
FASTCALL
|
|
|
|
ExAcquireRundownProtectionEx(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN OUT PEX_RUNDOWN_REF RunRef,
|
|
|
|
IN ULONG Count);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
VOID
|
|
|
|
FASTCALL
|
|
|
|
ExReleaseRundownProtectionEx(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN OUT PEX_RUNDOWN_REF RunRef,
|
|
|
|
IN ULONG Count);
|
|
|
|
|
|
|
|
#endif /* (NTDDI_VERSION >= NTDDI_WINXPSP2) */
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
#if (NTDDI_VERSION >= NTDDI_WS03SP1)
|
2010-03-18 22:45:30 +00:00
|
|
|
|
2010-03-13 00:34:48 +00:00
|
|
|
NTKERNELAPI
|
|
|
|
PEX_RUNDOWN_REF_CACHE_AWARE
|
|
|
|
NTAPI
|
|
|
|
ExAllocateCacheAwareRundownProtection(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN POOL_TYPE PoolType,
|
|
|
|
IN ULONG PoolTag);
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
SIZE_T
|
|
|
|
NTAPI
|
|
|
|
ExSizeOfRundownProtectionCacheAware(VOID);
|
2010-03-18 22:45:30 +00:00
|
|
|
|
|
|
|
#endif /* (NTDDI_VERSION >= NTDDI_WS03SP1) */
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
#if (NTDDI_VERSION >= NTDDI_VISTA)
|
|
|
|
NTKERNELAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
ExInitializeLookasideListEx(
|
2010-03-18 22:45:30 +00:00
|
|
|
OUT PLOOKASIDE_LIST_EX Lookaside,
|
|
|
|
IN PALLOCATE_FUNCTION_EX Allocate OPTIONAL,
|
|
|
|
IN PFREE_FUNCTION_EX Free OPTIONAL,
|
|
|
|
IN POOL_TYPE PoolType,
|
|
|
|
IN ULONG Flags,
|
|
|
|
IN SIZE_T Size,
|
|
|
|
IN ULONG Tag,
|
|
|
|
IN USHORT Depth);
|
2010-03-13 00:34:48 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !defined(MIDL_PASS)
|
|
|
|
|
|
|
|
static __inline PVOID
|
|
|
|
ExAllocateFromNPagedLookasideList(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN PNPAGED_LOOKASIDE_LIST Lookaside)
|
2010-03-13 00:34:48 +00:00
|
|
|
{
|
2010-03-18 22:45:30 +00:00
|
|
|
PVOID Entry;
|
|
|
|
|
|
|
|
Lookaside->L.TotalAllocates++;
|
|
|
|
Entry = InterlockedPopEntrySList(&Lookaside->L.ListHead);
|
|
|
|
if (Entry == NULL) {
|
|
|
|
Lookaside->L.AllocateMisses++;
|
|
|
|
Entry = (Lookaside->L.Allocate)(Lookaside->L.Type,
|
|
|
|
Lookaside->L.Size,
|
|
|
|
Lookaside->L.Tag);
|
|
|
|
}
|
|
|
|
return Entry;
|
2010-03-13 00:34:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static __inline PVOID
|
|
|
|
ExAllocateFromPagedLookasideList(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN PPAGED_LOOKASIDE_LIST Lookaside)
|
2010-03-13 00:34:48 +00:00
|
|
|
{
|
2010-03-18 22:45:30 +00:00
|
|
|
PVOID Entry;
|
|
|
|
|
|
|
|
Lookaside->L.TotalAllocates++;
|
|
|
|
Entry = InterlockedPopEntrySList(&Lookaside->L.ListHead);
|
|
|
|
if (Entry == NULL) {
|
|
|
|
Lookaside->L.AllocateMisses++;
|
|
|
|
Entry = (Lookaside->L.Allocate)(Lookaside->L.Type,
|
|
|
|
Lookaside->L.Size,
|
|
|
|
Lookaside->L.Tag);
|
|
|
|
}
|
|
|
|
return Entry;
|
2010-03-13 00:34:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static __inline VOID
|
|
|
|
ExFreeToNPagedLookasideList(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN PNPAGED_LOOKASIDE_LIST Lookaside,
|
|
|
|
IN PVOID Entry)
|
2010-03-13 00:34:48 +00:00
|
|
|
{
|
2010-03-18 22:45:30 +00:00
|
|
|
Lookaside->L.TotalFrees++;
|
|
|
|
if (ExQueryDepthSList(&Lookaside->L.ListHead) >= Lookaside->L.Depth) {
|
|
|
|
Lookaside->L.FreeMisses++;
|
|
|
|
(Lookaside->L.Free)(Entry);
|
|
|
|
} else {
|
|
|
|
InterlockedPushEntrySList(&Lookaside->L.ListHead, (PSLIST_ENTRY)Entry);
|
|
|
|
}
|
2010-03-13 00:34:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static __inline VOID
|
|
|
|
ExFreeToPagedLookasideList(
|
2010-03-18 22:45:30 +00:00
|
|
|
IN PPAGED_LOOKASIDE_LIST Lookaside,
|
|
|
|
IN PVOID Entry)
|
2010-03-13 00:34:48 +00:00
|
|
|
{
|
2010-03-18 22:45:30 +00:00
|
|
|
Lookaside->L.TotalFrees++;
|
|
|
|
if (ExQueryDepthSList(&Lookaside->L.ListHead) >= Lookaside->L.Depth) {
|
|
|
|
Lookaside->L.FreeMisses++;
|
|
|
|
(Lookaside->L.Free)(Entry);
|
|
|
|
} else {
|
|
|
|
InterlockedPushEntrySList(&Lookaside->L.ListHead, (PSLIST_ENTRY)Entry);
|
|
|
|
}
|
2010-03-13 00:34:48 +00:00
|
|
|
}
|
|
|
|
|
2010-03-18 22:45:30 +00:00
|
|
|
#endif /* !defined(MIDL_PASS) */
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
$endif
|
|
|
|
|