Eric Pouech : dbghelp: Implemented FindExecutableImage[W].
Alexandre Julliard
julliard at wine.codeweavers.com
Thu Feb 22 05:56:43 CST 2007
Module: wine
Branch: master
Commit: bcc1913354a033f751c091cace904df87e046d11
URL: http://source.winehq.org/git/wine.git/?a=commit;h=bcc1913354a033f751c091cace904df87e046d11
Author: Eric Pouech <eric.pouech at wanadoo.fr>
Date: Wed Feb 21 21:55:10 2007 +0100
dbghelp: Implemented FindExecutableImage[W].
---
dlls/dbghelp/dbghelp.spec | 4 ++--
dlls/dbghelp/path.c | 35 ++++++++++++++++++++++++++++++++---
dlls/imagehlp/imagehlp.spec | 2 +-
include/dbghelp.h | 2 ++
4 files changed, 37 insertions(+), 6 deletions(-)
diff --git a/dlls/dbghelp/dbghelp.spec b/dlls/dbghelp/dbghelp.spec
index 21ce93d..a91415e 100644
--- a/dlls/dbghelp/dbghelp.spec
+++ b/dlls/dbghelp/dbghelp.spec
@@ -10,8 +10,8 @@
@ stdcall FindDebugInfoFileEx(str str ptr ptr ptr)
@ stub FindDebugInfoFileExW
@ stdcall FindExecutableImage(str str str)
-@ stub FindExecutableImageEx
-@ stub FindExecutableImageExW
+@ stdcall FindExecutableImageEx(str str ptr ptr ptr)
+@ stdcall FindExecutableImageExW(wstr wstr ptr ptr ptr)
@ stub FindFileInPath
@ stub FindFileInSearchPath
@ stdcall GetTimestampForLoadedLibrary(long)
diff --git a/dlls/dbghelp/path.c b/dlls/dbghelp/path.c
index e9d9164..7c4b2e0 100644
--- a/dlls/dbghelp/path.c
+++ b/dlls/dbghelp/path.c
@@ -76,19 +76,48 @@ HANDLE WINAPI FindDebugInfoFileEx(PCSTR FileName, PCSTR SymbolPath,
}
/******************************************************************
- * FindExecutableImage (DBGHELP.@)
+ * FindExecutableImageExW (DBGHELP.@)
*
*/
-HANDLE WINAPI FindExecutableImage(PCSTR FileName, PCSTR SymbolPath, PSTR ImageFilePath)
+HANDLE WINAPI FindExecutableImageExW(PCWSTR FileName, PCWSTR SymbolPath, PWSTR ImageFilePath,
+ PFIND_EXE_FILE_CALLBACKW Callback, void* user)
+{
+ HANDLE h;
+
+ if (Callback) FIXME("Unsupported callback yet\n");
+ if (!SearchPathW(SymbolPath, FileName, NULL, MAX_PATH, ImageFilePath, NULL))
+ return NULL;
+ h = CreateFileW(ImageFilePath, GENERIC_READ, FILE_SHARE_READ, NULL,
+ OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+ return (h == INVALID_HANDLE_VALUE) ? NULL : h;
+}
+
+/******************************************************************
+ * FindExecutableImageEx (DBGHELP.@)
+ *
+ */
+HANDLE WINAPI FindExecutableImageEx(PCSTR FileName, PCSTR SymbolPath, PSTR ImageFilePath,
+ PFIND_EXE_FILE_CALLBACK Callback, void* user)
{
HANDLE h;
+
+ if (Callback) FIXME("Unsupported callback yet\n");
if (!SearchPathA(SymbolPath, FileName, NULL, MAX_PATH, ImageFilePath, NULL))
return NULL;
- h = CreateFileA(ImageFilePath, GENERIC_READ, FILE_SHARE_READ, NULL,
+ h = CreateFileA(ImageFilePath, GENERIC_READ, FILE_SHARE_READ, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
return (h == INVALID_HANDLE_VALUE) ? NULL : h;
}
+/******************************************************************
+ * FindExecutableImage (DBGHELP.@)
+ *
+ */
+HANDLE WINAPI FindExecutableImage(PCSTR FileName, PCSTR SymbolPath, PSTR ImageFilePath)
+{
+ return FindExecutableImageEx(FileName, SymbolPath, ImageFilePath, NULL, NULL);
+}
+
/***********************************************************************
* MakeSureDirectoryPathExists (DBGHELP.@)
*/
diff --git a/dlls/imagehlp/imagehlp.spec b/dlls/imagehlp/imagehlp.spec
index 9ca6c89..7c0b2cf 100644
--- a/dlls/imagehlp/imagehlp.spec
+++ b/dlls/imagehlp/imagehlp.spec
@@ -6,7 +6,7 @@
@ stdcall FindDebugInfoFile(str str str) dbghelp.FindDebugInfoFile
@ stdcall FindDebugInfoFileEx(str str ptr ptr ptr) dbghelp.FindDebugInfoFileEx
@ stdcall FindExecutableImage(str str str) dbghelp.FindExecutableImage
-@ stub FindExecutableImageEx
+@ stdcall FindExecutableImageEx(str str ptr ptr ptr) dbghelp.FindExecutableImageEx
@ stub FindFileInPath
@ stub FindFileInSearchPath
@ stdcall GetImageConfigInformation(ptr ptr)
diff --git a/include/dbghelp.h b/include/dbghelp.h
index 3840a1e..ee3103b 100644
--- a/include/dbghelp.h
+++ b/include/dbghelp.h
@@ -1005,6 +1005,8 @@ BOOL WINAPI SymFindFileInPath(HANDLE, PCSTR, PCSTR, PVOID, DWORD, DWORD, DWORD,
HANDLE WINAPI FindExecutableImage(PCSTR, PCSTR, PSTR);
typedef BOOL (CALLBACK *PFIND_EXE_FILE_CALLBACK)(HANDLE, PSTR, PVOID);
HANDLE WINAPI FindExecutableImageEx(PCSTR, PCSTR, PSTR, PFIND_EXE_FILE_CALLBACK, PVOID);
+typedef BOOL (CALLBACK *PFIND_EXE_FILE_CALLBACKW)(HANDLE, PWSTR, PVOID);
+HANDLE WINAPI FindExecutableImageExW(PCWSTR, PCWSTR, PWSTR, PFIND_EXE_FILE_CALLBACKW, PVOID);
PIMAGE_NT_HEADERS WINAPI ImageNtHeader(PVOID);
PVOID WINAPI ImageDirectoryEntryToDataEx(PVOID, BOOLEAN, USHORT, PULONG,
PIMAGE_SECTION_HEADER *);
More information about the wine-cvs
mailing list