Author: rmessiant
Date: Sat Sep 17 20:26:31 2011
New Revision: 53729
URL:
http://svn.reactos.org/svn/reactos?rev=53729&view=rev
Log:
[NTOSKRNL]
Disable normal APC delivery while acquiring/releasing a heap lock. Also, BOOLEAN !=
NTSTATUS.
Modified:
trunk/reactos/ntoskrnl/rtl/libsupp.c
Modified: trunk/reactos/ntoskrnl/rtl/libsupp.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/rtl/libsupp.c?rev…
==============================================================================
--- trunk/reactos/ntoskrnl/rtl/libsupp.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/rtl/libsupp.c [iso-8859-1] Sat Sep 17 20:26:31 2011
@@ -168,7 +168,10 @@
RtlEnterHeapLock(
PHEAP_LOCK Lock)
{
- return ExAcquireResourceExclusive(&Lock->Resource, TRUE);
+ KeEnterCriticalRegion();
+ ExAcquireResourceExclusive(&Lock->Resource, TRUE);
+ KeLeaveCriticalRegion();
+ return STATUS_SUCCESS;
}
NTSTATUS
@@ -185,7 +188,9 @@
RtlLeaveHeapLock(
PHEAP_LOCK Lock)
{
+ KeEnterCriticalRegion();
ExReleaseResource(&Lock->Resource);
+ KeLeaveCriticalRegion();
return STATUS_SUCCESS;
}
Why enable APC delivery after the resource is acquired?
It should stay disabled to prevent deadlocks.