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
864bef4f
Commit
864bef4f
authored
Feb 01, 2022
by
Zebediah Figura
Committed by
Alexandre Julliard
Feb 01, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: Always fill the WSADATA structure in WSAStartup().
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
155449c5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
23 deletions
+19
-23
socket.c
dlls/ws2_32/socket.c
+16
-17
protocol.c
dlls/ws2_32/tests/protocol.c
+3
-6
No files found.
dlls/ws2_32/socket.c
View file @
864bef4f
...
@@ -572,29 +572,28 @@ BOOL WINAPI DllMain( HINSTANCE instance, DWORD reason, void *reserved )
...
@@ -572,29 +572,28 @@ BOOL WINAPI DllMain( HINSTANCE instance, DWORD reason, void *reserved )
/***********************************************************************
/***********************************************************************
* WSAStartup (WS2_32.115)
* WSAStartup (WS2_32.115)
*/
*/
int
WINAPI
WSAStartup
(
WORD
wVersionRequested
,
LPWSADATA
lpWSAData
)
int
WINAPI
WSAStartup
(
WORD
version
,
WSADATA
*
data
)
{
{
TRACE
(
"verReq=%x
\n
"
,
wVersionRequested
);
TRACE
(
"version %#x
\n
"
,
version
);
if
(
LOBYTE
(
wVersionRequested
)
<
1
)
if
(
data
)
{
data
->
wVersion
=
version
;
data
->
wHighVersion
=
MAKEWORD
(
2
,
2
);
strcpy
(
data
->
szDescription
,
"WinSock 2.0"
);
strcpy
(
data
->
szSystemStatus
,
"Running"
);
data
->
iMaxSockets
=
MAX_SOCKETS_PER_PROCESS
;
data
->
iMaxUdpDg
=
MAX_UDP_DATAGRAM
;
/* don't fill lpVendorInfo */
}
if
(
!
LOBYTE
(
version
))
return
WSAVERNOTSUPPORTED
;
return
WSAVERNOTSUPPORTED
;
if
(
!
lpWSAD
ata
)
return
WSAEINVAL
;
if
(
!
d
ata
)
return
WSAEINVAL
;
num_startup
++
;
num_startup
++
;
TRACE
(
"increasing startup count to %d
\n
"
,
num_startup
);
/* that's the whole of the negotiation for now */
lpWSAData
->
wVersion
=
wVersionRequested
;
/* return winsock information */
lpWSAData
->
wHighVersion
=
0x0202
;
strcpy
(
lpWSAData
->
szDescription
,
"WinSock 2.0"
);
strcpy
(
lpWSAData
->
szSystemStatus
,
"Running"
);
lpWSAData
->
iMaxSockets
=
MAX_SOCKETS_PER_PROCESS
;
lpWSAData
->
iMaxUdpDg
=
MAX_UDP_DATAGRAM
;
/* don't do anything with lpWSAData->lpVendorInfo */
/* (some apps don't allocate the space for this field) */
TRACE
(
"succeeded starts: %d
\n
"
,
num_startup
);
return
0
;
return
0
;
}
}
...
...
dlls/ws2_32/tests/protocol.c
View file @
864bef4f
...
@@ -2869,12 +2869,9 @@ static void test_startup(void)
...
@@ -2869,12 +2869,9 @@ static void test_startup(void)
todo_wine
ok
(
!
WSAGetLastError
(),
"got error %u
\n
"
,
WSAGetLastError
());
todo_wine
ok
(
!
WSAGetLastError
(),
"got error %u
\n
"
,
WSAGetLastError
());
}
}
ok
(
data
.
lpVendorInfo
==
(
void
*
)
0xdeadbeef
,
"got vendor info %p
\n
"
,
data
.
lpVendorInfo
);
ok
(
data
.
lpVendorInfo
==
(
void
*
)
0xdeadbeef
,
"got vendor info %p
\n
"
,
data
.
lpVendorInfo
);
todo_wine_if
(
ret
)
ok
(
data
.
wHighVersion
==
0x202
,
"got maximum version %#x
\n
"
,
data
.
wHighVersion
);
{
ok
(
!
strcmp
(
data
.
szDescription
,
"WinSock 2.0"
),
"got description %s
\n
"
,
debugstr_a
(
data
.
szDescription
));
ok
(
data
.
wHighVersion
==
0x202
,
"got maximum version %#x
\n
"
,
data
.
wHighVersion
);
ok
(
!
strcmp
(
data
.
szSystemStatus
,
"Running"
),
"got status %s
\n
"
,
debugstr_a
(
data
.
szSystemStatus
));
ok
(
!
strcmp
(
data
.
szDescription
,
"WinSock 2.0"
),
"got description %s
\n
"
,
debugstr_a
(
data
.
szDescription
));
ok
(
!
strcmp
(
data
.
szSystemStatus
,
"Running"
),
"got status %s
\n
"
,
debugstr_a
(
data
.
szSystemStatus
));
}
todo_wine
ok
(
data
.
iMaxSockets
==
(
LOBYTE
(
tests
[
i
].
version
)
==
1
?
32767
:
0
),
"got maximum sockets %u
\n
"
,
data
.
iMaxSockets
);
todo_wine
ok
(
data
.
iMaxSockets
==
(
LOBYTE
(
tests
[
i
].
version
)
==
1
?
32767
:
0
),
"got maximum sockets %u
\n
"
,
data
.
iMaxSockets
);
todo_wine
ok
(
data
.
iMaxUdpDg
==
(
LOBYTE
(
tests
[
i
].
version
)
==
1
?
65467
:
0
),
"got maximum datagram size %u
\n
"
,
data
.
iMaxUdpDg
);
todo_wine
ok
(
data
.
iMaxUdpDg
==
(
LOBYTE
(
tests
[
i
].
version
)
==
1
?
65467
:
0
),
"got maximum datagram size %u
\n
"
,
data
.
iMaxUdpDg
);
...
...
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