From 922a7bd1912e8600bbfc6caf83ba5f6903f3098b Mon Sep 17 00:00:00 2001 From: Eric Pouech Date: Wed, 10 May 2006 21:35:15 +0200 Subject: [PATCH] dbghelp: Implemented SymLoadModuleExW. --- dlls/dbghelp/dbghelp.spec | 2 +- dlls/dbghelp/module.c | 34 ++++++++++++++++++++++++++++++++++ include/dbghelp.h | 2 ++ 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/dlls/dbghelp/dbghelp.spec b/dlls/dbghelp/dbghelp.spec index 8641f43325e..1f753db2afc 100644 --- a/dlls/dbghelp/dbghelp.spec +++ b/dlls/dbghelp/dbghelp.spec @@ -117,7 +117,7 @@ @ stdcall SymLoadModule(long long str str long long) @ stdcall SymLoadModule64(long long str str double long) @ stdcall SymLoadModuleEx(long long str str double long ptr long) -@ stub SymLoadModuleExW +@ stdcall SymLoadModuleExW(long long wstr wstr double long ptr long) @ stdcall SymMatchFileName(str str ptr ptr) @ stub SymMatchFileNameW @ stdcall SymMatchString(str str long) diff --git a/dlls/dbghelp/module.c b/dlls/dbghelp/module.c index 2076ccce605..6cc6c066794 100644 --- a/dlls/dbghelp/module.c +++ b/dlls/dbghelp/module.c @@ -30,6 +30,7 @@ #include "winreg.h" #include "winternl.h" #include "wine/debug.h" +#include "winnls.h" WINE_DEFAULT_DEBUG_CHANNEL(dbghelp); @@ -462,6 +463,39 @@ DWORD64 WINAPI SymLoadModuleEx(HANDLE hProcess, HANDLE hFile, PCSTR ImageName, (DWORD)BaseOfDll, DllSize); } +/*********************************************************************** + * SymLoadModuleExW (DBGHELP.@) + */ +DWORD64 WINAPI SymLoadModuleExW(HANDLE hProcess, HANDLE hFile, PCWSTR wImageName, + PCWSTR wModuleName, DWORD64 BaseOfDll, DWORD DllSize, + PMODLOAD_DATA Data, DWORD Flags) +{ + LPSTR ImageName, ModuleName; + unsigned len; + BOOL ret; + + if (wImageName) + { + len = WideCharToMultiByte(CP_ACP,0, wImageName, -1, NULL, 0, NULL, NULL); + ImageName = HeapAlloc(GetProcessHeap(), 0, len); + WideCharToMultiByte(CP_ACP,0, wImageName, -1, ImageName, len, NULL, NULL); + } + else ImageName = NULL; + if (wModuleName) + { + len = WideCharToMultiByte(CP_ACP,0, wModuleName, -1, NULL, 0, NULL, NULL); + ModuleName = HeapAlloc(GetProcessHeap(), 0, len); + WideCharToMultiByte(CP_ACP,0, wModuleName, -1, ModuleName, len, NULL, NULL); + } + else ModuleName = NULL; + + ret = SymLoadModuleEx(hProcess, hFile, ImageName, ModuleName, + BaseOfDll, DllSize, Data, Flags); + HeapFree(GetProcessHeap(), 0, ImageName); + HeapFree(GetProcessHeap(), 0, ModuleName); + return ret; +} + /*********************************************************************** * SymLoadModule64 (DBGHELP.@) */ diff --git a/include/dbghelp.h b/include/dbghelp.h index 49f4d7eab3a..45916c1d879 100644 --- a/include/dbghelp.h +++ b/include/dbghelp.h @@ -763,6 +763,8 @@ DWORD WINAPI SymLoadModule(HANDLE, HANDLE, PCSTR, PCSTR, DWORD, DWORD); DWORD64 WINAPI SymLoadModule64(HANDLE, HANDLE, PCSTR, PCSTR, DWORD64, DWORD); DWORD64 WINAPI SymLoadModuleEx(HANDLE, HANDLE, PCSTR, PCSTR, DWORD64, DWORD, PMODLOAD_DATA, DWORD); +DWORD64 WINAPI SymLoadModuleExW(HANDLE, HANDLE, PCWSTR, PCWSTR, DWORD64, DWORD, + PMODLOAD_DATA, DWORD); BOOL WINAPI SymUnloadModule(HANDLE, DWORD); BOOL WINAPI SymUnloadModule64(HANDLE, DWORD64);