mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 19:22:58 +00:00
- Cleanup RepairList, KiMoveApcState.
- Fixup comments for KeAreApcsDisabled. - Implement and add comment header to KeAreAllApcsDisabled. svn path=/trunk/; revision=24052
This commit is contained in:
parent
2fea34f0e1
commit
4b35027c0f
1 changed files with 63 additions and 31 deletions
|
@ -472,27 +472,30 @@ Quickie:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline
|
FORCEINLINE
|
||||||
VOID RepairList(PLIST_ENTRY Original,
|
VOID
|
||||||
PLIST_ENTRY Copy,
|
RepairList(IN PLIST_ENTRY Original,
|
||||||
KPROCESSOR_MODE Mode)
|
IN PLIST_ENTRY Copy,
|
||||||
|
IN KPROCESSOR_MODE Mode)
|
||||||
{
|
{
|
||||||
/* Copy Source to Desination */
|
/* Check if the list for this mode is empty */
|
||||||
if (IsListEmpty(&Original[(int)Mode])) {
|
if (IsListEmpty(&Original[Mode]))
|
||||||
|
{
|
||||||
InitializeListHead(&Copy[(int)Mode]);
|
/* It is, all we need to do is initialize it */
|
||||||
|
InitializeListHead(&Copy[Mode]);
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
Copy[(int)Mode].Flink = Original[(int)Mode].Flink;
|
{
|
||||||
Copy[(int)Mode].Blink = Original[(int)Mode].Blink;
|
/* Copy the lists */
|
||||||
Original[(int)Mode].Flink->Blink = &Copy[(int)Mode];
|
Copy[Mode].Flink = Original[Mode].Flink;
|
||||||
Original[(int)Mode].Blink->Flink = &Copy[(int)Mode];
|
Copy[Mode].Blink = Original[Mode].Blink;
|
||||||
|
Original[Mode].Flink->Blink = &Copy[Mode];
|
||||||
|
Original[Mode].Blink->Flink = &Copy[Mode];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
STDCALL
|
NTAPI
|
||||||
KiMoveApcState(PKAPC_STATE OldState,
|
KiMoveApcState(PKAPC_STATE OldState,
|
||||||
PKAPC_STATE NewState)
|
PKAPC_STATE NewState)
|
||||||
{
|
{
|
||||||
|
@ -832,33 +835,62 @@ KeRemoveQueueApc(PKAPC Apc)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*++
|
/*++
|
||||||
* KeAreApcsDisabled
|
* @name KeAreApcsDisabled
|
||||||
* @implemented NT4
|
* @implemented NT4
|
||||||
*
|
*
|
||||||
* Prepares the Context for a User-Mode APC called through NTDLL.DLL
|
* The KeAreApcsDisabled routine returns whether kernel APC delivery is
|
||||||
|
* disabled for the current thread.
|
||||||
*
|
*
|
||||||
* Params:
|
* @param None.
|
||||||
* None.
|
|
||||||
*
|
*
|
||||||
* Returns:
|
* @return KeAreApcsDisabled returns TRUE if the thread is within a critical
|
||||||
* KeAreApcsDisabled returns TRUE if the thread is within a critical region
|
* region or a guarded region, and FALSE otherwise.
|
||||||
* or a guarded region, and FALSE otherwise.
|
|
||||||
*
|
*
|
||||||
* Remarks:
|
* @remarks A thread running at IRQL = PASSIVE_LEVEL can use KeAreApcsDisabled
|
||||||
* A thread running at IRQL = PASSIVE_LEVEL can use KeAreApcsDisabled to
|
* determine if normal kernel APCs are disabled.
|
||||||
* determine if normal kernel APCs are disabled. A thread that is inside a
|
|
||||||
* critical region has both user APCs and normal kernel APCs disabled, but
|
|
||||||
* not special kernel APCs. A thread that is inside a guarded region has
|
|
||||||
* all APCs disabled, including special kernel APCs.
|
|
||||||
*
|
*
|
||||||
* Callers of this routine must be running at IRQL <= APC_LEVEL.
|
* A thread that is inside critical region has both user APCs and
|
||||||
|
* normal kernel APCs disabled, but not special kernel APCs.
|
||||||
|
*
|
||||||
|
* A thread that is inside a guarded region has all APCs disabled,
|
||||||
|
* including special kernel APCs.
|
||||||
|
*
|
||||||
|
* Callers of this routine must be running at IRQL <= DISPATCH_LEVEL.
|
||||||
*
|
*
|
||||||
*--*/
|
*--*/
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
STDCALL
|
NTAPI
|
||||||
KeAreApcsDisabled(VOID)
|
KeAreApcsDisabled(VOID)
|
||||||
{
|
{
|
||||||
/* Return the Kernel APC State */
|
/* Return the Kernel APC State */
|
||||||
return KeGetCurrentThread()->CombinedApcDisable ? TRUE : FALSE;
|
return KeGetCurrentThread()->CombinedApcDisable ? TRUE : FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*++
|
||||||
|
* @name KeAreAllApcsDisabled
|
||||||
|
* @implemented NT5.1
|
||||||
|
*
|
||||||
|
* The KeAreAllApcsDisabled routine returns whether the calling thread is
|
||||||
|
* inside a guarded region or running at IRQL = APC_LEVEL, which disables
|
||||||
|
* all APC delivery.
|
||||||
|
*
|
||||||
|
* @param None.
|
||||||
|
*
|
||||||
|
* @return KeAreAllApcsDisabled returns TRUE if the thread is within a guarded
|
||||||
|
* guarded region or running at IRQL >= APC_LEVEL, and FALSE otherwise.
|
||||||
|
*
|
||||||
|
* @remarks A thread running at IRQL = PASSIVE_LEVEL can use this routine to
|
||||||
|
* determine if all APCs delivery is disabled.
|
||||||
|
*
|
||||||
|
* Callers of this routine must be running at IRQL <= DISPATCH_LEVEL.
|
||||||
|
*
|
||||||
|
*--*/
|
||||||
|
BOOLEAN
|
||||||
|
NTAPI
|
||||||
|
KeAreAllApcsDisabled(VOID)
|
||||||
|
{
|
||||||
|
/* Return the Special APC State */
|
||||||
|
return ((KeGetCurrentThread()->SpecialApcDisable) ||
|
||||||
|
(KeGetCurrentIrql() >= APC_LEVEL)) ? TRUE : FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue