dbghelp: Implemented SymEnumTypesW.

This commit is contained in:
Eric Pouech 2007-03-04 17:00:50 +01:00 committed by Alexandre Julliard
parent 90167f26d3
commit ccf0be8e57
5 changed files with 36 additions and 2 deletions

View File

@ -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

View File

@ -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*

View File

@ -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;

View File

@ -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
*

View File

@ -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);