SearchTreeForFile

The SearchTreeForFile function is used to search a directory tree for a specified file.

BOOL SearchTreeForFile(
  IN LPSTR RootPath,       
  IN LPSTR InputPathName,  
  OUT LPSTR OutputPathBuffer  
);
 

Parameters

RootPath
Pointer to a null-terminated string that specifies the path where the function should begin searching for the file.
InputPathName
Pointer to a null-terminated string that specifies the file for which the function will search. You can use a partial path.
OutputPathBuffer
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.

Return Values

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.

Remarks

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.

QuickInfo

  Windows NT: Requires version 4.0 or later.
  Windows: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Windows CE: Unsupported.
  Header: Declared in imagehlp.h.
  Import Library: Use imagehlp.lib.

See Also

PE Image Helper (ImageHlp) Overview, ImageHlp General Functions