sync with trunk r46493
[reactos.git] / dll / win32 / kernel32 / synch / critical.c
index 474a5d6..ac5280a 100644 (file)
@@ -55,4 +55,30 @@ InitializeCriticalSectionAndSpinCount(OUT LPCRITICAL_SECTION lpCriticalSection,
     return TRUE;
 }
 
+/*
+ * @implemented
+ */
+BOOL WINAPI InitializeCriticalSectionEx(OUT LPCRITICAL_SECTION lpCriticalSection,
+                                       IN DWORD dwSpinCount,
+                                       IN DWORD flags )
+{
+    NTSTATUS Status;
+
+    /* FIXME: Flags ignored */
+
+    /* Initialize the critical section */
+    Status = RtlInitializeCriticalSectionAndSpinCount(
+        (PRTL_CRITICAL_SECTION)lpCriticalSection,
+        dwSpinCount);
+    if (!NT_SUCCESS(Status))
+    {
+        /* Set failure code */
+        SetLastErrorByStatus(Status);
+        return FALSE;
+    }
+
+    /* Success */
+    return TRUE;
+}
+
 /* EOF */