Commit 14b06d40 authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

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

parent 42761e7a
......@@ -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)
{
WSADATA WINSOCK_data = { 0x0101, 0x0101,
"WINE Sockets 1.1",
#ifdef linux
"Linux/i386",
#elif defined(__NetBSD__)
"NetBSD/i386",
#elif defined(sunos)
"SunOS",
#elif defined(__FreeBSD__)
"FreeBSD",
#elif defined(__OpenBSD__)
"OpenBSD/i386",
#else
"Unknown",
#endif
WS_MAX_SOCKETS_PER_PROCESS,
WS_MAX_UDP_DATAGRAM, (SEGPTR)NULL };
INT16 WINAPI WSAStartup16(UINT16 wVersionRequested, LPWSADATA16 lpWSAData)
{
static const WSADATA16 data =
{
0x0101, 0x0101,
"WINE Sockets 1.1",
#ifdef linux
"Linux/i386",
#elif defined(__NetBSD__)
"NetBSD/i386",
#elif defined(sunos)
"SunOS",
#elif defined(__FreeBSD__)
"FreeBSD",
#elif defined(__OpenBSD__)
"OpenBSD/i386",
#else
"Unknown",
#endif
WS_MAX_SOCKETS_PER_PROCESS,
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,
"WINE Sockets 2.0",
#ifdef linux
"Linux/i386",
#elif defined(__NetBSD__)
"NetBSD/i386",
#elif defined(sunos)
"SunOS",
#elif defined(__FreeBSD__)
"FreeBSD",
#elif defined(__OpenBSD__)
"OpenBSD/i386",
#else
"Unknown",
#endif
WS_MAX_SOCKETS_PER_PROCESS,
WS_MAX_UDP_DATAGRAM, (SEGPTR)NULL };
static const WSADATA data =
{
0x0202, 0x0202,
"WINE Sockets 2.0",
#ifdef linux
"Linux",
#elif defined(__NetBSD__)
"NetBSD",
#elif defined(sunos)
"SunOS",
#elif defined(__FreeBSD__)
"FreeBSD",
#elif defined(__OpenBSD__)
"OpenBSD",
#else
"Unknown",
#endif
WS_MAX_SOCKETS_PER_PROCESS,
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;
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment