76#define HANDLE_LOW_BITS (PAGE_SHIFT - 4)
77#define HANDLE_HIGH_BITS (PAGE_SHIFT - 3)
79#define HANDLE_LOW_BITS (PAGE_SHIFT - 3)
80#define HANDLE_HIGH_BITS (PAGE_SHIFT - 2)
82#define HANDLE_TAG_BITS 2
83#define HANDLE_INDEX_BITS (HANDLE_LOW_BITS + 2 * HANDLE_HIGH_BITS)
84#define KERNEL_FLAG_BITS (sizeof(ULONG_PTR) * 8 - HANDLE_INDEX_BITS - HANDLE_TAG_BITS)
133#define MAX_FAST_REFS 7
135#define ExAcquireRundownProtection _ExAcquireRundownProtection
136#define ExReleaseRundownProtection _ExReleaseRundownProtection
137#define ExInitializeRundownProtection _ExInitializeRundownProtection
138#define ExWaitForRundownProtectionRelease _ExWaitForRundownProtectionRelease
139#define ExRundownCompleted _ExRundownCompleted
140#define ExGetPreviousMode KeGetPreviousMode
146#define EXHANDLE_TABLE_ENTRY_LOCK_BIT 1
147#define FREE_HANDLE_MASK -1
152#define LOW_LEVEL_ENTRIES (PAGE_SIZE / sizeof(HANDLE_TABLE_ENTRY))
153#define MID_LEVEL_ENTRIES (PAGE_SIZE / sizeof(PHANDLE_TABLE_ENTRY))
154#define HIGH_LEVEL_ENTRIES (16777216 / (LOW_LEVEL_ENTRIES * MID_LEVEL_ENTRIES))
159#define MAX_LOW_INDEX LOW_LEVEL_ENTRIES
160#define MAX_MID_INDEX (MID_LEVEL_ENTRIES * LOW_LEVEL_ENTRIES)
161#define MAX_HIGH_INDEX (MID_LEVEL_ENTRIES * MID_LEVEL_ENTRIES * LOW_LEVEL_ENTRIES)
163#define ExpChangeRundown(x, y, z) (ULONG_PTR)InterlockedCompareExchangePointer(&(x)->Ptr, (PVOID)(y), (PVOID)(z))
164#define ExpChangePushlock(x, y, z) InterlockedCompareExchangePointer((PVOID*)(x), (PVOID)(y), (PVOID)(z))
165#define ExpSetRundown(x, y) InterlockedExchangePointer(&(x)->Ptr, (PVOID)(y))
171 IN ULONG SystemInformationLength,
583 return (
PVOID)(FastRef.Value & ~MAX_FAST_REFS);
591 return (
ULONG)FastRef.RefCnt;
606 FastRef->Object =
NULL;
797 RunRefCacheAware->RunRefSize *
798 (ProcNumber % RunRefCacheAware->Number));
825 Value = RunRef->Count &~ EX_RUNDOWN_ACTIVE;
832 if (NewValue !=
Value)
866 Value = RunRef->Count &~ EX_RUNDOWN_ACTIVE;
875 if (NewValue !=
Value)
1013#define ExInitializePushLock _ExInitializePushLock
1155 ASSERT(PushLock->Locked);
1336 (
Thread->CombinedApcDisable != 0) ||
1349 FastMutex->Owner =
Thread;
1363 FastMutex->Owner =
NULL;
1403 FastMutex->Owner =
NULL;
1524#define InterlockedDecrementUL(Addend) \
1525 (ULONG)InterlockedDecrement((PLONG)(Addend))
1527#define InterlockedIncrementUL(Addend) \
1528 (ULONG)InterlockedIncrement((PLONG)(Addend))
1530#define InterlockedExchangeUL(Target, Value) \
1531 (ULONG)InterlockedExchange((PLONG)(Target), (LONG)(Value))
1533#define InterlockedExchangeAddUL(Addend, Value) \
1534 (ULONG)InterlockedExchangeAdd((PLONG)(Addend), (LONG)(Value))
1536#define InterlockedCompareExchangeUL(Destination, Exchange, Comperand) \
1537 (ULONG)InterlockedCompareExchange((PLONG)(Destination), (LONG)(Exchange), (LONG)(Comperand))
1539#define InterlockedCompareExchangeSizeT(Destination, Exchange, Comperand) \
1540 (SIZE_T)InterlockedCompareExchangePointer((PVOID*)(Destination), (PVOID)(SIZE_T)(Exchange), (PVOID)(SIZE_T)(Comperand))
1543#define InterlockedExchangeSizeT(Target, Value) \
1544 (SIZE_T)InterlockedExchange64((PLONG64)(Target), (LONG64)(Value))
1546#define InterlockedExchangeSizeT(Target, Value) \
1547 (SIZE_T)InterlockedExchange((PLONG)(Target), (LONG)(Value))
1550#define ExfInterlockedCompareExchange64UL(Destination, Exchange, Comperand) \
1551 (ULONGLONG)ExfInterlockedCompareExchange64((PLONGLONG)(Destination), (PLONGLONG)(Exchange), (PLONGLONG)(Comperand))
#define EX_PUSH_LOCK_SHARE_INC
#define EX_PUSH_LOCK_LOCK
#define EX_PUSH_LOCK_LOCK_V
#define InterlockedIncrement
#define MM_SYSTEM_RANGE_START
#define InterlockedDecrement
_Acquires_exclusive_lock_ Resource _Acquires_shared_lock_ Resource _Inout_ PERESOURCE Resource
_In_ CDROM_SCAN_FOR_SPECIAL_INFO _In_ PCDROM_SCAN_FOR_SPECIAL_HANDLER Function
#define InterlockedExchangePointer(Target, Value)
IN CINT OUT PVOID IN ULONG OUT PULONG ReturnLength
#define KeRaiseIrql(irql, oldIrql)
#define KeLowerIrql(oldIrql)
#define KeGetCurrentIrql()
VOID NTAPI KeSetEventBoostPriority(IN PKEVENT Event, IN PKTHREAD *WaitingThread OPTIONAL)
FORCEINLINE VOID _ExReleaseFastMutexUnsafe(IN OUT PFAST_MUTEX FastMutex)
ULONG ExpInitializationPhase
LARGE_INTEGER ExpTimeZoneBias
BOOLEAN NTAPI ExpInitializeSemaphoreImplementation(VOID)
VOID NTAPI ExWaitForCallBacks(IN PEX_CALLBACK_ROUTINE_BLOCK CallbackRoutineBlock)
PEPROCESS ExpDebuggerProcessAttach
VOID NTAPI ExShutdownSystem(VOID)
RTL_TIME_ZONE_INFORMATION ExpTimeZoneInfo
VOID NTAPI ExSweepHandleTable(IN PHANDLE_TABLE HandleTable, IN PEX_SWEEP_HANDLE_CALLBACK EnumHandleProcedure, IN PVOID Context)
POBJECT_TYPE ExEventPairObjectType
FORCEINLINE VOID ExReleasePushLock(PEX_PUSH_LOCK PushLock)
BOOLEAN NTAPI ExChangeHandle(IN PHANDLE_TABLE HandleTable, IN HANDLE Handle, IN PEX_CHANGE_HANDLE_CALLBACK ChangeRoutine, IN ULONG_PTR Context)
FORCEINLINE VOID _ExReleaseFastMutex(IN OUT PFAST_MUTEX FastMutex)
NTSTATUS ExpSetTimeZoneInformation(IN PRTL_TIME_ZONE_INFORMATION TimeZoneInformation)
BOOLEAN NTAPI ExpInitializeTimerImplementation(VOID)
VOID FASTCALL ExBlockPushLock(IN PEX_PUSH_LOCK PushLock, IN PVOID WaitBlock)
#define ExpSetRundown(x, y)
FORCEINLINE VOID _ExAcquireFastMutexUnsafe(IN PFAST_MUTEX FastMutex)
KSPIN_LOCK ExpPagedLookasideListLock
FORCEINLINE BOOLEAN ExReleaseFastReference(IN PEX_FAST_REF FastRef, IN PVOID Object)
PEPROCESS ExpDebuggerProcessKill
VOID NTAPI ExpInitializeHandleTables(VOID)
PHANDLE_TABLE_ENTRY NTAPI ExpLookupHandleTableEntry(IN PHANDLE_TABLE HandleTable, IN EXHANDLE Handle)
FORCEINLINE VOID _ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(IN OUT PFAST_MUTEX FastMutex)
HANDLE NTAPI ExCreateHandle(IN PHANDLE_TABLE HandleTable, IN PHANDLE_TABLE_ENTRY HandleTableEntry)
VOID NTAPI ExpResourceInitialization(VOID)
FORCEINLINE ULONG ExGetCountFastReference(IN EX_FAST_REF FastRef)
POBJECT_TYPE _ExEventObjectType
BOOLEAN NTAPI ExpInitializeProfileImplementation(VOID)
PCALLBACK_OBJECT PowerStateCallback
VOID NTAPI XIPInit(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
BOOLEAN FASTCALL ExfAcquireRundownProtectionEx(IN OUT PEX_RUNDOWN_REF RunRef, IN ULONG Count)
NTSTATUS NTAPI ExGetPoolTagInfo(IN PSYSTEM_POOLTAG_INFORMATION SystemInformation, IN ULONG SystemInformationLength, IN OUT PULONG ReturnLength OPTIONAL)
WINKD_WORKER_STATE ExpDebuggerWork
VOID FASTCALL ExfInitializeRundownProtection(OUT PEX_RUNDOWN_REF RunRef)
PVOID NTAPI ExGetCallBackBlockContext(IN PEX_CALLBACK_ROUTINE_BLOCK CallbackRoutineBlock)
ULONG_PTR ExpDebuggerPageIn
UNICODE_STRING NtSystemRoot
VOID NTAPI ExInitializeSystemLookasideList(IN PGENERAL_LOOKASIDE List, IN POOL_TYPE Type, IN ULONG Size, IN ULONG Tag, IN USHORT MaximumDepth, IN PLIST_ENTRY ListHead)
LIST_ENTRY ExPoolLookasideListHead
BOOLEAN NTAPI ExpInitializeKeyedEventImplementation(VOID)
POBJECT_TYPE _ExSemaphoreObjectType
KSPIN_LOCK ExpNonPagedLookasideListLock
LIST_ENTRY ExpFirmwareTableProviderListHead
FORCEINLINE BOOLEAN _ExTryToAcquireFastMutex(IN OUT PFAST_MUTEX FastMutex)
ULONG ExpOemCodePageDataOffset
VOID NTAPI ExUpdateSystemTimeFromCmos(IN BOOLEAN UpdateInterruptTime, IN ULONG MaxSepInSeconds)
BOOLEAN NTAPI ExpWin32kInit(VOID)
ULONG ExpUnicodeCaseTableDataOffset
BOOLEAN NTAPI ExTryToAcquireResourceExclusiveLite(IN PERESOURCE Resource)
FORCEINLINE EX_FAST_REF ExCompareSwapFastReference(IN PEX_FAST_REF FastRef, IN PVOID Object, IN PVOID OldObject)
VOID NTAPI ExpInitializePushLocks(VOID)
ERESOURCE ExpTimeRefreshLock
FORCEINLINE VOID _ExInitializeRundownProtection(IN PEX_RUNDOWN_REF RunRef)
BOOLEAN NTAPI ExpInitializeEventImplementation(VOID)
PEX_CALLBACK_FUNCTION NTAPI ExGetCallBackBlockRoutine(IN PEX_CALLBACK_ROUTINE_BLOCK CallbackRoutineBlock)
PVOID ExpDefaultErrorPort
FAST_MUTEX ExpEnvironmentLock
LIST_ENTRY ExpPagedLookasideListHead
VOID FASTCALL ExWaitForUnblockPushLock(IN PEX_PUSH_LOCK PushLock, IN PVOID WaitBlock)
PHANDLE_TABLE NTAPI ExCreateHandleTable(IN PEPROCESS Process OPTIONAL)
ULONG ExCriticalWorkerThreads
BOOLEAN(NTAPI * PEX_SWEEP_HANDLE_CALLBACK)(PHANDLE_TABLE_ENTRY HandleTableEntry, HANDLE Handle, PVOID Context)
enum _WINKD_WORKER_STATE WINKD_WORKER_STATE
BOOLEAN NTAPI ExCompareExchangeCallBack(IN OUT PEX_CALLBACK CallBack, IN PEX_CALLBACK_ROUTINE_BLOCK NewBlock, IN PEX_CALLBACK_ROUTINE_BLOCK OldBlock)
BOOLEAN(NTAPI * PEX_CHANGE_HANDLE_CALLBACK)(PHANDLE_TABLE_ENTRY HandleTableEntry, ULONG_PTR Context)
VOID NTAPI ExAllocateLocallyUniqueId(OUT LUID *LocallyUniqueId)
VOID FASTCALL ExfReleaseRundownProtectionEx(IN OUT PEX_RUNDOWN_REF RunRef, IN ULONG Count)
FORCEINLINE VOID ExDoCallBack(IN OUT PEX_CALLBACK Callback, IN PVOID Context, IN PVOID Argument1, IN PVOID Argument2)
FORCEINLINE VOID ExAcquirePushLockExclusive(PEX_PUSH_LOCK PushLock)
union _EXHANDLE * PEXHANDLE
UNICODE_STRING CmVersionString
PVOID ExpNlsSectionPointer
VOID NTAPI ExInitializeCallBack(IN OUT PEX_CALLBACK Callback)
PEX_CALLBACK_ROUTINE_BLOCK NTAPI ExReferenceCallBackBlock(IN OUT PEX_CALLBACK CallBack)
ULONG ExDelayedWorkerThreads
VOID FASTCALL ExfRundownCompleted(OUT PEX_RUNDOWN_REF RunRef)
LIST_ENTRY ExpSystemResourcesList
PEPROCESS ExpDefaultErrorPortProcess
ULONG ExpResourceTimeoutCount
VOID NTAPI ExpDebuggerWorker(IN PVOID Context)
FORCEINLINE VOID _ExAcquireFastMutex(IN PFAST_MUTEX FastMutex)
BOOLEAN NTAPI ExpInitializeCallbacks(VOID)
LIST_ENTRY ExSystemLookasideListHead
ERESOURCE ExpFirmwareTableResource
BOOLEAN NTAPI ExDestroyHandle(IN PHANDLE_TABLE HandleTable, IN HANDLE Handle, IN PHANDLE_TABLE_ENTRY HandleTableEntry OPTIONAL)
#define HANDLE_INDEX_BITS
ULONG ExpTickCountMultiplier
ULONG ExpLastTimeZoneBias
WORK_QUEUE_ITEM ExpDebuggerWorkItem
FORCEINLINE BOOLEAN ExInsertFastReference(IN OUT PEX_FAST_REF FastRef, IN PVOID Object)
BOOLEAN NTAPI ExpInitializeMutantImplementation(VOID)
BOOLEAN NTAPI ExpLockHandleTableEntry(IN PHANDLE_TABLE HandleTable, IN PHANDLE_TABLE_ENTRY HandleTableEntry)
FORCEINLINE VOID _ExWaitForRundownProtectionRelease(IN PEX_RUNDOWN_REF RunRef)
VOID FASTCALL ExfReInitializeRundownProtection(OUT PEX_RUNDOWN_REF RunRef)
VOID NTAPI ExFreeCallBack(IN PEX_CALLBACK_ROUTINE_BLOCK CallbackRoutineBlock)
FORCEINLINE VOID ExInitializeFastReference(OUT PEX_FAST_REF FastRef, IN OPTIONAL PVOID Object)
FORCEINLINE VOID ExAcquirePushLockShared(PEX_PUSH_LOCK PushLock)
VOID NTAPI ExDestroyHandleTable(IN PHANDLE_TABLE HandleTable, IN PVOID DestroyHandleProcedure OPTIONAL)
VOID NTAPI HeadlessInit(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
PHANDLE_TABLE_ENTRY NTAPI ExMapHandleToPointer(IN PHANDLE_TABLE HandleTable, IN HANDLE Handle)
FORCEINLINE BOOLEAN ExTryToAcquirePushLockExclusive(PEX_PUSH_LOCK PushLock)
VOID NTAPI ExDereferenceCallBackBlock(IN OUT PEX_CALLBACK CallBack, IN PEX_CALLBACK_ROUTINE_BLOCK CallbackRoutineBlock)
FORCEINLINE VOID ExReleasePushLockShared(PEX_PUSH_LOCK PushLock)
VOID NTAPI ExReleaseTimeRefreshLock(VOID)
FORCEINLINE BOOLEAN ExConvertPushLockSharedToExclusive(IN PEX_PUSH_LOCK PushLock)
ULONG ExpAnsiCodePageDataOffset
#define ExpChangeRundown(x, y, z)
struct _UUID_CACHED_VALUES_STRUCT UUID_CACHED_VALUES_STRUCT
FORCEINLINE VOID _ExEnterCriticalRegionAndAcquireFastMutexUnsafe(IN OUT PFAST_MUTEX FastMutex)
FORCEINLINE BOOLEAN _ExAcquireRundownProtection(IN PEX_RUNDOWN_REF RunRef)
FORCEINLINE EX_FAST_REF ExSwapFastReference(IN PEX_FAST_REF FastRef, IN PVOID Object)
VOID FASTCALL ExfWaitForRundownProtectionRelease(IN OUT PEX_RUNDOWN_REF RunRef)
LIST_ENTRY ExpNonPagedLookasideListHead
VOID NTAPI ExTimerRundown(VOID)
VOID NTAPI ExpInitializeExecutive(IN ULONG Cpu, IN PLOADER_PARAMETER_BLOCK LoaderBlock)
FORCEINLINE VOID _ExRundownCompleted(IN PEX_RUNDOWN_REF RunRef)
BOOLEAN NTAPI ExAcquireTimeRefreshLock(IN BOOLEAN Wait)
#define ExpChangePushlock(x, y, z)
FORCEINLINE PVOID ExGetObjectFastReference(IN EX_FAST_REF FastRef)
VOID NTAPI Phase1Initialization(IN PVOID Context)
VOID NTAPI ExInitPoolLookasidePointers(VOID)
FORCEINLINE VOID _ExInitializePushLock(OUT PEX_PUSH_LOCK PushLock)
VOID FASTCALL ExfReleaseRundownProtection(IN OUT PEX_RUNDOWN_REF RunRef)
BOOLEAN NTAPI ExpInitializeEventPairImplementation(VOID)
VOID NTAPI ExUnlockHandleTableEntry(IN PHANDLE_TABLE HandleTable, IN PHANDLE_TABLE_ENTRY HandleTableEntry)
VOID NTAPI ExSwapinWorkerThreads(IN BOOLEAN AllowSwap)
UNICODE_STRING CmCSDVersionString
FORCEINLINE VOID _ExReleaseRundownProtection(IN PEX_RUNDOWN_REF RunRef)
LONG NTAPI ExSystemExceptionFilter(VOID)
PEX_CALLBACK_ROUTINE_BLOCK NTAPI ExAllocateCallBack(IN PEX_CALLBACK_FUNCTION Function, IN PVOID Context)
BOOLEAN FASTCALL ExfAcquireRundownProtection(IN OUT PEX_RUNDOWN_REF RunRef)
BOOLEAN NTAPI ExLuidInitialization(VOID)
FORCEINLINE PEX_RUNDOWN_REF ExGetRunRefForGivenProcessor(IN PEX_RUNDOWN_REF_CACHE_AWARE RunRefCacheAware, IN ULONG ProcNumber)
BOOLEAN NTAPI ExRefreshTimeZoneInformation(IN PLARGE_INTEGER SystemBootTime)
FORCEINLINE VOID ExReleasePushLockExclusive(PEX_PUSH_LOCK PushLock)
VOID NTAPI ExpInitializeWorkerThreads(VOID)
VOID FASTCALL ExfUnblockPushLock(IN PEX_PUSH_LOCK PushLock, IN PVOID CurrentWaitBlock)
PHANDLE_TABLE NTAPI ExDupHandleTable(IN PEPROCESS Process, IN PHANDLE_TABLE HandleTable, IN PEX_DUPLICATE_HANDLE_CALLBACK DupHandleProcedure, IN ULONG_PTR Mask)
BOOLEAN(NTAPI * PEX_DUPLICATE_HANDLE_CALLBACK)(IN PEPROCESS Process, IN PHANDLE_TABLE HandleTable, IN PHANDLE_TABLE_ENTRY HandleTableEntry, IN PHANDLE_TABLE_ENTRY NewEntry)
struct _HARDERROR_USER_PARAMETERS HARDERROR_USER_PARAMETERS
FORCEINLINE EX_FAST_REF ExAcquireFastReference(IN OUT PEX_FAST_REF FastRef)
struct _HARDERROR_USER_PARAMETERS * PHARDERROR_USER_PARAMETERS
struct _UUID_CACHED_VALUES_STRUCT * PUUID_CACHED_VALUES_STRUCT
FORCEINLINE VOID ExWaitOnPushLock(PEX_PUSH_LOCK PushLock)
BOOLEAN NTAPI ExpUuidInitialization(VOID)
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
#define KeGetCurrentThread
static XMS_HANDLE HandleTable[XMS_MAX_HANDLES]
#define InterlockedBitTestAndSet
#define InterlockedExchangeAddSizeT(a, b)
#define InterlockedCompareExchange
VOID ExpInitLookasideLists()
#define RTL_FIELD_SIZE(type, field)
#define KeLeaveCriticalRegion()
#define KeEnterCriticalRegion()
#define MAXIMUM_HARDERROR_PARAMETERS
VOID FASTCALL KiAcquireFastMutex(IN PFAST_MUTEX FastMutex)
VOID FASTCALL ExfReleasePushLock(PEX_PUSH_LOCK PushLock)
VOID FASTCALL ExfTryToWakePushLock(PEX_PUSH_LOCK PushLock)
VOID FASTCALL ExfReleasePushLockShared(PEX_PUSH_LOCK PushLock)
VOID FASTCALL ExfReleasePushLockExclusive(PEX_PUSH_LOCK PushLock)
VOID FASTCALL ExfAcquirePushLockExclusive(PEX_PUSH_LOCK PushLock)
VOID FASTCALL ExfAcquirePushLockShared(PEX_PUSH_LOCK PushLock)
PULONG MinorVersion OPTIONAL
PCALLBACK_OBJECT * CallbackObject
LIST_ENTRY WakeTimerListEntry
LIST_ENTRY ActiveTimerListEntry
UNICODE_STRING Strings[MAXIMUM_HARDERROR_PARAMETERS]
UCHAR ClockSeqHiAndReserved
HANDLE GenericHandleOverlay
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
_In_ WDFDPC _In_ BOOLEAN Wait
_In_ WDFINTERRUPT _In_ PFN_WDF_INTERRUPT_SYNCHRONIZE Callback
_Must_inspect_result_ _In_ WDFQUEUE _In_opt_ WDFREQUEST _In_opt_ WDFFILEOBJECT _Inout_opt_ PWDF_REQUEST_PARAMETERS Parameters
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
_Must_inspect_result_ _In_ WDFCMRESLIST List
_IRQL_requires_same_ _In_opt_ PVOID Argument1
EX_CALLBACK_FUNCTION * PEX_CALLBACK_FUNCTION
#define EX_RUNDOWN_COUNT_INC
#define EX_RUNDOWN_ACTIVE
struct LOOKASIDE_ALIGN _GENERAL_LOOKASIDE * PGENERAL_LOOKASIDE
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql