Commit 414b31bc authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

ws2_32: Reimplement select() on top of IOCTL_AFD_POLL.

parent 639a4cab
...@@ -3127,6 +3127,14 @@ static void test_select(void) ...@@ -3127,6 +3127,14 @@ static void test_select(void)
ret = select(0, &readfds, &writefds, &exceptfds, &select_timeout); ret = select(0, &readfds, &writefds, &exceptfds, &select_timeout);
ok(ret == 1, "expected 1, got %d\n", ret); ok(ret == 1, "expected 1, got %d\n", ret);
ok(FD_ISSET(fdRead, &readfds), "fdRead socket is not in the set\n"); ok(FD_ISSET(fdRead, &readfds), "fdRead socket is not in the set\n");
ok(!FD_ISSET(fdRead, &exceptfds), "fdRead socket is in the set\n");
FD_ZERO_ALL();
FD_SET_ALL(fdRead);
ret = select(0, &readfds, &writefds, &exceptfds, &select_timeout);
ok(ret == 2, "expected 1, got %d\n", ret);
ok(FD_ISSET(fdRead, &readfds), "fdRead socket is not in the set\n");
ok(FD_ISSET(fdRead, &writefds), "fdRead socket is not in the set\n");
ok(!FD_ISSET(fdRead, &exceptfds), "fdRead socket is in the set\n");
ret = recv(fdRead, tmp_buf, sizeof(tmp_buf), 0); ret = recv(fdRead, tmp_buf, sizeof(tmp_buf), 0);
ok(ret == 4, "expected 4, got %d\n", ret); ok(ret == 4, "expected 4, got %d\n", ret);
ok(!strcmp(tmp_buf, "1234"), "data received differs from sent\n"); ok(!strcmp(tmp_buf, "1234"), "data received differs from sent\n");
...@@ -3239,9 +3247,9 @@ static void test_select(void) ...@@ -3239,9 +3247,9 @@ static void test_select(void)
FD_SET(fdWrite, &exceptfds); FD_SET(fdWrite, &exceptfds);
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = select(0, NULL, NULL, &exceptfds, &select_timeout); ret = select(0, NULL, NULL, &exceptfds, &select_timeout);
todo_wine
ok(ret == SOCKET_ERROR, "expected -1, got %d\n", ret); ok(ret == SOCKET_ERROR, "expected -1, got %d\n", ret);
ok(GetLastError() == WSAENOTSOCK, "got %d\n", GetLastError()); ok(GetLastError() == WSAENOTSOCK, "got %d\n", GetLastError());
ok(!FD_ISSET(fdWrite, &exceptfds), "fdWrite socket is in the set\n");
WaitForSingleObject (thread_handle, 1000); WaitForSingleObject (thread_handle, 1000);
closesocket(fdRead); closesocket(fdRead);
......
...@@ -190,8 +190,6 @@ struct per_thread_data ...@@ -190,8 +190,6 @@ struct per_thread_data
struct WS_hostent *he_buffer; struct WS_hostent *he_buffer;
struct WS_servent *se_buffer; struct WS_servent *se_buffer;
struct WS_protoent *pe_buffer; struct WS_protoent *pe_buffer;
struct pollfd *fd_cache;
unsigned int fd_count;
int he_len; int he_len;
int se_len; int se_len;
int pe_len; int pe_len;
......
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