From 8d3db0afbe4fb44126c7300fa9ff8f43e6858776 Mon Sep 17 00:00:00 2001 From: Danny Smith Date: Tue, 5 Mar 2002 22:40:30 +0000 Subject: [PATCH] * include/mswsock.h (TP_*): Add new defines. (TRANSMIT_PACKETS_ELEMENT): Define new structure. (WSAMSG): Likewise. (WSACMSGHDR): Likewise. (DisconnectEx): Add new prototype. (WSARecvMsg): Likewise. (WSA_CMSG_*) Add empty macros, guarded by #if 0. --- winsup/w32api/ChangeLog | 10 +++++++ winsup/w32api/include/mswsock.h | 47 +++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) diff --git a/winsup/w32api/ChangeLog b/winsup/w32api/ChangeLog index 18bb1c7df..6246ac2f8 100644 --- a/winsup/w32api/ChangeLog +++ b/winsup/w32api/ChangeLog @@ -1,3 +1,13 @@ +2002-03-05 dannysmith@users.sourceforge.net + + * include/mswsock.h (TP_*): Add new defines. + (TRANSMIT_PACKETS_ELEMENT): Define new structure. + (WSAMSG): Likewise. + (WSACMSGHDR): Likewise. + (DisconnectEx): Add new prototype. + (WSARecvMsg): Likewise. + (WSA_CMSG_*) Add empty macros, guarded by #if 0. + 2002-03-02 dannysmith@users.sourceforge.net * ChangeLog: Fix typo in last entry. diff --git a/winsup/w32api/include/mswsock.h b/winsup/w32api/include/mswsock.h index d48c7443d..88f7037b5 100644 --- a/winsup/w32api/include/mswsock.h +++ b/winsup/w32api/include/mswsock.h @@ -40,6 +40,10 @@ extern "C" { #define TF_USE_SYSTEM_THREAD 16 #define TF_USE_KERNEL_APC 32 +#define TP_ELEMENT_FILE 1 +#define TP_ELEMENT_MEMORY 2 +#define TP_ELEMENT_EOP 4 + typedef struct _TRANSMIT_FILE_BUFFERS { PVOID Head; DWORD HeadLength; @@ -47,10 +51,53 @@ typedef struct _TRANSMIT_FILE_BUFFERS { DWORD TailLength; } TRANSMIT_FILE_BUFFERS, *PTRANSMIT_FILE_BUFFERS, *LPTRANSMIT_FILE_BUFFERS; +typedef struct _TRANSMIT_PACKETS_ELEMENT { + ULONG dwElFlags; + ULONG cLength; + _ANONYMOUS_UNION + union { + struct { + LARGE_INTEGER nFileOffset; + HANDLE hFile; + }; + PVOID pBuffer; + }; +} TRANSMIT_PACKETS_ELEMENT; + +typedef struct _WSAMSG { + LPSOCKADDR name; + INT namelen; + LPWSABUF lpBuffers; + DWORD dwBufferCount; + WSABUF Control; + DWORD dwFlags; +} WSAMSG, *PWSAMSG, *LPWSAMSG; + + +/* According to MSDN docs, the WSAMSG.Control buffer starts with a + cmsghdr header of the following form. See also RFC 2292. */ + +typedef struct wsacmsghdr { + UINT cmsg_len; + INT cmsg_level; + INT cmsg_type; + /* followed by UCHAR cmsg_data[]; */ +} WSACMSGHDR; + +/* TODO: Standard Posix.1g macros as per RFC 2292, with WSA_uglification. */ +#if 0 +#define WSA_CMSG_FIRSTHDR(mhdr) +#define WSA_CMSG_NXTHDR(mhdr, cmsg) +#define WSA_CMSG_SPACE(length) +#define WSA_CMSG_LEN(length) +#endif + int PASCAL WSARecvEx(SOCKET,char*,int,int*); BOOL PASCAL TransmitFile(SOCKET,HANDLE,DWORD,DWORD,LPOVERLAPPED,LPTRANSMIT_FILE_BUFFERS,DWORD); BOOL PASCAL AcceptEx(SOCKET,SOCKET,PVOID,DWORD,DWORD,DWORD,LPDWORD,LPOVERLAPPED); VOID PASCAL GetAcceptExSockaddrs(PVOID,DWORD,DWORD,DWORD,struct sockaddr**, LPINT, struct sockaddr**, LPINT); +BOOL PASCAL DisconnectEx(SOCKET,LPOVERLAPPED,DWORD,DWORD); +int PASCAL WSARecvMsg(SOCKET,LPWSAMSG,LPDWORD,LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE); #ifdef __cplusplus }