diff --git a/dlls/dbghelp/dbghelp.spec b/dlls/dbghelp/dbghelp.spec index a59ca401519..b15aae773a1 100644 --- a/dlls/dbghelp/dbghelp.spec +++ b/dlls/dbghelp/dbghelp.spec @@ -134,7 +134,7 @@ @ stdcall SymRegisterFunctionEntryCallback(ptr ptr ptr) @ stdcall SymRegisterFunctionEntryCallback64(ptr ptr double) @ stdcall SymSearch(long double long long str double ptr ptr long) -@ stub SymSearchW +@ stdcall SymSearchW(long double long long wstr double ptr ptr long) @ stdcall SymSetContext(long ptr ptr) @ stub SymSetHomeDirectory @ stub SymSetHomeDirectoryW diff --git a/dlls/dbghelp/symbol.c b/dlls/dbghelp/symbol.c index add5be608d9..a2181889920 100644 --- a/dlls/dbghelp/symbol.c +++ b/dlls/dbghelp/symbol.c @@ -1538,3 +1538,38 @@ BOOL WINAPI SymSearch(HANDLE hProcess, ULONG64 BaseOfDll, DWORD Index, return sym_enum(hProcess, BaseOfDll, Mask, &se); } + +/****************************************************************** + * SymSearchW (DBGHELP.@) + */ +BOOL WINAPI SymSearchW(HANDLE hProcess, ULONG64 BaseOfDll, DWORD Index, + DWORD SymTag, PCWSTR Mask, DWORD64 Address, + PSYM_ENUMERATESYMBOLS_CALLBACKW EnumSymbolsCallback, + PVOID UserContext, DWORD Options) +{ + struct sym_enumW sew; + BOOL ret = FALSE; + char* maskA = NULL; + + TRACE("(%p %s %lu %lu %s %s %p %p %lx)\n", + hProcess, wine_dbgstr_longlong(BaseOfDll), Index, SymTag, debugstr_w(Mask), + wine_dbgstr_longlong(Address), EnumSymbolsCallback, + UserContext, Options); + + 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 = SymSearch(hProcess, BaseOfDll, Index, SymTag, maskA, Address, + sym_enumW, &sew, Options); + HeapFree(GetProcessHeap(), 0, maskA); + + return ret; +} diff --git a/include/dbghelp.h b/include/dbghelp.h index b8a5c38efae..27eb7d90330 100644 --- a/include/dbghelp.h +++ b/include/dbghelp.h @@ -942,6 +942,7 @@ DWORD WINAPI UnDecorateSymbolName(LPCSTR, LPSTR, DWORD, DWORD); BOOL WINAPI SymMatchString(PCSTR, PCSTR, BOOL); BOOL WINAPI SymMatchStringW(PCWSTR, PCWSTR, BOOL); BOOL WINAPI SymSearch(HANDLE, ULONG64, DWORD, DWORD, PCSTR, DWORD64, PSYM_ENUMERATESYMBOLS_CALLBACK, PVOID, DWORD); +BOOL WINAPI SymSearchW(HANDLE, ULONG64, DWORD, DWORD, PCWSTR, DWORD64, PSYM_ENUMERATESYMBOLS_CALLBACKW, PVOID, DWORD); DWORD WINAPI UnDecorateSymbolName(PCSTR, PSTR, DWORD, DWORD); BOOL WINAPI SymGetScope(HANDLE, ULONG64, DWORD, PSYMBOL_INFO); BOOL WINAPI SymFromIndex(HANDLE, ULONG64, DWORD, PSYMBOL_INFO);