mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 13:26:17 +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>
|
#include <k32.h>
|
||||||
|
|
||||||
//#define NDEBUG
|
#define NDEBUG
|
||||||
#include "../include/debug.h"
|
#include "../include/debug.h"
|
||||||
|
|
||||||
/* GLOBALS *******************************************************************/
|
/* GLOBALS *******************************************************************/
|
||||||
|
@ -378,7 +378,7 @@ DllMain(HANDLE hDll,
|
||||||
|
|
||||||
/* Insert more dll attach stuff here! */
|
/* Insert more dll attach stuff here! */
|
||||||
DllInitialized = TRUE;
|
DllInitialized = TRUE;
|
||||||
DPRINT1("Initialization complete\n");
|
DPRINT("Initialization complete\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DLL_PROCESS_DETACH:
|
case DLL_PROCESS_DETACH:
|
||||||
|
|
|
@ -19,6 +19,8 @@ typedef struct tagLOADPARMS32 {
|
||||||
DWORD dwReserved;
|
DWORD dwReserved;
|
||||||
} LOADPARMS32;
|
} LOADPARMS32;
|
||||||
|
|
||||||
|
extern BOOLEAN InWindows;
|
||||||
|
|
||||||
/* FUNCTIONS ****************************************************************/
|
/* FUNCTIONS ****************************************************************/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -167,12 +169,20 @@ LoadLibraryExW (
|
||||||
HINSTANCE hInst;
|
HINSTANCE hInst;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
PWSTR SearchPath;
|
PWSTR SearchPath;
|
||||||
|
ULONG DllCharacteristics;
|
||||||
|
|
||||||
(void)hFile;
|
(void)hFile;
|
||||||
|
|
||||||
if ( lpLibFileName == NULL )
|
if ( lpLibFileName == NULL )
|
||||||
return 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 &=
|
dwFlags &=
|
||||||
DONT_RESOLVE_DLL_REFERENCES |
|
DONT_RESOLVE_DLL_REFERENCES |
|
||||||
LOAD_LIBRARY_AS_DATAFILE |
|
LOAD_LIBRARY_AS_DATAFILE |
|
||||||
|
@ -182,7 +192,19 @@ LoadLibraryExW (
|
||||||
dwFlags & LOAD_WITH_ALTERED_SEARCH_PATH ? lpLibFileName : NULL);
|
dwFlags & LOAD_WITH_ALTERED_SEARCH_PATH ? lpLibFileName : NULL);
|
||||||
|
|
||||||
RtlInitUnicodeString(&DllName, (LPWSTR)lpLibFileName);
|
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);
|
RtlFreeHeap(RtlGetProcessHeap(), 0, SearchPath);
|
||||||
if ( !NT_SUCCESS(Status))
|
if ( !NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
|
|
|
@ -987,13 +987,4 @@ IsDBCSLeadByte(BYTE TestByte)
|
||||||
return IntIsLeadByte(&AnsiCodePage.CodePageTable, TestByte);
|
return IntIsLeadByte(&AnsiCodePage.CodePageTable, TestByte);
|
||||||
}
|
}
|
||||||
|
|
||||||
ULONG
|
|
||||||
WINAPI
|
|
||||||
NlsGetCacheUpdateCount(VOID)
|
|
||||||
{
|
|
||||||
/* FIXME: */
|
|
||||||
UNIMPLEMENTED;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
|
@ -1633,3 +1633,11 @@ SetClientTimeZoneInformation(
|
||||||
STUB;
|
STUB;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ULONG
|
||||||
|
WINAPI
|
||||||
|
NlsGetCacheUpdateCount(VOID)
|
||||||
|
{
|
||||||
|
STUB;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue