Platform SDK: Debugging and Error Handling

FindExecutableImageEx

The FindExecutableImageEx function locates an executable file.

HANDLE FindExecutableImageEx(
  PSTR FileName,
  PSTR SymbolPath,
  PSTR ImageFilePath,
  PFIND_EXE_FILE_CALLBACK Callback,
  PVOID CallerData
);

Parameters

FileName
[in] Pointer to a null-terminated string that specifies the name of the symbol file to locate. You can use a partial path.
SymbolPath
[in] Pointer to a null-terminated string that specifies the path where symbol files are located. This string can contain multiple paths separated by semicolons. To retrieve the symbol path, use the SymGetSearchPath function.
ImageFilePath
[out] Receives the full path of the executable file that is found.
Callback
[in] Pointer to 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 FindExeFileProc.

This parameter can be NULL.

CallerData
[in] User-defined data to pass to the callback function. This parameter can be NULL.

Return Values

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

The FindExecutableImageEx function is provided so executable files can be found in several different directories by using a single function call. If the SymbolPath parameter containins multiple paths, the function searches each specified directory tree for the executable file. When the file is found, the search stops. Thus, be sure to specify SymbolPath with the paths in the correct order.

Requirements

  Windows NT/2000: Requires Windows 2000. Available as a redistributable for Windows NT 4.0.
  Windows 95/98: Requires Available as a redistributable for Windows 98.
  Header: Declared in Dbghelp.h.
  Library: Use Dbghelp.lib.

See Also

Debug Help Library Overview, DbgHelp Functions, FindExeFileProc, SymGetSearchPath