This section describes the differences between the TCP/IP for OS/2 implementation of Winsock and the Winsock 1.1 specification.
WSASetLastError and WSAGetLastError APIs
The Winsock specification states that on Win32 systems, WSAGetLastError and WSASetLastError will simply call the Win32 GetLastError and SetLastError functions. For reasons of efficiency, the Open32 version of OS/2 Winsock implements these two calls internally and does not call GetLastError or SetLastError. Also because PM does not have a function that is equivalent to SetLastError, the PM version of Winsock also implements these calls internally.
BSD Compatibility Files
The Winsock 1.1 specification states that the standard <BSD NETDB.H>, <ARPA/INET.H>, <SYS/TIME.H>, <SYS/SOCKET.H>, and <NETINET/IN.H> header files should be supplied by Winsock implementations and should just include <WINSOCK.H>. Because TCP/IP for OS/2 also supplies a BSD socket library, it does not comply with the specification in this regard. If a developer includes any of those header files, the developer will get the BSD version of those header files, not the Winsock version.
Calling Conventions
In the Winsock 1.1 specification, Winsock calls are defined to use the PASCAL calling convention (the standard calling convention on Windows systems). OS/2 also has the PASCAL calling convention, but instead it uses APIENTRY as the standard calling convention. Because of this, OS/2 Winsock uses the APIENTRY convention for all of its Winsock calls.
In the Open32 environment, PASCAL is defined (with #define) to be APIENTRY by <OS2WDEF.H>, which is part of Open32, so no changes are needed to <WINSOCK.H> to accommodate APIENTRY.
In the PM and VIO environments, PASCAL and APIENTRY are two different calling conventions, so the Winsock function prototypes in <PMWSOCK.H> have been modified by replacing all occurrences of PASCAL with APIENTRY.
Topics
Differences between <PMWSOCK.H>
and Standard <WINSOCK.H> Header Files
Differences between IBM Open32
<WINSOCK.H> and Standard <WINSOCK.H> Header Files