Added WSASTARTUP16 a 1 byte alignment version of WSASTARTUP for win16.

This commit is contained in:
Francois Gouget 2001-08-24 21:33:58 +00:00 committed by Alexandre Julliard
parent 42761e7adb
commit 14b06d40e6
2 changed files with 57 additions and 38 deletions

View File

@ -530,25 +530,29 @@ void __ws_memfree(void* ptr)
* Create socket control struct, attach it to the global list and
* update a pointer in the task struct.
*/
INT16 WINAPI WSAStartup16(UINT16 wVersionRequested, LPWSADATA lpWSAData)
INT16 WINAPI WSAStartup16(UINT16 wVersionRequested, LPWSADATA16 lpWSAData)
{
WSADATA WINSOCK_data = { 0x0101, 0x0101,
static const WSADATA16 data =
{
0x0101, 0x0101,
"WINE Sockets 1.1",
#ifdef linux
#ifdef linux
"Linux/i386",
#elif defined(__NetBSD__)
#elif defined(__NetBSD__)
"NetBSD/i386",
#elif defined(sunos)
#elif defined(sunos)
"SunOS",
#elif defined(__FreeBSD__)
#elif defined(__FreeBSD__)
"FreeBSD",
#elif defined(__OpenBSD__)
#elif defined(__OpenBSD__)
"OpenBSD/i386",
#else
#else
"Unknown",
#endif
#endif
WS_MAX_SOCKETS_PER_PROCESS,
WS_MAX_UDP_DATAGRAM, (SEGPTR)NULL };
WS_MAX_UDP_DATAGRAM,
0
};
TRACE("verReq=%x\n", wVersionRequested);
@ -574,7 +578,7 @@ INT16 WINAPI WSAStartup16(UINT16 wVersionRequested, LPWSADATA lpWSAData)
/* return winsock information */
memcpy(lpWSAData, &WINSOCK_data, sizeof(WINSOCK_data));
memcpy(lpWSAData, &data, sizeof(data));
TRACE("succeeded\n");
return 0;
@ -585,23 +589,27 @@ INT16 WINAPI WSAStartup16(UINT16 wVersionRequested, LPWSADATA lpWSAData)
*/
INT WINAPI WSAStartup(UINT wVersionRequested, LPWSADATA lpWSAData)
{
WSADATA WINSOCK_data = { 0x0202, 0x0202,
static const WSADATA data =
{
0x0202, 0x0202,
"WINE Sockets 2.0",
#ifdef linux
"Linux/i386",
#elif defined(__NetBSD__)
"NetBSD/i386",
#elif defined(sunos)
#ifdef linux
"Linux",
#elif defined(__NetBSD__)
"NetBSD",
#elif defined(sunos)
"SunOS",
#elif defined(__FreeBSD__)
#elif defined(__FreeBSD__)
"FreeBSD",
#elif defined(__OpenBSD__)
"OpenBSD/i386",
#else
#elif defined(__OpenBSD__)
"OpenBSD",
#else
"Unknown",
#endif
#endif
WS_MAX_SOCKETS_PER_PROCESS,
WS_MAX_UDP_DATAGRAM, (SEGPTR)NULL };
WS_MAX_UDP_DATAGRAM,
NULL
};
TRACE("verReq=%x\n", wVersionRequested);
@ -626,7 +634,7 @@ INT WINAPI WSAStartup(UINT wVersionRequested, LPWSADATA lpWSAData)
num_startup++;
/* return winsock information */
memcpy(lpWSAData, &WINSOCK_data, sizeof(WINSOCK_data));
memcpy(lpWSAData, &data, sizeof(data));
/* that's the whole of the negotiation for now */
lpWSAData->wVersion = wVersionRequested;

View File

@ -46,6 +46,17 @@ typedef struct ws_netent16
INT n_net; /* network # */
} _ws_netent16;
typedef struct WSAData16
{
WORD wVersion;
WORD wHighVersion;
char szDescription[WSADESCRIPTION_LEN+1];
char szSystemStatus[WSASYS_STATUS_LEN+1];
WORD iMaxSockets;
WORD iMaxUdpDg;
SEGPTR lpVendorInfo;
} WSADATA16, *LPWSADATA16;
#include "poppack.h"
#define WS_FD_CLR16(fd, set) __WS_FD_CLR((fd),(set), ws_fd_set16)
@ -56,7 +67,7 @@ typedef struct ws_netent16
#define INVALID_SOCKET16 ((SOCKET16)(~0))
INT16 WINAPI __WSAFDIsSet16( SOCKET16, ws_fd_set16 * );
INT16 WINAPI WSAStartup16(UINT16 wVersionRequired, LPWSADATA lpWSAData);
INT16 WINAPI WSAStartup16(UINT16 wVersionRequired, LPWSADATA16 lpWSAData);
void WINAPI WSASetLastError16(INT16 iError);
INT16 WINAPI WSAUnhookBlockingHook16(void);
FARPROC16 WINAPI WSASetBlockingHook16(FARPROC16 lpBlockFunc);