Skip to content

Commit 6b88b8c

Browse files
Paul Gofmanrbernon
authored andcommitted
ntdll: Set DebugInfo to NULL for absent DebugInfo in RtlDeleteCriticalSection().
CW-Bug-Id: #23142
1 parent 8725630 commit 6b88b8c

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

dlls/kernel32/tests/sync.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3114,21 +3114,21 @@ static void test_crit_section(void)
31143114
ok(ret, "Failed to initialize critical section.\n");
31153115
ok(cs.DebugInfo == (void *)(ULONG_PTR)-1, "Unexpected debug info pointer %p.\n", cs.DebugInfo);
31163116
DeleteCriticalSection(&cs);
3117-
todo_wine ok(cs.DebugInfo == NULL, "Unexpected debug info pointer %p.\n", cs.DebugInfo);
3117+
ok(cs.DebugInfo == NULL, "Unexpected debug info pointer %p.\n", cs.DebugInfo);
31183118

31193119
memset(&cs, 0, sizeof(cs));
31203120
ret = pInitializeCriticalSectionEx(&cs, 0, CRITICAL_SECTION_NO_DEBUG_INFO);
31213121
ok(ret, "Failed to initialize critical section.\n");
31223122
ok(cs.DebugInfo == (void *)(ULONG_PTR)-1, "Unexpected debug info pointer %p.\n", cs.DebugInfo);
31233123
DeleteCriticalSection(&cs);
3124-
todo_wine ok(cs.DebugInfo == NULL, "Unexpected debug info pointer %p.\n", cs.DebugInfo);
3124+
ok(cs.DebugInfo == NULL, "Unexpected debug info pointer %p.\n", cs.DebugInfo);
31253125

31263126
memset(&cs, 0, sizeof(cs));
31273127
ret = pInitializeCriticalSectionEx(&cs, 0, 0);
31283128
ok(ret, "Failed to initialize critical section.\n");
31293129
ok(cs.DebugInfo == (void *)(ULONG_PTR)-1, "Unexpected debug info pointer %p.\n", cs.DebugInfo);
31303130
DeleteCriticalSection(&cs);
3131-
todo_wine ok(cs.DebugInfo == NULL, "Unexpected debug info pointer %p.\n", cs.DebugInfo);
3131+
ok(cs.DebugInfo == NULL, "Unexpected debug info pointer %p.\n", cs.DebugInfo);
31323132

31333133
memset(&cs, 0, sizeof(cs));
31343134
ret = pInitializeCriticalSectionEx(&cs, 0, RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO);

dlls/ntdll/sync.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,11 @@ NTSTATUS WINAPI RtlDeleteCriticalSection( RTL_CRITICAL_SECTION *crit )
289289
crit->DebugInfo = NULL;
290290
}
291291
}
292-
else NtClose( crit->LockSemaphore );
292+
else
293+
{
294+
NtClose( crit->LockSemaphore );
295+
crit->DebugInfo = NULL;
296+
}
293297
crit->LockSemaphore = 0;
294298
return STATUS_SUCCESS;
295299
}

0 commit comments

Comments
 (0)