Author: jgardou
Date: Thu Jul 12 14:55:53 2012
New Revision: 56874
URL:
http://svn.reactos.org/svn/reactos?rev=56874&view=rev
Log:
[NTDLL]
* Fix Cookie for loader locking generation
Silences "LdrUnlockLoaderLock() called with an invalid cookie!" debug messages
Modified:
trunk/reactos/dll/ntdll/ldr/ldrapi.c
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] Thu Jul 12 14:55:53 2012
@@ -37,7 +37,7 @@
{
/* Generate a cookie */
return (((ULONG_PTR)NtCurrentTeb()->RealClientId.UniqueThread & 0xFFF)
<< 16) |
- _InterlockedIncrement(&LdrpLoaderLockAcquisitonCount);
+ (_InterlockedIncrement(&LdrpLoaderLockAcquisitonCount) &
0xFFFF);
}
/*
@@ -1540,19 +1540,19 @@
LdrUnloadAlternateResourceModule(IN PVOID BaseAddress)
{
ULONG_PTR Cookie;
-
+
/* Acquire the loader lock */
LdrLockLoaderLock(TRUE, NULL, &Cookie);
-
+
/* Check if there's any alternate resources loaded */
if (AlternateResourceModuleCount)
{
UNIMPLEMENTED;
}
-
+
/* Release the loader lock */
LdrUnlockLoaderLock(1, Cookie);
-
+
/* All done */
return TRUE;
}
@@ -1570,9 +1570,9 @@
{
/* Is MUI Support enabled? */
if (!LdrAlternateResourcesEnabled()) return STATUS_SUCCESS;
-
+
UNIMPLEMENTED;
return STATUS_MUI_FILE_NOT_FOUND;
}
-
+
/* EOF */