RtlEnterCriticalSection

Michael Marxmeier mike at marxmeier.com
Wed Oct 17 17:22:10 CDT 2001


After encountering timeout messages from
RtlEnterCriticalSection i had a look at it.

Since interlocked_inc() should never return zero
the following patch is likely necessary.
I was unable to test this as now wine crashes with
a segmentation fault (which also terminates gdb).


Michael

--- critsection.c.orig  Wed Oct 17 23:24:13 2001
+++ critsection.c       Thu Oct 18 00:04:32 2001
@@ -233,7 +233,7 @@
   */
  NTSTATUS WINAPI RtlEnterCriticalSection( RTL_CRITICAL_SECTION *crit )
  {
-    if (interlocked_inc( &crit->LockCount ))
+    if (interlocked_inc( &crit->LockCount ) != 1)
      {
          if (crit->OwningThread == GetCurrentThreadId())
          {





More information about the wine-patches mailing list