Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
56666888
Commit
56666888
authored
Dec 24, 2021
by
Torge Matthies
Committed by
Alexandre Julliard
Dec 26, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32/tests: Test short fd_set with select().
Signed-off-by:
Torge Matthies
<
openglfreak@googlemail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ae0209a3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
sock.c
dlls/ws2_32/tests/sock.c
+12
-2
No files found.
dlls/ws2_32/tests/sock.c
View file @
56666888
...
...
@@ -3152,7 +3152,7 @@ static void test_select(void)
static
char
tmp_buf
[
1024
];
SOCKET
fdListen
,
fdRead
,
fdWrite
;
fd_set
readfds
,
writefds
,
exceptfds
;
fd_set
readfds
,
writefds
,
exceptfds
,
*
alloc_readfds
;
unsigned
int
maxfd
;
int
ret
,
len
;
char
buffer
;
...
...
@@ -3160,7 +3160,8 @@ static void test_select(void)
struct
sockaddr_in
address
;
select_thread_params
thread_params
;
HANDLE
thread_handle
;
DWORD
ticks
,
id
;
DWORD
ticks
,
id
,
old_protect
;
char
*
page_pair
;
fdRead
=
socket
(
AF_INET
,
SOCK_STREAM
,
0
);
ok
(
(
fdRead
!=
INVALID_SOCKET
),
"socket failed unexpectedly: %d
\n
"
,
WSAGetLastError
()
);
...
...
@@ -3326,6 +3327,15 @@ static void test_select(void)
ok
(
FD_ISSET
(
fdWrite
,
&
readfds
),
"fdWrite socket is not in the set
\n
"
);
ok
(
FD_ISSET
(
fdRead
,
&
readfds
),
"fdRead socket is not in the set
\n
"
);
page_pair
=
VirtualAlloc
(
NULL
,
0x1000
*
2
,
MEM_RESERVE
|
MEM_COMMIT
,
PAGE_READWRITE
);
VirtualProtect
(
page_pair
+
0x1000
,
0x1000
,
PAGE_NOACCESS
,
&
old_protect
);
alloc_readfds
=
(
fd_set
*
)((
page_pair
+
0x1000
)
-
offsetof
(
fd_set
,
fd_array
[
1
]));
alloc_readfds
->
fd_count
=
1
;
alloc_readfds
->
fd_array
[
0
]
=
fdRead
;
ret
=
select
(
fdRead
+
1
,
alloc_readfds
,
NULL
,
NULL
,
&
select_timeout
);
ok
(
ret
==
1
,
"select returned %d
\n
"
,
ret
);
VirtualFree
(
page_pair
,
0
,
MEM_RELEASE
);
closesocket
(
fdRead
);
closesocket
(
fdWrite
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment