mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 09:34:43 +00:00
Add NDEBUG back and call LdrLoadDll correctly on Windows.
svn path=/trunk/; revision=18106
This commit is contained in:
parent
ed77c5e942
commit
2f5a9a2734
4 changed files with 33 additions and 12 deletions
|
@ -13,7 +13,7 @@
|
|||
|
||||
#include <k32.h>
|
||||
|
||||
//#define NDEBUG
|
||||
#define NDEBUG
|
||||
#include "../include/debug.h"
|
||||
|
||||
/* GLOBALS *******************************************************************/
|
||||
|
@ -378,7 +378,7 @@ DllMain(HANDLE hDll,
|
|||
|
||||
/* Insert more dll attach stuff here! */
|
||||
DllInitialized = TRUE;
|
||||
DPRINT1("Initialization complete\n");
|
||||
DPRINT("Initialization complete\n");
|
||||
break;
|
||||
|
||||
case DLL_PROCESS_DETACH:
|
||||
|
|
|
@ -19,6 +19,8 @@ typedef struct tagLOADPARMS32 {
|
|||
DWORD dwReserved;
|
||||
} LOADPARMS32;
|
||||
|
||||
extern BOOLEAN InWindows;
|
||||
|
||||
/* FUNCTIONS ****************************************************************/
|
||||
|
||||
/**
|
||||
|
@ -167,12 +169,20 @@ LoadLibraryExW (
|
|||
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 @@ LoadLibraryExW (
|
|||
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))
|
||||
{
|
||||
|
|
|
@ -987,13 +987,4 @@ IsDBCSLeadByte(BYTE TestByte)
|
|||
return IntIsLeadByte(&AnsiCodePage.CodePageTable, TestByte);
|
||||
}
|
||||
|
||||
ULONG
|
||||
WINAPI
|
||||
NlsGetCacheUpdateCount(VOID)
|
||||
{
|
||||
/* FIXME: */
|
||||
UNIMPLEMENTED;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
|
|
@ -1633,3 +1633,11 @@ SetClientTimeZoneInformation(
|
|||
STUB;
|
||||
return 0;
|
||||
}
|
||||
|
||||
ULONG
|
||||
WINAPI
|
||||
NlsGetCacheUpdateCount(VOID)
|
||||
{
|
||||
STUB;
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue