MSWSOCK.DLL Information
The functions listed below are entry points to MSWSOCK.DLL, the "Microsoft
WinSock" DLL. They are not part of the official set of WinSock APIs
(not WinSock 1.1 or WinSock 2), but are Microsoft proprietary.
Although they don't appear in the official WinSock specifications, the
documentation for some of them is inter-mixed with standard WinSock function
documentation in Microsoft's on-line version of the Winsock 2 documentation.
This is available at the Microsoft Developers' Network (MSDN) "premium"
website. You may have to join MSDN to access these; fortunately there's
no charge to join:
http://premium.microsoft.com
in the menu
- SDK Documentation
- Platform SDK
- Networking and Distributed Services
I have not completed testing of all the APIs, but here's what I know
so far. The APIs listed under "Routed..." are only hints; in
many cases a number of APIs are used, including WSAStartup(). For those
I don't know the answer to, I've put a question mark. The way that I tested
whether or not the API is "routed to WS2_32.DLL" was by executing
a WinSock 2 application that used the functions, and with the debug version
of the WinSock 2 DLL installed (WS2_32.DLL) and my updated version of the
WinSock 2 (DT_DLL.DLL) in the same directory as the application, I
could log what WinSock calls were made (along with their input and output
arguments, and return values). For more information on the DT_DLL, see "Debug
Trace DLL Issues" at http://www.sockets.com/ws2_stat.htm:
- Function Name
|
- Win95
|
- NT
|
- Doc'd
|
- Routed to WS2_32.DLL
|
- *AcceptEx
|
- N
|
- Y
|
- Y
|
- N (see note 12)
|
- Arecv
|
- Y
|
- N
|
- N
|
- ?
|
- Asend
|
- Y
|
- N
|
- N
|
- ?
|
- EnumProtocolsA
|
- Y
|
- Y
|
- Y
|
- WSAEnumProtocols
|
- EnumProtocolsW
|
- Y
|
- Y
|
- Y
|
- "
|
- *GetAcceptExSockaddrs
|
- N
|
- Y
|
- Y
|
- N (see note 12)
|
- GetAddressByNameA
|
- Y
|
- Y
|
- Y
|
- WSALookupServiceXXXX
|
- GetAddressByNameW
|
- Y
|
- Y
|
- Y
|
- WSALookupServiceXXXX
|
- GetNameByTypeA
|
- Y
|
- Y
|
- Y
|
- N
|
- GetNameByTypeW
|
- Y
|
- Y
|
- Y
|
- N
|
- GetServiceA
|
- Y
|
- Y
|
- Y
|
- WSALookupServiceXXXX
|
- GetServiceW
|
- Y
|
- Y
|
- Y
|
- WSALookupServiceXXXX
|
- GetTypeByNameA
|
- Y
|
- Y
|
- Y
|
- N
|
- GetTypeByNameW
|
- Y
|
- Y
|
- Y
|
- N
|
- *MigrateWinSockConfiguration
|
- Y
|
- N
|
- N
|
- ?
|
- NPLoadNameSpaces
|
- Y
|
- Y
|
- N
|
- ?
|
- *NSPStartup
|
- Y
|
- N
|
- Y
|
- ?
|
- SetServiceA
|
- Y
|
- Y
|
- Y
|
- ?
|
- SetServiceW
|
- Y
|
- Y
|
- Y
|
- ?
|
- TransmitFile
|
- N
|
- Y
|
- Y
|
- WSAIoctl() (also see note 12)
|
- *WSACleanup
|
- Y
|
- N
|
- Y
|
- ?
|
- WSARecvEx
|
- Y
|
- Y
|
- Y
|
- N (see note 12)
|
- WSHEnumProtocols
|
- Y
|
- Y
|
- N
|
- ?
|
- WSControl
|
- Y
|
- Y
|
- N
|
- ?
|
- closesockinfo
|
- Y
|
- Y
|
- N
|
- ?
|
- dn_expand
|
- Y
|
- Y
|
- N
|
- ?
|
- getnetbyname
|
- Y
|
- Y
|
- N
|
- ?
|
- inet_network
|
- Y
|
- Y
|
- N
|
- ?
|
- rcmd
|
- Y
|
- Y
|
- N
|
- ?
|
- rexec
|
- Y
|
- Y
|
- see note 8
|
- ?
|
- rresvport
|
- Y
|
- Y
|
- see note 9
|
- ?
|
- s_perror
|
- Y
|
- Y
|
- see note 10
|
- ?
|
- sethostname
|
- Y
|
- Y
|
- N
|
- ?
|
A few things to note about the contents of the table above:
- I didn't include ordinals for each entry point, since they differ on
different versions and platforms.
- On systems with WinSock 2 installed some APIs are routed to the WS2_32.DLL
(which means the Layered Service Providers, or TCP/IP Service Providers
from vendors other than Microsoft can service the calls).
- I've added a few here that weren't in the original list that Eugeni
asked about (see message attached below); I have flagged the ones I added
with asterisks
- This list is what appears in the MSWSOCK.DLL installed with Winsock
2 on Win95. As noted below, some don't appear in the NT4 (SP3) version
of MSWSOCK.DLL
- For those APIs with a "N" (No) under the Win95 column, the
entry point exists, but the API is not supported in Windows 95. This is
indicated in the Microsoft documentation. Of the others that are marked
"Y" (Yes) I am not sure they are supported in those cases where
the last column has '?' to indicate I haven't tested.
- Those APIs with the 'W' suffix handle Unicode ("wide" character)
input strings (which may be within fields of structures passed), and those
with the 'A' suffix handle ANSI (single byte character) strings.
- NSPStartup() is doc'd in the WinSock 2 Service Providers Interface
(SPI) Specification, not the API specification. The fact that MSWSOCK.DLL
has this entry point is a hint that this DLL is where Microsoft has implemented
their Name Space
provider.
- Although the rexec() function is not documented, the rexec() program
is available in NT. Whether or not this application uses this API, I haven't
determined.
- Not doc'd, but this function may have Berkeley or RPC heritage, designed
to return a privileged port number (a value under 1024).
- Not doc'd, but maybe it's related to the perror() function to print
and error string. Then again, maybe not.
- Another caveat (courtesy of Chris Pearson <CPearson@ideal.jf.intel.com>):
MSWSOCK.H creates a header-ordering conflict with WINSOCK2.H. This happens
only if you include WINSOCK2.H before (or instead of) WINDOWS.H. What happens
is that WINSOCK2.H includes WINDOWS.H, which in turn (recursively) includes
WINSOCK2.H to define symbols needed by MSWSOCK.H. However, since _WINSOCK2API_
is already defined by the first inclusion of WINSOCK2.H, the second inclusion
of WINSOCK2.H is a no-op. Your compile then fails when MSWSOCK.H reference
undefined symbols. If you want to use MSWSOCK APIs, you'll need to make
sure you always include WINDOWS.H before WINSOCK2.H. This can be a pain,
especially when using third party headers which include WINSOCK2.H directly.
If you don't need MSWSOCK, an alternative which allows you to include WINSOCK2.H
first is to define these preprocessor symbols in your project definition:
_WIN32_WINT=0x400
_MSWSOCK_
- For more information, also see http://premium.microsoft.com/msdn/library/sdkdoc/ovrspi_6836.htm
which lists some of the MSWSOCK.DLL APIs that are not redirected to.
I hope this is helpful. I welcome any other input anyone wants to offer.
updated 1/27/98, (c) Bob
Quinn 1995-1998