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
;
29 typedef struct _EXHANDLE
38 HANDLE GenericHandleOverlay
;
41 } EXHANDLE
, *PEXHANDLE
;
43 typedef struct _ETIMER
48 LIST_ENTRY ActiveTimerListEntry
;
51 BOOLEAN ApcAssociated
;
53 LIST_ENTRY WakeTimerListEntry
;
58 PCALLBACK_OBJECT
*CallbackObject
;
62 #define MAX_FAST_REFS 7
64 /* Note: we only use a spinlock on SMP. On UP, we cli/sti intead */
66 #define ExAcquireResourceLock(l, i) { \
70 #define ExReleaseResourceLock(l, i) _enable();
72 #define ExAcquireResourceLock(l, i) KeAcquireSpinLock(l, i);
73 #define ExReleaseResourceLock(l, i) KeReleaseSpinLock(l, i);
76 #define ExAcquireRundownProtection _ExAcquireRundownProtection
77 #define ExReleaseRundownProtection _ExReleaseRundownProtection
78 #define ExInitializeRundownProtection _ExInitializeRundownProtection
79 #define ExWaitForRundownProtectionRelease _ExWaitForRundownProtectionRelease
80 #define ExRundownCompleted _ExRundownCompleted
81 #define ExGetPreviousMode KeGetPreviousMode
85 // Various bits tagged on the handle or handle table
87 #define EXHANDLE_TABLE_ENTRY_LOCK_BIT 1
88 #define FREE_HANDLE_MASK -1
91 // Number of entries in each table level
93 #define LOW_LEVEL_ENTRIES (PAGE_SIZE / sizeof(HANDLE_TABLE_ENTRY))
94 #define MID_LEVEL_ENTRIES (PAGE_SIZE / sizeof(PHANDLE_TABLE_ENTRY))
95 #define HIGH_LEVEL_ENTRIES (65535 / (LOW_LEVEL_ENTRIES * MID_LEVEL_ENTRIES))
98 // Maximum index in each table level before we need another table
100 #define MAX_LOW_INDEX LOW_LEVEL_ENTRIES
101 #define MAX_MID_INDEX (MID_LEVEL_ENTRIES * LOW_LEVEL_ENTRIES)
102 #define MAX_HIGH_INDEX (MID_LEVEL_ENTRIES * MID_LEVEL_ENTRIES * LOW_LEVEL_ENTRIES)
107 #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) < 40102
110 // Broken GCC with Alignment Bug. We'll do alignment ourselves at higher cost.
112 #define DEFINE_WAIT_BLOCK(x) \
116 EX_PUSH_LOCK_WAIT_BLOCK UnalignedBlock; \
118 PEX_PUSH_LOCK_WAIT_BLOCK x = (PEX_PUSH_LOCK_WAIT_BLOCK) \
119 ((ULONG_PTR)&WaitBlockBuffer.UnalignedBlock &~ 0xF);
124 // This is only for compatibility; the compiler will optimize the extra
125 // local variable (the actual pointer) away, so we don't take any perf hit
128 #define DEFINE_WAIT_BLOCK(x) \
129 EX_PUSH_LOCK_WAIT_BLOCK WaitBlockBuffer; \
130 PEX_PUSH_LOCK_WAIT_BLOCK x = &WaitBlockBuffer;
134 /* INITIALIZATION FUNCTIONS *************************************************/
146 Phase1Initialization(
152 ExpInitializePushLocks(VOID
);
156 ExRefreshTimeZoneInformation(
157 IN PLARGE_INTEGER SystemBootTime
162 ExpInitializeWorkerThreads(VOID
);
166 ExpInitLookasideLists(VOID
);
170 ExInitializeSystemLookasideList(
171 IN PGENERAL_LOOKASIDE List
,
175 IN USHORT MaximumDepth
,
176 IN PLIST_ENTRY ListHead
181 ExpInitializeCallbacks(VOID
);
189 ExpInitializeExecutive(
191 IN PLOADER_PARAMETER_BLOCK LoaderBlock
196 ExpInitializeEventImplementation(VOID
);
200 ExpInitializeEventImplementation(VOID
);
204 ExpInitializeEventPairImplementation(VOID
);
208 ExpInitializeSemaphoreImplementation(VOID
);
212 ExpInitializeMutantImplementation(VOID
);
216 ExpInitializeTimerImplementation(VOID
);
220 ExpInitializeProfileImplementation(VOID
);
224 ExpResourceInitialization(VOID
);
228 ExInitPoolLookasidePointers(VOID
);
230 /* Callback Functions ********************************************************/
234 ExInitializeCallBack(
235 IN OUT PEX_CALLBACK Callback
238 PEX_CALLBACK_ROUTINE_BLOCK
241 IN PEX_CALLBACK_FUNCTION Function
,
248 IN PEX_CALLBACK_ROUTINE_BLOCK CallbackRoutineBlock
253 ExCompareExchangeCallBack (
254 IN OUT PEX_CALLBACK CallBack
,
255 IN PEX_CALLBACK_ROUTINE_BLOCK NewBlock
,
256 IN PEX_CALLBACK_ROUTINE_BLOCK OldBlock
259 PEX_CALLBACK_ROUTINE_BLOCK
261 ExReferenceCallBackBlock(
262 IN OUT PEX_CALLBACK CallBack
267 ExDereferenceCallBackBlock(
268 IN OUT PEX_CALLBACK CallBack
,
269 IN PEX_CALLBACK_ROUTINE_BLOCK CallbackRoutineBlock
272 PEX_CALLBACK_FUNCTION
274 ExGetCallBackBlockRoutine(
275 IN PEX_CALLBACK_ROUTINE_BLOCK CallbackRoutineBlock
280 ExGetCallBackBlockContext(
281 IN PEX_CALLBACK_ROUTINE_BLOCK CallbackRoutineBlock
287 IN PEX_CALLBACK_ROUTINE_BLOCK CallbackRoutineBlock
290 /* Rundown Functions ********************************************************/
294 ExfInitializeRundownProtection(
295 OUT PEX_RUNDOWN_REF RunRef
300 ExfReInitializeRundownProtection(
301 OUT PEX_RUNDOWN_REF RunRef
306 ExfAcquireRundownProtection(
307 IN OUT PEX_RUNDOWN_REF RunRef
312 ExfAcquireRundownProtectionEx(
313 IN OUT PEX_RUNDOWN_REF RunRef
,
319 ExfReleaseRundownProtection(
320 IN OUT PEX_RUNDOWN_REF RunRef
325 ExfReleaseRundownProtectionEx(
326 IN OUT PEX_RUNDOWN_REF RunRef
,
333 OUT PEX_RUNDOWN_REF RunRef
338 ExfWaitForRundownProtectionRelease(
339 IN OUT PEX_RUNDOWN_REF RunRef
342 /* HANDLE TABLE FUNCTIONS ***************************************************/
345 (NTAPI
*PEX_SWEEP_HANDLE_CALLBACK
)(
346 PHANDLE_TABLE_ENTRY HandleTableEntry
,
352 (NTAPI
*PEX_DUPLICATE_HANDLE_CALLBACK
)(
353 IN PEPROCESS Process
,
354 IN PHANDLE_TABLE HandleTable
,
355 IN PHANDLE_TABLE_ENTRY HandleTableEntry
,
356 IN PHANDLE_TABLE_ENTRY NewEntry
360 (NTAPI
*PEX_CHANGE_HANDLE_CALLBACK
)(
361 PHANDLE_TABLE_ENTRY HandleTableEntry
,
367 ExpInitializeHandleTables(
374 IN PEPROCESS Process OPTIONAL
379 ExUnlockHandleTableEntry(
380 IN PHANDLE_TABLE HandleTable
,
381 IN PHANDLE_TABLE_ENTRY HandleTableEntry
387 IN PHANDLE_TABLE HandleTable
,
388 IN PHANDLE_TABLE_ENTRY HandleTableEntry
393 ExDestroyHandleTable(
394 IN PHANDLE_TABLE HandleTable
,
395 IN PVOID DestroyHandleProcedure OPTIONAL
401 IN PHANDLE_TABLE HandleTable
,
403 IN PHANDLE_TABLE_ENTRY HandleTableEntry OPTIONAL
408 ExMapHandleToPointer(
409 IN PHANDLE_TABLE HandleTable
,
416 IN PEPROCESS Process
,
417 IN PHANDLE_TABLE HandleTable
,
418 IN PEX_DUPLICATE_HANDLE_CALLBACK DupHandleProcedure
,
425 IN PHANDLE_TABLE HandleTable
,
427 IN PEX_CHANGE_HANDLE_CALLBACK ChangeRoutine
,
434 IN PHANDLE_TABLE HandleTable
,
435 IN PEX_SWEEP_HANDLE_CALLBACK EnumHandleProcedure
,
439 /* PSEH EXCEPTION HANDLING **************************************************/
443 ExSystemExceptionFilter(VOID
);
445 static __inline
_SEH_FILTER(_SEH_ExSystemExceptionFilter
)
447 return ExSystemExceptionFilter();
450 /* CALLBACKS *****************************************************************/
454 ExDoCallBack(IN OUT PEX_CALLBACK Callback
,
459 PEX_CALLBACK_ROUTINE_BLOCK CallbackRoutineBlock
;
460 PEX_CALLBACK_FUNCTION Function
;
462 /* Reference the block */
463 CallbackRoutineBlock
= ExReferenceCallBackBlock(Callback
);
464 if (CallbackRoutineBlock
)
466 /* Get the function */
467 Function
= ExGetCallBackBlockRoutine(CallbackRoutineBlock
);
469 /* Do the callback */
470 Function(Context
, Argument1
, Argument2
);
472 /* Now dereference it */
473 ExDereferenceCallBackBlock(Callback
, CallbackRoutineBlock
);
477 /* RUNDOWN *******************************************************************/
480 #define ExpChangeRundown(x, y, z) InterlockedCompareExchange64((PLONGLONG)x, y, z)
481 #define ExpSetRundown(x, y) InterlockedExchange64((PLONGLONG)x, y)
483 #define ExpChangeRundown(x, y, z) InterlockedCompareExchange((PLONG)x, PtrToLong(y), PtrToLong(z))
484 #define ExpChangePushlock(x, y, z) LongToPtr(InterlockedCompareExchange((PLONG)x, PtrToLong(y), PtrToLong(z)))
485 #define ExpSetRundown(x, y) InterlockedExchange((PLONG)x, y)
489 * @name ExfAcquireRundownProtection
492 * The ExfAcquireRundownProtection routine acquires rundown protection for
493 * the specified descriptor.
496 * Pointer to a rundown reference descriptor.
498 * @return TRUE if access to the protected structure was granted, FALSE otherwise.
500 * @remarks This is the internal macro for system use only.In case the rundown
501 * was active, then the slow-path will be called through the exported
507 _ExAcquireRundownProtection(IN PEX_RUNDOWN_REF RunRef
)
509 ULONG_PTR Value
, NewValue
;
511 /* Get the current value and mask the active bit */
512 Value
= RunRef
->Count
&~ EX_RUNDOWN_ACTIVE
;
514 /* Add a reference */
515 NewValue
= Value
+ EX_RUNDOWN_COUNT_INC
;
517 /* Change the value */
518 NewValue
= ExpChangeRundown(RunRef
, NewValue
, Value
);
519 if (NewValue
!= Value
)
521 /* Rundown was active, use long path */
522 return ExfAcquireRundownProtection(RunRef
);
530 * @name ExReleaseRundownProtection
533 * The ExReleaseRundownProtection routine releases rundown protection for
534 * the specified descriptor.
537 * Pointer to a rundown reference descriptor.
539 * @return TRUE if access to the protected structure was granted, FALSE otherwise.
541 * @remarks This is the internal macro for system use only.In case the rundown
542 * was active, then the slow-path will be called through the exported
548 _ExReleaseRundownProtection(IN PEX_RUNDOWN_REF RunRef
)
550 ULONG_PTR Value
, NewValue
;
552 /* Get the current value and mask the active bit */
553 Value
= RunRef
->Count
&~ EX_RUNDOWN_ACTIVE
;
555 /* Remove a reference */
556 NewValue
= Value
- EX_RUNDOWN_COUNT_INC
;
558 /* Change the value */
559 NewValue
= ExpChangeRundown(RunRef
, NewValue
, Value
);
561 /* Check if the rundown was active */
562 if (NewValue
!= Value
)
564 /* Rundown was active, use long path */
565 ExfReleaseRundownProtection(RunRef
);
570 ASSERT((Value
>= EX_RUNDOWN_COUNT_INC
) || (KeNumberProcessors
> 1));
575 * @name ExInitializeRundownProtection
578 * The ExInitializeRundownProtection routine initializes a rundown
579 * protection descriptor.
582 * Pointer to a rundown reference descriptor.
586 * @remarks This is the internal macro for system use only.
591 _ExInitializeRundownProtection(IN PEX_RUNDOWN_REF RunRef
)
593 /* Set the count to zero */
598 * @name ExWaitForRundownProtectionRelease
601 * The ExWaitForRundownProtectionRelease routine waits until the specified
602 * rundown descriptor has been released.
605 * Pointer to a rundown reference descriptor.
609 * @remarks This is the internal macro for system use only. If a wait is actually
610 * necessary, then the slow path is taken through the exported function.
615 _ExWaitForRundownProtectionRelease(IN PEX_RUNDOWN_REF RunRef
)
619 /* Set the active bit */
620 Value
= ExpChangeRundown(RunRef
, EX_RUNDOWN_ACTIVE
, 0);
621 if ((Value
) && (Value
!= EX_RUNDOWN_ACTIVE
))
623 /* If the the rundown wasn't already active, then take the long path */
624 ExfWaitForRundownProtectionRelease(RunRef
);
629 * @name ExRundownCompleted
632 * The ExRundownCompleted routine completes the rundown of the specified
633 * descriptor by setting the active bit.
636 * Pointer to a rundown reference descriptor.
640 * @remarks This is the internal macro for system use only.
645 _ExRundownCompleted(IN PEX_RUNDOWN_REF RunRef
)
648 ASSERT((RunRef
->Count
& EX_RUNDOWN_ACTIVE
) != 0);
650 /* Mark the counter as active */
651 ExpSetRundown(&RunRef
->Count
, EX_RUNDOWN_ACTIVE
);
654 /* PUSHLOCKS *****************************************************************/
656 /* FIXME: VERIFY THESE! */
661 IN PEX_PUSH_LOCK PushLock
,
668 IN PEX_PUSH_LOCK PushLock
,
669 IN PVOID CurrentWaitBlock
674 ExWaitForUnblockPushLock(
675 IN PEX_PUSH_LOCK PushLock
,
680 * @name ExInitializePushLock
683 * The ExInitializePushLock macro initializes a PushLock.
686 * Pointer to the pushlock which is to be initialized.
695 ExInitializePushLock(IN PULONG_PTR PushLock
)
697 /* Set the value to 0 */
702 * @name ExAcquirePushLockExclusive
705 * The ExAcquirePushLockExclusive macro exclusively acquires a PushLock.
708 * Pointer to the pushlock which is to be acquired.
712 * @remarks The function attempts the quickest route to acquire the lock, which is
713 * to simply set the lock bit.
714 * However, if the pushlock is already shared, the slower path is taken.
716 * Callers of ExAcquirePushLockShared must be running at IRQL <= APC_LEVEL.
717 * This macro should usually be paired up with KeAcquireCriticalRegion.
722 ExAcquirePushLockExclusive(PEX_PUSH_LOCK PushLock
)
724 /* Try acquiring the lock */
725 if (InterlockedBitTestAndSet((PLONG
)PushLock
, EX_PUSH_LOCK_LOCK_V
))
727 /* Someone changed it, use the slow path */
728 DbgPrint("%s - Contention!\n", __FUNCTION__
);
729 ExfAcquirePushLockExclusive(PushLock
);
733 ASSERT(PushLock
->Locked
);
737 * @name ExAcquirePushLockShared
740 * The ExAcquirePushLockShared macro acquires a shared PushLock.
743 * Pointer to the pushlock which is to be acquired.
747 * @remarks The function attempts the quickest route to acquire the lock, which is
748 * to simply set the lock bit and set the share count to one.
749 * However, if the pushlock is already shared, the slower path is taken.
751 * Callers of ExAcquirePushLockShared must be running at IRQL <= APC_LEVEL.
752 * This macro should usually be paired up with KeAcquireCriticalRegion.
757 ExAcquirePushLockShared(PEX_PUSH_LOCK PushLock
)
759 EX_PUSH_LOCK NewValue
;
761 /* Try acquiring the lock */
762 NewValue
.Value
= EX_PUSH_LOCK_LOCK
| EX_PUSH_LOCK_SHARE_INC
;
763 if (ExpChangePushlock(PushLock
, NewValue
.Ptr
, 0))
765 /* Someone changed it, use the slow path */
766 DbgPrint("%s - Contention!\n", __FUNCTION__
);
767 ExfAcquirePushLockShared(PushLock
);
771 ASSERT(PushLock
->Locked
);
772 ASSERT(PushLock
->Waiting
|| PushLock
->Shared
> 0);
776 * @name ExConvertPushLockSharedToExclusive
779 * The ExConvertPushLockSharedToExclusive macro converts an exclusive
780 * pushlock to a shared pushlock.
783 * Pointer to the pushlock which is to be converted.
785 * @return FALSE if conversion failed, TRUE otherwise.
787 * @remarks The function attempts the quickest route to convert the lock, which is
788 * to simply set the lock bit and remove any other bits.
793 ExConvertPushLockSharedToExclusive(IN PEX_PUSH_LOCK PushLock
)
795 EX_PUSH_LOCK OldValue
;
797 /* Set the expected old value */
798 OldValue
.Value
= EX_PUSH_LOCK_LOCK
| EX_PUSH_LOCK_SHARE_INC
;
800 /* Try converting the lock */
801 if (ExpChangePushlock(PushLock
, EX_PUSH_LOCK_LOCK
, OldValue
.Value
) !=
804 /* Conversion failed */
809 ASSERT(PushLock
->Locked
);
814 * @name ExWaitOnPushLock
817 * The ExWaitOnPushLock macro acquires and instantly releases a pushlock.
820 * Pointer to a pushlock.
824 * @remarks The function attempts to get any exclusive waiters out of their slow
825 * path by forcing an instant acquire/release operation.
827 * Callers of ExWaitOnPushLock must be running at IRQL <= APC_LEVEL.
832 ExWaitOnPushLock(PEX_PUSH_LOCK PushLock
)
834 /* Check if we're locked */
835 if (PushLock
->Locked
)
837 /* Acquire the lock */
838 ExfAcquirePushLockExclusive(PushLock
);
839 ASSERT(PushLock
->Locked
);
842 ExfReleasePushLockExclusive(PushLock
);
847 * @name ExReleasePushLockShared
850 * The ExReleasePushLockShared macro releases a previously acquired PushLock.
853 * Pointer to a previously acquired pushlock.
857 * @remarks The function attempts the quickest route to release the lock, which is
858 * to simply decrease the share count and remove the lock bit.
859 * However, if the pushlock is being waited on then the long path is taken.
861 * Callers of ExReleasePushLockShared must be running at IRQL <= APC_LEVEL.
862 * This macro should usually be paired up with KeLeaveCriticalRegion.
867 ExReleasePushLockShared(PEX_PUSH_LOCK PushLock
)
869 EX_PUSH_LOCK OldValue
;
872 ASSERT(PushLock
->Locked
);
873 ASSERT(PushLock
->Waiting
|| PushLock
->Shared
> 0);
875 /* Try to clear the pushlock */
876 OldValue
.Value
= EX_PUSH_LOCK_LOCK
| EX_PUSH_LOCK_SHARE_INC
;
877 if (ExpChangePushlock(PushLock
, 0, OldValue
.Ptr
) != OldValue
.Ptr
)
879 /* There are still other people waiting on it */
880 DbgPrint("%s - Contention!\n", __FUNCTION__
);
881 ExfReleasePushLockShared(PushLock
);
886 * @name ExReleasePushLockExclusive
889 * The ExReleasePushLockExclusive macro releases a previously
890 * exclusively acquired PushLock.
893 * Pointer to a previously acquired pushlock.
897 * @remarks The function attempts the quickest route to release the lock, which is
898 * to simply clear the locked bit.
899 * However, if the pushlock is being waited on, the slow path is taken
900 * in an attempt to wake up the lock.
902 * Callers of ExReleasePushLockExclusive must be running at IRQL <= APC_LEVEL.
903 * This macro should usually be paired up with KeLeaveCriticalRegion.
908 ExReleasePushLockExclusive(PEX_PUSH_LOCK PushLock
)
910 EX_PUSH_LOCK OldValue
;
913 ASSERT(PushLock
->Locked
);
914 ASSERT(PushLock
->Waiting
|| PushLock
->Shared
== 0);
916 /* Unlock the pushlock */
917 OldValue
.Value
= InterlockedExchangeAddSizeT((PLONG
)PushLock
,
918 -(LONG
)EX_PUSH_LOCK_LOCK
);
921 ASSERT(OldValue
.Locked
);
922 ASSERT(OldValue
.Waiting
|| OldValue
.Shared
== 0);
924 /* Check if anyone is waiting on it and it's not already waking*/
925 if ((OldValue
.Waiting
) && !(OldValue
.Waking
))
928 DbgPrint("%s - Contention!\n", __FUNCTION__
);
929 ExfTryToWakePushLock(PushLock
);
934 * @name ExReleasePushLock
937 * The ExReleasePushLock macro releases a previously acquired PushLock.
940 * Pointer to a previously acquired pushlock.
944 * @remarks The function attempts the quickest route to release the lock, which is
945 * to simply clear all the fields and decrease the share count if required.
946 * However, if the pushlock is being waited on then the long path is taken.
948 * Callers of ExReleasePushLock must be running at IRQL <= APC_LEVEL.
949 * This macro should usually be paired up with KeLeaveCriticalRegion.
954 ExReleasePushLock(PEX_PUSH_LOCK PushLock
)
956 EX_PUSH_LOCK OldValue
= *PushLock
;
957 EX_PUSH_LOCK NewValue
;
960 ASSERT(OldValue
.Locked
);
962 /* Check if the pushlock is shared */
963 if (OldValue
.Shared
> 1)
965 /* Decrease the share count */
966 NewValue
.Value
= OldValue
.Value
&~ EX_PUSH_LOCK_SHARE_INC
;
970 /* Clear the pushlock entirely */
974 /* Check if nobody is waiting on us and try clearing the lock here */
975 if ((OldValue
.Waiting
) ||
976 (ExpChangePushlock(PushLock
, NewValue
.Ptr
, OldValue
.Ptr
) !=
979 /* We have waiters, use the long path */
980 DbgPrint("%s - Contention!\n", __FUNCTION__
);
981 ExfReleasePushLock(PushLock
);
985 /* OTHER FUNCTIONS **********************************************************/
989 ExfpInterlockedExchange64(
990 LONGLONG
volatile * Destination
,
995 ExpSetTimeZoneInformation(PTIME_ZONE_INFORMATION TimeZoneInformation
);
999 ExAcquireTimeRefreshLock(BOOLEAN Wait
);
1003 ExReleaseTimeRefreshLock(VOID
);
1007 ExUpdateSystemTimeFromCmos(IN BOOLEAN UpdateInterruptTime
,
1008 IN ULONG MaxSepInSeconds
);
1012 ExpAllocateLocallyUniqueId(OUT LUID
*LocallyUniqueId
);
1016 ExTimerRundown(VOID
);
1018 #define InterlockedDecrementUL(Addend) \
1019 (ULONG)InterlockedDecrement((PLONG)(Addend))
1021 #define InterlockedIncrementUL(Addend) \
1022 (ULONG)InterlockedIncrement((PLONG)(Addend))
1024 #define InterlockedExchangeUL(Target, Value) \
1025 (ULONG)InterlockedExchange((PLONG)(Target), (LONG)(Value))
1027 #define InterlockedExchangeAddUL(Addend, Value) \
1028 (ULONG)InterlockedExchangeAdd((PLONG)(Addend), (LONG)(Value))
1030 #define InterlockedCompareExchangeUL(Destination, Exchange, Comperand) \
1031 (ULONG)InterlockedCompareExchange((PLONG)(Destination), (LONG)(Exchange), (LONG)(Comperand))
1033 #define ExfInterlockedCompareExchange64UL(Destination, Exchange, Comperand) \
1034 (ULONGLONG)ExfInterlockedCompareExchange64((PLONGLONG)(Destination), (PLONGLONG)(Exchange), (PLONGLONG)(Comperand))
1036 #define ExfpInterlockedExchange64UL(Target, Value) \
1037 (ULONGLONG)ExfpInterlockedExchange64((PLONGLONG)(Target), (PLONGLONG)(Value))
1039 #endif /* __NTOSKRNL_INCLUDE_INTERNAL_EXECUTIVE_H */