PathMatchSpecEx function
Matches a file name from a path against one or more file name patterns.
Syntax
HRESULT PathMatchSpecEx( _In_ LPCTSTR pszFile, _In_ LPCTSTR pszSpec, _In_ DWORD dwFlags );
Parameters
- pszFile [in]
-
Type: LPCTSTR
A pointer to a null-terminated string of maximum length MAX_PATH that contains the path from which the file name to be matched is taken.
- pszSpec [in]
-
Type: LPCTSTR
A pointer to a null-terminated string of maximum length MAX_PATH that contains the file name pattern for which to search. This can be the exact name, or it can contain wildcard characters. If exactly one pattern is specified, set the PMSF_NORMAL flag in dwFlags. If more than one pattern is specified, separate them with semicolons and set the PMSF_MULTIPLE flag.
- dwFlags [in]
-
Type: DWORD
Modifies the search condition. The following are valid flags.
-
The pszSpec parameter points to a single file name pattern to be matched.
-
The pszSpec parameter points to a semicolon-delimited list of file name patterns to be matched.
-
If PMSF_NORMAL is used, ignore leading spaces in the string pointed to by pszSpec. If PMSF_MULTIPLE is used, ignore leading spaces in each file type contained in the string pointed to by pszSpec. This flag can be combined with PMSF_NORMAL and PMSF_MULTIPLE.
Return value
Type: HRESULT
Returns one of the following values.
Return code | Description |
---|---|
|
A file name pattern specified in pszSpec matched the file name found in the string pointed to by pszFile. |
|
No file name pattern specified in pszSpec matched the file name found in the string pointed to by pszFile. |
Requirements
Minimum supported client |
Windows Vista [desktop apps only] |
---|---|
Minimum supported server |
Windows Server 2008 [desktop apps only] |
Header |
|
Library |
|
DLL |
|
Unicode and ANSI names |
PathMatchSpecExW (Unicode) and PathMatchSpecExA (ANSI) |
See also