SymMatchFileName function (dbghelp.h)

Compares a string to a file name and path.

Syntax

BOOL IMAGEAPI SymMatchFileName(
  [in]            PCSTR FileName,
  [in]            PCSTR Match,
  [out, optional] PSTR  *FileNameStop,
  [out, optional] PSTR  *MatchStop
);

Parameters

[in] FileName

The file name to be compared to the Match parameter.

[in] Match

The string to be compared to the FileName parameter.

[out, optional] FileNameStop

A pointer to a string buffer that receives a pointer to the location in FileName where matching stopped. For a complete match, this value can be one character before FileName. This value can also be NULL.

[out, optional] MatchStop

A pointer to a string buffer that receives a pointer to the location in Match where matching stopped. For a complete match, this value may be one character before Match. This value may be NULL.

Return value

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

Because the match string can be a suffix of the complete file name, this function can be used to match a plain file name to a fully qualified file name.

Matching begins from the end of both strings and proceeds backward. Matching is case-insensitive and equates a backslash (\) with a forward slash (/).

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

Requirement Value
Target Platform Windows
Header dbghelp.h
Library Dbghelp.lib
DLL Dbghelp.dll
Redistributable DbgHelp.dll 5.1 or later

See also

DbgHelp Functions