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
4c67e0fb
Commit
4c67e0fb
authored
Jul 05, 2022
by
Paul Gofman
Committed by
Alexandre Julliard
Jul 18, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: Add ipv4 raw socket protocol info.
Signed-off-by:
Paul Gofman
<
pgofman@codeweavers.com
>
parent
dfff9217
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
8 deletions
+47
-8
socket.c
dlls/ws2_32/socket.c
+24
-6
protocol.c
dlls/ws2_32/tests/protocol.c
+2
-0
sock.c
dlls/ws2_32/tests/sock.c
+21
-2
No files found.
dlls/ws2_32/socket.c
View file @
4c67e0fb
...
...
@@ -71,6 +71,23 @@ static const WSAPROTOCOL_INFOW supported_protocols[] =
.
szProtocol
=
L"UDP/IP"
,
},
{
.
dwServiceFlags1
=
XP1_IFS_HANDLES
|
XP1_SUPPORT_BROADCAST
|
XP1_SUPPORT_MULTIPOINT
|
XP1_MESSAGE_ORIENTED
|
XP1_CONNECTIONLESS
,
.
dwProviderFlags
=
PFL_MATCHES_PROTOCOL_ZERO
|
PFL_HIDDEN
,
.
ProviderId
=
{
0xe70f1aa0
,
0xab8b
,
0x11cf
,
{
0x8c
,
0xa3
,
0x00
,
0x80
,
0x5f
,
0x48
,
0xa1
,
0x92
}},
.
dwCatalogEntryId
=
1003
,
.
ProtocolChain
.
ChainLen
=
1
,
.
iVersion
=
2
,
.
iAddressFamily
=
AF_INET
,
.
iMaxSockAddr
=
sizeof
(
struct
sockaddr_in
),
.
iMinSockAddr
=
sizeof
(
struct
sockaddr_in
),
.
iSocketType
=
SOCK_RAW
,
.
iProtocol
=
0
,
.
iProtocolMaxOffset
=
255
,
.
dwMessageSize
=
0x8000
,
.
szProtocol
=
L"MSAFD Tcpip [RAW/IP]"
,
},
{
.
dwServiceFlags1
=
XP1_IFS_HANDLES
|
XP1_EXPEDITED_DATA
|
XP1_GRACEFUL_CLOSE
|
XP1_GUARANTEED_ORDER
|
XP1_GUARANTEED_DELIVERY
,
.
dwProviderFlags
=
PFL_MATCHES_PROTOCOL_ZERO
,
...
...
@@ -4097,12 +4114,13 @@ int WINAPI WSARecvDisconnect( SOCKET s, WSABUF *data )
}
static
BOOL
protocol_matches_filter
(
const
int
*
filter
,
int
protocol
)
static
BOOL
protocol_matches_filter
(
const
int
*
filter
,
unsigned
int
index
)
{
if
(
supported_protocols
[
index
].
dwProviderFlags
&
PFL_HIDDEN
)
return
FALSE
;
if
(
!
filter
)
return
TRUE
;
while
(
*
filter
)
{
if
(
p
rotocol
==
*
filter
++
)
return
TRUE
;
if
(
supported_protocols
[
index
].
iP
rotocol
==
*
filter
++
)
return
TRUE
;
}
return
FALSE
;
}
...
...
@@ -4120,7 +4138,7 @@ int WINAPI WSAEnumProtocolsA( int *filter, WSAPROTOCOL_INFOA *protocols, DWORD *
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
supported_protocols
);
++
i
)
{
if
(
protocol_matches_filter
(
filter
,
supported_protocols
[
i
].
iProtocol
))
if
(
protocol_matches_filter
(
filter
,
i
))
++
count
;
}
...
...
@@ -4134,7 +4152,7 @@ int WINAPI WSAEnumProtocolsA( int *filter, WSAPROTOCOL_INFOA *protocols, DWORD *
count
=
0
;
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
supported_protocols
);
++
i
)
{
if
(
protocol_matches_filter
(
filter
,
supported_protocols
[
i
].
iProtocol
))
if
(
protocol_matches_filter
(
filter
,
i
))
{
memcpy
(
&
protocols
[
count
],
&
supported_protocols
[
i
],
offsetof
(
WSAPROTOCOL_INFOW
,
szProtocol
)
);
WideCharToMultiByte
(
CP_ACP
,
0
,
supported_protocols
[
i
].
szProtocol
,
-
1
,
...
...
@@ -4190,7 +4208,7 @@ int WINAPI WSAEnumProtocolsW( int *filter, WSAPROTOCOL_INFOW *protocols, DWORD *
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
supported_protocols
);
++
i
)
{
if
(
protocol_matches_filter
(
filter
,
supported_protocols
[
i
].
iProtocol
))
if
(
protocol_matches_filter
(
filter
,
i
))
++
count
;
}
...
...
@@ -4204,7 +4222,7 @@ int WINAPI WSAEnumProtocolsW( int *filter, WSAPROTOCOL_INFOW *protocols, DWORD *
count
=
0
;
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
supported_protocols
);
++
i
)
{
if
(
protocol_matches_filter
(
filter
,
supported_protocols
[
i
].
iProtocol
))
if
(
protocol_matches_filter
(
filter
,
i
))
protocols
[
count
++
]
=
supported_protocols
[
i
];
}
return
count
;
...
...
dlls/ws2_32/tests/protocol.c
View file @
4c67e0fb
...
...
@@ -107,6 +107,7 @@ static void test_WSAEnumProtocolsA(void)
for
(
i
=
0
;
i
<
ret
;
i
++
)
{
ok
(
strlen
(
buffer
[
i
].
szProtocol
),
"No protocol name found
\n
"
);
ok
(
!
(
buffer
[
i
].
dwProviderFlags
&
PFL_HIDDEN
),
"Found a protocol with PFL_HIDDEN.
\n
"
);
test_service_flags
(
buffer
[
i
].
iAddressFamily
,
buffer
[
i
].
iVersion
,
buffer
[
i
].
iSocketType
,
buffer
[
i
].
iProtocol
,
buffer
[
i
].
dwServiceFlags1
);
...
...
@@ -174,6 +175,7 @@ static void test_WSAEnumProtocolsW(void)
for
(
i
=
0
;
i
<
ret
;
i
++
)
{
ok
(
lstrlenW
(
buffer
[
i
].
szProtocol
),
"No protocol name found
\n
"
);
ok
(
!
(
buffer
[
i
].
dwProviderFlags
&
PFL_HIDDEN
),
"Found a protocol with PFL_HIDDEN.
\n
"
);
test_service_flags
(
buffer
[
i
].
iAddressFamily
,
buffer
[
i
].
iVersion
,
buffer
[
i
].
iSocketType
,
buffer
[
i
].
iProtocol
,
buffer
[
i
].
dwServiceFlags1
);
...
...
dlls/ws2_32/tests/sock.c
View file @
4c67e0fb
...
...
@@ -2937,18 +2937,38 @@ static void test_WSASocket(void)
}
else
{
WSAPROTOCOL_INFOW
info
;
size
=
sizeof
(
socktype
);
socktype
=
0xdead
;
err
=
getsockopt
(
sock
,
SOL_SOCKET
,
SO_TYPE
,
(
char
*
)
&
socktype
,
&
size
);
ok
(
!
err
,
"getsockopt failed with %d
\n
"
,
WSAGetLastError
());
ok
(
socktype
==
SOCK_RAW
,
"Wrong socket type, expected %d received %d
\n
"
,
SOCK_RAW
,
socktype
);
size
=
sizeof
(
info
);
err
=
getsockopt
(
sock
,
SOL_SOCKET
,
SO_PROTOCOL_INFOW
,
(
char
*
)
&
info
,
&
size
);
ok
(
!
err
,
"got error %d
\n
"
,
WSAGetLastError
());
ok
(
!
wcscmp
(
info
.
szProtocol
,
L"MSAFD Tcpip [RAW/IP]"
)
||
broken
(
!
wcscmp
(
info
.
szProtocol
,
L"MSAFD-Tcpip [RAW/IP]"
))
/* Some Win7 machines. */
,
"got szProtocol %s.
\n
"
,
debugstr_w
(
info
.
szProtocol
));
ok
(
info
.
iAddressFamily
==
AF_INET
,
"got iAddressFamily %d.
\n
"
,
info
.
iAddressFamily
);
ok
(
info
.
iSocketType
==
SOCK_RAW
,
"got iSocketType %d.
\n
"
,
info
.
iSocketType
);
ok
(
info
.
iMaxSockAddr
==
0x10
,
"got iMaxSockAddr %d.
\n
"
,
info
.
iMaxSockAddr
);
ok
(
info
.
iMinSockAddr
==
0x10
,
"got iMinSockAddr %d.
\n
"
,
info
.
iMinSockAddr
);
todo_wine
ok
(
!
info
.
iProtocol
,
"got iProtocol %d.
\n
"
,
info
.
iProtocol
);
ok
(
info
.
iProtocolMaxOffset
==
255
,
"got iProtocol %d.
\n
"
,
info
.
iProtocolMaxOffset
);
ok
(
info
.
dwProviderFlags
==
(
PFL_MATCHES_PROTOCOL_ZERO
|
PFL_HIDDEN
),
"got dwProviderFlags %#lx.
\n
"
,
info
.
dwProviderFlags
);
ok
(
info
.
dwServiceFlags1
==
(
XP1_IFS_HANDLES
|
XP1_SUPPORT_BROADCAST
|
XP1_SUPPORT_MULTIPOINT
|
XP1_MESSAGE_ORIENTED
|
XP1_CONNECTIONLESS
),
"got dwServiceFlags1 %#lx.
\n
"
,
info
.
dwServiceFlags1
);
closesocket
(
sock
);
sock
=
WSASocketA
(
0
,
0
,
IPPROTO_RAW
,
NULL
,
0
,
0
);
if
(
sock
!=
INVALID_SOCKET
)
{
todo_wine
{
size
=
sizeof
(
socktype
);
socktype
=
0xdead
;
err
=
getsockopt
(
sock
,
SOL_SOCKET
,
SO_TYPE
,
(
char
*
)
&
socktype
,
&
size
);
...
...
@@ -2956,7 +2976,6 @@ static void test_WSASocket(void)
ok
(
socktype
==
SOCK_RAW
,
"Wrong socket type, expected %d received %d
\n
"
,
SOCK_RAW
,
socktype
);
closesocket
(
sock
);
}
sock
=
WSASocketA
(
AF_INET
,
SOCK_RAW
,
IPPROTO_TCP
,
NULL
,
0
,
0
);
ok
(
sock
!=
INVALID_SOCKET
,
"Failed to create socket: %d
\n
"
,
...
...
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