Module: wine Branch: master Commit: d6fadb882f1d5575e38e33e89ef75bf8b533e2f1 URL: http://source.winehq.org/git/wine.git/?a=commit;h=d6fadb882f1d5575e38e33e89e...
Author: André Hentschel nerv@dawncrow.de Date: Mon Oct 31 20:08:00 2011 +0100
dbghelp: Implement SymMatchStringW.
---
dlls/dbghelp/dbghelp.spec | 2 +- dlls/dbghelp/symbol.c | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletions(-)
diff --git a/dlls/dbghelp/dbghelp.spec b/dlls/dbghelp/dbghelp.spec index 926218b..5b48ae5 100644 --- a/dlls/dbghelp/dbghelp.spec +++ b/dlls/dbghelp/dbghelp.spec @@ -139,7 +139,7 @@ @ stdcall SymMatchFileNameW(wstr wstr ptr ptr) @ stdcall SymMatchString(str str long) SymMatchStringA @ stdcall SymMatchStringA(str str long) -@ stub SymMatchStringW +@ stdcall SymMatchStringW(wstr wstr long) @ stub SymNext @ stub SymNextW @ stub SymPrev diff --git a/dlls/dbghelp/symbol.c b/dlls/dbghelp/symbol.c index 4ee0695..add3a1a 100644 --- a/dlls/dbghelp/symbol.c +++ b/dlls/dbghelp/symbol.c @@ -1891,6 +1891,35 @@ BOOL WINAPI SymMatchStringA(PCSTR string, PCSTR re, BOOL _case) }
/****************************************************************** + * SymMatchStringW (DBGHELP.@) + * + * FIXME: SymMatchStringA should convert and pass the strings to SymMatchStringW, + * but that needs a unicode RE library. + */ +BOOL WINAPI SymMatchStringW(PCWSTR string, PCWSTR re, BOOL _case) +{ + BOOL ret; + LPSTR s, r; + DWORD len; + + TRACE("%s %s %c\n", debugstr_w(string), debugstr_w(re), _case ? 'Y' : 'N'); + + len = WideCharToMultiByte( CP_ACP, 0, string, -1, NULL, 0, NULL, NULL ); + s = HeapAlloc( GetProcessHeap(), 0, len ); + WideCharToMultiByte( CP_ACP, 0, string, -1, s, len, NULL, NULL ); + + len = WideCharToMultiByte( CP_ACP, 0, re, -1, NULL, 0, NULL, NULL ); + r = HeapAlloc( GetProcessHeap(), 0, len ); + WideCharToMultiByte( CP_ACP, 0, re, -1, r, len, NULL, NULL ); + + ret = SymMatchStringA(s, r, _case); + + HeapFree( GetProcessHeap(), 0, r ); + HeapFree( GetProcessHeap(), 0, s ); + return ret; +} + +/****************************************************************** * SymSearch (DBGHELP.@) */ BOOL WINAPI SymSearch(HANDLE hProcess, ULONG64 BaseOfDll, DWORD Index,