eric pouech (@epo) commented about dlls/ntdll/tests/directory.c:
+ } + /* Search for a non-existent file, putting it into a state with an empty cache */ + /* This also confirms that using a non-existent mask with a fresh handle returns a different status*/ + test_NtQueryDirectoryFile_mask(dirh_test_multiple_handles, TRUE, ¬atestfile, STATUS_NO_SUCH_FILE, ¬atestfile, FALSE); + /* Confirm that handle is in a state where it fails to find atestfile */ + test_NtQueryDirectoryFile_mask(dirh_test_multiple_handles, FALSE, &atestfile, STATUS_NO_MORE_FILES, &atestfile, FALSE); + /* Confirm that another handle is able to find atestfile */ + test_NtQueryDirectoryFile_mask(dirh, TRUE, &atestfile, STATUS_SUCCESS, &atestfile, FALSE); + /* Close handle used for testing multiple handles */ + pNtClose(&dirh_test_multiple_handles); + + /* All searches for `notatestfile` are expected to fail */ + /* Tests should also fail if the scan is not reset, and the mask changes to an incompatible one */ + test_NtQueryDirectoryFile_mask(dirh, TRUE, &atestfile, STATUS_SUCCESS, &atestfile, FALSE); + test_NtQueryDirectoryFile_mask(dirh, TRUE, &anothertestfile, STATUS_SUCCESS, &anothertestfile, FALSE); + test_NtQueryDirectoryFile_mask(dirh, TRUE, ¬atestfile, STATUS_NO_MORE_FILES, ¬atestfile, FALSE); it doesn't make sense to pass ¬atestfile when expected status isn't STATUS_SUCCESS
IOW, all tests with expected_status != STATUS_SUCCESS should have NULL as expected filename (actually, we could even think that for the expected_status == STATUS_SUCCESS case, the expected filename isn't NULL, but that would requires some more work as a NULL mask generates other filenames starting with "." and "..") -- https://gitlab.winehq.org/wine/wine/-/merge_requests/6904#note_93176