dbghelp: Implemented SymEnumSymbolsW.
This commit is contained in:
parent
96efcbc47b
commit
208e701a7b
|
@ -39,7 +39,7 @@
|
|||
@ stub SymEnumSourceFilesW
|
||||
@ stub SymEnumSym
|
||||
@ stdcall SymEnumSymbols(ptr double str ptr ptr)
|
||||
@ stub SymEnumSymbolsW
|
||||
@ stdcall SymEnumSymbolsW(ptr double wstr ptr ptr)
|
||||
@ stub SymEnumSymbolsForAddr
|
||||
@ stub SymEnumSymbolsForAddrW
|
||||
@ stdcall SymEnumTypes(ptr double ptr ptr)
|
||||
|
|
|
@ -902,6 +902,53 @@ BOOL WINAPI SymEnumSymbols(HANDLE hProcess, ULONG64 BaseOfDll, PCSTR Mask,
|
|||
return sym_enum(hProcess, BaseOfDll, Mask, &se);
|
||||
}
|
||||
|
||||
struct sym_enumW
|
||||
{
|
||||
PSYM_ENUMERATESYMBOLS_CALLBACKW cb;
|
||||
void* ctx;
|
||||
PSYMBOL_INFOW sym_info;
|
||||
char buffer[sizeof(SYMBOL_INFOW) + MAX_SYM_NAME];
|
||||
|
||||
};
|
||||
|
||||
static BOOL CALLBACK sym_enumW(PSYMBOL_INFO si, ULONG size, PVOID ctx)
|
||||
{
|
||||
struct sym_enumW* sew = ctx;
|
||||
|
||||
copy_symbolW(sew->sym_info, si);
|
||||
|
||||
return (sew->cb)(sew->sym_info, size, sew->ctx);
|
||||
}
|
||||
|
||||
/******************************************************************
|
||||
* SymEnumSymbolsW (DBGHELP.@)
|
||||
*
|
||||
*/
|
||||
BOOL WINAPI SymEnumSymbolsW(HANDLE hProcess, ULONG64 BaseOfDll, PCWSTR Mask,
|
||||
PSYM_ENUMERATESYMBOLS_CALLBACKW EnumSymbolsCallback,
|
||||
PVOID UserContext)
|
||||
{
|
||||
struct sym_enumW sew;
|
||||
BOOL ret = FALSE;
|
||||
char* maskA = NULL;
|
||||
|
||||
sew.ctx = UserContext;
|
||||
sew.cb = EnumSymbolsCallback;
|
||||
sew.sym_info = (PSYMBOL_INFOW)sew.buffer;
|
||||
|
||||
if (Mask)
|
||||
{
|
||||
unsigned len = WideCharToMultiByte(CP_ACP, 0, Mask, -1, NULL, 0, NULL, NULL);
|
||||
maskA = HeapAlloc(GetProcessHeap(), 0, len);
|
||||
if (!maskA) return FALSE;
|
||||
WideCharToMultiByte(CP_ACP, 0, Mask, -1, maskA, len, NULL, NULL);
|
||||
}
|
||||
ret = SymEnumSymbols(hProcess, BaseOfDll, maskA, sym_enumW, &sew);
|
||||
HeapFree(GetProcessHeap(), 0, maskA);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
struct sym_enumerate
|
||||
{
|
||||
void* ctx;
|
||||
|
|
|
@ -907,6 +907,7 @@ typedef struct _TI_FINDCHILDREN_PARAMS
|
|||
|
||||
BOOL WINAPI SymGetTypeInfo(HANDLE, DWORD64, ULONG, IMAGEHLP_SYMBOL_TYPE_INFO, PVOID);
|
||||
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 SymFromAddr(HANDLE, DWORD64, DWORD64*, SYMBOL_INFO*);
|
||||
BOOL WINAPI SymFromAddrW(HANDLE, DWORD64, DWORD64*, SYMBOL_INFOW*);
|
||||
|
@ -923,6 +924,8 @@ BOOL WINAPI SymGetSymPrev(HANDLE, PIMAGEHLP_SYMBOL);
|
|||
BOOL WINAPI SymGetSymPrev64(HANDLE, PIMAGEHLP_SYMBOL64);
|
||||
BOOL WINAPI SymEnumSymbols(HANDLE, ULONG64, PCSTR, PSYM_ENUMERATESYMBOLS_CALLBACK,
|
||||
PVOID);
|
||||
BOOL WINAPI SymEnumSymbolsW(HANDLE, ULONG64, PCWSTR, PSYM_ENUMERATESYMBOLS_CALLBACKW,
|
||||
PVOID);
|
||||
typedef BOOL (CALLBACK *PSYM_ENUMSYMBOLS_CALLBACK)(PSTR, DWORD, ULONG, PVOID);
|
||||
BOOL WINAPI SymEnumerateSymbols(HANDLE, DWORD, PSYM_ENUMSYMBOLS_CALLBACK, PVOID);
|
||||
typedef BOOL (CALLBACK *PSYM_ENUMSYMBOLS_CALLBACK64)(PSTR, DWORD64, ULONG, PVOID);
|
||||
|
|
Loading…
Reference in New Issue