See the return value :
Return value
Type: HRESULT
Returns one of the following values.
Return code Description
S_OK
A file name pattern specified in pszSpec matched the file name found in the string pointed to by pszFile.
S_FALSE
No file name pattern specified in pszSpec matched the file name found in the string pointed to by pszFile.