Here,we are passing to FileFindFirst an inexistant Path to a File.
It should return ERROR_INVALID_HANDLE and ERROR_PATH_NOT_FOUND
Checking the calls:
-FindFirstFileA calls FindFirstFileExA without checking if the Path does exist.
-FindFirstFileExA calls InternalFindFirstFile, this latter one returns the Handle but until now noone has checked if the Path to the file exists.
00362 bResult = RtlDosPathNameToNtPathName_U (lpFileName,
00364 (PCWSTR *)((ULONG_PTR)&PathFileName.Buffer),
00366 if (FALSE == bResult)
So seems we are relying in RTLDosPathNameToNtPathName_U to check if the Path exists.
This could be true in case "lpfilename=NULL", as bresult will be Zero. But if we sent to RTLDosPathNameToNtPathName_U a false path, it will translate, and it will suceed. So bresult will be !0.
Here we can see the RtlDosPathNameToNtPathName_U behavior:
- us.Length is greater than 8, so we go into the IF #656.
- We just return false if buffer is NULL ( line #671)
- We are not checking inside that IF if we the "lpfilename" exists. Hence bresult!=0 and the Winetest fails.
Should we sync with WINE these functions?