Author: sir_richard
Date: Sun Mar 4 02:56:16 2012
New Revision: 55985
URL: http://svn.reactos.org/svn/reactos?rev=55985&view=rev
Log:
[NTOS]: Don't keep the address space locked when failing in NtFreeVirtualMemory. Dang this testbot is good at catching those bugs.
Modified:
trunk/reactos/ntoskrnl/mm/ARM3/virtual.c
Modified: trunk/reactos/ntoskrnl/mm/ARM3/virtual.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/virtual.c…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/virtual.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/virtual.c [iso-8859-1] Sun Mar 4 02:56:16 2012
@@ -1825,7 +1825,6 @@
//
if (PteCount) MiProcessValidPteList(ValidPteList, PteCount);
MiUnlockWorkingSet(CurrentThread, &Process->Vm);
- if (CommitReduction) DPRINT1("DBG-REDUCE: %lx\n", CommitReduction);
return CommitReduction;
}
@@ -3870,7 +3869,7 @@
//
// Finally lock the working set and remove the VAD from the VAD tree
//
- MiLockWorkingSet(CurrentThread, &Process->Vm);
+ MiLockWorkingSet(CurrentThread, AddressSpace);
ASSERT(Process->VadRoot.NumberGenericTableElements >= 1);
MiRemoveNode((PMMADDRESS_NODE)Vad, &Process->VadRoot);
}
@@ -3900,7 +3899,7 @@
// the code path above when the caller sets a zero region size
// and the whole VAD is destroyed
//
- MiLockWorkingSet(CurrentThread, &Process->Vm);
+ MiLockWorkingSet(CurrentThread, AddressSpace);
ASSERT(Process->VadRoot.NumberGenericTableElements >= 1);
MiRemoveNode((PMMADDRESS_NODE)Vad, &Process->VadRoot);
}
@@ -3972,7 +3971,7 @@
// around with process pages.
//
MiDeleteVirtualAddresses(StartingAddress, EndingAddress, NULL);
- MiUnlockWorkingSet(CurrentThread, &Process->Vm);
+ MiUnlockWorkingSet(CurrentThread, AddressSpace);
Status = STATUS_SUCCESS;
FinalPath:
@@ -4069,6 +4068,7 @@
// return whatever failure code was sent.
//
FailPath:
+ MiUnlockWorkingSet(CurrentThread, AddressSpace);
if (Attached) KeUnstackDetachProcess(&ApcState);
if (ProcessHandle != NtCurrentProcess()) ObDereferenceObject(Process);
return Status;
Author: sir_richard
Date: Sun Mar 4 00:47:20 2012
New Revision: 55981
URL: http://svn.reactos.org/svn/reactos?rev=55981&view=rev
Log:
[RTL]: Sorry, forgot this critical part of the VAD commit.
Modified:
trunk/reactos/lib/rtl/avlsupp.c
Modified: trunk/reactos/lib/rtl/avlsupp.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/avlsupp.c?rev=5598…
==============================================================================
--- trunk/reactos/lib/rtl/avlsupp.c [iso-8859-1] (original)
+++ trunk/reactos/lib/rtl/avlsupp.c [iso-8859-1] Sun Mar 4 00:47:20 2012
@@ -224,7 +224,8 @@
{
/* This is the new root node */
RtlInsertAsRightChildAvl(&Table->BalancedRoot, NewNode);
- MI_ASSERT(RtlBalance(NewNode) == RtlBalancedAvlTree);
+ //MI_ASSERT(RtlBalance(NewNode) == RtlBalancedAvlTree);
+ if (RtlBalance(NewNode) != RtlBalancedAvlTree) DPRINT1("Warning: Root node unbalanced?\n");
/* On AVL trees, we also update the depth */
ASSERT(Table->DepthOfTree == 0);
@@ -243,7 +244,8 @@
}
/* Little cheat to save on loop processing, taken from Timo */
- MI_ASSERT(RtlBalance(NewNode) == RtlBalancedAvlTree);
+ //MI_ASSERT(RtlBalance(NewNode) == RtlBalancedAvlTree);
+ if (RtlBalance(NewNode) != RtlBalancedAvlTree) DPRINT1("Warning: Root node unbalanced?\n");
RtlSetBalance(&Table->BalancedRoot, RtlLeftHeavyAvlTree);
/*