[NTDLL] Use LDR_LOCK_LOADER_LOCK_FLAG_RAISE_ON_ERRORS flag instead of TRUE
[reactos.git] / reactos / ntoskrnl / ps / thread.c
index 07d7108..3bc9469 100644 (file)
@@ -812,10 +812,22 @@ PsGetCurrentThreadWin32Thread(VOID)
  */
 PVOID
 NTAPI
-PsGetCurrentThreadWin32ThreadAndEnterCriticalRegion(VOID)
+PsGetCurrentThreadWin32ThreadAndEnterCriticalRegion(
+    _Out_ HANDLE* OutProcessId)
 {
+    PETHREAD CurrentThread;
+
+    /* Get the current thread */
+    CurrentThread = PsGetCurrentThread();
+
+    /* Return the process id */
+    *OutProcessId = CurrentThread->Cid.UniqueProcess;
+
+    /* Enter critical region */
     KeEnterCriticalRegion();
-    return PsGetCurrentThread()->Tcb.Win32Thread;
+
+    /* Return the win32 thread */
+    return CurrentThread->Tcb.Win32Thread;
 }
 
 /*