delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/01/05/20:25:21

Message-ID: <32D05286.5121@rangenet.com>
Date: Sun, 05 Jan 1997 19:17:09 -0600
From: Dan Hedlund <markiv AT rangenet DOT com>
Reply-To: markiv AT rangenet DOT com
Organization: Range Net
MIME-Version: 1.0
To: fayda <austinhs AT WHC DOT NET>, djgpp AT delorie DOT com
Subject: Re: WinSock in Dos with WIn95
References: <199701052336 DOT QAA05827 AT user DOT whc DOT net>

This is a multi-part message in MIME format.

--------------4FBC3F54439B
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

fayda wrote:
> 
> > I'm trying to get TCP/IP in dos with Win95.  I'm accessing WSOCK.VXD
> > (through int 2f) using djgpp.  I've got several functions to work :
> > Bind, CloseSocket, GetSockName, Listen, and Socket.  But when I call
> > Connect or Accept, it just returns with an error (ax = 0xffff) and the
> > lights on my modem light up for a few seconds.  I know it's trying to
> > connect, but for some reason it fails.
> 
> Could you please tell me where you found the information you used on
> winsock programming? I would like to attempt what you are, and dont know
> excatly where to start. thank you.

I found most of the information on the internet, but I forgot where I
got most of it.  You'll probably want winsock.h, wsock.h, and a good
refrence for winsock.  You can find winsock.h and info about winsock at
http://www.microsoft.com , just use search.  Wsock.h might be more
difficult to find.  If you want a copy of my winsock refrence (300k), I
can email it to you.

Basically, I'm using the wsock virtual device driver (ID = 0x003e).  It
comes with windows.  I'm accessing it using int 2f like this.

Ax = 0x1684
Bx = 0x003e
int 2f
Es:Di = entry point for the vxd.

When calling the entry point set Es:Bx to the vxd's paramaters (see
wsock.h), and set Ax to the function number.  Be careful when setting
ax, the vxd uses a call table and doesn't check the value in ax.

I havent found a way to call the entry point directly from protected
mode, so I'm just using DPMI functions to call it in real mode from
protected mode.  (DPMI function 0x0301)  Also, all the pointers have to
be in real mode, and everything has to be called in real mode.

If you have any luck calling connect or accept, or find any more info on
wsock.vxd, email me.

Good Luck, 

*****      ***   **    **       Dan M. Hedlund
 ** **    *****  ***   **       <markiv AT rangenet DOT com>
 **  **  **   ** ****  **       http://www.rangenet.com/markiv
 **   ** **   ** ** ** **
 **   ** ******* **  ****
 **  **  **   ** **   ***
 ** **   **   ** **    **
*****    **   ** **    **

--------------4FBC3F54439B
Content-Type: text/plain; charset=us-ascii; name="Wsock.h"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="Wsock.h"

/**********************************************************************/
/**                        Microsoft Windows                         **/
/**                Copyright(c) Microsoft Corp., 1993                **/
/**********************************************************************/

/*
    wsock.h

    WSOCK.386 VxD service definitions.


    FILE HISTORY:
        DavidKa     ??-???-???? Created.
        KeithMo     30-Dec-1993 Cleaned up a bit, made H2INC-able.

*/


#ifndef _WSOCK_H_
#define _WSOCK_H_


//
//  Service table.
//

#ifndef Not_VxD

/*XLATOFF*/
#define WSOCK_Service   Declare_Service
#pragma warning ( disable : 4003 )          // disable not enough params warning
/*XLATON*/

/*MACROS*/
Begin_Service_Table(WSOCK)

WSOCK_Service (WSOCK_Get_Version, LOCAL)
WSOCK_Service (WSOCK_Register, LOCAL)
WSOCK_Service (WSOCK_Deregister, LOCAL)
WSOCK_Service (WSOCK_SignalNotify, LOCAL)
WSOCK_Service (WSOCK_SignalAllNotify, LOCAL)

End_Service_Table(WSOCK)
/*ENDMACROS*/

/*XLATOFF*/
#pragma warning ( default : 4003 )          // restore not enough params warning
/*XLATON*/

#endif  // Not_VxD


//
//  Version numbers.
//

#define WSOCK_Ver_Major         1
#define WSOCK_Ver_Minor         0


//
//  The current provider interface version number.  Increment
//  this constant after any change that effects the provider
//  interface.
//

#define WSOCK_INTERFACE_VERSION 0x00000001


//
//  A locally-defined error code, indicating the underlying
//  provider returned WSAEWOULDBLOCK for an operation invoked
//  on a blocking socket.
//

#define WSOCK_WILL_BLOCK        0xFFFF


//
//  Infinite wait time for send/recv timeout.
//

#define SOCK_IO_TIME            (DWORD)-1L


//
//  Incomplete types.
//

#ifndef LPSOCK_INFO_DEFINED
#define LPSOCK_INFO_DEFINED
typedef struct _SOCK_INFO FAR * LPSOCK_INFO;
#endif  // LPSOCK_INFO_DEFINED


#ifdef MASM

//
//  Stolen simplified definitions so we don't force
//  H2INC to parse WINNT.H, WINSOCK.H, et al.
//

typedef DWORD       LIST_ENTRY[2];
typedef WORD        LINGER[2];
typedef VOID FAR  * LPVOID;

#endif


//
//  All FD_* events.
//

#define FD_ALL  (FD_READ | FD_WRITE | FD_OOB | FD_ACCEPT | FD_CONNECT | FD_CLOSE)


//
//  This "special" FD_ event is used in select so that we may
//  synthesize proper exceptfds for failed connection attempts.
//

#define FD_FAILED_CONNECT   0x0100


//
//  A notification object.  One of these objects is created
//  and attached to a socket for every thread that is blocked
//  in an API.
//

typedef struct _WSNOTIFY {
    LIST_ENTRY  PerSocketList;      // per-socket list of notify objects
    LIST_ENTRY  GlobalList;         // global list of all notify objects
    LPSOCK_INFO OwningSocket;       // the socket that "owns" this object
    DWORD       Flags;              // private notification flags (see below)
    DWORD       EventMask;          // events the client is interested in
    DWORD       Status;             // the completion status
    DWORD       OwningThread;       // either ring 0 thread id or VM handle
    LPVOID      ApcRoutine;         // the user-mode APC to schedule
    DWORD       ApcContext;         // a user-supplied context value

} WSNOTIFY;

//
// NOTE: For overlapped IO (asend and arecv), OwningThread field is used to
// store the pointer to the overlapped structure.  ApcRoutine contains a pointer
// to the IO buffer and ApcContext is the IO buffer length.
//
// Field name       Use
// --------------------
// OwningThread     pointer to overlapped structure
// ApcRoutine       pointer to IO buffer
// ApcContext       length of IO buffer
//

#ifndef LPWSNOTIFY_DEFINED
#define LPWSNOTIFY_DEFINED
typedef struct _WSNOTIFY FAR * LPWSNOTIFY;
#endif  // LPWSNOTIFY_DEFINED


//
//  Notification object flags.
//

#define NOTIFY_FLAG_16BIT_CLIENT    0x00000001
#define NOTIFY_FLAG_ASYNC_SEND      0x00000002
#define NOTIFY_FLAG_ASYNC_RECV      0x00000004
#define NOTIFY_FLAG_VALID_MASK      0x00000007


//
//  A list of socket/event mask pairs.  A pointer to an array
//  of these structures is passed to WsCreateMultipleNotify to
//  create multiple notification objects.
//

typedef struct _SOCK_LIST {
    LPSOCK_INFO Socket;             // the target socket
    DWORD       EventMask;          // events the client is interested in
    DWORD       Context;            // user-defined context value (handle?)

} SOCK_LIST;

#ifndef LPSOCK_LIST_DEFINED
#define LPSOCK_LIST_DEFINED
typedef struct _SOCK_LIST FAR * LPSOCK_LIST;
#endif  // LPSOCK_LIST_DEFINED


//
//  A Winsock I/O Status Block.  This structure contains all information
//  about completing/cancelling a blocking socket operation.  Whenever an
//  APC is scheduled against a thread, the APC Context value points to
//  the thread's WSIOSTATUS structure.  This is especially useful for
//  16-bit applications, since it enables the WSOCK VxD to "unblock" a
//  16-bit thread without calling "up" into user mode.
//

typedef struct _WSIOSTATUS {
    DWORD   IoStatus;               // completion status
    char    IoCompleted;            // i/o has completed
    char    IoCancelled;            // i/o has been cancelled
    char    IoTimedOut;             // i/o has timed out
    char    IoSpare1;               // spare (for dword alignment)

} WSIOSTATUS;
typedef struct _WSIOSTATUS FAR * LPWSIOSTATUS;


//
//  This is is a special APC Routine value that may be passed into the
//  various CreateNotify services.  If this value is specified as the
//  APC Routine, then the APC is not actually invoked, and the APC
//  Context is assumed to point to the thread's WSIOSTATUS block.
//
//  Note that this is used for 16-bit applications only!
//

#define SPECIAL_16BIT_APC ((LPVOID)-1L)


//
//  This section defines the constants and structures necessary for
//  communication between the WinSock DLLs and WSOCK.386.  For each
//  command, there is defined a unique opcode and a structure defining
//  the command parameters.
//
//  Also, for each command, a 16-bit constants, *_MAPIN is defined.  This
//  is used by the 16-bit interface to the provider VxDs to control the
//  mapping of segmented 16:16 pointers to flat 0:32 pointers within the
//  command parameter structures.  Each structure is considered to be a
//  sequence of one or more DWORDS.  All pointers that must be mapped
//  MUST appear FIRST in the command structures.  The *_MAPIN constant
//  specifies how many parameters should be mapped for each command.
//
//  Note also that the LPSOCK_INFO pointers are not mapped, since they are
//  opaque at the application level.  ApcRoutine fields are not mapped either,
//  since 32-bit APCs are scheduled via VWIN32, and 16-bit APCs are called
//  directly.
//
//        D A N G E R ! !       W A R N I N G ! !       D A N G E R ! !
//
//  IF YOU CHANGE ANY FIELDS IN ANY OF THESE STRUCTURES, ENSURE THE *_MAPIN
//  CONSTANT REMAINS ACCURATE!  IF YOU DON'T, YOU'LL BREAK 16-BIT WINSOCK!!
//
//        D A N G E R ! !       W A R N I N G ! !       D A N G E R ! !
//

#define WSOCK_FIRST_CMD             0x00000100

#define WSOCK_ACCEPT_CMD            (WSOCK_FIRST_CMD + 0x0000)
#define WSOCK_BIND_CMD              (WSOCK_FIRST_CMD + 0x0001)
#define WSOCK_CLOSESOCKET_CMD       (WSOCK_FIRST_CMD + 0x0002)
#define WSOCK_CONNECT_CMD           (WSOCK_FIRST_CMD + 0x0003)
#define WSOCK_GETPEERNAME_CMD       (WSOCK_FIRST_CMD + 0x0004)
#define WSOCK_GETSOCKNAME_CMD       (WSOCK_FIRST_CMD + 0x0005)
#define WSOCK_GETSOCKOPT_CMD        (WSOCK_FIRST_CMD + 0x0006)
#define WSOCK_IOCTLSOCKET_CMD       (WSOCK_FIRST_CMD + 0x0007)
#define WSOCK_LISTEN_CMD            (WSOCK_FIRST_CMD + 0x0008)
#define WSOCK_RECV_CMD              (WSOCK_FIRST_CMD + 0x0009)
#define WSOCK_SELECT_SETUP_CMD      (WSOCK_FIRST_CMD + 0x000a)
#define WSOCK_SELECT_CLEANUP_CMD    (WSOCK_FIRST_CMD + 0x000b)
#define WSOCK_ASYNC_SELECT_CMD      (WSOCK_FIRST_CMD + 0x000c)
#define WSOCK_SEND_CMD              (WSOCK_FIRST_CMD + 0x000d)
#define WSOCK_SETSOCKOPT_CMD        (WSOCK_FIRST_CMD + 0x000e)
#define WSOCK_SHUTDOWN_CMD          (WSOCK_FIRST_CMD + 0x000f)
#define WSOCK_SOCKET_CMD            (WSOCK_FIRST_CMD + 0x0010)

#define WSOCK_CREATE_CMD            (WSOCK_FIRST_CMD + 0x0011)
#define WSOCK_CREATE_MULTIPLE_CMD   (WSOCK_FIRST_CMD + 0x0012)
#define WSOCK_DESTROY_CMD           (WSOCK_FIRST_CMD + 0x0013)
#define WSOCK_DESTROY_BY_SOCKET_CMD (WSOCK_FIRST_CMD + 0x0014)
#define WSOCK_DESTROY_BY_THREAD_CMD (WSOCK_FIRST_CMD + 0x0015)
#define WSOCK_SIGNAL_CMD            (WSOCK_FIRST_CMD + 0x0016)
#define WSOCK_SIGNAL_ALL_CMD        (WSOCK_FIRST_CMD + 0x0017)

#define WSOCK_CONTROL_CMD           (WSOCK_FIRST_CMD + 0x0018)

#define WSOCK_REGISTER_POSTMSG_CMD  (WSOCK_FIRST_CMD + 0x0019)

#define WSOCK_ARECV_CMD             (WSOCK_FIRST_CMD + 0x001a)
#define WSOCK_ASEND_CMD             (WSOCK_FIRST_CMD + 0x001b)

#ifdef CHICAGO
#define WSOCK_LAST_CMD              WSOCK_ASEND_CMD
#else
#define WSOCK_LAST_CMD              WSOCK_REGISTER_POSTMSG_CMD
#endif


//
//  Socket APIs.
//

typedef struct _WSOCK_ACCEPT_PARAMS {
    LPVOID      Address;
    LPSOCK_INFO ListeningSocket;
    LPSOCK_INFO ConnectedSocket;
    DWORD       AddressLength;
    DWORD       ConnectedSocketHandle;
    LPVOID      ApcRoutine;
    DWORD       ApcContext;

} WSOCK_ACCEPT_PARAMS;
typedef struct _WSOCK_ACCEPT_PARAMS FAR * LPWSOCK_ACCEPT_PARAMS;
#define WSOCK_ACCEPT_MAPIN                  1


typedef struct _WSOCK_BIND_PARAMS {
    LPVOID      Address;
    LPSOCK_INFO Socket;
    DWORD       AddressLength;
    LPVOID      ApcRoutine;
    DWORD       ApcContext;

} WSOCK_BIND_PARAMS;
typedef struct _WSOCK_BIND_PARAMS FAR * LPWSOCK_BIND_PARAMS;
#define WSOCK_BIND_MAPIN                    1


typedef struct _WSOCK_CLOSESOCKET_PARAMS {
    LPSOCK_INFO Socket;

} WSOCK_CLOSESOCKET_PARAMS;
typedef struct _WSOCK_CLOSESOCKET_PARAMS FAR * LPWSOCK_CLOSESOCKET_PARAMS;
#define WSOCK_CLOSESOCKET_MAPIN             0


typedef struct _WSOCK_CONNECT_PARAMS {
    LPVOID      Address;
    LPSOCK_INFO Socket;
    DWORD       AddressLength;
    LPVOID      ApcRoutine;
    DWORD       ApcContext;

} WSOCK_CONNECT_PARAMS;
typedef struct _WSOCK_CONNECT_PARAMS FAR * LPWSOCK_CONNECT_PARAMS;
#define WSOCK_CONNECT_MAPIN                 1


typedef struct _WSOCK_GETPEERNAME_PARAMS {
    LPVOID      Address;
    LPSOCK_INFO Socket;
    DWORD       AddressLength;

} WSOCK_GETPEERNAME_PARAMS;
typedef struct _WSOCK_GETPEERNAME_PARAMS FAR * LPWSOCK_GETPEERNAME_PARAMS;
#define WSOCK_GETPEERNAME_MAPIN             1


typedef struct _WSOCK_GETSOCKNAME_PARAMS {
    LPVOID      Address;
    LPSOCK_INFO Socket;
    DWORD       AddressLength;

} WSOCK_GETSOCKNAME_PARAMS;
typedef struct _WSOCK_GETSOCKNAME_PARAMS FAR * LPWSOCK_GETSOCKNAME_PARAMS;
#define WSOCK_GETSOCKNAME_MAPIN             1


typedef struct _WSOCK_GETSOCKOPT_PARAMS {
    LPVOID      Value;
    LPSOCK_INFO Socket;
    DWORD       OptionLevel;
    DWORD       OptionName;
    DWORD       ValueLength;
    DWORD       IntValue;

} WSOCK_GETSOCKOPT_PARAMS;
typedef struct _WSOCK_GETSOCKOPT_PARAMS FAR * LPWSOCK_GETSOCKOPT_PARAMS;
#define WSOCK_GETSOCKOPT_MAPIN              1


typedef struct _WSOCK_IOCTLSOCKET_PARAMS {
    LPSOCK_INFO Socket;
    DWORD       Command;
    DWORD       Param;

} WSOCK_IOCTLSOCKET_PARAMS;
typedef struct _WSOCK_IOCTLSOCKET_PARAMS FAR * LPWSOCK_IOCTLSOCKET_PARAMS;
#define WSOCK_IOCTLSOCKET_MAPIN             0


typedef struct _WSOCK_LISTEN_PARAMS {
    LPSOCK_INFO Socket;
    DWORD       Backlog;

} WSOCK_LISTEN_PARAMS;
typedef struct _WSOCK_LISTEN_PARAMS FAR * LPWSOCK_LISTEN_PARAMS;
#define WSOCK_LISTEN_MAPIN                  0


typedef struct _WSOCK_RECV_PARAMS {
    LPVOID      Buffer;
    LPVOID      Address;
    LPSOCK_INFO Socket;
    DWORD       BufferLength;
    DWORD       Flags;
    DWORD       AddressLength;
    DWORD       BytesReceived;
    LPVOID      ApcRoutine;
    DWORD       ApcContext;
    DWORD       Timeout;

} WSOCK_RECV_PARAMS;
typedef struct _WSOCK_RECV_PARAMS FAR * LPWSOCK_RECV_PARAMS;
#define WSOCK_RECV_MAPIN                    2


typedef struct _WSOCK_SELECT_SETUP_PARAMS {
    LPSOCK_LIST ReadList;
    LPSOCK_LIST WriteList;
    LPSOCK_LIST ExceptList;
    DWORD       ReadCount;
    DWORD       WriteCount;
    DWORD       ExceptCount;
    LPVOID      ApcRoutine;
    DWORD       ApcContext;

} WSOCK_SELECT_SETUP_PARAMS;
typedef struct _WSOCK_SELECT_SETUP_PARAMS FAR * LPWSOCK_SELECT_SETUP_PARAMS;
#define WSOCK_SELECT_SETUP_MAPIN            3


typedef struct _WSOCK_SELECT_CLEANUP_PARAMS {
    LPSOCK_LIST ReadList;
    LPSOCK_LIST WriteList;
    LPSOCK_LIST ExceptList;
    DWORD       ReadCount;
    DWORD       WriteCount;
    DWORD       ExceptCount;

} WSOCK_SELECT_CLEANUP_PARAMS;
typedef struct _WSOCK_SELECT_CLEANUP_PARAMS FAR * LPWSOCK_SELECT_CLEANUP_PARAMS;
#define WSOCK_SELECT_CLEANUP_MAPIN          3


typedef struct _WSOCK_ASYNC_SELECT_PARAMS {
    LPSOCK_INFO Socket;
    DWORD       Window;
    DWORD       Message;
    DWORD       Events;

} WSOCK_ASYNC_SELECT_PARAMS;
typedef struct _WSOCK_ASYNC_SELECT_PARAMS FAR * LPWSOCK_ASYNC_SELECT_PARAMS;
#define WSOCK_ASYNC_SELECT_MAPIN            0


typedef struct _WSOCK_SEND_PARAMS {
    LPVOID      Buffer;
    LPVOID      Address;
    LPSOCK_INFO Socket;
    DWORD       BufferLength;
    DWORD       Flags;
    DWORD       AddressLength;
    DWORD       BytesSent;
    LPVOID      ApcRoutine;
    DWORD       ApcContext;
    DWORD       Timeout;

} WSOCK_SEND_PARAMS;
typedef struct _WSOCK_SEND_PARAMS FAR * LPWSOCK_SEND_PARAMS;
#define WSOCK_SEND_MAPIN                    2


typedef struct _WSOCK_SETSOCKOPT_PARAMS {
    LPVOID      Value;
    LPSOCK_INFO Socket;
    DWORD       OptionLevel;
    DWORD       OptionName;
    DWORD       ValueLength;
    DWORD       IntValue;

} WSOCK_SETSOCKOPT_PARAMS;
typedef struct _WSOCK_SETSOCKOPT_PARAMS FAR * LPWSOCK_SETSOCKOPT_PARAMS;
#define WSOCK_SETSOCKOPT_MAPIN              1


typedef struct _WSOCK_SOCKET_PARAMS {
    DWORD       AddressFamily;
    DWORD       SocketType;
    DWORD       Protocol;
    LPSOCK_INFO NewSocket;
    DWORD       NewSocketHandle;

} WSOCK_SOCKET_PARAMS;
typedef struct _WSOCK_SOCKET_PARAMS FAR * LPWSOCK_SOCKET_PARAMS;
#define WSOCK_SOCKET_MAPIN                  0


typedef struct _WSOCK_SHUTDOWN_PARAMS {
    LPSOCK_INFO Socket;
    DWORD       How;

} WSOCK_SHUTDOWN_PARAMS;
typedef struct _WSOCK_SHUTDOWN_PARAMS FAR * LPWSOCK_SHUTDOWN_PARAMS;
#define WSOCK_SHUTDOWN_MAPIN                0


//
//  Notification APIs.
//

typedef struct _WSOCK_CREATE_PARAMS {
    LPSOCK_INFO Socket;
    DWORD       Event;
    LPVOID      ApcRoutine;
    DWORD       ApcContext;
    LPWSNOTIFY  Notify;

} WSOCK_CREATE_PARAMS;
typedef struct _WSOCK_CREATE_PARAMS FAR * LPWSOCK_CREATE_PARAMS;
#define WSOCK_CREATE_MAPIN                  0


typedef struct _WSOCK_CREATE_MULTIPLE_PARAMS {
    LPSOCK_LIST ReadList;
    LPSOCK_LIST WriteList;
    LPSOCK_LIST ExceptList;
    DWORD       ReadCount;
    DWORD       WriteCount;
    DWORD       ExceptCount;
    LPVOID      ApcRoutine;
    DWORD       ApcContext;

} WSOCK_CREATE_MULTIPLE_PARAMS;
typedef struct _WSOCK_CREATE_MULTIPLE_PARAMS FAR * LPWSOCK_CREATE_MULTIPLE_PARAMS;
#define WSOCK_CREATE_MULTIPLE_MAPIN         3


typedef struct _WSOCK_DESTROY_PARAMS {
    LPWSNOTIFY  Notify;

} WSOCK_DESTROY_PARAMS;
typedef struct _WSOCK_DESTROY_PARAMS FAR * LPWSOCK_DESTROY_PARAMS;
#define WSOCK_DESTROY_MAPIN                 1


typedef struct _WSOCK_DESTROY_BY_SOCKET_PARAMS {
    LPSOCK_INFO Socket;

} WSOCK_DESTROY_BY_SOCKET_PARAMS;
typedef struct _WSOCK_DESTROY_BY_SOCKET_PARAMS FAR * LPWSOCK_DESTROY_BY_SOCKET_PARAMS;
#define WSOCK_DESTROY_BY_SOCKET_MAPIN       0


//
//  Note that there is no structure defined for WSOCK_DESTROY_BY_THREAD,
//  since this function takes no parameters, and C won't allow us to have
//  an empty structure, but if it did, it would look like this:
//
//  typedef struct _WSOCK_DESTROY_BY_THREAD_PARAMS {
//
//  } WSOCK_DESTROY_BY_THREAD_PARAMS;
//
typedef struct _WSOCK_DESTROY_BY_THREAD_PARAMS FAR * LPWSOCK_DESTROY_BY_THREAD_PARAMS;
#define WSOCK_DESTROY_BY_THREAD_MAPIN       0


typedef struct _WSOCK_SIGNAL_PARAMS {
    LPSOCK_INFO Socket;
    DWORD       Event;
    DWORD       Status;

} WSOCK_SIGNAL_PARAMS;
typedef struct _WSOCK_SIGNAL_PARAMS FAR * LPWSOCK_SIGNAL_PARAMS;
#define WSOCK_SIGNAL_MAPIN                  0


typedef struct _WSOCK_SIGNAL_ALL_PARAMS {
    LPSOCK_INFO Socket;
    DWORD       Status;

} WSOCK_SIGNAL_ALL_PARAMS;
typedef struct _WSOCK_SIGNAL_ALL_PARAMS FAR * LPWSOCK_SIGNAL_ALL_PARAMS;
#define WSOCK_SIGNAL_ALL_MAPIN              0


typedef struct _WSOCK_REGISTER_POSTMSG_PARAMS {
    DWORD       PostMessageCallback;

} WSOCK_REGISTER_POSTMSG_PARAMS;
typedef struct _WSOCK_REGISTER_POSTMSG_PARAMS FAR * LPWSOCK_REGISTER_POSTMSG_PARAMS;
#define WSOCK_REGISTER_POSTMSG_MAPIN        0


typedef struct _WSOCK_CONTROL_PARAMS {
    LPVOID  InputBuffer;
    LPVOID  OutputBuffer;
    DWORD   InputBufferLength;
    DWORD   OutputBufferLength;
    DWORD   Protocol;
    DWORD   Action;

} WSOCK_CONTROL_PARAMS;
typedef struct _WSOCK_CONTROL_PARAMS FAR * LPWSOCK_CONTROL_PARAMS;
#define WSOCK_CONTROL_MAPIN                 2



typedef struct _WSOCK_ASYNCIO_PARAMS {
    LPVOID      Buffer;
    LPVOID      Address;
    LPSOCK_INFO Socket;
    DWORD       BufferLength;
    LPVOID      Overlap;

} WSOCK_ASYNCIO_PARAMS;
typedef struct _WSOCK_ASYNCIO_PARAMS FAR * LPWSOCK_ASYNCIO_PARAMS;
#define WSOCK_ASYNCIO_MAPIN                 0

#endif  // _WSOCK_H_


--------------4FBC3F54439B
Content-Type: text/plain; charset=us-ascii; name="Winsock.inc"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="Winsock.inc"

ifndef _WINSOCKAPI_
_WINSOCKAPI_	EQU	1
ifndef FD_SETSIZE
FD_SETSIZE	EQU	64
endif

IPPROTO_IP	EQU	0
IPPROTO_ICMP	EQU	1
IPPROTO_GGP	EQU	2
IPPROTO_TCP	EQU	6
IPPROTO_PUP	EQU	12
IPPROTO_UDP	EQU	17
IPPROTO_IDP	EQU	22
IPPROTO_ND	EQU	77
IPPROTO_RAW	EQU	255
IPPROTO_MAX	EQU	256
IPPORT_ECHO	EQU	7
IPPORT_DISCARD	EQU	9
IPPORT_SYSTAT	EQU	11
IPPORT_DAYTIME	EQU	13
IPPORT_NETSTAT	EQU	15
IPPORT_FTP	EQU	21
IPPORT_TELNET	EQU	23
IPPORT_SMTP	EQU	25
IPPORT_TIMESERVER	EQU	37
IPPORT_NAMESERVER	EQU	42
IPPORT_WHOIS	EQU	43
IPPORT_MTP	EQU	57
IPPORT_TFTP	EQU	69
IPPORT_RJE	EQU	77
IPPORT_FINGER	EQU	79
IPPORT_TTYLINK	EQU	87
IPPORT_SUPDUP	EQU	95
IPPORT_EXECSERVER	EQU	512
IPPORT_LOGINSERVER	EQU	513
IPPORT_CMDSERVER	EQU	514
IPPORT_EFSSERVER	EQU	520
IPPORT_BIFFUDP	EQU	512
IPPORT_WHOSERVER	EQU	513
IPPORT_ROUTESERVER	EQU	520
IPPORT_RESERVED	EQU	1024
IMPLINK_IP	EQU	155
IMPLINK_LOWEXPER	EQU	156
IMPLINK_HIGHEXPER	EQU	158

INADDR_ANY	EQU	00000000H
INADDR_LOOPBACK	EQU	7f000001H
INADDR_BROADCAST	EQU	0ffffffffH
INADDR_NONE	EQU	0ffffffffH

WSADESCRIPTION_LEN	EQU	256
WSASYS_STATUS_LEN	EQU	128

IP_OPTIONS	EQU	1
INVALID_SOCKET	EQU	(NOT 0)

SOCKET_ERROR	EQU	(-1)

SOCK_STREAM	EQU	1
SOCK_DGRAM	EQU	2
SOCK_RAW	EQU	3
SOCK_RDM	EQU	4
SOCK_SEQPACKET	EQU	5

SO_DEBUG	EQU	0001H
SO_ACCEPTCONN	EQU	0002H
SO_REUSEADDR	EQU	0004H
SO_KEEPALIVE	EQU	0008H
SO_DONTROUTE	EQU	0010H
SO_BROADCAST	EQU	0020H
SO_USELOOPBACK	EQU	0040H
SO_LINGER	EQU	0080H
SO_OOBINLINE	EQU	0100H
SO_DONTLINGER	EQU	(NOT SO_LINGER)
SO_SNDBUF	EQU	1001H
SO_RCVBUF	EQU	1002H
SO_SNDLOWAT	EQU	1003H
SO_RCVLOWAT	EQU	1004H
SO_SNDTIMEO	EQU	1005H
SO_RCVTIMEO	EQU	1006H
SO_ERROR	EQU	1007H
SO_TYPE	EQU	1008H

TCP_NODELAY	EQU	0001H

AF_UNSPEC	EQU	0
AF_UNIX	EQU	1
AF_INET	EQU	2
AF_IMPLINK	EQU	3
AF_PUP	EQU	4
AF_CHAOS	EQU	5
AF_NS	EQU	6
AF_ISO	EQU	7
AF_OSI	EQU	AF_ISO
AF_ECMA	EQU	8
AF_DATAKIT	EQU	9
AF_CCITT	EQU	10
AF_SNA	EQU	11
AF_DECnet	EQU	12
AF_DLI	EQU	13
AF_LAT	EQU	14
AF_HYLINK	EQU	15
AF_APPLETALK	EQU	16
AF_NETBIOS	EQU	17
AF_MAX	EQU	18

PF_UNSPEC	EQU	AF_UNSPEC
PF_UNIX	EQU	AF_UNIX
PF_INET	EQU	AF_INET
PF_IMPLINK	EQU	AF_IMPLINK
PF_PUP	EQU	AF_PUP
PF_CHAOS	EQU	AF_CHAOS
PF_NS	EQU	AF_NS
PF_ISO	EQU	AF_ISO
PF_OSI	EQU	AF_OSI
PF_ECMA	EQU	AF_ECMA
PF_DATAKIT	EQU	AF_DATAKIT
PF_CCITT	EQU	AF_CCITT
PF_SNA	EQU	AF_SNA
PF_DECnet	EQU	AF_DECnet
PF_DLI	EQU	AF_DLI
PF_LAT	EQU	AF_LAT
PF_HYLINK	EQU	AF_HYLINK
PF_APPLETALK	EQU	AF_APPLETALK
PF_MAX	EQU	AF_MAX

SOL_SOCKET	EQU	0ffffH

SOMAXCONN	EQU	5

MSG_OOB	EQU	1H
MSG_PEEK	EQU	2H
MSG_DONTROUTE	EQU	4H
MSG_MAXIOVLEN	EQU	16

MAXGETHOSTSTRUCT	EQU	1024

FD_READ	EQU	01H
FD_WRITE	EQU	02H
FD_OOB	EQU	04H
FD_ACCEPT	EQU	08H
FD_CONNECT	EQU	10H
FD_CLOSE	EQU	20H

WSABASEERR	EQU	10000
WSAEINTR	EQU	(WSABASEERR+4)
WSAEBADF	EQU	(WSABASEERR+9)
WSAEACCES	EQU	(WSABASEERR+13)
WSAEFAULT	EQU	(WSABASEERR+14)
WSAEINVAL	EQU	(WSABASEERR+22)
WSAEMFILE	EQU	(WSABASEERR+24)
WSAEWOULDBLOCK	EQU	(WSABASEERR+35)
WSAEINPROGRESS	EQU	(WSABASEERR+36)
WSAEALREADY	EQU	(WSABASEERR+37)
WSAENOTSOCK	EQU	(WSABASEERR+38)
WSAEDESTADDRREQ	EQU	(WSABASEERR+39)
WSAEMSGSIZE	EQU	(WSABASEERR+40)
WSAEPROTOTYPE	EQU	(WSABASEERR+41)
WSAENOPROTOOPT	EQU	(WSABASEERR+42)
WSAEPROTONOSUPPORT	EQU	(WSABASEERR+43)
WSAESOCKTNOSUPPORT	EQU	(WSABASEERR+44)
WSAEOPNOTSUPP	EQU	(WSABASEERR+45)
WSAEPFNOSUPPORT	EQU	(WSABASEERR+46)
WSAEAFNOSUPPORT	EQU	(WSABASEERR+47)
WSAEADDRINUSE	EQU	(WSABASEERR+48)
WSAEADDRNOTAVAIL	EQU	(WSABASEERR+49)
WSAENETDOWN	EQU	(WSABASEERR+50)
WSAENETUNREACH	EQU	(WSABASEERR+51)
WSAENETRESET	EQU	(WSABASEERR+52)
WSAECONNABORTED	EQU	(WSABASEERR+53)
WSAECONNRESET	EQU	(WSABASEERR+54)
WSAENOBUFS	EQU	(WSABASEERR+55)
WSAEISCONN	EQU	(WSABASEERR+56)
WSAENOTCONN	EQU	(WSABASEERR+57)
WSAESHUTDOWN	EQU	(WSABASEERR+58)
WSAETOOMANYREFS	EQU	(WSABASEERR+59)
WSAETIMEDOUT	EQU	(WSABASEERR+60)
WSAECONNREFUSED	EQU	(WSABASEERR+61)
WSAELOOP	EQU	(WSABASEERR+62)
WSAENAMETOOLONG	EQU	(WSABASEERR+63)
WSAEHOSTDOWN	EQU	(WSABASEERR+64)
WSAEHOSTUNREACH	EQU	(WSABASEERR+65)
WSAENOTEMPTY	EQU	(WSABASEERR+66)
WSAEPROCLIM	EQU	(WSABASEERR+67)
WSAEUSERS	EQU	(WSABASEERR+68)
WSAEDQUOT	EQU	(WSABASEERR+69)
WSAESTALE	EQU	(WSABASEERR+70)
WSAEREMOTE	EQU	(WSABASEERR+71)
WSASYSNOTREADY	EQU	(WSABASEERR+91)
WSAVERNOTSUPPORTED	EQU	(WSABASEERR+92)
WSANOTINITIALISED	EQU	(WSABASEERR+93)

WSAHOST_NOT_FOUND	EQU	(WSABASEERR+1001)
HOST_NOT_FOUND	EQU	WSAHOST_NOT_FOUND
WSATRY_AGAIN	EQU	(WSABASEERR+1002)
TRY_AGAIN	EQU	WSATRY_AGAIN
WSANO_RECOVERY	EQU	(WSABASEERR+1003)
NO_RECOVERY	EQU	WSANO_RECOVERY
WSANO_DATA	EQU	(WSABASEERR+1004)
NO_DATA	EQU	WSANO_DATA
WSANO_ADDRESS	EQU	WSANO_DATA
NO_ADDRESS	EQU	WSANO_ADDRESS
EWOULDBLOCK	EQU	WSAEWOULDBLOCK
EINPROGRESS	EQU	WSAEINPROGRESS
EALREADY	EQU	WSAEALREADY
ENOTSOCK	EQU	WSAENOTSOCK
EDESTADDRREQ	EQU	WSAEDESTADDRREQ
EMSGSIZE	EQU	WSAEMSGSIZE
EPROTOTYPE	EQU	WSAEPROTOTYPE
ENOPROTOOPT	EQU	WSAENOPROTOOPT
EPROTONOSUPPORT	EQU	WSAEPROTONOSUPPORT
ESOCKTNOSUPPORT	EQU	WSAESOCKTNOSUPPORT
EOPNOTSUPP	EQU	WSAEOPNOTSUPP
EPFNOSUPPORT	EQU	WSAEPFNOSUPPORT
EAFNOSUPPORT	EQU	WSAEAFNOSUPPORT
EADDRINUSE	EQU	WSAEADDRINUSE
EADDRNOTAVAIL	EQU	WSAEADDRNOTAVAIL
ENETDOWN	EQU	WSAENETDOWN
ENETUNREACH	EQU	WSAENETUNREACH
ENETRESET	EQU	WSAENETRESET
ECONNABORTED	EQU	WSAECONNABORTED
ECONNRESET	EQU	WSAECONNRESET
ENOBUFS	EQU	WSAENOBUFS
EISCONN	EQU	WSAEISCONN
ENOTCONN	EQU	WSAENOTCONN
ESHUTDOWN	EQU	WSAESHUTDOWN
ETOOMANYREFS	EQU	WSAETOOMANYREFS
ETIMEDOUT	EQU	WSAETIMEDOUT
ECONNREFUSED	EQU	WSAECONNREFUSED
ELOOP	EQU	WSAELOOP
ENAMETOOLONG	EQU	WSAENAMETOOLONG
EHOSTDOWN	EQU	WSAEHOSTDOWN
EHOSTUNREACH	EQU	WSAEHOSTUNREACH
ENOTEMPTY	EQU	WSAENOTEMPTY
EPROCLIM	EQU	WSAEPROCLIM
EUSERS	EQU	WSAEUSERS
EDQUOT	EQU	WSAEDQUOT
ESTALE	EQU	WSAESTALE
EREMOTE	EQU	WSAEREMOTE

ifdef __cplusplus
endif
endif

--------------4FBC3F54439B--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019