From: Eric Pouech epouech@codeweavers.com
Signed-off-by: Eric Pouech epouech@codeweavers.com --- dlls/dbghelp/dbghelp_private.h | 2 ++ dlls/dbghelp/symbol.c | 5 ++--- dlls/dbghelp/type.c | 8 +++++++- 3 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/dlls/dbghelp/dbghelp_private.h b/dlls/dbghelp/dbghelp_private.h index 66282a2e6e9..f2c74f05d24 100644 --- a/dlls/dbghelp/dbghelp_private.h +++ b/dlls/dbghelp/dbghelp_private.h @@ -972,6 +972,8 @@ extern BOOL lineinfo_set_nameA(struct process* pcs, struct lineinfo_t* i extern void symt_init_basic(struct module* module); extern BOOL symt_get_info(struct module* module, const struct symt* type, IMAGEHLP_SYMBOL_TYPE_INFO req, void* pInfo); +extern BOOL symt_get_info_from_index(struct module* module, DWORD index, + IMAGEHLP_SYMBOL_TYPE_INFO req, void* pInfo); extern struct symt_basic* symt_get_basic(enum BasicType, unsigned size); extern struct symt_udt* diff --git a/dlls/dbghelp/symbol.c b/dlls/dbghelp/symbol.c index 65eb4fd3106..784f88beb08 100644 --- a/dlls/dbghelp/symbol.c +++ b/dlls/dbghelp/symbol.c @@ -708,8 +708,7 @@ static BOOL symt_fill_sym_info(struct module_pair* pair, sym_info->Reserved[0] = sym_info->Reserved[1] = 0; if (!symt_get_info(pair->effective, sym, TI_GET_LENGTH, &size) && (!sym_info->TypeIndex || - !symt_get_info(pair->effective, symt_index2ptr(pair->effective, sym_info->TypeIndex), - TI_GET_LENGTH, &size))) + !symt_get_info_from_index(pair->effective, sym_info->TypeIndex, TI_GET_LENGTH, &size))) size = 0; sym_info->Size = (DWORD)size; sym_info->ModBase = pair->requested->module.BaseOfImage; @@ -991,7 +990,7 @@ static void symt_get_length(struct module* module, const struct symt* symt, ULON return;
if (symt_get_info(module, symt, TI_GET_TYPE, &type_index) && - symt_get_info(module, symt_index2ptr(module, type_index), TI_GET_LENGTH, size)) return; + symt_get_info_from_index(module, type_index, TI_GET_LENGTH, size)) return; *size = 1; /* no size info */ }
diff --git a/dlls/dbghelp/type.c b/dlls/dbghelp/type.c index 8be905116c7..97abb60f64d 100644 --- a/dlls/dbghelp/type.c +++ b/dlls/dbghelp/type.c @@ -1111,6 +1111,12 @@ BOOL symt_get_info(struct module* module, const struct symt* type, return TRUE; }
+BOOL symt_get_info_from_index(struct module* module, DWORD index, + IMAGEHLP_SYMBOL_TYPE_INFO req, void* pInfo) +{ + return symt_get_info(module, symt_index2ptr(module, index), req, pInfo); +} + /****************************************************************** * SymGetTypeInfo (DBGHELP.@) * @@ -1122,7 +1128,7 @@ BOOL WINAPI SymGetTypeInfo(HANDLE hProcess, DWORD64 ModBase, struct module_pair pair;
if (!module_init_pair(&pair, hProcess, ModBase)) return FALSE; - return symt_get_info(pair.effective, symt_index2ptr(pair.effective, TypeId), GetType, pInfo); + return symt_get_info_from_index(pair.effective, TypeId, GetType, pInfo); }
/******************************************************************