[NTOS:KD64] First unlock the KD port then lower the IRQL, instead of doing the reverse. (#3942)

This properly reverses the operation of first raising the IRQL before
locking the KD port.
This commit is contained in:
Hermès Bélusca-Maïto 2021-09-05 02:44:20 +02:00
parent c9f335e996
commit 05590079cc
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0

View file

@ -1987,8 +1987,8 @@ KdEnableDebuggerWithLock(IN BOOLEAN NeedLock)
if (NeedLock)
{
/* Do the unlock */
KeLowerIrql(OldIrql);
KdpPortUnlock();
KeLowerIrql(OldIrql);
/* Fail: We're already enabled */
return STATUS_INVALID_PARAMETER;
@ -2022,8 +2022,8 @@ KdEnableDebuggerWithLock(IN BOOLEAN NeedLock)
if (NeedLock)
{
/* Yes, now unlock it */
KeLowerIrql(OldIrql);
KdpPortUnlock();
KeLowerIrql(OldIrql);
}
/* We're done */
@ -2083,8 +2083,8 @@ KdDisableDebuggerWithLock(IN BOOLEAN NeedLock)
if (!NT_SUCCESS(Status))
{
/* Release the lock and fail */
KeLowerIrql(OldIrql);
KdpPortUnlock();
KeLowerIrql(OldIrql);
return Status;
}
}
@ -2112,8 +2112,8 @@ KdDisableDebuggerWithLock(IN BOOLEAN NeedLock)
if (NeedLock)
{
/* Yes, now unlock it */
KeLowerIrql(OldIrql);
KdpPortUnlock();
KeLowerIrql(OldIrql);
}
/* We're done */