1 #ifndef __NTOSKRNL_INCLUDE_INTERNAL_EXECUTIVE_H
2 #define __NTOSKRNL_INCLUDE_INTERNAL_EXECUTIVE_H
4 /* GLOBAL VARIABLES *********************************************************/
6 extern TIME_ZONE_INFORMATION ExpTimeZoneInfo
;
7 extern LARGE_INTEGER ExpTimeZoneBias
;
8 extern ULONG ExpTimeZoneId
;
9 extern ULONG ExpTickCountMultiplier
;
10 extern ULONG ExpLastTimeZoneBias
;
11 extern POBJECT_TYPE ExEventPairObjectType
;
12 extern POBJECT_TYPE _ExEventObjectType
, _ExSemaphoreObjectType
;
13 extern ULONG NtBuildNumber
;
14 extern ULONG NtMajorVersion
;
15 extern ULONG NtMinorVersion
;
16 extern FAST_MUTEX ExpEnvironmentLock
;
17 extern ERESOURCE ExpFirmwareTableResource
;
18 extern LIST_ENTRY ExpFirmwareTableProviderListHead
;
19 extern BOOLEAN ExpIsWinPEMode
;
20 extern LIST_ENTRY ExpSystemResourcesList
;
21 ULONG ExpAnsiCodePageDataOffset
, ExpOemCodePageDataOffset
;
22 ULONG ExpUnicodeCaseTableDataOffset
;
23 PVOID ExpNlsSectionPointer
;
24 extern CHAR NtBuildLab
[];
25 extern ULONG CmNtCSDVersion
;
26 extern ULONG NtGlobalFlag
;
27 extern ULONG ExpInitializationPhase
;
28 extern ULONG ExpAltTimeZoneBias
;
29 extern LIST_ENTRY ExSystemLookasideListHead
;
31 typedef struct _EXHANDLE
40 HANDLE GenericHandleOverlay
;
43 } EXHANDLE
, *PEXHANDLE
;
45 typedef struct _ETIMER
50 LIST_ENTRY ActiveTimerListEntry
;
53 BOOLEAN ApcAssociated
;
55 LIST_ENTRY WakeTimerListEntry
;
60 PCALLBACK_OBJECT
*CallbackObject
;
64 #define MAX_FAST_REFS 7
66 #define ExAcquireRundownProtection _ExAcquireRundownProtection
67 #define ExReleaseRundownProtection _ExReleaseRundownProtection
68 #define ExInitializeRundownProtection _ExInitializeRundownProtection
69 #define ExWaitForRundownProtectionRelease _ExWaitForRundownProtectionRelease
70 #define ExRundownCompleted _ExRundownCompleted
71 #define ExGetPreviousMode KeGetPreviousMode
75 // Various bits tagged on the handle or handle table
77 #define EXHANDLE_TABLE_ENTRY_LOCK_BIT 1
78 #define FREE_HANDLE_MASK -1
81 // Number of entries in each table level
83 #define LOW_LEVEL_ENTRIES (PAGE_SIZE / sizeof(HANDLE_TABLE_ENTRY))
84 #define MID_LEVEL_ENTRIES (PAGE_SIZE / sizeof(PHANDLE_TABLE_ENTRY))
85 #define HIGH_LEVEL_ENTRIES (16777216 / (LOW_LEVEL_ENTRIES * MID_LEVEL_ENTRIES))
88 // Maximum index in each table level before we need another table
90 #define MAX_LOW_INDEX LOW_LEVEL_ENTRIES
91 #define MAX_MID_INDEX (MID_LEVEL_ENTRIES * LOW_LEVEL_ENTRIES)
92 #define MAX_HIGH_INDEX (MID_LEVEL_ENTRIES * MID_LEVEL_ENTRIES * LOW_LEVEL_ENTRIES)
99 #define DEFINE_WAIT_BLOCK(x) \
103 EX_PUSH_LOCK_WAIT_BLOCK UnalignedBlock; \
105 PEX_PUSH_LOCK_WAIT_BLOCK x = (PEX_PUSH_LOCK_WAIT_BLOCK) \
106 ((ULONG_PTR)&WaitBlockBuffer.UnalignedBlock &~ 0xF);
111 // This is only for compatibility; the compiler will optimize the extra
112 // local variable (the actual pointer) away, so we don't take any perf hit
115 #define DEFINE_WAIT_BLOCK(x) \
116 EX_PUSH_LOCK_WAIT_BLOCK WaitBlockBuffer; \
117 PEX_PUSH_LOCK_WAIT_BLOCK x = &WaitBlockBuffer;
121 /* INITIALIZATION FUNCTIONS *************************************************/
133 Phase1Initialization(
139 ExpInitializePushLocks(VOID
);
143 ExRefreshTimeZoneInformation(
144 IN PLARGE_INTEGER SystemBootTime
149 ExpInitializeWorkerThreads(VOID
);
153 ExpInitLookasideLists(VOID
);
157 ExInitializeSystemLookasideList(
158 IN PGENERAL_LOOKASIDE List
,
162 IN USHORT MaximumDepth
,
163 IN PLIST_ENTRY ListHead
168 ExpInitializeCallbacks(VOID
);
176 ExpInitializeExecutive(
178 IN PLOADER_PARAMETER_BLOCK LoaderBlock
183 ExpInitializeEventImplementation(VOID
);
187 ExpInitializeEventImplementation(VOID
);
191 ExpInitializeEventPairImplementation(VOID
);
195 ExpInitializeSemaphoreImplementation(VOID
);
199 ExpInitializeMutantImplementation(VOID
);
203 ExpInitializeTimerImplementation(VOID
);
207 ExpInitializeProfileImplementation(VOID
);
211 ExpResourceInitialization(VOID
);
215 ExInitPoolLookasidePointers(VOID
);
217 /* Callback Functions ********************************************************/
221 ExInitializeCallBack(
222 IN OUT PEX_CALLBACK Callback
225 PEX_CALLBACK_ROUTINE_BLOCK
228 IN PEX_CALLBACK_FUNCTION Function
,
235 IN PEX_CALLBACK_ROUTINE_BLOCK CallbackRoutineBlock
240 ExCompareExchangeCallBack (
241 IN OUT PEX_CALLBACK CallBack
,
242 IN PEX_CALLBACK_ROUTINE_BLOCK NewBlock
,
243 IN PEX_CALLBACK_ROUTINE_BLOCK OldBlock
246 PEX_CALLBACK_ROUTINE_BLOCK
248 ExReferenceCallBackBlock(
249 IN OUT PEX_CALLBACK CallBack
254 ExDereferenceCallBackBlock(
255 IN OUT PEX_CALLBACK CallBack
,
256 IN PEX_CALLBACK_ROUTINE_BLOCK CallbackRoutineBlock
259 PEX_CALLBACK_FUNCTION
261 ExGetCallBackBlockRoutine(
262 IN PEX_CALLBACK_ROUTINE_BLOCK CallbackRoutineBlock
267 ExGetCallBackBlockContext(
268 IN PEX_CALLBACK_ROUTINE_BLOCK CallbackRoutineBlock
274 IN PEX_CALLBACK_ROUTINE_BLOCK CallbackRoutineBlock
277 /* Rundown Functions ********************************************************/
281 ExfInitializeRundownProtection(
282 OUT PEX_RUNDOWN_REF RunRef
287 ExfReInitializeRundownProtection(
288 OUT PEX_RUNDOWN_REF RunRef
293 ExfAcquireRundownProtection(
294 IN OUT PEX_RUNDOWN_REF RunRef
299 ExfAcquireRundownProtectionEx(
300 IN OUT PEX_RUNDOWN_REF RunRef
,
306 ExfReleaseRundownProtection(
307 IN OUT PEX_RUNDOWN_REF RunRef
312 ExfReleaseRundownProtectionEx(
313 IN OUT PEX_RUNDOWN_REF RunRef
,
320 OUT PEX_RUNDOWN_REF RunRef
325 ExfWaitForRundownProtectionRelease(
326 IN OUT PEX_RUNDOWN_REF RunRef
329 /* HANDLE TABLE FUNCTIONS ***************************************************/
332 (NTAPI
*PEX_SWEEP_HANDLE_CALLBACK
)(
333 PHANDLE_TABLE_ENTRY HandleTableEntry
,
339 (NTAPI
*PEX_DUPLICATE_HANDLE_CALLBACK
)(
340 IN PEPROCESS Process
,
341 IN PHANDLE_TABLE HandleTable
,
342 IN PHANDLE_TABLE_ENTRY HandleTableEntry
,
343 IN PHANDLE_TABLE_ENTRY NewEntry
347 (NTAPI
*PEX_CHANGE_HANDLE_CALLBACK
)(
348 PHANDLE_TABLE_ENTRY HandleTableEntry
,
354 ExpInitializeHandleTables(
361 IN PEPROCESS Process OPTIONAL
366 ExUnlockHandleTableEntry(
367 IN PHANDLE_TABLE HandleTable
,
368 IN PHANDLE_TABLE_ENTRY HandleTableEntry
374 IN PHANDLE_TABLE HandleTable
,
375 IN PHANDLE_TABLE_ENTRY HandleTableEntry
380 ExDestroyHandleTable(
381 IN PHANDLE_TABLE HandleTable
,
382 IN PVOID DestroyHandleProcedure OPTIONAL
388 IN PHANDLE_TABLE HandleTable
,
390 IN PHANDLE_TABLE_ENTRY HandleTableEntry OPTIONAL
395 ExMapHandleToPointer(
396 IN PHANDLE_TABLE HandleTable
,
403 IN PEPROCESS Process
,
404 IN PHANDLE_TABLE HandleTable
,
405 IN PEX_DUPLICATE_HANDLE_CALLBACK DupHandleProcedure
,
412 IN PHANDLE_TABLE HandleTable
,
414 IN PEX_CHANGE_HANDLE_CALLBACK ChangeRoutine
,
421 IN PHANDLE_TABLE HandleTable
,
422 IN PEX_SWEEP_HANDLE_CALLBACK EnumHandleProcedure
,
426 /* PSEH EXCEPTION HANDLING **************************************************/
430 ExSystemExceptionFilter(VOID
);
432 static __inline
_SEH_FILTER(_SEH_ExSystemExceptionFilter
)
434 return ExSystemExceptionFilter();
437 /* CALLBACKS *****************************************************************/
441 ExDoCallBack(IN OUT PEX_CALLBACK Callback
,
446 PEX_CALLBACK_ROUTINE_BLOCK CallbackRoutineBlock
;
447 PEX_CALLBACK_FUNCTION Function
;
449 /* Reference the block */
450 CallbackRoutineBlock
= ExReferenceCallBackBlock(Callback
);
451 if (CallbackRoutineBlock
)
453 /* Get the function */
454 Function
= ExGetCallBackBlockRoutine(CallbackRoutineBlock
);
456 /* Do the callback */
457 Function(Context
, Argument1
, Argument2
);
459 /* Now dereference it */
460 ExDereferenceCallBackBlock(Callback
, CallbackRoutineBlock
);
464 /* RUNDOWN *******************************************************************/
467 #define ExpChangeRundown(x, y, z) InterlockedCompareExchange64((PLONGLONG)x, y, z)
468 #define ExpSetRundown(x, y) InterlockedExchange64((PLONGLONG)x, y)
470 #define ExpChangeRundown(x, y, z) InterlockedCompareExchange((PLONG)x, PtrToLong(y), PtrToLong(z))
471 #define ExpChangePushlock(x, y, z) LongToPtr(InterlockedCompareExchange((PLONG)x, PtrToLong(y), PtrToLong(z)))
472 #define ExpSetRundown(x, y) InterlockedExchange((PLONG)x, y)
476 * @name ExfAcquireRundownProtection
479 * The ExfAcquireRundownProtection routine acquires rundown protection for
480 * the specified descriptor.
483 * Pointer to a rundown reference descriptor.
485 * @return TRUE if access to the protected structure was granted, FALSE otherwise.
487 * @remarks This is the internal macro for system use only.In case the rundown
488 * was active, then the slow-path will be called through the exported
494 _ExAcquireRundownProtection(IN PEX_RUNDOWN_REF RunRef
)
496 ULONG_PTR Value
, NewValue
;
498 /* Get the current value and mask the active bit */
499 Value
= RunRef
->Count
&~ EX_RUNDOWN_ACTIVE
;
501 /* Add a reference */
502 NewValue
= Value
+ EX_RUNDOWN_COUNT_INC
;
504 /* Change the value */
505 NewValue
= ExpChangeRundown(RunRef
, NewValue
, Value
);
506 if (NewValue
!= Value
)
508 /* Rundown was active, use long path */
509 return ExfAcquireRundownProtection(RunRef
);
517 * @name ExReleaseRundownProtection
520 * The ExReleaseRundownProtection routine releases rundown protection for
521 * the specified descriptor.
524 * Pointer to a rundown reference descriptor.
526 * @return TRUE if access to the protected structure was granted, FALSE otherwise.
528 * @remarks This is the internal macro for system use only.In case the rundown
529 * was active, then the slow-path will be called through the exported
535 _ExReleaseRundownProtection(IN PEX_RUNDOWN_REF RunRef
)
537 ULONG_PTR Value
, NewValue
;
539 /* Get the current value and mask the active bit */
540 Value
= RunRef
->Count
&~ EX_RUNDOWN_ACTIVE
;
542 /* Remove a reference */
543 NewValue
= Value
- EX_RUNDOWN_COUNT_INC
;
545 /* Change the value */
546 NewValue
= ExpChangeRundown(RunRef
, NewValue
, Value
);
548 /* Check if the rundown was active */
549 if (NewValue
!= Value
)
551 /* Rundown was active, use long path */
552 ExfReleaseRundownProtection(RunRef
);
557 ASSERT((Value
>= EX_RUNDOWN_COUNT_INC
) || (KeNumberProcessors
> 1));
562 * @name ExInitializeRundownProtection
565 * The ExInitializeRundownProtection routine initializes a rundown
566 * protection descriptor.
569 * Pointer to a rundown reference descriptor.
573 * @remarks This is the internal macro for system use only.
578 _ExInitializeRundownProtection(IN PEX_RUNDOWN_REF RunRef
)
580 /* Set the count to zero */
585 * @name ExWaitForRundownProtectionRelease
588 * The ExWaitForRundownProtectionRelease routine waits until the specified
589 * rundown descriptor has been released.
592 * Pointer to a rundown reference descriptor.
596 * @remarks This is the internal macro for system use only. If a wait is actually
597 * necessary, then the slow path is taken through the exported function.
602 _ExWaitForRundownProtectionRelease(IN PEX_RUNDOWN_REF RunRef
)
606 /* Set the active bit */
607 Value
= ExpChangeRundown(RunRef
, EX_RUNDOWN_ACTIVE
, 0);
608 if ((Value
) && (Value
!= EX_RUNDOWN_ACTIVE
))
610 /* If the the rundown wasn't already active, then take the long path */
611 ExfWaitForRundownProtectionRelease(RunRef
);
616 * @name ExRundownCompleted
619 * The ExRundownCompleted routine completes the rundown of the specified
620 * descriptor by setting the active bit.
623 * Pointer to a rundown reference descriptor.
627 * @remarks This is the internal macro for system use only.
632 _ExRundownCompleted(IN PEX_RUNDOWN_REF RunRef
)
635 ASSERT((RunRef
->Count
& EX_RUNDOWN_ACTIVE
) != 0);
637 /* Mark the counter as active */
638 ExpSetRundown(&RunRef
->Count
, EX_RUNDOWN_ACTIVE
);
641 /* PUSHLOCKS *****************************************************************/
643 /* FIXME: VERIFY THESE! */
648 IN PEX_PUSH_LOCK PushLock
,
655 IN PEX_PUSH_LOCK PushLock
,
656 IN PVOID CurrentWaitBlock
661 ExWaitForUnblockPushLock(
662 IN PEX_PUSH_LOCK PushLock
,
667 * @name ExInitializePushLock
670 * The ExInitializePushLock macro initializes a PushLock.
673 * Pointer to the pushlock which is to be initialized.
682 ExInitializePushLock(IN PULONG_PTR PushLock
)
684 /* Set the value to 0 */
689 * @name ExAcquirePushLockExclusive
692 * The ExAcquirePushLockExclusive macro exclusively acquires a PushLock.
695 * Pointer to the pushlock which is to be acquired.
699 * @remarks The function attempts the quickest route to acquire the lock, which is
700 * to simply set the lock bit.
701 * However, if the pushlock is already shared, the slower path is taken.
703 * Callers of ExAcquirePushLockShared must be running at IRQL <= APC_LEVEL.
704 * This macro should usually be paired up with KeAcquireCriticalRegion.
709 ExAcquirePushLockExclusive(PEX_PUSH_LOCK PushLock
)
711 /* Try acquiring the lock */
712 if (InterlockedBitTestAndSet((PLONG
)PushLock
, EX_PUSH_LOCK_LOCK_V
))
714 /* Someone changed it, use the slow path */
715 ExfAcquirePushLockExclusive(PushLock
);
719 ASSERT(PushLock
->Locked
);
723 * @name ExTryToAcquirePushLockExclusive
726 * The ExAcquirePushLockExclusive macro exclusively acquires a PushLock.
729 * Pointer to the pushlock which is to be acquired.
733 * @remarks The function attempts the quickest route to acquire the lock, which is
734 * to simply set the lock bit.
735 * However, if the pushlock is already shared, the slower path is taken.
737 * Callers of ExAcquirePushLockShared must be running at IRQL <= APC_LEVEL.
738 * This macro should usually be paired up with KeAcquireCriticalRegion.
743 ExTryToAcquirePushLockExclusive(PEX_PUSH_LOCK PushLock
)
745 /* Try acquiring the lock */
746 if (InterlockedBitTestAndSet((PLONG
)PushLock
, EX_PUSH_LOCK_LOCK_V
))
753 ASSERT (PushLock
->Locked
);
758 * @name ExAcquirePushLockShared
761 * The ExAcquirePushLockShared macro acquires a shared PushLock.
764 * Pointer to the pushlock which is to be acquired.
768 * @remarks The function attempts the quickest route to acquire the lock, which is
769 * to simply set the lock bit and set the share count to one.
770 * However, if the pushlock is already shared, the slower path is taken.
772 * Callers of ExAcquirePushLockShared must be running at IRQL <= APC_LEVEL.
773 * This macro should usually be paired up with KeAcquireCriticalRegion.
778 ExAcquirePushLockShared(PEX_PUSH_LOCK PushLock
)
780 EX_PUSH_LOCK NewValue
;
782 /* Try acquiring the lock */
783 NewValue
.Value
= EX_PUSH_LOCK_LOCK
| EX_PUSH_LOCK_SHARE_INC
;
784 if (ExpChangePushlock(PushLock
, NewValue
.Ptr
, 0))
786 /* Someone changed it, use the slow path */
787 ExfAcquirePushLockShared(PushLock
);
791 ASSERT(PushLock
->Locked
);
792 ASSERT(PushLock
->Waiting
|| PushLock
->Shared
> 0);
796 * @name ExConvertPushLockSharedToExclusive
799 * The ExConvertPushLockSharedToExclusive macro converts an exclusive
800 * pushlock to a shared pushlock.
803 * Pointer to the pushlock which is to be converted.
805 * @return FALSE if conversion failed, TRUE otherwise.
807 * @remarks The function attempts the quickest route to convert the lock, which is
808 * to simply set the lock bit and remove any other bits.
813 ExConvertPushLockSharedToExclusive(IN PEX_PUSH_LOCK PushLock
)
815 EX_PUSH_LOCK OldValue
;
817 /* Set the expected old value */
818 OldValue
.Value
= EX_PUSH_LOCK_LOCK
| EX_PUSH_LOCK_SHARE_INC
;
820 /* Try converting the lock */
821 if (ExpChangePushlock(PushLock
, EX_PUSH_LOCK_LOCK
, OldValue
.Value
) !=
824 /* Conversion failed */
829 ASSERT(PushLock
->Locked
);
834 * @name ExWaitOnPushLock
837 * The ExWaitOnPushLock macro acquires and instantly releases a pushlock.
840 * Pointer to a pushlock.
844 * @remarks The function attempts to get any exclusive waiters out of their slow
845 * path by forcing an instant acquire/release operation.
847 * Callers of ExWaitOnPushLock must be running at IRQL <= APC_LEVEL.
852 ExWaitOnPushLock(PEX_PUSH_LOCK PushLock
)
854 /* Check if we're locked */
855 if (PushLock
->Locked
)
857 /* Acquire the lock */
858 ExfAcquirePushLockExclusive(PushLock
);
859 ASSERT(PushLock
->Locked
);
862 ExfReleasePushLockExclusive(PushLock
);
867 * @name ExReleasePushLockShared
870 * The ExReleasePushLockShared macro releases a previously acquired PushLock.
873 * Pointer to a previously acquired pushlock.
877 * @remarks The function attempts the quickest route to release the lock, which is
878 * to simply decrease the share count and remove the lock bit.
879 * However, if the pushlock is being waited on then the long path is taken.
881 * Callers of ExReleasePushLockShared must be running at IRQL <= APC_LEVEL.
882 * This macro should usually be paired up with KeLeaveCriticalRegion.
887 ExReleasePushLockShared(PEX_PUSH_LOCK PushLock
)
889 EX_PUSH_LOCK OldValue
;
892 ASSERT(PushLock
->Locked
);
893 ASSERT(PushLock
->Waiting
|| PushLock
->Shared
> 0);
895 /* Try to clear the pushlock */
896 OldValue
.Value
= EX_PUSH_LOCK_LOCK
| EX_PUSH_LOCK_SHARE_INC
;
897 if (ExpChangePushlock(PushLock
, 0, OldValue
.Ptr
) != OldValue
.Ptr
)
899 /* There are still other people waiting on it */
900 ExfReleasePushLockShared(PushLock
);
905 * @name ExReleasePushLockExclusive
908 * The ExReleasePushLockExclusive macro releases a previously
909 * exclusively acquired PushLock.
912 * Pointer to a previously acquired pushlock.
916 * @remarks The function attempts the quickest route to release the lock, which is
917 * to simply clear the locked bit.
918 * However, if the pushlock is being waited on, the slow path is taken
919 * in an attempt to wake up the lock.
921 * Callers of ExReleasePushLockExclusive must be running at IRQL <= APC_LEVEL.
922 * This macro should usually be paired up with KeLeaveCriticalRegion.
927 ExReleasePushLockExclusive(PEX_PUSH_LOCK PushLock
)
929 EX_PUSH_LOCK OldValue
;
932 ASSERT(PushLock
->Locked
);
933 ASSERT(PushLock
->Waiting
|| PushLock
->Shared
== 0);
935 /* Unlock the pushlock */
936 OldValue
.Value
= InterlockedExchangeAddSizeT((PLONG
)PushLock
,
937 -(LONG
)EX_PUSH_LOCK_LOCK
);
940 ASSERT(OldValue
.Locked
);
941 ASSERT(OldValue
.Waiting
|| OldValue
.Shared
== 0);
943 /* Check if anyone is waiting on it and it's not already waking*/
944 if ((OldValue
.Waiting
) && !(OldValue
.Waking
))
947 ExfTryToWakePushLock(PushLock
);
952 * @name ExReleasePushLock
955 * The ExReleasePushLock macro releases a previously acquired PushLock.
958 * Pointer to a previously acquired pushlock.
962 * @remarks The function attempts the quickest route to release the lock, which is
963 * to simply clear all the fields and decrease the share count if required.
964 * However, if the pushlock is being waited on then the long path is taken.
966 * Callers of ExReleasePushLock must be running at IRQL <= APC_LEVEL.
967 * This macro should usually be paired up with KeLeaveCriticalRegion.
972 ExReleasePushLock(PEX_PUSH_LOCK PushLock
)
974 EX_PUSH_LOCK OldValue
= *PushLock
;
975 EX_PUSH_LOCK NewValue
;
978 ASSERT(OldValue
.Locked
);
980 /* Check if the pushlock is shared */
981 if (OldValue
.Shared
> 1)
983 /* Decrease the share count */
984 NewValue
.Value
= OldValue
.Value
- EX_PUSH_LOCK_SHARE_INC
;
988 /* Clear the pushlock entirely */
992 /* Check if nobody is waiting on us and try clearing the lock here */
993 if ((OldValue
.Waiting
) ||
994 (ExpChangePushlock(PushLock
, NewValue
.Ptr
, OldValue
.Ptr
) !=
997 /* We have waiters, use the long path */
998 ExfReleasePushLock(PushLock
);
1002 /* OTHER FUNCTIONS **********************************************************/
1006 ExTryToAcquireResourceExclusiveLite(
1007 IN PERESOURCE Resource
1012 ExfpInterlockedExchange64(
1013 LONGLONG
volatile * Destination
,
1018 ExpSetTimeZoneInformation(PTIME_ZONE_INFORMATION TimeZoneInformation
);
1022 ExAcquireTimeRefreshLock(BOOLEAN Wait
);
1026 ExReleaseTimeRefreshLock(VOID
);
1030 ExUpdateSystemTimeFromCmos(IN BOOLEAN UpdateInterruptTime
,
1031 IN ULONG MaxSepInSeconds
);
1035 ExpAllocateLocallyUniqueId(OUT LUID
*LocallyUniqueId
);
1039 ExTimerRundown(VOID
);
1044 IN PLOADER_PARAMETER_BLOCK LoaderBlock
1050 IN PLOADER_PARAMETER_BLOCK LoaderBlock
1053 #define InterlockedDecrementUL(Addend) \
1054 (ULONG)InterlockedDecrement((PLONG)(Addend))
1056 #define InterlockedIncrementUL(Addend) \
1057 (ULONG)InterlockedIncrement((PLONG)(Addend))
1059 #define InterlockedExchangeUL(Target, Value) \
1060 (ULONG)InterlockedExchange((PLONG)(Target), (LONG)(Value))
1062 #define InterlockedExchangeAddUL(Addend, Value) \
1063 (ULONG)InterlockedExchangeAdd((PLONG)(Addend), (LONG)(Value))
1065 #define InterlockedCompareExchangeUL(Destination, Exchange, Comperand) \
1066 (ULONG)InterlockedCompareExchange((PLONG)(Destination), (LONG)(Exchange), (LONG)(Comperand))
1068 #define ExfInterlockedCompareExchange64UL(Destination, Exchange, Comperand) \
1069 (ULONGLONG)ExfInterlockedCompareExchange64((PLONGLONG)(Destination), (PLONGLONG)(Exchange), (PLONGLONG)(Comperand))
1071 #define ExfpInterlockedExchange64UL(Target, Value) \
1072 (ULONGLONG)ExfpInterlockedExchange64((PLONGLONG)(Target), (PLONGLONG)(Value))
1074 #endif /* __NTOSKRNL_INCLUDE_INTERNAL_EXECUTIVE_H */