Module: wine Branch: master Commit: a0c2f40b4e26128bd3ba99613eeba4b2e41d6e05 URL: https://gitlab.winehq.org/wine/wine/-/commit/a0c2f40b4e26128bd3ba99613eeba4b...
Author: Brendan McGrath bmcgrath@codeweavers.com Date: Wed May 29 11:46:11 2024 +1000
ntdll/tests: Test error code when NtOpenFile uses file as directory.
---
dlls/ntdll/tests/file.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c index 9dd49c925b7..7961abad1b1 100644 --- a/dlls/ntdll/tests/file.c +++ b/dlls/ntdll/tests/file.c @@ -414,6 +414,16 @@ static void open_file_test(void) CloseHandle( handle ); pRtlFreeUnicodeString( &nameW );
+ wcscat( path, L"\" ); + pRtlDosPathNameToNtPathName_U( path, &nameW, NULL, NULL ); + status = NtOpenFile( &handle, FILE_LIST_DIRECTORY | SYNCHRONIZE, &attr, &io, + FILE_SHARE_READ | FILE_SHARE_WRITE, + FILE_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT | FILE_OPEN_FOR_BACKUP_INTENT ); + todo_wine + ok( status == STATUS_NOT_A_DIRECTORY, "open %s failed %lx\n", wine_dbgstr_w(nameW.Buffer), status ); + CloseHandle( handle ); + pRtlFreeUnicodeString( &nameW ); + wcscat( path, L"\cmd.exe" ); pRtlDosPathNameToNtPathName_U( path, &nameW, NULL, NULL ); status = pNtOpenFile( &handle, GENERIC_READ, &attr, &io,