dbghelp: Implement SymFromNameW().

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50829
Signed-off-by: Gijs Vermeulen <gijsvrm@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
(cherry picked from commit 8d260b40fc)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
This commit is contained in:
Gijs Vermeulen 2021-04-22 12:20:18 +02:00 committed by Michael Stefaniuc
parent 74d7bd0fdf
commit fe998fb2d3
2 changed files with 34 additions and 1 deletions

View File

@ -75,7 +75,7 @@
@ stdcall SymFromIndex(long int64 long ptr) @ stdcall SymFromIndex(long int64 long ptr)
@ stdcall SymFromIndexW(long int64 long ptr) @ stdcall SymFromIndexW(long int64 long ptr)
@ stdcall SymFromName(long str ptr) @ stdcall SymFromName(long str ptr)
@ stub SymFromNameW @ stdcall SymFromNameW(long wstr ptr)
@ stub SymFromToken @ stub SymFromToken
@ stub SymFromTokenW @ stub SymFromTokenW
@ stdcall SymFunctionTableAccess(long long) @ stdcall SymFunctionTableAccess(long long)

View File

@ -1404,6 +1404,39 @@ BOOL WINAPI SymFromName(HANDLE hProcess, PCSTR Name, PSYMBOL_INFO Symbol)
return FALSE; return FALSE;
} }
/***********************************************************************
* SymFromNameW (DBGHELP.@)
*/
BOOL WINAPI SymFromNameW(HANDLE process, const WCHAR *name, SYMBOL_INFOW *symbol)
{
SYMBOL_INFO *si;
DWORD len;
char *tmp;
BOOL ret;
TRACE("(%p, %s, %p)\n", process, debugstr_w(name), symbol);
len = sizeof(*si) + symbol->MaxNameLen * sizeof(WCHAR);
if (!(si = HeapAlloc(GetProcessHeap(), 0, len))) return FALSE;
len = WideCharToMultiByte(CP_ACP, 0, name, -1, NULL, 0, NULL, NULL);
if (!(tmp = HeapAlloc(GetProcessHeap(), 0, len)))
{
HeapFree(GetProcessHeap(), 0, si);
return FALSE;
}
WideCharToMultiByte(CP_ACP, 0, name, -1, tmp, len, NULL, NULL);
si->SizeOfStruct = sizeof(*si);
si->MaxNameLen = symbol->MaxNameLen;
if ((ret = SymFromName(process, tmp, si)))
copy_symbolW(symbol, si);
HeapFree(GetProcessHeap(), 0, tmp);
HeapFree(GetProcessHeap(), 0, si);
return ret;
}
/*********************************************************************** /***********************************************************************
* SymGetSymFromName64 (DBGHELP.@) * SymGetSymFromName64 (DBGHELP.@)
*/ */