server: Add FILE_SKIP_SET_EVENT_ON_HANDLE support.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2018-11-01 12:40:04 +01:00 committed by Alexandre Julliard
parent 455de70201
commit 3dacf82173
3 changed files with 6 additions and 7 deletions

View file

@ -2661,8 +2661,8 @@ NTSTATUS WINAPI NtSetInformationFile(HANDLE handle, PIO_STATUS_BLOCK io,
{ {
FILE_IO_COMPLETION_NOTIFICATION_INFORMATION *info = ptr; FILE_IO_COMPLETION_NOTIFICATION_INFORMATION *info = ptr;
if (info->Flags & ~FILE_SKIP_COMPLETION_PORT_ON_SUCCESS) if (info->Flags & FILE_SKIP_SET_USER_EVENT_ON_FAST_IO)
FIXME( "Unsupported completion flags %x\n", info->Flags ); FIXME( "FILE_SKIP_SET_USER_EVENT_ON_FAST_IO not supported\n" );
SERVER_START_REQ( set_fd_completion_mode ) SERVER_START_REQ( set_fd_completion_mode )
{ {

View file

@ -1423,12 +1423,10 @@ static void test_completion(void)
info.Flags = FILE_SKIP_SET_EVENT_ON_HANDLE; info.Flags = FILE_SKIP_SET_EVENT_ON_HANDLE;
status = pNtSetInformationFile(client, &io, &info, sizeof(info), FileIoCompletionNotificationInformation); status = pNtSetInformationFile(client, &io, &info, sizeof(info), FileIoCompletionNotificationInformation);
ok(status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %08x\n", status); ok(status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %08x\n", status);
todo_wine
ok(!is_signaled(client), "client is not signaled\n"); ok(!is_signaled(client), "client is not signaled\n");
ret = WriteFile(pipe, buf, sizeof(buf), &num_bytes, NULL); ret = WriteFile(pipe, buf, sizeof(buf), &num_bytes, NULL);
ok(ret, "WriteFile failed, error %u\n", GetLastError()); ok(ret, "WriteFile failed, error %u\n", GetLastError());
todo_wine
ok(!is_signaled(client), "client is signaled\n"); ok(!is_signaled(client), "client is signaled\n");
test_queued_completion(port, &io, STATUS_SUCCESS, sizeof(buf)); test_queued_completion(port, &io, STATUS_SUCCESS, sizeof(buf));
@ -1439,12 +1437,10 @@ static void test_completion(void)
ret = WriteFile(client, buf, 1, &num_bytes, NULL); ret = WriteFile(client, buf, 1, &num_bytes, NULL);
ok(ret, "WriteFile failed, error %u\n", GetLastError()); ok(ret, "WriteFile failed, error %u\n", GetLastError());
todo_wine
ok(!is_signaled(client), "client is signaled\n"); ok(!is_signaled(client), "client is signaled\n");
ret = WriteFile(pipe, buf, sizeof(buf), &num_bytes, NULL); ret = WriteFile(pipe, buf, sizeof(buf), &num_bytes, NULL);
ok(ret, "WriteFile failed, error %u\n", GetLastError()); ok(ret, "WriteFile failed, error %u\n", GetLastError());
todo_wine
ok(!is_signaled(client), "client is signaled\n"); ok(!is_signaled(client), "client is signaled\n");
CloseHandle(port); CloseHandle(port);

View file

@ -1964,6 +1964,7 @@ int is_fd_removable( struct fd *fd )
/* set or clear the fd signaled state */ /* set or clear the fd signaled state */
void set_fd_signaled( struct fd *fd, int signaled ) void set_fd_signaled( struct fd *fd, int signaled )
{ {
if (fd->comp_flags & FILE_SKIP_SET_EVENT_ON_HANDLE) return;
fd->signaled = signaled; fd->signaled = signaled;
if (signaled) wake_up( fd->user, 0 ); if (signaled) wake_up( fd->user, 0 );
} }
@ -2647,7 +2648,9 @@ DECL_HANDLER(set_fd_completion_mode)
{ {
if (is_fd_overlapped( fd )) if (is_fd_overlapped( fd ))
{ {
/* removing COMPLETION_SKIP_ON_SUCCESS is not allowed */ if (req->flags & FILE_SKIP_SET_EVENT_ON_HANDLE)
set_fd_signaled( fd, 0 );
/* removing flags is not allowed */
fd->comp_flags |= req->flags & ( FILE_SKIP_COMPLETION_PORT_ON_SUCCESS fd->comp_flags |= req->flags & ( FILE_SKIP_COMPLETION_PORT_ON_SUCCESS
| FILE_SKIP_SET_EVENT_ON_HANDLE | FILE_SKIP_SET_EVENT_ON_HANDLE
| FILE_SKIP_SET_USER_EVENT_ON_FAST_IO ); | FILE_SKIP_SET_USER_EVENT_ON_FAST_IO );