Searches a directory tree for a specified file.
BOOL IMAGEAPI SearchTreeForFile( PCSTR RootPath, PCSTR InputPathName, PSTR OutputPathBuffer );
The path where the function should begin searching for the file.
The file for which the function will search. You can use a partial path.
A pointer to a buffer that receives the full path to the file that is found. This string is not modified if the return value is FALSE.
If the function succeeds, the return value is TRUE.
If the function fails, the return value is FALSE. To retrieve extended error information, call GetLastError.
The function searches for the file specified by the InputPathName parameter beginning at the path specified in the RootPath parameter. The maximum path depth that is allowed in the RootPath is 32 directories. When the function finds the file in the directory tree, it places the full path to the file in the buffer specified by the OutputPathBuffer parameter. The underlying file system specifies the order of the subdirectory search.
The search can be canceled if you register a SymRegisterCallbackProc64 callback function. For every directory searched, SearchTreeForFile calls this callback function with CBA_DEFERRED_SYMBOL_LOAD_CANCEL. If the callback function returns TRUE, SearchTreeForFile cancels the search.
This function triggers one CBA_DEFERRED_SYMBOL_LOAD_CANCEL event per directory searched. This allows the caller to cancel the search.
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.
|Redistributable||DbgHelp.dll 5.1 or later|