From f9a6dfab7d27d12a020642efd1393f869a464fbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gardou?= Date: Thu, 12 Jul 2012 14:55:53 +0000 Subject: [PATCH] [NTDLL] * Fix Cookie for loader locking generation Silences "LdrUnlockLoaderLock() called with an invalid cookie!" debug messages svn path=/trunk/; revision=56874 --- reactos/dll/ntdll/ldr/ldrapi.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/reactos/dll/ntdll/ldr/ldrapi.c b/reactos/dll/ntdll/ldr/ldrapi.c index f5c59139377..4b73bf92c5d 100644 --- a/reactos/dll/ntdll/ldr/ldrapi.c +++ b/reactos/dll/ntdll/ldr/ldrapi.c @@ -37,7 +37,7 @@ LdrpMakeCookie(VOID) { /* Generate a cookie */ return (((ULONG_PTR)NtCurrentTeb()->RealClientId.UniqueThread & 0xFFF) << 16) | - _InterlockedIncrement(&LdrpLoaderLockAcquisitonCount); + (_InterlockedIncrement(&LdrpLoaderLockAcquisitonCount) & 0xFFFF); } /* @@ -1540,19 +1540,19 @@ NTAPI 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 @@ LdrLoadAlternateResourceModule(IN PVOID Module, { /* Is MUI Support enabled? */ if (!LdrAlternateResourcesEnabled()) return STATUS_SUCCESS; - + UNIMPLEMENTED; return STATUS_MUI_FILE_NOT_FOUND; } - + /* EOF */