SymFindExecutableImage Function
Locates an executable file in the process search path.
HANDLE WINAPI SymFindExecutableImage( __in HANDLE hProcess, __in PCTSTR FileName, __out PTSTR ImageFilePath, __in PFIND_EXE_FILE_CALLBACK Callback, __in PVOID CallerData );
Parameters
- hProcess
-
A handle to the process that was originally passed to the SymInitialize function.
- FileName
-
The name of the executable file. You can use a partial path.
- ImageFilePath
-
The fully-qualified path of the executable file. This buffer must be at least MAX_PATH characters.
- Callback
-
An application-defined callback function that verifies whether the correct executable file was found, or whether the function should continue its search. For more information, see FindExecutableImageProc.
This parameter can be NULL.
- CallerData
-
A user-defined value or NULL. This value is simply passed to the callback function. This parameter is typically used by an application to pass a pointer to a data structure that provides some context for the callback function.
Return Value
If the function succeeds, the return value is an open handle to the executable file.
If the function fails, the return value is NULL. To retrieve extended error information, call GetLastError.
Remarks
This function uses the search path set using the SymInitialize or SymSetSearchPath function.
All DbgHelp functions, such as this one, are single threaded. Therefore, calls from more than one thread to this function will likely result in unexpected behavior or memory corruption. To avoid this, you must synchronize all concurrent calls from more than one thread to this function.
To call the Unicode version of this function, define DBGHELP_TRANSLATE_TCHAR.
Requirements
Redistributable |
Requires DbgHelp.dll 6.6 or later. |
---|---|
Header |
Declared in Dbghelp.h. |
Library |
Use Dbghelp.lib. |
DLL |
Requires Dbghelp.dll. |
Unicode |
Implemented as SymFindExecutableImageW (Unicode) and SymFindExecutableImage (ANSI). |
See Also
DbgHelp FunctionsFindExecutableImageProc
Send comments about this topic to Microsoft
Build date: 9/25/2007
© 2007 Microsoft Corporation. All rights reserved.