Jacek Caban : server: Add FILE_SKIP_SET_EVENT_ON_HANDLE support.
Alexandre Julliard
julliard at winehq.org
Thu Nov 1 16:33:52 CDT 2018
Module: wine
Branch: master
Commit: 3dacf82173a142fbcf26dec59614481f27f91d68
URL: https://source.winehq.org/git/wine.git/?a=commit;h=3dacf82173a142fbcf26dec59614481f27f91d68
Author: Jacek Caban <jacek at codeweavers.com>
Date: Thu Nov 1 12:40:04 2018 +0100
server: Add FILE_SKIP_SET_EVENT_ON_HANDLE support.
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/ntdll/file.c | 4 ++--
dlls/ntdll/tests/pipe.c | 4 ----
server/fd.c | 5 ++++-
3 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
index 622b5de..2b62206 100644
--- a/dlls/ntdll/file.c
+++ b/dlls/ntdll/file.c
@@ -2661,8 +2661,8 @@ NTSTATUS WINAPI NtSetInformationFile(HANDLE handle, PIO_STATUS_BLOCK io,
{
FILE_IO_COMPLETION_NOTIFICATION_INFORMATION *info = ptr;
- if (info->Flags & ~FILE_SKIP_COMPLETION_PORT_ON_SUCCESS)
- FIXME( "Unsupported completion flags %x\n", info->Flags );
+ if (info->Flags & FILE_SKIP_SET_USER_EVENT_ON_FAST_IO)
+ FIXME( "FILE_SKIP_SET_USER_EVENT_ON_FAST_IO not supported\n" );
SERVER_START_REQ( set_fd_completion_mode )
{
diff --git a/dlls/ntdll/tests/pipe.c b/dlls/ntdll/tests/pipe.c
index 08bde6d..406d555 100644
--- a/dlls/ntdll/tests/pipe.c
+++ b/dlls/ntdll/tests/pipe.c
@@ -1423,12 +1423,10 @@ static void test_completion(void)
info.Flags = FILE_SKIP_SET_EVENT_ON_HANDLE;
status = pNtSetInformationFile(client, &io, &info, sizeof(info), FileIoCompletionNotificationInformation);
ok(status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %08x\n", status);
- todo_wine
ok(!is_signaled(client), "client is not signaled\n");
ret = WriteFile(pipe, buf, sizeof(buf), &num_bytes, NULL);
ok(ret, "WriteFile failed, error %u\n", GetLastError());
- todo_wine
ok(!is_signaled(client), "client is signaled\n");
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);
ok(ret, "WriteFile failed, error %u\n", GetLastError());
- todo_wine
ok(!is_signaled(client), "client is signaled\n");
ret = WriteFile(pipe, buf, sizeof(buf), &num_bytes, NULL);
ok(ret, "WriteFile failed, error %u\n", GetLastError());
- todo_wine
ok(!is_signaled(client), "client is signaled\n");
CloseHandle(port);
diff --git a/server/fd.c b/server/fd.c
index 119fae6..fa174f5 100644
--- a/server/fd.c
+++ b/server/fd.c
@@ -1964,6 +1964,7 @@ int is_fd_removable( struct fd *fd )
/* set or clear the fd signaled state */
void set_fd_signaled( struct fd *fd, int signaled )
{
+ if (fd->comp_flags & FILE_SKIP_SET_EVENT_ON_HANDLE) return;
fd->signaled = signaled;
if (signaled) wake_up( fd->user, 0 );
}
@@ -2647,7 +2648,9 @@ DECL_HANDLER(set_fd_completion_mode)
{
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
| FILE_SKIP_SET_EVENT_ON_HANDLE
| FILE_SKIP_SET_USER_EVENT_ON_FAST_IO );
More information about the wine-cvs
mailing list