Platform SDK: Debugging and Error Handling

SearchTreeForFile

The SearchTreeForFile function searches a directory tree for a specified file.

BOOL SearchTreeForFile(
  PSTR RootPath,       
  PSTR InputPathName,  
  PSTR OutputPathBuffer  
);

Parameters

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

Requirements

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

See Also

Debug Help Library Overview, DbgHelp Functions