Commit 4e73595a authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

- Partially implement LdrGetDllHandle.

- Implement LdrGetProcedureAddress.
parent b65c99b0
......@@ -19,6 +19,13 @@
#include "winbase.h"
#include "ntdef.h"
#include "winnt.h"
#include "ntddk.h"
#include "module.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(ntdll);
NTSTATUS WINAPI LdrDisableThreadCalloutsForDll(HANDLE hModule)
{
......@@ -27,3 +34,38 @@ NTSTATUS WINAPI LdrDisableThreadCalloutsForDll(HANDLE hModule)
else
return STATUS_DLL_NOT_FOUND;
}
/* FIXME : MODULE_FindModule should depend on LdrGetDllHandle, not vice-versa */
NTSTATUS WINAPI LdrGetDllHandle(ULONG x, LONG y, PUNICODE_STRING name, PVOID *base)
{
STRING str;
WINE_MODREF *wm;
FIXME("%08lx %08lx %s %p : partial stub\n",x,y,debugstr_wn(name->Buffer,name->Length),base);
*base = 0;
RtlUnicodeStringToAnsiString(&str, name, TRUE);
wm = MODULE_FindModule(str.Buffer);
if(!wm)
return STATUS_DLL_NOT_FOUND;
*base = (PVOID) wm->module;
return STATUS_SUCCESS;
}
/* FIXME : MODULE_GetProcAddress should depend on LdrGetProcedureAddress, not vice-versa */
NTSTATUS WINAPI LdrGetProcedureAddress(PVOID base, PANSI_STRING name, ULONG ord, PVOID *address)
{
WARN("%p %s %ld %p\n",base, debugstr_an(name->Buffer,name->Length), ord, address);
if(name)
*address = MODULE_GetProcAddress( (HMODULE) base, name->Buffer, FALSE);
else
*address = MODULE_GetProcAddress( (HMODULE) base, (LPSTR) ord, FALSE);
return (*address) ? STATUS_SUCCESS : STATUS_DLL_NOT_FOUND;
}
......@@ -41,8 +41,8 @@ name ntdll
@ stub LdrFindEntryForAddress
@ stub LdrFindResourceDirectory_U
@ stub LdrFindResource_U
@ stub LdrGetDllHandle
@ stub LdrGetProcedureAddress
@ stdcall LdrGetDllHandle(long long ptr ptr) LdrGetDllHandle
@ stdcall LdrGetProcedureAddress(ptr ptr long ptr) LdrGetProcedureAddress
@ stub LdrInitializeThunk
@ stub LdrLoadDll
@ stub LdrProcessRelocationBlock
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment