--- dlls/dbghelp/type.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/dlls/dbghelp/type.c b/dlls/dbghelp/type.c index 8e91eb3c554..1a7cef9b7c0 100644 --- a/dlls/dbghelp/type.c +++ b/dlls/dbghelp/type.c @@ -925,6 +925,8 @@ BOOL WINAPI SymGetTypeFromName(HANDLE hProcess, ULONG64 BaseOfDll, { struct module_pair pair; struct symt* type; + const char* name; + DWORD64 size;
pair.pcs = process_find_by_handle(hProcess); if (!pair.pcs) return FALSE; @@ -932,7 +934,19 @@ BOOL WINAPI SymGetTypeFromName(HANDLE hProcess, ULONG64 BaseOfDll, if (!module_get_debug(&pair)) return FALSE; type = symt_find_type_by_name(pair.effective, SymTagNull, Name); if (!type) return FALSE; - Symbol->TypeIndex = symt_ptr2index(pair.effective, type); - + Symbol->Index = Symbol->TypeIndex = symt_ptr2index(pair.effective, type); + if (Symbol->MaxNameLen) + { + name = symt_get_name(type); + Symbol->NameLen = min(strlen(name), Symbol->MaxNameLen - 1); + memcpy(Symbol->Name, name, Symbol->NameLen); + Symbol->Name[Symbol->NameLen] = '\0'; + } + else + Symbol->NameLen = 0; + symt_get_info(pair.effective, type, TI_GET_LENGTH, &size); + Symbol->Size = size; + Symbol->ModBase = pair.requested->module.BaseOfImage; + Symbol->Tag = type->tag; return TRUE; }