diff --git a/dlls/dbghelp/dbghelp.spec b/dlls/dbghelp/dbghelp.spec index ffb51bb3bd..63bb5afa9b 100644 --- a/dlls/dbghelp/dbghelp.spec +++ b/dlls/dbghelp/dbghelp.spec @@ -43,7 +43,7 @@ @ stub SymEnumSymbolsForAddr @ stub SymEnumSymbolsForAddrW @ stdcall SymEnumTypes(ptr double ptr ptr) -@ stub SymEnumTypesW +@ stdcall SymEnumTypesW(ptr double ptr ptr) @ stdcall SymEnumerateModules(long ptr ptr) @ stdcall SymEnumerateModules64(long ptr ptr) @ stub SymEnumerateModulesW64 diff --git a/dlls/dbghelp/dbghelp_private.h b/dlls/dbghelp/dbghelp_private.h index d450f8d866..198c4da2ca 100644 --- a/dlls/dbghelp/dbghelp_private.h +++ b/dlls/dbghelp/dbghelp_private.h @@ -503,6 +503,7 @@ extern BOOL dwarf2_parse(struct module* module, unsigned long load_offse /* symbol.c */ extern const char* symt_get_name(const struct symt* sym); extern int symt_cmp_addr(const void* p1, const void* p2); +extern void copy_symbolW(SYMBOL_INFOW* siw, const SYMBOL_INFO* si); extern struct symt_ht* symt_find_nearest(struct module* module, DWORD addr); extern struct symt_compiland* diff --git a/dlls/dbghelp/symbol.c b/dlls/dbghelp/symbol.c index cf8abf3a29..06240d437b 100644 --- a/dlls/dbghelp/symbol.c +++ b/dlls/dbghelp/symbol.c @@ -828,7 +828,7 @@ static BOOL symt_enum_locals(struct process* pcs, const char* mask, * Helper for transforming an ANSI symbol info into an UNICODE one. * Assume that MaxNameLen is the same for both version (A & W). */ -static void copy_symbolW(SYMBOL_INFOW* siw, const SYMBOL_INFO* si) +void copy_symbolW(SYMBOL_INFOW* siw, const SYMBOL_INFO* si) { siw->SizeOfStruct = si->SizeOfStruct; siw->TypeIndex = si->TypeIndex; diff --git a/dlls/dbghelp/type.c b/dlls/dbghelp/type.c index 3a36abaacb..4a340adc87 100644 --- a/dlls/dbghelp/type.c +++ b/dlls/dbghelp/type.c @@ -421,6 +421,38 @@ BOOL WINAPI SymEnumTypes(HANDLE hProcess, ULONG64 BaseOfDll, return TRUE; } +struct enum_types_AtoW +{ + char buffer[sizeof(SYMBOL_INFOW) + 256 * sizeof(WCHAR)]; + void* user; + PSYM_ENUMERATESYMBOLS_CALLBACKW callback; +}; + +BOOL CALLBACK enum_types_AtoW(PSYMBOL_INFO si, ULONG addr, PVOID _et) +{ + struct enum_types_AtoW* et = _et; + SYMBOL_INFOW* siW = (SYMBOL_INFOW*)et->buffer; + + copy_symbolW(siW, si); + return et->callback(siW, addr, et->user); +} + +/****************************************************************** + * SymEnumTypesW (DBGHELP.@) + * + */ +BOOL WINAPI SymEnumTypesW(HANDLE hProcess, ULONG64 BaseOfDll, + PSYM_ENUMERATESYMBOLS_CALLBACKW EnumSymbolsCallback, + PVOID UserContext) +{ + struct enum_types_AtoW et; + + et.callback = EnumSymbolsCallback; + et.user = UserContext; + + return SymEnumTypes(hProcess, BaseOfDll, enum_types_AtoW, &et); +} + /****************************************************************** * symt_get_info * diff --git a/include/dbghelp.h b/include/dbghelp.h index b777224cfb..eb2442a46b 100644 --- a/include/dbghelp.h +++ b/include/dbghelp.h @@ -911,6 +911,7 @@ BOOL WINAPI SymGetTypeInfo(HANDLE, DWORD64, ULONG, IMAGEHLP_SYMBOL_TYPE_INFO, PV typedef BOOL (CALLBACK *PSYM_ENUMERATESYMBOLS_CALLBACK)(PSYMBOL_INFO, ULONG, PVOID); typedef BOOL (CALLBACK *PSYM_ENUMERATESYMBOLS_CALLBACKW)(PSYMBOL_INFOW, ULONG, PVOID); BOOL WINAPI SymEnumTypes(HANDLE, ULONG64, PSYM_ENUMERATESYMBOLS_CALLBACK, PVOID); +BOOL WINAPI SymEnumTypesW(HANDLE, ULONG64, PSYM_ENUMERATESYMBOLS_CALLBACKW, PVOID); BOOL WINAPI SymFromAddr(HANDLE, DWORD64, DWORD64*, SYMBOL_INFO*); BOOL WINAPI SymFromAddrW(HANDLE, DWORD64, DWORD64*, SYMBOL_INFOW*); BOOL WINAPI SymFromToken(HANDLE, DWORD64, DWORD, PSYMBOL_INFO);