Implemented SymGetModuleInfo64.

This commit is contained in:
Eric Pouech 2005-11-29 11:42:13 +01:00 committed by Alexandre Julliard
parent 567919d78f
commit dd3e1dc525
3 changed files with 86 additions and 2 deletions

View File

@ -53,7 +53,7 @@
@ stdcall SymGetLinePrev(long ptr)
@ stub SymGetModuleBase64
@ stdcall SymGetModuleBase(long long)
@ stub SymGetModuleInfo64
@ stdcall SymGetModuleInfo64(long double ptr)
@ stdcall SymGetModuleInfo(long long ptr)
@ stub SymGetModuleInfoW64
@ stub SymGetModuleInfoW

View File

@ -551,6 +551,61 @@ BOOL WINAPI SymGetModuleInfo(HANDLE hProcess, DWORD dwAddr,
return TRUE;
}
/******************************************************************
* SymGetModuleInfo64 (DBGHELP.@)
*
*/
BOOL WINAPI SymGetModuleInfo64(HANDLE hProcess, DWORD64 dwAddr,
PIMAGEHLP_MODULE64 ModuleInfo)
{
struct process* pcs = process_find_by_handle(hProcess);
struct module* module;
DWORD sz;
IMAGEHLP_MODULE64 mod;
TRACE("%p %s %p\n", hProcess, wine_dbgstr_longlong(dwAddr), ModuleInfo);
if (!pcs) return FALSE;
if (ModuleInfo->SizeOfStruct > sizeof(*ModuleInfo)) return FALSE;
module = module_find_by_addr(pcs, dwAddr, DMT_UNKNOWN);
if (!module) return FALSE;
mod.BaseOfImage = module->module.BaseOfImage;
mod.ImageSize = module->module.ImageSize;
mod.TimeDateStamp = module->module.TimeDateStamp;
mod.CheckSum = module->module.CheckSum;
mod.NumSyms = module->module.NumSyms;
mod.SymType = module->module.SymType;
strcpy(mod.ModuleName, module->module.ModuleName);
strcpy(mod.ImageName, module->module.ImageName);
strcpy(mod.LoadedImageName, module->module.LoadedImageName);
/* FIXME: all following attributes need to be set */
mod.LoadedPdbName[0] = '\0';
mod.CVSig = 0;
memset(mod.CVData, 0, sizeof(mod.CVData));
mod.PdbSig = 0;
memset(&mod.PdbSig70, 0, sizeof(mod.PdbSig70));
mod.PdbAge = 0;
mod.PdbUnmatched = 0;
mod.DbgUnmatched = 0;
mod.LineNumbers = 0;
mod.GlobalSymbols = 0;
mod.TypeInfo = 0;
mod.SourceIndexed = 0;
mod.Publics = 0;
if (module->module.SymType == SymNone)
{
module = module_get_container(pcs, module);
if (module && module->module.SymType != SymNone)
mod.SymType = module->module.SymType;
}
sz = ModuleInfo->SizeOfStruct;
memcpy(ModuleInfo, &mod, sz);
ModuleInfo->SizeOfStruct = sz;
return TRUE;
}
/***********************************************************************
* SymGetModuleBase (IMAGEHLP.@)
*/

View File

@ -113,7 +113,8 @@ typedef struct _IMAGEHLP_MODULE
CHAR LoadedImageName[256];
} IMAGEHLP_MODULE, *PIMAGEHLP_MODULE;
typedef struct _IMAGEHLP_MODULEW {
typedef struct _IMAGEHLP_MODULEW
{
DWORD SizeOfStruct;
DWORD BaseOfImage;
DWORD ImageSize;
@ -126,6 +127,33 @@ typedef struct _IMAGEHLP_MODULEW {
WCHAR LoadedImageName[256];
} IMAGEHLP_MODULEW, *PIMAGEHLP_MODULEW;
typedef struct _IMAGEHLP_MODULE64
{
DWORD SizeOfStruct;
DWORD64 BaseOfImage;
DWORD ImageSize;
DWORD TimeDateStamp;
DWORD CheckSum;
DWORD NumSyms;
SYM_TYPE SymType;
CHAR ModuleName[32];
CHAR ImageName[256];
CHAR LoadedImageName[256];
CHAR LoadedPdbName[256];
DWORD CVSig;
CHAR CVData[MAX_PATH*3];
DWORD PdbSig;
GUID PdbSig70;
DWORD PdbAge;
BOOL PdbUnmatched;
BOOL DbgUnmatched;
BOOL LineNumbers;
BOOL GlobalSymbols;
BOOL TypeInfo;
BOOL SourceIndexed;
BOOL Publics;
} IMAGEHLP_MODULE64, *PIMAGEHLP_MODULE64;
typedef struct _IMAGEHLP_LINE
{
DWORD SizeOfStruct;
@ -612,6 +640,7 @@ typedef BOOL (CALLBACK *PSYM_ENUMMODULES_CALLBACK)(PSTR, DWORD, PVOID);
BOOL WINAPI SymEnumerateModules(HANDLE, PSYM_ENUMMODULES_CALLBACK, PVOID);
BOOL WINAPI SymGetModuleInfo(HANDLE, DWORD, PIMAGEHLP_MODULE);
BOOL WINAPI SymGetModuleInfoW(HANDLE, DWORD, PIMAGEHLP_MODULEW);
BOOL WINAPI SymGetModuleInfo64(HANDLE, DWORD64, PIMAGEHLP_MODULE64);
DWORD WINAPI SymGetModuleBase(HANDLE, DWORD);
DWORD WINAPI SymLoadModule(HANDLE, HANDLE, PSTR, PSTR, DWORD, DWORD);
DWORD64 WINAPI SymLoadModuleEx(HANDLE, HANDLE, PCSTR, PCSTR, DWORD64, DWORD,