Commit 9e1f9ec1 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

dbghelp: Implemented SearchTreeForFileW.

parent c0be0032
...@@ -26,8 +26,8 @@ ...@@ -26,8 +26,8 @@
@ stdcall MapDebugInformation(long str str long) @ stdcall MapDebugInformation(long str str long)
@ stdcall MiniDumpReadDumpStream(ptr long ptr ptr ptr) @ stdcall MiniDumpReadDumpStream(ptr long ptr ptr ptr)
@ stdcall MiniDumpWriteDump(ptr long ptr long long long long) @ stdcall MiniDumpWriteDump(ptr long ptr long long long long)
@ stdcall SearchTreeForFile(str str str) @ stdcall SearchTreeForFile(str str ptr)
@ stub SearchTreeForFileW @ stdcall SearchTreeForFileW(wstr wstr ptr)
@ stdcall StackWalk(long long long ptr ptr ptr ptr ptr ptr) @ stdcall StackWalk(long long long ptr ptr ptr ptr ptr ptr)
@ stdcall StackWalk64(long long long ptr ptr ptr ptr ptr ptr) @ stdcall StackWalk64(long long long ptr ptr ptr ptr ptr ptr)
@ stub SymAddSymbol @ stub SymAddSymbol
......
...@@ -273,14 +273,32 @@ static BOOL do_search(const char* file, char* buffer, BOOL recurse, ...@@ -273,14 +273,32 @@ static BOOL do_search(const char* file, char* buffer, BOOL recurse,
} }
/*********************************************************************** /***********************************************************************
* SearchTreeForFileW (DBGHELP.@)
*/
BOOL WINAPI SearchTreeForFileW(PCWSTR root, PCWSTR file, PWSTR buffer)
{
TRACE("(%s, %s, %p)\n",
debugstr_w(root), debugstr_w(file), buffer);
strcpyW(buffer, root);
return do_searchW(file, buffer, TRUE, NULL, NULL);
}
/***********************************************************************
* SearchTreeForFile (DBGHELP.@) * SearchTreeForFile (DBGHELP.@)
*/ */
BOOL WINAPI SearchTreeForFile(PCSTR root, PCSTR file, PSTR buffer) BOOL WINAPI SearchTreeForFile(PCSTR root, PCSTR file, PSTR buffer)
{ {
TRACE("(%s, %s, %p)\n", WCHAR rootW[MAX_PATH];
debugstr_a(root), debugstr_a(file), buffer); WCHAR fileW[MAX_PATH];
strcpy(buffer, root); WCHAR bufferW[MAX_PATH];
return do_search(file, buffer, TRUE, NULL, NULL); BOOL ret;
MultiByteToWideChar(CP_ACP, 0, root, -1, rootW, MAX_PATH);
MultiByteToWideChar(CP_ACP, 0, file, -1, fileW, MAX_PATH);
ret = SearchTreeForFileW(rootW, fileW, bufferW);
if (ret)
WideCharToMultiByte(CP_ACP, 0, bufferW, -1, buffer, MAX_PATH, NULL, NULL);
return ret;
} }
/****************************************************************** /******************************************************************
......
...@@ -1020,6 +1020,7 @@ BOOL WINAPI SymSetSearchPathW(HANDLE, PCWSTR); ...@@ -1020,6 +1020,7 @@ BOOL WINAPI SymSetSearchPathW(HANDLE, PCWSTR);
DWORD WINAPI GetTimestampForLoadedLibrary(HMODULE); DWORD WINAPI GetTimestampForLoadedLibrary(HMODULE);
BOOL WINAPI MakeSureDirectoryPathExists(PCSTR); BOOL WINAPI MakeSureDirectoryPathExists(PCSTR);
BOOL WINAPI SearchTreeForFile(PCSTR, PCSTR, PSTR); BOOL WINAPI SearchTreeForFile(PCSTR, PCSTR, PSTR);
BOOL WINAPI SearchTreeForFileW(PCWSTR, PCWSTR, PWSTR);
typedef BOOL (CALLBACK *PENUMDIRTREE_CALLBACK)(LPCSTR, PVOID); typedef BOOL (CALLBACK *PENUMDIRTREE_CALLBACK)(LPCSTR, PVOID);
BOOL WINAPI EnumDirTree(HANDLE, PCSTR, PCSTR, PSTR, PENUMDIRTREE_CALLBACK, void*); BOOL WINAPI EnumDirTree(HANDLE, PCSTR, PCSTR, PSTR, PENUMDIRTREE_CALLBACK, void*);
typedef BOOL (CALLBACK *PENUMDIRTREE_CALLBACKW)(LPCWSTR, PVOID); typedef BOOL (CALLBACK *PENUMDIRTREE_CALLBACKW)(LPCWSTR, PVOID);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment