mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-29 01:21:40 +00:00
server: Don't always return STATUS_OBJECT_NAME_INVALID on ENOTDIR.
Only return STATUS_OBJECT_NAME_INVALID if we're not looking for a FILE_DIRECTORY_FILE.
This commit is contained in:
parent
a0c2f40b4e
commit
d88863805d
|
@ -2769,7 +2769,6 @@ static void test_FindFirstFileA(void)
|
|||
handle = FindFirstFileA(buffer2, &data);
|
||||
err = GetLastError();
|
||||
ok ( handle == INVALID_HANDLE_VALUE, "FindFirstFile on %s should fail\n", buffer2 );
|
||||
todo_wine
|
||||
ok ( err == ERROR_DIRECTORY, "Bad Error number %x\n", err );
|
||||
}
|
||||
|
||||
|
|
|
@ -419,7 +419,6 @@ static void open_file_test(void)
|
|||
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 );
|
||||
|
|
|
@ -1942,7 +1942,7 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam
|
|||
if (fd->unix_fd == -1)
|
||||
{
|
||||
/* check for trailing slash on file path */
|
||||
if ((errno == ENOENT || errno == ENOTDIR) && name[strlen(name) - 1] == '/')
|
||||
if ((errno == ENOENT || (errno == ENOTDIR && !(options & FILE_DIRECTORY_FILE))) && name[strlen(name) - 1] == '/')
|
||||
set_error( STATUS_OBJECT_NAME_INVALID );
|
||||
else
|
||||
file_set_error();
|
||||
|
|
Loading…
Reference in a new issue