[PATCH 3/5] ntdll: Respect HEAP_NO_SERIALIZE flag in HeapLock / HeapUnlock.

Rémi Bernon rbernon at codeweavers.com
Thu Apr 28 05:31:47 CDT 2022


Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---
 dlls/kernel32/tests/heap.c | 2 --
 dlls/ntdll/heap.c          | 4 ++--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/dlls/kernel32/tests/heap.c b/dlls/kernel32/tests/heap.c
index 28cbee6ea83..93392ad3a3c 100644
--- a/dlls/kernel32/tests/heap.c
+++ b/dlls/kernel32/tests/heap.c
@@ -952,11 +952,9 @@ static void test_HeapCreate(void)
     thread_params.flags = 0;
     SetEvent( thread_params.start_event );
     res = WaitForSingleObject( thread_params.ready_event, 100 );
-    todo_wine
     ok( !res, "WaitForSingleObject returned %#lx, error %lu\n", res, GetLastError() );
     ret = HeapUnlock( heap );
     ok( ret, "HeapUnlock failed, error %lu\n", GetLastError() );
-    if (res) WaitForSingleObject( thread_params.ready_event, 100 );
 
     ret = HeapLock( heap );
     ok( ret, "HeapLock failed, error %lu\n", GetLastError() );
diff --git a/dlls/ntdll/heap.c b/dlls/ntdll/heap.c
index c3689ecca9e..37e77cf1d23 100644
--- a/dlls/ntdll/heap.c
+++ b/dlls/ntdll/heap.c
@@ -1986,7 +1986,7 @@ BOOLEAN WINAPI RtlLockHeap( HANDLE heap )
 {
     HEAP *heapPtr = HEAP_GetPtr( heap );
     if (!heapPtr) return FALSE;
-    RtlEnterCriticalSection( &heapPtr->cs );
+    heap_lock( heapPtr, 0 );
     return TRUE;
 }
 
@@ -2007,7 +2007,7 @@ BOOLEAN WINAPI RtlUnlockHeap( HANDLE heap )
 {
     HEAP *heapPtr = HEAP_GetPtr( heap );
     if (!heapPtr) return FALSE;
-    RtlLeaveCriticalSection( &heapPtr->cs );
+    heap_unlock( heapPtr, 0 );
     return TRUE;
 }
 
-- 
2.35.1




More information about the wine-devel mailing list