Module:       WinSock2
Copyright:    Original Code is Copyright (c) 1995-2004 Functional Objects, Inc.
              All rights reserved.
License:      See License.txt in this distribution for details.
Warranty:     Distributed WITHOUT WARRANTY OF ANY KIND

// This file is automatically generated from "mswsock.h"; do not edit.


// Adapted from:
/*++


Module Name:

    mswsock.h

Abstract:

    This module contains the Microsoft-specific extensions to the Windows
    Sockets API.

Author:

    Keith Moore (keithmo) 06-Oct-1995 (Separated from WINSOCK.H).

Revision History:

--*/
define inline-only constant $SO-CONNDATA                = #x7000;
define inline-only constant $SO-CONNOPT                 = #x7001;
define inline-only constant $SO-DISCDATA                = #x7002;
define inline-only constant $SO-DISCOPT                 = #x7003;
define inline-only constant $SO-CONNDATALEN             = #x7004;
define inline-only constant $SO-CONNOPTLEN              = #x7005;
define inline-only constant $SO-DISCDATALEN             = #x7006;
define inline-only constant $SO-DISCOPTLEN              = #x7007;
define inline-only constant $SO-OPENTYPE                = #x7008;
define inline-only constant $SO-SYNCHRONOUS-ALERT       = #x10;
define inline-only constant $SO-SYNCHRONOUS-NONALERT    = #x20;
define inline-only constant $SO-MAXDG                   = #x7009;
define inline-only constant $SO-MAXPATHDG               = #x700A;
define inline-only constant $SO-UPDATE-ACCEPT-CONTEXT   = #x700B;
define inline-only constant $SO-CONNECT-TIME            = #x700C;
define inline-only constant $TCP-BSDURGENT              = #x7000;

define inline-only C-function WSARecvEx
  parameter s          :: <C-SOCKET>;
  parameter buf        :: <C-char*>;
  parameter len        :: <C-int>;
  parameter flags      :: <C-int*>;
  result value :: <C-int>;
  c-name: "WSARecvEx", c-modifiers: "__stdcall";
end;

define C-struct <TRANSMIT-FILE-BUFFERS>
  sealed inline-only slot Head-value     :: <LPVOID>;
  sealed inline-only slot HeadLength-value :: <DWORD>;
  sealed inline-only slot Tail-value     :: <LPVOID>;
  sealed inline-only slot TailLength-value :: <DWORD>;
  pointer-type-name: <LPTRANSMIT-FILE-BUFFERS>;
  c-name: "struct _TRANSMIT_FILE_BUFFERS";
end C-struct <TRANSMIT-FILE-BUFFERS>;
define inline constant <PTRANSMIT-FILE-BUFFERS> = <LPTRANSMIT-FILE-BUFFERS>;
define inline-only constant $TF-DISCONNECT              = #x01;
define inline-only constant $TF-REUSE-SOCKET            = #x02;
define inline-only constant $TF-WRITE-BEHIND            = #x04;

define inline-only C-function TransmitFile
  input parameter hSocket :: <C-SOCKET>;
  input parameter hFile :: <HANDLE>;
  input parameter nNumberOfBytesToWrite :: <DWORD>;
  input parameter nNumberOfBytesPerSend :: <DWORD>;
  input parameter lpOverlapped :: <LPOVERLAPPED>;
  input parameter lpTransmitBuffers :: <LPTRANSMIT-FILE-BUFFERS>;
  input parameter dwReserved :: <DWORD>;
  result value :: <BOOL>;
  c-name: "TransmitFile", c-modifiers: "__stdcall";
end;

define inline-only C-function AcceptEx
  input parameter sListenSocket :: <C-SOCKET>;
  input parameter sAcceptSocket :: <C-SOCKET>;
  input parameter lpOutputBuffer :: <PVOID>;
  input parameter dwReceiveDataLength :: <DWORD>;
  input parameter dwLocalAddressLength :: <DWORD>;
  input parameter dwRemoteAddressLength :: <DWORD>;
  output parameter lpdwBytesReceived :: <LPDWORD>;
  input parameter lpOverlapped :: <LPOVERLAPPED>;
  result value :: <BOOL>;
  c-name: "AcceptEx", c-modifiers: "__stdcall";
end;

define inline-only C-function GetAcceptExSockaddrs
  input parameter lpOutputBuffer :: <PVOID>;
  input parameter dwReceiveDataLength :: <DWORD>;
  input parameter dwLocalAddressLength :: <DWORD>;
  input parameter dwRemoteAddressLength :: <DWORD>;
  output parameter LocalSockaddr :: <sockaddr**>;
  output parameter LocalSockaddrLength :: <LPINT>;
  output parameter RemoteSockaddr :: <sockaddr**>;
  output parameter RemoteSockaddrLength :: <LPINT>;
  c-name: "GetAcceptExSockaddrs", c-modifiers: "__stdcall";
end;
define constant <LPFN-TRANSMITFILE> = <C-function-pointer>;
define constant <LPFN-ACCEPTEX> = <C-function-pointer>;
define constant <LPFN-GETACCEPTEXSOCKADDRS> = <C-function-pointer>;

define sealed domain make (singleton(<LPTRANSMIT-FILE-BUFFERS>));
define sealed domain initialize (<LPTRANSMIT-FILE-BUFFERS>);
