Commit 44a3c70d authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

server: Reset the reported event mask in set_socket_event only when using window messages.

parent 07ea3061
...@@ -2641,9 +2641,8 @@ static void test_WSAEnumNetworkEvents(void) ...@@ -2641,9 +2641,8 @@ static void test_WSAEnumNetworkEvents(void)
} }
else else
{ {
todo_wine_if (i != 0) /* Remove when fixed */ ok (net_events.lNetworkEvents == 0, "Test[%d]: expected 0, got %d\n",
ok (net_events.lNetworkEvents == 0, "Test[%d]: expected 0, got %d\n", i, net_events.lNetworkEvents);
i, net_events.lNetworkEvents);
} }
for (k = 0; k < FD_MAX_EVENTS; k++) for (k = 0; k < FD_MAX_EVENTS; k++)
{ {
...@@ -3990,12 +3989,12 @@ static void test_accept_events(struct event_test_ctx *ctx) ...@@ -3990,12 +3989,12 @@ static void test_accept_events(struct event_test_ctx *ctx)
select_events(ctx, listener, FD_CONNECT | FD_READ | FD_OOB | FD_ACCEPT); select_events(ctx, listener, FD_CONNECT | FD_READ | FD_OOB | FD_ACCEPT);
if (ctx->is_message) if (ctx->is_message)
check_events(ctx, FD_ACCEPT, 0, 200); check_events(ctx, FD_ACCEPT, 0, 200);
check_events_todo_event(ctx, 0, 0, 0); check_events(ctx, 0, 0, 0);
select_events(ctx, listener, 0); select_events(ctx, listener, 0);
select_events(ctx, listener, FD_CONNECT | FD_READ | FD_OOB | FD_ACCEPT); select_events(ctx, listener, FD_CONNECT | FD_READ | FD_OOB | FD_ACCEPT);
if (ctx->is_message) if (ctx->is_message)
check_events(ctx, FD_ACCEPT, 0, 200); check_events(ctx, FD_ACCEPT, 0, 200);
check_events_todo_event(ctx, 0, 0, 0); check_events(ctx, 0, 0, 0);
client2 = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); client2 = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
ok(client2 != -1, "failed to create socket, error %u\n", WSAGetLastError()); ok(client2 != -1, "failed to create socket, error %u\n", WSAGetLastError());
...@@ -4134,7 +4133,7 @@ static void test_connect_events(struct event_test_ctx *ctx) ...@@ -4134,7 +4133,7 @@ static void test_connect_events(struct event_test_ctx *ctx)
select_events(ctx, client, FD_ACCEPT | FD_CLOSE | FD_CONNECT | FD_OOB | FD_READ | FD_WRITE); select_events(ctx, client, FD_ACCEPT | FD_CLOSE | FD_CONNECT | FD_OOB | FD_READ | FD_WRITE);
if (ctx->is_message) if (ctx->is_message)
check_events(ctx, FD_WRITE, 0, 200); check_events(ctx, FD_WRITE, 0, 200);
check_events_todo_event(ctx, 0, 0, 0); check_events(ctx, 0, 0, 0);
server = accept(listener, NULL, NULL); server = accept(listener, NULL, NULL);
ok(server != -1, "failed to accept, error %u\n", WSAGetLastError()); ok(server != -1, "failed to accept, error %u\n", WSAGetLastError());
...@@ -4235,12 +4234,12 @@ static void test_write_events(struct event_test_ctx *ctx) ...@@ -4235,12 +4234,12 @@ static void test_write_events(struct event_test_ctx *ctx)
select_events(ctx, server, FD_ACCEPT | FD_CLOSE | FD_CONNECT | FD_OOB | FD_READ | FD_WRITE); select_events(ctx, server, FD_ACCEPT | FD_CLOSE | FD_CONNECT | FD_OOB | FD_READ | FD_WRITE);
if (ctx->is_message) if (ctx->is_message)
check_events(ctx, FD_WRITE, 0, 200); check_events(ctx, FD_WRITE, 0, 200);
check_events_todo_event(ctx, 0, 0, 0); check_events(ctx, 0, 0, 0);
select_events(ctx, server, 0); select_events(ctx, server, 0);
select_events(ctx, server, FD_ACCEPT | FD_CLOSE | FD_CONNECT | FD_OOB | FD_READ | FD_WRITE); select_events(ctx, server, FD_ACCEPT | FD_CLOSE | FD_CONNECT | FD_OOB | FD_READ | FD_WRITE);
if (ctx->is_message) if (ctx->is_message)
check_events(ctx, FD_WRITE, 0, 200); check_events(ctx, FD_WRITE, 0, 200);
check_events_todo_event(ctx, 0, 0, 0); check_events(ctx, 0, 0, 0);
ret = send(server, "data", 5, 0); ret = send(server, "data", 5, 0);
ok(ret == 5, "got %d\n", ret); ok(ret == 5, "got %d\n", ret);
...@@ -4268,7 +4267,7 @@ static void test_write_events(struct event_test_ctx *ctx) ...@@ -4268,7 +4267,7 @@ static void test_write_events(struct event_test_ctx *ctx)
select_events(ctx, server, FD_ACCEPT | FD_CLOSE | FD_CONNECT | FD_OOB | FD_READ | FD_WRITE); select_events(ctx, server, FD_ACCEPT | FD_CLOSE | FD_CONNECT | FD_OOB | FD_READ | FD_WRITE);
if (ctx->is_message) if (ctx->is_message)
check_events(ctx, FD_WRITE, 0, 200); check_events(ctx, FD_WRITE, 0, 200);
check_events_todo_event(ctx, 0, 0, 0); check_events(ctx, 0, 0, 0);
} }
closesocket(server); closesocket(server);
...@@ -4313,12 +4312,12 @@ static void test_read_events(struct event_test_ctx *ctx) ...@@ -4313,12 +4312,12 @@ static void test_read_events(struct event_test_ctx *ctx)
select_events(ctx, server, FD_ACCEPT | FD_CLOSE | FD_CONNECT | FD_OOB | FD_READ); select_events(ctx, server, FD_ACCEPT | FD_CLOSE | FD_CONNECT | FD_OOB | FD_READ);
if (ctx->is_message) if (ctx->is_message)
check_events(ctx, FD_READ, 0, 200); check_events(ctx, FD_READ, 0, 200);
check_events_todo_event(ctx, 0, 0, 0); check_events(ctx, 0, 0, 0);
select_events(ctx, server, 0); select_events(ctx, server, 0);
select_events(ctx, server, FD_ACCEPT | FD_CLOSE | FD_CONNECT | FD_OOB | FD_READ); select_events(ctx, server, FD_ACCEPT | FD_CLOSE | FD_CONNECT | FD_OOB | FD_READ);
if (ctx->is_message) if (ctx->is_message)
check_events(ctx, FD_READ, 0, 200); check_events(ctx, FD_READ, 0, 200);
check_events_todo_event(ctx, 0, 0, 0); check_events(ctx, 0, 0, 0);
ret = send(client, "data", 5, 0); ret = send(client, "data", 5, 0);
ok(ret == 5, "got %d\n", ret); ok(ret == 5, "got %d\n", ret);
......
...@@ -1780,7 +1780,8 @@ DECL_HANDLER(set_socket_event) ...@@ -1780,7 +1780,8 @@ DECL_HANDLER(set_socket_event)
if (get_unix_fd( sock->fd ) == -1) return; if (get_unix_fd( sock->fd ) == -1) return;
old_event = sock->event; old_event = sock->event;
sock->mask = req->mask; sock->mask = req->mask;
sock->reported_events &= ~req->mask; /* re-enable held events */ if (req->window)
sock->reported_events &= ~req->mask; /* re-enable held events */
sock->event = NULL; sock->event = NULL;
sock->window = req->window; sock->window = req->window;
sock->message = req->msg; sock->message = req->msg;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment