Author: ion
Date: Fri Jul 8 21:07:31 2011
New Revision: 52575
URL:
http://svn.reactos.org/svn/reactos?rev=52575&view=rev
Log:
[NTDLL]: Fix LdrUnlockLoaderLock bugs. 4x10000$.
Modified:
trunk/reactos/dll/ntdll/ldr/ldrapi.c
trunk/reactos/include/ndk/ldrtypes.h
Modified: trunk/reactos/dll/ntdll/ldr/ldrapi.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/ldr/ldrapi.c?rev…
==============================================================================
--- trunk/reactos/dll/ntdll/ldr/ldrapi.c [iso-8859-1] (original)
+++ trunk/reactos/dll/ntdll/ldr/ldrapi.c [iso-8859-1] Fri Jul 8 21:07:31 2011
@@ -34,19 +34,17 @@
DPRINT("LdrUnlockLoaderLock(%x %x)\n", Flags, Cookie);
/* Check for valid flags */
- if (Flags & ~1)
+ if (Flags & ~LDR_UNLOCK_LOADER_LOCK_FLAG_RAISE_ON_ERRORS)
{
/* Flags are invalid, check how to fail */
- if (Flags & LDR_LOCK_LOADER_LOCK_FLAG_RAISE_ON_ERRORS)
+ if (Flags & LDR_UNLOCK_LOADER_LOCK_FLAG_RAISE_ON_ERRORS)
{
/* The caller wants us to raise status */
RtlRaiseStatus(STATUS_INVALID_PARAMETER_1);
}
- else
- {
- /* A normal failure */
- return STATUS_INVALID_PARAMETER_1;
- }
+
+ /* A normal failure */
+ return STATUS_INVALID_PARAMETER_1;
}
/* If we don't have a cookie, just return */
@@ -59,20 +57,18 @@
DPRINT1("LdrUnlockLoaderLock() called with an invalid cookie!\n");
/* Invalid cookie, check how to fail */
- if (Flags & LDR_LOCK_LOADER_LOCK_FLAG_RAISE_ON_ERRORS)
+ if (Flags & LDR_UNLOCK_LOADER_LOCK_FLAG_RAISE_ON_ERRORS)
{
/* The caller wants us to raise status */
RtlRaiseStatus(STATUS_INVALID_PARAMETER_2);
}
- else
- {
- /* A normal failure */
- return STATUS_INVALID_PARAMETER_2;
- }
+
+ /* A normal failure */
+ return STATUS_INVALID_PARAMETER_2;
}
/* Ready to release the lock */
- if (Flags & LDR_LOCK_LOADER_LOCK_FLAG_RAISE_ON_ERRORS)
+ if (Flags & LDR_UNLOCK_LOADER_LOCK_FLAG_RAISE_ON_ERRORS)
{
/* Do a direct leave */
RtlLeaveCriticalSection(&LdrpLoaderLock);
Modified: trunk/reactos/include/ndk/ldrtypes.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/ldrtypes.h?rev…
==============================================================================
--- trunk/reactos/include/ndk/ldrtypes.h [iso-8859-1] (original)
+++ trunk/reactos/include/ndk/ldrtypes.h [iso-8859-1] Fri Jul 8 21:07:31 2011
@@ -73,6 +73,11 @@
//
#define LDR_LOCK_LOADER_LOCK_FLAG_RAISE_ON_ERRORS 0x00000001
#define LDR_LOCK_LOADER_LOCK_FLAG_TRY_ONLY 0x00000002
+
+//
+// LdrUnlockLoaderLock Flags
+//
+#define LDR_UNLOCK_LOADER_LOCK_FLAG_RAISE_ON_ERRORS 0x00000001
#define LDR_LOCK_LOADER_LOCK_DISPOSITION_INVALID 0
#define LDR_LOCK_LOADER_LOCK_DISPOSITION_LOCK_ACQUIRED 1