Implemented SymLoadModuleEx.

This commit is contained in:
Eric Pouech 2005-11-29 11:24:46 +01:00 committed by Alexandre Julliard
parent c238ec520f
commit 1cb1183037
5 changed files with 36 additions and 3 deletions

View File

@ -99,6 +99,21 @@ struct process* process_find_by_handle(HANDLE hProcess)
return p;
}
/******************************************************************
* 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.@)
*

View File

@ -72,7 +72,7 @@
@ stdcall SymInitialize(long str long)
@ stdcall SymLoadModule64(long long str str double 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)
@ stub SymMatchString
@ stdcall SymRegisterCallback64(long ptr double)

View File

@ -312,7 +312,8 @@ struct line_info
/* dbghelp.c */
extern struct process* process_find_by_handle(HANDLE hProcess);
extern HANDLE hMsvcrt;
extern BOOL validate_addr64(DWORD64 addr);
/* elf_module.c */
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*);

View File

@ -374,6 +374,23 @@ done:
return module->module.BaseOfImage;
}
/***********************************************************************
* 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.@)
*/

View File

@ -614,7 +614,7 @@ BOOL WINAPI SymGetModuleInfo(HANDLE, DWORD, PIMAGEHLP_MODULE);
BOOL WINAPI SymGetModuleInfoW(HANDLE, DWORD, PIMAGEHLP_MODULEW);
DWORD WINAPI SymGetModuleBase(HANDLE, 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);
BOOL WINAPI SymUnloadModule(HANDLE, DWORD);