Commit 1cb11830 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

Implemented SymLoadModuleEx.

parent c238ec52
...@@ -100,6 +100,21 @@ struct process* process_find_by_handle(HANDLE hProcess) ...@@ -100,6 +100,21 @@ struct process* process_find_by_handle(HANDLE hProcess)
} }
/****************************************************************** /******************************************************************
* validate_addr64 (internal)
*
*/
BOOL validate_addr64(DWORD64 addr)
{
if (addr >> 32)
{
FIXME("Unsupported address %s\n", wine_dbgstr_longlong(addr));
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
return TRUE;
}
/******************************************************************
* SymSetSearchPath (DBGHELP.@) * SymSetSearchPath (DBGHELP.@)
* *
*/ */
......
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
@ stdcall SymInitialize(long str long) @ stdcall SymInitialize(long str long)
@ stdcall SymLoadModule64(long long str str double long) @ stdcall SymLoadModule64(long long str str double long)
@ stdcall SymLoadModule(long long str str long long) @ stdcall SymLoadModule(long long str str long long)
@ stub SymLoadModuleEx @ stdcall SymLoadModuleEx(long long str str double long ptr long)
@ stdcall SymMatchFileName(str str ptr ptr) @ stdcall SymMatchFileName(str str ptr ptr)
@ stub SymMatchString @ stub SymMatchString
@ stdcall SymRegisterCallback64(long ptr double) @ stdcall SymRegisterCallback64(long ptr double)
......
...@@ -312,7 +312,8 @@ struct line_info ...@@ -312,7 +312,8 @@ struct line_info
/* dbghelp.c */ /* dbghelp.c */
extern struct process* process_find_by_handle(HANDLE hProcess); extern struct process* process_find_by_handle(HANDLE hProcess);
extern HANDLE hMsvcrt; extern HANDLE hMsvcrt;
extern BOOL validate_addr64(DWORD64 addr);
/* elf_module.c */ /* elf_module.c */
typedef BOOL (*elf_enum_modules_cb)(const char*, unsigned long addr, void* user); typedef BOOL (*elf_enum_modules_cb)(const char*, unsigned long addr, void* user);
extern BOOL elf_enum_modules(HANDLE hProc, elf_enum_modules_cb, void*); extern BOOL elf_enum_modules(HANDLE hProc, elf_enum_modules_cb, void*);
......
...@@ -375,6 +375,23 @@ done: ...@@ -375,6 +375,23 @@ done:
} }
/*********************************************************************** /***********************************************************************
* SymLoadModuleEx (DBGHELP.@)
*/
DWORD64 WINAPI SymLoadModuleEx(HANDLE hProcess, HANDLE hFile, PCSTR ImageName,
PCSTR ModuleName, DWORD64 BaseOfDll, DWORD DllSize,
PMODLOAD_DATA Data, DWORD Flags)
{
if (Data || Flags)
{
FIXME("Unsupported parameters (%p, %lx) for %s\n", Data, Flags, ImageName);
if (Flags & 1) return TRUE;
}
if (!validate_addr64(BaseOfDll)) return FALSE;
return SymLoadModule(hProcess, hFile, (char*)ImageName, (char*)ModuleName,
(DWORD)BaseOfDll, DllSize);
}
/***********************************************************************
* SymLoadModule64 (DBGHELP.@) * SymLoadModule64 (DBGHELP.@)
*/ */
DWORD WINAPI SymLoadModule64(HANDLE hProcess, HANDLE hFile, char* ImageName, DWORD WINAPI SymLoadModule64(HANDLE hProcess, HANDLE hFile, char* ImageName,
......
...@@ -614,7 +614,7 @@ BOOL WINAPI SymGetModuleInfo(HANDLE, DWORD, PIMAGEHLP_MODULE); ...@@ -614,7 +614,7 @@ BOOL WINAPI SymGetModuleInfo(HANDLE, DWORD, PIMAGEHLP_MODULE);
BOOL WINAPI SymGetModuleInfoW(HANDLE, DWORD, PIMAGEHLP_MODULEW); BOOL WINAPI SymGetModuleInfoW(HANDLE, DWORD, PIMAGEHLP_MODULEW);
DWORD WINAPI SymGetModuleBase(HANDLE, DWORD); DWORD WINAPI SymGetModuleBase(HANDLE, DWORD);
DWORD WINAPI SymLoadModule(HANDLE, HANDLE, PSTR, PSTR, DWORD, DWORD); DWORD WINAPI SymLoadModule(HANDLE, HANDLE, PSTR, PSTR, DWORD, DWORD);
DWORD64 WINAPI SymLoadModuleEx(HANDLE, HANDLE, PSTR, PSTR, DWORD64, DWORD, DWORD64 WINAPI SymLoadModuleEx(HANDLE, HANDLE, PCSTR, PCSTR, DWORD64, DWORD,
PMODLOAD_DATA, DWORD); PMODLOAD_DATA, DWORD);
BOOL WINAPI SymUnloadModule(HANDLE, DWORD); BOOL WINAPI SymUnloadModule(HANDLE, DWORD);
......
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