Add NDEBUG back and call LdrLoadDll correctly on Windows. Modified: trunk/reactos/lib/kernel32/misc/dllmain.c Modified: trunk/reactos/lib/kernel32/misc/ldr.c Modified: trunk/reactos/lib/kernel32/misc/nls.c Modified: trunk/reactos/lib/kernel32/misc/stubs.c _____
Modified: trunk/reactos/lib/kernel32/misc/dllmain.c --- trunk/reactos/lib/kernel32/misc/dllmain.c 2005-09-26 20:06:49 UTC (rev 18105) +++ trunk/reactos/lib/kernel32/misc/dllmain.c 2005-09-26 20:08:11 UTC (rev 18106) @@ -13,7 +13,7 @@
#include <k32.h>
-//#define NDEBUG +#define NDEBUG #include "../include/debug.h"
/* GLOBALS *******************************************************************/ @@ -378,7 +378,7 @@
/* Insert more dll attach stuff here! */ DllInitialized = TRUE; - DPRINT1("Initialization complete\n"); + DPRINT("Initialization complete\n"); break;
case DLL_PROCESS_DETACH: _____
Modified: trunk/reactos/lib/kernel32/misc/ldr.c --- trunk/reactos/lib/kernel32/misc/ldr.c 2005-09-26 20:06:49 UTC (rev 18105) +++ trunk/reactos/lib/kernel32/misc/ldr.c 2005-09-26 20:08:11 UTC (rev 18106) @@ -19,6 +19,8 @@
DWORD dwReserved; } LOADPARMS32;
+extern BOOLEAN InWindows; + /* FUNCTIONS ****************************************************************/
/** @@ -167,12 +169,20 @@ HINSTANCE hInst; NTSTATUS Status; PWSTR SearchPath; + ULONG DllCharacteristics;
(void)hFile;
if ( lpLibFileName == NULL ) return NULL;
+ /* Check for any flags LdrLoadDll might be interested in */ + if (dwFlags & DONT_RESOLVE_DLL_REFERENCES) + { + /* Tell LDR to treat it as an EXE */ + DllCharacteristics = IMAGE_FILE_EXECUTABLE_IMAGE; + } + dwFlags &= DONT_RESOLVE_DLL_REFERENCES | LOAD_LIBRARY_AS_DATAFILE | @@ -182,7 +192,19 @@ dwFlags & LOAD_WITH_ALTERED_SEARCH_PATH ? lpLibFileName : NULL);
RtlInitUnicodeString(&DllName, (LPWSTR)lpLibFileName); - Status = LdrLoadDll(SearchPath, dwFlags, &DllName, (PVOID*)&hInst); + if (InWindows) + { + /* Call the API Properly */ + Status = LdrLoadDll(SearchPath, + (ULONG)&DllCharacteristics, // Silence compiler + &DllName, + (PVOID*)&hInst); + } + else + { + /* Call the ROS API. NOTE: Don't fix this, I have a patch to merge later. */ + Status = LdrLoadDll(SearchPath, dwFlags, &DllName, (PVOID*)&hInst); + } RtlFreeHeap(RtlGetProcessHeap(), 0, SearchPath); if ( !NT_SUCCESS(Status)) { _____
Modified: trunk/reactos/lib/kernel32/misc/nls.c --- trunk/reactos/lib/kernel32/misc/nls.c 2005-09-26 20:06:49 UTC (rev 18105) +++ trunk/reactos/lib/kernel32/misc/nls.c 2005-09-26 20:08:11 UTC (rev 18106) @@ -987,13 +987,4 @@
return IntIsLeadByte(&AnsiCodePage.CodePageTable, TestByte); }
-ULONG -WINAPI -NlsGetCacheUpdateCount(VOID) -{ - /* FIXME: */ - UNIMPLEMENTED; - return 0; -} - /* EOF */ _____
Modified: trunk/reactos/lib/kernel32/misc/stubs.c --- trunk/reactos/lib/kernel32/misc/stubs.c 2005-09-26 20:06:49 UTC (rev 18105) +++ trunk/reactos/lib/kernel32/misc/stubs.c 2005-09-26 20:08:11 UTC (rev 18106) @@ -1633,3 +1633,11 @@
STUB; return 0; } + +ULONG +WINAPI +NlsGetCacheUpdateCount(VOID) +{ + STUB; + return 0; +}