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
b67b3c56
Commit
b67b3c56
authored
Nov 02, 2004
by
Hans Leidekker
Committed by
Alexandre Julliard
Nov 02, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure we match output of Win2k protocol enumeration functions.
parent
82297525
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
23 deletions
+59
-23
protocol.c
dlls/winsock/protocol.c
+59
-23
No files found.
dlls/winsock/protocol.c
View file @
b67b3c56
...
...
@@ -19,6 +19,11 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* 02/11/2004
* The protocol enumeration functions were verified to match Win2k versions
* for these protocols: IPX, SPX, SPXII, TCP/IP and UDP/IP.
*/
#include "config.h"
#include <stdarg.h>
...
...
@@ -61,7 +66,12 @@ static const WCHAR NameTcpW[] = {'T', 'C', 'P', '/', 'I', 'P', '\0'};
static
const
WCHAR
NameUdpW
[]
=
{
'U'
,
'D'
,
'P'
,
'/'
,
'I'
,
'P'
,
'\0'
};
/* Taken from Win2k */
GUID
ProviderId
=
{
0xe70f1aa0
,
0xab8b
,
0x11cf
,
{
0x8c
,
0xa3
,
0x00
,
0x80
,
0x5f
,
0x48
,
0xa1
,
0x92
}
};
static
const
GUID
ProviderIdIP
=
{
0xe70f1aa0
,
0xab8b
,
0x11cf
,
{
0x8c
,
0xa3
,
0x00
,
0x80
,
0x5f
,
0x48
,
0xa1
,
0x92
}
};
static
const
GUID
ProviderIdIPX
=
{
0x11058240
,
0xbe47
,
0x11cf
,
{
0x95
,
0xc8
,
0x00
,
0x80
,
0x5f
,
0x48
,
0xa1
,
0x92
}
};
static
const
GUID
ProviderIdSPX
=
{
0x11058241
,
0xbe47
,
0x11cf
,
{
0x95
,
0xc8
,
0x00
,
0x80
,
0x5f
,
0x48
,
0xa1
,
0x92
}
};
/*****************************************************************************
* WINSOCK_EnterSingleProtocolW [internal]
...
...
@@ -89,7 +99,7 @@ static INT WINSOCK_EnterSingleProtocolW( INT protocol, WSAPROTOCOL_INFOW* info )
info
->
dwServiceFlags1
=
XP1_PARTIAL_MESSAGE
|
XP1_EXPEDITED_DATA
|
XP1_GRACEFUL_CLOSE
|
XP1_GUARANTEED_ORDER
|
XP1_GUARANTEED_DELIVERY
;
memcpy
(
&
info
->
ProviderId
,
&
ProviderId
,
sizeof
(
GUID
)
);
memcpy
(
&
info
->
ProviderId
,
&
ProviderId
IP
,
sizeof
(
GUID
)
);
info
->
dwCatalogEntryId
=
0x3e9
;
info
->
ProtocolChain
.
ChainLen
=
1
;
info
->
iVersion
=
2
;
...
...
@@ -104,7 +114,7 @@ static INT WINSOCK_EnterSingleProtocolW( INT protocol, WSAPROTOCOL_INFOW* info )
info
->
dwServiceFlags1
=
XP1_PARTIAL_MESSAGE
|
XP1_SUPPORT_BROADCAST
|
XP1_SUPPORT_MULTIPOINT
|
XP1_MESSAGE_ORIENTED
|
XP1_CONNECTIONLESS
;
memcpy
(
&
info
->
ProviderId
,
&
ProviderId
,
sizeof
(
GUID
)
);
memcpy
(
&
info
->
ProviderId
,
&
ProviderId
IP
,
sizeof
(
GUID
)
);
info
->
dwCatalogEntryId
=
0x3ea
;
info
->
ProtocolChain
.
ChainLen
=
1
;
info
->
iVersion
=
2
;
...
...
@@ -120,35 +130,48 @@ static INT WINSOCK_EnterSingleProtocolW( INT protocol, WSAPROTOCOL_INFOW* info )
info
->
dwServiceFlags1
=
XP1_PARTIAL_MESSAGE
|
XP1_SUPPORT_BROADCAST
|
XP1_SUPPORT_MULTIPOINT
|
XP1_MESSAGE_ORIENTED
|
XP1_CONNECTIONLESS
;
memcpy
(
&
info
->
ProviderId
,
&
ProviderIdIPX
,
sizeof
(
GUID
)
);
info
->
dwCatalogEntryId
=
0x406
;
info
->
ProtocolChain
.
ChainLen
=
1
;
info
->
iVersion
=
2
;
info
->
iAddressFamily
=
WS_AF_IPX
;
info
->
iMaxSockAddr
=
0x10
;
info
->
iMinSockAddr
=
0x0e
;
info
->
iSocketType
=
WS_SOCK_DGRAM
;
info
->
dwMessageSize
=
576
;
info
->
iProtocolMaxOffset
=
0xff
;
info
->
dwMessageSize
=
0x240
;
strcpyW
(
info
->
szProtocol
,
NameIpxW
);
break
;
case
NSPROTO_SPX
:
info
->
dwServiceFlags1
=
XP1_PARTIAL_MESSAGE
|
XP1_PSEUDO_STREAM
|
XP1_MESSAGE_ORIENTED
|
XP1_GUARANTEED_ORDER
|
XP1_GUARANTEED_DELIVERY
;
info
->
dwServiceFlags1
=
XP1_IFS_HANDLES
|
XP1_PSEUDO_STREAM
|
XP1_MESSAGE_ORIENTED
|
XP1_GUARANTEED_ORDER
|
XP1_GUARANTEED_DELIVERY
;
memcpy
(
&
info
->
ProviderId
,
&
ProviderIdSPX
,
sizeof
(
GUID
)
);
info
->
dwCatalogEntryId
=
0x407
;
info
->
ProtocolChain
.
ChainLen
=
1
;
info
->
iVersion
=
2
;
info
->
iAddressFamily
=
WS_AF_IPX
;
info
->
iMaxSockAddr
=
0x10
;
info
->
iMinSockAddr
=
0x0e
;
info
->
iSocketType
=
5
;
info
->
dwMessageSize
=
-
1
;
info
->
dwMessageSize
=
0xffffffff
;
strcpyW
(
info
->
szProtocol
,
NameSpxW
);
break
;
case
NSPROTO_SPXII
:
info
->
dwServiceFlags1
=
XP1_
PARTIAL_MESSAGE
|
XP1_GRACEFUL_CLOSE
|
info
->
dwServiceFlags1
=
XP1_
IFS_HANDLES
|
XP1_GRACEFUL_CLOSE
|
XP1_PSEUDO_STREAM
|
XP1_MESSAGE_ORIENTED
|
XP1_GUARANTEED_ORDER
|
XP1_GUARANTEED_DELIVERY
;
memcpy
(
&
info
->
ProviderId
,
&
ProviderIdSPX
,
sizeof
(
GUID
)
);
info
->
dwCatalogEntryId
=
0x409
;
info
->
ProtocolChain
.
ChainLen
=
1
;
info
->
iVersion
=
2
;
info
->
iAddressFamily
=
WS_AF_IPX
;
info
->
iMaxSockAddr
=
0x10
;
info
->
iMinSockAddr
=
0x0e
;
info
->
iSocketType
=
5
;
info
->
dwMessageSize
=
-
1
;
info
->
dwMessageSize
=
0xffffffff
;
strcpyW
(
info
->
szProtocol
,
NameSpxIIW
);
break
;
...
...
@@ -180,7 +203,7 @@ static INT WINSOCK_EnterSingleProtocolA( INT protocol, WSAPROTOCOL_INFOA* info )
info
->
dwServiceFlags1
=
XP1_IFS_HANDLES
|
XP1_EXPEDITED_DATA
|
XP1_GRACEFUL_CLOSE
|
XP1_GUARANTEED_ORDER
|
XP1_GUARANTEED_DELIVERY
;
memcpy
(
&
info
->
ProviderId
,
&
ProviderId
,
sizeof
(
GUID
)
);
memcpy
(
&
info
->
ProviderId
,
&
ProviderId
IP
,
sizeof
(
GUID
)
);
info
->
dwCatalogEntryId
=
0x3e9
;
info
->
ProtocolChain
.
ChainLen
=
1
;
info
->
iVersion
=
2
;
...
...
@@ -195,7 +218,7 @@ static INT WINSOCK_EnterSingleProtocolA( INT protocol, WSAPROTOCOL_INFOA* info )
info
->
dwServiceFlags1
=
XP1_IFS_HANDLES
|
XP1_SUPPORT_BROADCAST
|
XP1_SUPPORT_MULTIPOINT
|
XP1_MESSAGE_ORIENTED
|
XP1_CONNECTIONLESS
;
memcpy
(
&
info
->
ProviderId
,
&
ProviderId
,
sizeof
(
GUID
)
);
memcpy
(
&
info
->
ProviderId
,
&
ProviderId
IP
,
sizeof
(
GUID
)
);
info
->
dwCatalogEntryId
=
0x3ea
;
info
->
ProtocolChain
.
ChainLen
=
1
;
info
->
iVersion
=
2
;
...
...
@@ -208,38 +231,51 @@ static INT WINSOCK_EnterSingleProtocolA( INT protocol, WSAPROTOCOL_INFOA* info )
break
;
case
NSPROTO_IPX
:
info
->
dwServiceFlags1
=
XP1_
PARTIAL_MESSAGE
|
XP1_SUPPORT_BROADCAST
|
info
->
dwServiceFlags1
=
XP1_
IFS_HANDLES
|
XP1_SUPPORT_BROADCAST
|
XP1_SUPPORT_MULTIPOINT
|
XP1_MESSAGE_ORIENTED
|
XP1_CONNECTIONLESS
;
memcpy
(
&
info
->
ProviderId
,
&
ProviderIdIPX
,
sizeof
(
GUID
)
);
info
->
dwCatalogEntryId
=
0x406
;
info
->
ProtocolChain
.
ChainLen
=
1
;
info
->
iVersion
=
2
;
info
->
iAddressFamily
=
WS_AF_IPX
;
info
->
iMaxSockAddr
=
0x10
;
info
->
iMinSockAddr
=
0x0e
;
info
->
iSocketType
=
WS_SOCK_DGRAM
;
info
->
dwMessageSize
=
576
;
info
->
iProtocolMaxOffset
=
0xff
;
info
->
dwMessageSize
=
0x240
;
strcpy
(
info
->
szProtocol
,
NameIpx
);
break
;
case
NSPROTO_SPX
:
info
->
dwServiceFlags1
=
XP1_PARTIAL_MESSAGE
|
XP1_PSEUDO_STREAM
|
XP1_MESSAGE_ORIENTED
|
XP1_GUARANTEED_ORDER
|
XP1_GUARANTEED_DELIVERY
;
info
->
dwServiceFlags1
=
XP1_IFS_HANDLES
|
XP1_PSEUDO_STREAM
|
XP1_MESSAGE_ORIENTED
|
XP1_GUARANTEED_ORDER
|
XP1_GUARANTEED_DELIVERY
;
memcpy
(
&
info
->
ProviderId
,
&
ProviderIdSPX
,
sizeof
(
GUID
)
);
info
->
dwCatalogEntryId
=
0x407
;
info
->
ProtocolChain
.
ChainLen
=
1
;
info
->
iVersion
=
2
;
info
->
iAddressFamily
=
WS_AF_IPX
;
info
->
iMaxSockAddr
=
0x10
;
info
->
iMinSockAddr
=
0x0e
;
info
->
iSocketType
=
5
;
info
->
dwMessageSize
=
-
1
;
info
->
dwMessageSize
=
0xffffffff
;
strcpy
(
info
->
szProtocol
,
NameSpx
);
break
;
case
NSPROTO_SPXII
:
info
->
dwServiceFlags1
=
XP1_
PARTIAL_MESSAGE
|
XP1_GRACEFUL_CLOSE
|
info
->
dwServiceFlags1
=
XP1_
IFS_HANDLES
|
XP1_GRACEFUL_CLOSE
|
XP1_PSEUDO_STREAM
|
XP1_MESSAGE_ORIENTED
|
XP1_GUARANTEED_ORDER
|
XP1_GUARANTEED_DELIVERY
;
memcpy
(
&
info
->
ProviderId
,
&
ProviderIdSPX
,
sizeof
(
GUID
)
);
info
->
dwCatalogEntryId
=
0x409
;
info
->
ProtocolChain
.
ChainLen
=
1
;
info
->
iVersion
=
2
;
info
->
iAddressFamily
=
WS_AF_IPX
;
info
->
iMaxSockAddr
=
0x10
;
info
->
iMinSockAddr
=
0x0e
;
info
->
iSocketType
=
5
;
info
->
dwMessageSize
=
-
1
;
info
->
dwMessageSize
=
0xffffffff
;
strcpy
(
info
->
szProtocol
,
NameSpxII
);
break
;
...
...
@@ -263,7 +299,7 @@ INT WINAPI WSAEnumProtocolsA( LPINT protocols, LPWSAPROTOCOL_INFOA buffer, LPDWO
{
INT
i
=
0
;
DWORD
size
=
0
;
INT
local
[]
=
{
WS_IPPROTO_TCP
,
WS_IPPROTO_UDP
,
NSPROTO_IPX
,
NSPROTO_SPXII
,
0
};
INT
local
[]
=
{
WS_IPPROTO_TCP
,
WS_IPPROTO_UDP
,
NSPROTO_IPX
,
NSPROTO_SPX
,
NSPROTO_SPX
II
,
0
};
if
(
!
buffer
)
return
SOCKET_ERROR
;
...
...
@@ -307,7 +343,7 @@ INT WINAPI WSAEnumProtocolsA( LPINT protocols, LPWSAPROTOCOL_INFOA buffer, LPDWO
* Failure: SOCKET_ERROR
*
* NOTES
* NT4SP5 does not return SPX if
lpiP
rotocols == NULL
* NT4SP5 does not return SPX if
p
rotocols == NULL
*
* BUGS
* - NT4SP5 returns in addition these list of NETBIOS protocols
...
...
@@ -329,7 +365,7 @@ INT WINAPI WSAEnumProtocolsW( LPINT protocols, LPWSAPROTOCOL_INFOW buffer, LPDWO
{
INT
i
=
0
;
DWORD
size
=
0
;
INT
local
[]
=
{
WS_IPPROTO_TCP
,
WS_IPPROTO_UDP
,
NSPROTO_IPX
,
NSPROTO_SPXII
,
0
};
INT
local
[]
=
{
WS_IPPROTO_TCP
,
WS_IPPROTO_UDP
,
NSPROTO_IPX
,
NSPROTO_SPX
,
NSPROTO_SPX
II
,
0
};
if
(
!
buffer
)
return
SOCKET_ERROR
;
...
...
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