Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
63fb7a79
Commit
63fb7a79
authored
Jul 31, 2013
by
Bruno Jesus
Committed by
Alexandre Julliard
Jul 31, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: Fix service flags returned from TCP and UDP protocols.
parent
7944ca48
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
12 deletions
+53
-12
protocol.c
dlls/ws2_32/protocol.c
+2
-2
protocol.c
dlls/ws2_32/tests/protocol.c
+51
-10
No files found.
dlls/ws2_32/protocol.c
View file @
63fb7a79
...
@@ -96,7 +96,7 @@ static INT WINSOCK_EnterSingleProtocolW( INT protocol, WSAPROTOCOL_INFOW* info )
...
@@ -96,7 +96,7 @@ static INT WINSOCK_EnterSingleProtocolW( INT protocol, WSAPROTOCOL_INFOW* info )
switch
(
protocol
)
switch
(
protocol
)
{
{
case
WS_IPPROTO_TCP
:
case
WS_IPPROTO_TCP
:
info
->
dwServiceFlags1
=
XP1_
PARTIAL_MESSAGE
|
XP1_EXPEDITED_DATA
|
info
->
dwServiceFlags1
=
XP1_
IFS_HANDLES
|
XP1_EXPEDITED_DATA
|
XP1_GRACEFUL_CLOSE
|
XP1_GUARANTEED_ORDER
|
XP1_GRACEFUL_CLOSE
|
XP1_GUARANTEED_ORDER
|
XP1_GUARANTEED_DELIVERY
;
XP1_GUARANTEED_DELIVERY
;
info
->
ProviderId
=
ProviderIdIP
;
info
->
ProviderId
=
ProviderIdIP
;
...
@@ -111,7 +111,7 @@ static INT WINSOCK_EnterSingleProtocolW( INT protocol, WSAPROTOCOL_INFOW* info )
...
@@ -111,7 +111,7 @@ static INT WINSOCK_EnterSingleProtocolW( INT protocol, WSAPROTOCOL_INFOW* info )
break
;
break
;
case
WS_IPPROTO_UDP
:
case
WS_IPPROTO_UDP
:
info
->
dwServiceFlags1
=
XP1_
PARTIAL_MESSAGE
|
XP1_SUPPORT_BROADCAST
|
info
->
dwServiceFlags1
=
XP1_
IFS_HANDLES
|
XP1_SUPPORT_BROADCAST
|
XP1_SUPPORT_MULTIPOINT
|
XP1_MESSAGE_ORIENTED
|
XP1_SUPPORT_MULTIPOINT
|
XP1_MESSAGE_ORIENTED
|
XP1_CONNECTIONLESS
;
XP1_CONNECTIONLESS
;
info
->
ProviderId
=
ProviderIdIP
;
info
->
ProviderId
=
ProviderIdIP
;
...
...
dlls/ws2_32/tests/protocol.c
View file @
63fb7a79
...
@@ -26,22 +26,55 @@
...
@@ -26,22 +26,55 @@
#include "wine/test.h"
#include "wine/test.h"
/* TCP and UDP over IP fixed set of service flags */
#define TCPIP_SERVICE_FLAGS (XP1_GUARANTEED_DELIVERY \
| XP1_GUARANTEED_ORDER \
| XP1_GRACEFUL_CLOSE \
| XP1_EXPEDITED_DATA \
| XP1_IFS_HANDLES)
#define UDPIP_SERVICE_FLAGS (XP1_CONNECTIONLESS \
| XP1_MESSAGE_ORIENTED \
| XP1_SUPPORT_BROADCAST \
| XP1_SUPPORT_MULTIPOINT \
| XP1_IFS_HANDLES)
static
void
test_service_flags
(
int
family
,
int
version
,
int
socktype
,
int
protocol
,
DWORD
testflags
)
{
DWORD
expectedflags
=
0
;
if
(
socktype
==
SOCK_STREAM
&&
protocol
==
IPPROTO_TCP
)
expectedflags
=
TCPIP_SERVICE_FLAGS
;
if
(
socktype
==
SOCK_DGRAM
&&
protocol
==
IPPROTO_UDP
)
expectedflags
=
UDPIP_SERVICE_FLAGS
;
/* check if standard TCP and UDP protocols are offering the correct service flags */
if
((
family
==
AF_INET
||
family
==
AF_INET6
)
&&
version
==
2
&&
expectedflags
)
{
/* QOS may or may not be installed */
testflags
&=
~
XP1_QOS_SUPPORTED
;
ok
(
expectedflags
==
testflags
,
"Incorrect flags, expected 0x%x, received 0x%x
\n
"
,
expectedflags
,
testflags
);
}
}
static
void
test_WSAEnumProtocolsA
(
void
)
static
void
test_WSAEnumProtocolsA
(
void
)
{
{
INT
ret
;
INT
ret
;
DWORD
len
=
0
;
DWORD
len
=
0
,
error
;
WSAPROTOCOL_INFOA
info
,
*
buffer
;
WSAPROTOCOL_INFOA
info
,
*
buffer
;
ret
=
WSAEnumProtocolsA
(
NULL
,
NULL
,
&
len
);
ret
=
WSAEnumProtocolsA
(
NULL
,
NULL
,
&
len
);
ok
(
ret
==
SOCKET_ERROR
,
"WSAEnumProtocolsA() succeeded unexpectedly: %d
\n
"
,
ok
(
ret
==
SOCKET_ERROR
,
"WSAEnumProtocolsA() succeeded unexpectedly
\n
"
);
WSAGetLastError
()
);
error
=
WSAGetLastError
();
ok
(
error
==
WSAENOBUFS
,
"Expected 10055, received %d
\n
"
,
error
);
len
=
0
;
len
=
0
;
ret
=
WSAEnumProtocolsA
(
NULL
,
&
info
,
&
len
);
ret
=
WSAEnumProtocolsA
(
NULL
,
&
info
,
&
len
);
ok
(
ret
==
SOCKET_ERROR
,
"WSAEnumProtocolsA() succeeded unexpectedly: %d
\n
"
,
ok
(
ret
==
SOCKET_ERROR
,
"WSAEnumProtocolsA() succeeded unexpectedly
\n
"
);
WSAGetLastError
()
);
error
=
WSAGetLastError
();
ok
(
error
==
WSAENOBUFS
,
"Expected 10055, received %d
\n
"
,
error
);
buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
...
@@ -56,6 +89,9 @@ static void test_WSAEnumProtocolsA(void)
...
@@ -56,6 +89,9 @@ static void test_WSAEnumProtocolsA(void)
for
(
i
=
0
;
i
<
ret
;
i
++
)
for
(
i
=
0
;
i
<
ret
;
i
++
)
{
{
ok
(
strlen
(
buffer
[
i
].
szProtocol
),
"No protocol name found
\n
"
);
ok
(
strlen
(
buffer
[
i
].
szProtocol
),
"No protocol name found
\n
"
);
test_service_flags
(
buffer
[
i
].
iAddressFamily
,
buffer
[
i
].
iVersion
,
buffer
[
i
].
iSocketType
,
buffer
[
i
].
iProtocol
,
buffer
[
i
].
dwServiceFlags1
);
}
}
HeapFree
(
GetProcessHeap
(),
0
,
buffer
);
HeapFree
(
GetProcessHeap
(),
0
,
buffer
);
...
@@ -65,18 +101,20 @@ static void test_WSAEnumProtocolsA(void)
...
@@ -65,18 +101,20 @@ static void test_WSAEnumProtocolsA(void)
static
void
test_WSAEnumProtocolsW
(
void
)
static
void
test_WSAEnumProtocolsW
(
void
)
{
{
INT
ret
;
INT
ret
;
DWORD
len
=
0
;
DWORD
len
=
0
,
error
;
WSAPROTOCOL_INFOW
info
,
*
buffer
;
WSAPROTOCOL_INFOW
info
,
*
buffer
;
ret
=
WSAEnumProtocolsW
(
NULL
,
NULL
,
&
len
);
ret
=
WSAEnumProtocolsW
(
NULL
,
NULL
,
&
len
);
ok
(
ret
==
SOCKET_ERROR
,
"WSAEnumProtocolsW() succeeded unexpectedly: %d
\n
"
,
ok
(
ret
==
SOCKET_ERROR
,
"WSAEnumProtocolsW() succeeded unexpectedly
\n
"
);
WSAGetLastError
()
);
error
=
WSAGetLastError
();
ok
(
error
==
WSAENOBUFS
,
"Expected 10055, received %d
\n
"
,
error
);
len
=
0
;
len
=
0
;
ret
=
WSAEnumProtocolsW
(
NULL
,
&
info
,
&
len
);
ret
=
WSAEnumProtocolsW
(
NULL
,
&
info
,
&
len
);
ok
(
ret
==
SOCKET_ERROR
,
"WSAEnumProtocolsW() succeeded unexpectedly: %d
\n
"
,
ok
(
ret
==
SOCKET_ERROR
,
"WSAEnumProtocolsW() succeeded unexpectedly
\n
"
);
WSAGetLastError
()
);
error
=
WSAGetLastError
();
ok
(
error
==
WSAENOBUFS
,
"Expected 10055, received %d
\n
"
,
error
);
buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
...
@@ -91,6 +129,9 @@ static void test_WSAEnumProtocolsW(void)
...
@@ -91,6 +129,9 @@ static void test_WSAEnumProtocolsW(void)
for
(
i
=
0
;
i
<
ret
;
i
++
)
for
(
i
=
0
;
i
<
ret
;
i
++
)
{
{
ok
(
lstrlenW
(
buffer
[
i
].
szProtocol
),
"No protocol name found
\n
"
);
ok
(
lstrlenW
(
buffer
[
i
].
szProtocol
),
"No protocol name found
\n
"
);
test_service_flags
(
buffer
[
i
].
iAddressFamily
,
buffer
[
i
].
iVersion
,
buffer
[
i
].
iSocketType
,
buffer
[
i
].
iProtocol
,
buffer
[
i
].
dwServiceFlags1
);
}
}
HeapFree
(
GetProcessHeap
(),
0
,
buffer
);
HeapFree
(
GetProcessHeap
(),
0
,
buffer
);
...
...
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