2013-03-16 19:49:08 +00:00
|
|
|
/*
|
2004-07-18 22:49:18 +00:00
|
|
|
* COPYRIGHT: See COPYING in the top level directory
|
|
|
|
* PROJECT: ReactOS kernel
|
|
|
|
* FILE: drivers/net/afd/include/afd.h
|
|
|
|
* PURPOSE: Ancillary functions driver -- constants and structures
|
|
|
|
* PROGRAMMER: Art Yerkes (ayerkes@speakeasy.net)
|
|
|
|
* UPDATE HISTORY:
|
|
|
|
* 20040630 Created
|
2001-01-14 17:44:38 +00:00
|
|
|
*/
|
|
|
|
|
2004-07-18 22:49:18 +00:00
|
|
|
#ifndef _AFD_H
|
|
|
|
#define _AFD_H
|
2001-01-14 17:44:38 +00:00
|
|
|
|
2008-11-30 08:26:52 +00:00
|
|
|
#include <ntifs.h>
|
|
|
|
#include <ndk/obtypes.h>
|
2004-07-18 22:49:18 +00:00
|
|
|
#include <tdi.h>
|
2014-11-04 10:38:26 +00:00
|
|
|
#include <tcpioctl.h>
|
2005-11-28 21:40:21 +00:00
|
|
|
#define _WINBASE_
|
2023-11-23 16:20:05 +00:00
|
|
|
#define _WINDOWS_H
|
2006-01-07 08:07:41 +00:00
|
|
|
#define _INC_WINDOWS
|
|
|
|
#include <windef.h>
|
2004-07-18 22:49:18 +00:00
|
|
|
#include <winsock2.h>
|
2005-07-20 14:46:24 +00:00
|
|
|
#include <afd/shared.h>
|
2011-07-27 19:29:34 +00:00
|
|
|
#include <pseh/pseh2.h>
|
|
|
|
|
|
|
|
#include "tdi_proto.h"
|
|
|
|
#include "tdiconn.h"
|
|
|
|
#include "debug.h"
|
2004-07-18 22:49:18 +00:00
|
|
|
|
|
|
|
#ifndef MIN
|
|
|
|
#define MIN(x,y) (((x)<(y))?(x):(y))
|
|
|
|
#endif
|
|
|
|
|
2008-08-11 00:02:26 +00:00
|
|
|
#define TL_INSTANCE 0
|
|
|
|
#define IP_MIB_STATS_ID 1
|
|
|
|
#define IP_MIB_ADDRTABLE_ENTRY_ID 0x102
|
|
|
|
|
2017-12-01 23:20:14 +00:00
|
|
|
#define TAG_AFD_DATA_BUFFER 'BdfA'
|
|
|
|
#define TAG_AFD_TRANSPORT_ADDRESS 'tdfA'
|
|
|
|
#define TAG_AFD_SOCKET_CONTEXT 'XdfA'
|
|
|
|
#define TAG_AFD_CONNECT_DATA 'cdfA'
|
|
|
|
#define TAG_AFD_DISCONNECT_DATA 'ddfA'
|
|
|
|
|
|
|
|
#define TAG_AFD_CONNECT_OPTIONS 'ocfA'
|
|
|
|
#define TAG_AFD_DISCONNECT_OPTIONS 'odfA'
|
|
|
|
#define TAG_AFD_ACCEPT_QUEUE 'qafA'
|
|
|
|
#define TAG_AFD_POLL_HANDLE 'hpfA'
|
|
|
|
#define TAG_AFD_FCB 'cffA'
|
|
|
|
#define TAG_AFD_ACTIVE_POLL 'pafA'
|
|
|
|
#define TAG_AFD_EA_INFO 'aefA'
|
|
|
|
#define TAG_AFD_STORED_DATAGRAM 'gsfA'
|
|
|
|
#define TAG_AFD_SNMP_ADDRESS_INFO 'asfA'
|
|
|
|
#define TAG_AFD_TDI_CONNECTION_INFORMATION 'cTfA'
|
|
|
|
#define TAG_AFD_WSA_BUFFER 'bWfA'
|
|
|
|
|
2008-08-11 00:02:26 +00:00
|
|
|
typedef struct IPADDR_ENTRY {
|
|
|
|
ULONG Addr;
|
|
|
|
ULONG Index;
|
|
|
|
ULONG Mask;
|
|
|
|
ULONG BcastAddr;
|
|
|
|
ULONG ReasmSize;
|
|
|
|
USHORT Context;
|
|
|
|
USHORT Pad;
|
|
|
|
} IPADDR_ENTRY, *PIPADDR_ENTRY;
|
|
|
|
|
|
|
|
#define DN2H(dw) \
|
|
|
|
((((dw) & 0xFF000000L) >> 24) | \
|
|
|
|
(((dw) & 0x00FF0000L) >> 8) | \
|
|
|
|
(((dw) & 0x0000FF00L) << 8) | \
|
|
|
|
(((dw) & 0x000000FFL) << 24))
|
|
|
|
|
2004-07-18 22:49:18 +00:00
|
|
|
#define SOCKET_STATE_INVALID_TRANSITION ((DWORD)-1)
|
|
|
|
#define SOCKET_STATE_CREATED 0
|
|
|
|
#define SOCKET_STATE_BOUND 1
|
|
|
|
#define SOCKET_STATE_CONNECTING 2
|
|
|
|
#define SOCKET_STATE_CONNECTED 3
|
|
|
|
#define SOCKET_STATE_LISTENING 4
|
|
|
|
#define SOCKET_STATE_MASK 0x0000ffff
|
2005-02-25 03:02:45 +00:00
|
|
|
#define SOCKET_STATE_EOF_READ 0x20000000
|
2004-07-18 22:49:18 +00:00
|
|
|
#define SOCKET_STATE_LOCKED 0x40000000
|
|
|
|
#define SOCKET_STATE_NEW 0x80000000
|
|
|
|
#define SOCKET_STATE_CLOSED 0x00000100
|
|
|
|
|
|
|
|
#define FUNCTION_CONNECT 0
|
|
|
|
#define FUNCTION_RECV 1
|
2004-11-14 19:45:16 +00:00
|
|
|
#define FUNCTION_SEND 2
|
2004-12-25 21:30:20 +00:00
|
|
|
#define FUNCTION_PREACCEPT 3
|
|
|
|
#define FUNCTION_ACCEPT 4
|
2011-06-22 00:17:19 +00:00
|
|
|
#define FUNCTION_DISCONNECT 5
|
|
|
|
#define FUNCTION_CLOSE 6
|
|
|
|
#define MAX_FUNCTIONS 7
|
2004-07-18 22:49:18 +00:00
|
|
|
|
2011-08-01 03:54:19 +00:00
|
|
|
#define IN_FLIGHT_REQUESTS 5
|
2004-07-18 22:49:18 +00:00
|
|
|
|
2004-11-15 18:24:57 +00:00
|
|
|
#define EXTRA_LOCK_BUFFERS 2 /* Number of extra buffers needed
|
|
|
|
* for ancillary data on packet
|
|
|
|
* requests. */
|
|
|
|
|
2005-05-08 02:16:32 +00:00
|
|
|
/* XXX This is a hack we should clean up later
|
2004-11-25 23:36:36 +00:00
|
|
|
* We do this in order to get some storage for the locked handle table
|
|
|
|
* Maybe I'll use some tail item in the irp instead */
|
|
|
|
#define AFD_HANDLES(x) ((PAFD_HANDLE)(x)->Exclusive)
|
merge from amd64 branch. and
35645: Fix some wrong declarations for 64bits. (Samuel Serapión)
35652: More header fixes. (Samuel Serapión)
35950: Implement __readeflags and __writeeflags (Timo Kreuzer)
35951: Remove hacks from __addgsbyte, __addgsword, __addgsdword. (Timo Kreuzer)
36171: Fix TIMERPROC definition. Fix CreateToolbarEx definition. (Samuel Serapión)
36468: Add MemoryBarrier definition for amd64 (Timo Kreuzer)
36469: Fix NetLocalGroupGetMembers prototype. (Samuel Serapión)
36474: Fix ReadProcessMemory and Toolhelp32ReadProcessMemory prototypes. (Samuel Serapión)
36840: fix __rdtsc on amd64 build (Timo Kreuzer)
36898: Fix CryptReleaseContext definition. (Samuel Serapión)
36900: Fix COMBOBOXEXITEA/W noticed by Daniel Verkamp. (Samuel Serapión)
36901: Fix NMHDR definition. noticed by Daniel Verkamp. (Samuel Serapión)
36906: Fix definitions of CDHOOKPROC, PROC, FARPROC, NEARPROC, SYSTEM_INFO, COMPAREITEMSTRUCT, COPYDATASTRUCT, DELETEITEMSTRUCT, DRAWITEMSTRUCT, MENUITEMINFOA/W, HELPINFO, MSGBOXPARAMSA/W, MOUSEHOOKSTRUCT, DROPSTRUCT, KBDLLHOOKSTRUCT, GetProcessAffinityMask, SetProcessAffinityMask, DragObject, InsertMenuA/W, ModifyMenuA/W, WinHelpA/W, RT_GROUP_CURSOR, RT_GROUP_ICON (Daniel Verkamp.)
36953: Fix AFD compilation for 64-bit (treat handles as ULONG_PTR-sized). Also correct Winsock's SOCKET definition (Stefan Ginsberg)
37307: Add UNWIND_HISTORY_TABLE_ENTRY and UNWIND_HISTORY_TABLE. (Timo Kreuzer)
37875: Inlcude excpt.h in winnt.h. (Timo Kreuzer)
37908: Fix definition of SOCKET. (Timo Kreuzer)
37926: fix *HOOKPROC definition. Add 64 bit BitTest functions. (Timo Kreuzer)
38072: Fix FARPROC, NEARPROC, PROC definitions (Samuel Serapión)
38091: Fix some 64bit portability issues. (Samuel Serapión)
38093: Hack for wine specific hack. (Samuel Serapión)
38095: Fix packing for commdlg. (Samuel Serapión)
38260: Fix EDITSTREAM structure. (Samuel Serapión)
38263: Fix definitions of WAVEOPENDESC, WAVEHDR structures. Fix prototypes for DefDriverProc, waveOutMessage, waveOutGetDevCapsA/W, waveInGetDevCapsA/W, waveInMessage, midiStreamOpen, midiOutGetDevCapsA/W, midiOutOpen, midiOutMessage, midiInGetDevCapsA/W, midiInOpen, midiInMessage, auxGetDevCapsA/W, auxOutMessage, mixerGetDevCapsA/W, mixerOpen, timeSetEvent, joyGetDevCapsA/W, mciSendCommandA/W, and mciGetCreatorTask. (Samuel Serapión)
38478: Fix HeapAlloc prototype. (Timo Kreuzer)
39468: Fix some definitions in mmsystem.h (Timo Kreuzer)
svn path=/trunk/; revision=39471
2009-02-08 03:41:29 +00:00
|
|
|
#define SET_AFD_HANDLES(x,y) (((x)->Exclusive) = (ULONG_PTR)(y))
|
2004-11-25 23:36:36 +00:00
|
|
|
|
2004-07-18 22:49:18 +00:00
|
|
|
typedef struct _AFD_MAPBUF {
|
|
|
|
PVOID BufferAddress;
|
|
|
|
PMDL Mdl;
|
|
|
|
} AFD_MAPBUF, *PAFD_MAPBUF;
|
|
|
|
|
|
|
|
typedef struct _AFD_DEVICE_EXTENSION {
|
|
|
|
PDEVICE_OBJECT DeviceObject;
|
|
|
|
LIST_ENTRY Polls;
|
|
|
|
KSPIN_LOCK Lock;
|
|
|
|
} AFD_DEVICE_EXTENSION, *PAFD_DEVICE_EXTENSION;
|
|
|
|
|
|
|
|
typedef struct _AFD_ACTIVE_POLL {
|
|
|
|
LIST_ENTRY ListEntry;
|
|
|
|
PIRP Irp;
|
|
|
|
PAFD_DEVICE_EXTENSION DeviceExt;
|
|
|
|
KDPC TimeoutDpc;
|
|
|
|
KTIMER Timer;
|
2004-11-21 20:54:52 +00:00
|
|
|
PKEVENT EventObject;
|
2004-11-25 23:36:36 +00:00
|
|
|
BOOLEAN Exclusive;
|
2004-07-18 22:49:18 +00:00
|
|
|
} AFD_ACTIVE_POLL, *PAFD_ACTIVE_POLL;
|
|
|
|
|
|
|
|
typedef struct _IRP_LIST {
|
|
|
|
LIST_ENTRY ListEntry;
|
|
|
|
PIRP Irp;
|
|
|
|
} IRP_LIST, *PIRP_LIST;
|
|
|
|
|
|
|
|
typedef struct _AFD_TDI_OBJECT {
|
|
|
|
PFILE_OBJECT Object;
|
|
|
|
HANDLE Handle;
|
|
|
|
} AFD_TDI_OBJECT, *PAFD_TDI_OBJECT;
|
|
|
|
|
2004-12-25 21:30:20 +00:00
|
|
|
typedef struct _AFD_TDI_OBJECT_QELT {
|
|
|
|
LIST_ENTRY ListEntry;
|
|
|
|
UINT Seq;
|
|
|
|
PTDI_CONNECTION_INFORMATION ConnInfo;
|
|
|
|
AFD_TDI_OBJECT Object;
|
|
|
|
} AFD_TDI_OBJECT_QELT, *PAFD_TDI_OBJECT_QELT;
|
|
|
|
|
2004-07-18 22:49:18 +00:00
|
|
|
typedef struct _AFD_IN_FLIGHT_REQUEST {
|
|
|
|
PIRP InFlightRequest;
|
2004-12-25 21:30:20 +00:00
|
|
|
PTDI_CONNECTION_INFORMATION ConnectionCallInfo;
|
|
|
|
PTDI_CONNECTION_INFORMATION ConnectionReturnInfo;
|
2004-07-18 22:49:18 +00:00
|
|
|
} AFD_IN_FLIGHT_REQUEST, *PAFD_IN_FLIGHT_REQUEST;
|
|
|
|
|
|
|
|
typedef struct _AFD_DATA_WINDOW {
|
|
|
|
PCHAR Window;
|
|
|
|
UINT BytesUsed, Size, Content;
|
|
|
|
} AFD_DATA_WINDOW, *PAFD_DATA_WINDOW;
|
|
|
|
|
|
|
|
typedef struct _AFD_STORED_DATAGRAM {
|
|
|
|
LIST_ENTRY ListEntry;
|
|
|
|
UINT Len;
|
2004-11-15 18:24:57 +00:00
|
|
|
PTRANSPORT_ADDRESS Address;
|
2004-07-18 22:49:18 +00:00
|
|
|
CHAR Buffer[1];
|
|
|
|
} AFD_STORED_DATAGRAM, *PAFD_STORED_DATAGRAM;
|
|
|
|
|
|
|
|
typedef struct _AFD_FCB {
|
2023-03-25 13:00:26 +00:00
|
|
|
BOOLEAN Locked, Critical, NonBlocking, OobInline, TdiReceiveClosed, SendClosed;
|
2011-07-04 17:37:45 +00:00
|
|
|
UINT State, Flags, GroupID, GroupType;
|
2004-07-18 22:49:18 +00:00
|
|
|
KIRQL OldIrql;
|
|
|
|
UINT LockCount;
|
|
|
|
PVOID CurrentThread;
|
|
|
|
PFILE_OBJECT FileObject;
|
|
|
|
PAFD_DEVICE_EXTENSION DeviceExt;
|
2011-05-30 17:27:53 +00:00
|
|
|
BOOLEAN DelayedAccept;
|
2004-12-25 21:30:20 +00:00
|
|
|
UINT ConnSeq;
|
2011-07-01 14:31:37 +00:00
|
|
|
USHORT DisconnectFlags;
|
|
|
|
BOOLEAN DisconnectPending;
|
2011-07-02 20:26:21 +00:00
|
|
|
LARGE_INTEGER DisconnectTimeout;
|
2004-07-18 22:49:18 +00:00
|
|
|
PTRANSPORT_ADDRESS LocalAddress, RemoteAddress;
|
2011-07-01 14:31:37 +00:00
|
|
|
PTDI_CONNECTION_INFORMATION AddressFrom, ConnectCallInfo, ConnectReturnInfo;
|
2004-07-18 22:49:18 +00:00
|
|
|
AFD_TDI_OBJECT AddressFile, Connection;
|
2011-07-01 14:31:37 +00:00
|
|
|
AFD_IN_FLIGHT_REQUEST ConnectIrp, ListenIrp, ReceiveIrp, SendIrp, DisconnectIrp;
|
2004-07-18 22:49:18 +00:00
|
|
|
AFD_DATA_WINDOW Send, Recv;
|
- Implement IOCTL_AFD_GET_CONNECT_DATA, IOCTL_AFD_SET_CONNECT_DATA, IOCTL_AFD_SET_CONNECT_DATA_SIZE, IOCTL_AFD_GET_DISCONNECT_DATA, IOCTL_AFD_SET_DISCONNECT_DATA, IOCTL_AFD_SET_DISCONNECT_DATA_SIZE, IOCTL_AFD_SET_CONNECT_OPTIONS, IOCTL_AFD_GET_CONNECT_OPTIONS, IOCTL_AFD_SET_CONNECT_OPTIONS_SIZE, IOCTL_AFD_SET_DISCONNECT_OPTIONS, IOCTL_AFD_GET_DISCONNECT_OPTIONS, IOCTL_AFD_SET_DISCONNECT_OPTIONS_SIZE
- Check that the socket allows connections in AfdDisconnect and AfdStreamSocketConnect
- Allocate the receive window in connectionless sockets when the socket is bound instead of at FCB creation
- Remove a horrible hack in UnlockRequest
- Remove an incorrect call to MmUnmapLockedPages (the pages aren't mapped!)
- Replace the recursive mutex with a KMUTEX for now (eventually I want to move to a fast mutex)
- Fix a leak in LockRequest in failure case
svn path=/branches/aicom-network-branch/; revision=44370
2009-12-02 23:57:57 +00:00
|
|
|
KMUTEX Mutex;
|
2004-11-21 20:54:52 +00:00
|
|
|
PKEVENT EventSelect;
|
|
|
|
DWORD EventSelectTriggers;
|
2011-07-18 04:21:40 +00:00
|
|
|
DWORD EventSelectDisabled;
|
2004-07-18 22:49:18 +00:00
|
|
|
UNICODE_STRING TdiDeviceName;
|
|
|
|
PVOID Context;
|
|
|
|
DWORD PollState;
|
2010-05-28 03:55:50 +00:00
|
|
|
NTSTATUS PollStatus[FD_MAX_EVENTS];
|
2012-12-23 09:53:36 +00:00
|
|
|
NTSTATUS LastReceiveStatus;
|
2004-07-18 22:49:18 +00:00
|
|
|
UINT ContextSize;
|
- Implement IOCTL_AFD_GET_CONNECT_DATA, IOCTL_AFD_SET_CONNECT_DATA, IOCTL_AFD_SET_CONNECT_DATA_SIZE, IOCTL_AFD_GET_DISCONNECT_DATA, IOCTL_AFD_SET_DISCONNECT_DATA, IOCTL_AFD_SET_DISCONNECT_DATA_SIZE, IOCTL_AFD_SET_CONNECT_OPTIONS, IOCTL_AFD_GET_CONNECT_OPTIONS, IOCTL_AFD_SET_CONNECT_OPTIONS_SIZE, IOCTL_AFD_SET_DISCONNECT_OPTIONS, IOCTL_AFD_GET_DISCONNECT_OPTIONS, IOCTL_AFD_SET_DISCONNECT_OPTIONS_SIZE
- Check that the socket allows connections in AfdDisconnect and AfdStreamSocketConnect
- Allocate the receive window in connectionless sockets when the socket is bound instead of at FCB creation
- Remove a horrible hack in UnlockRequest
- Remove an incorrect call to MmUnmapLockedPages (the pages aren't mapped!)
- Replace the recursive mutex with a KMUTEX for now (eventually I want to move to a fast mutex)
- Fix a leak in LockRequest in failure case
svn path=/branches/aicom-network-branch/; revision=44370
2009-12-02 23:57:57 +00:00
|
|
|
PVOID ConnectData;
|
|
|
|
UINT FilledConnectData;
|
|
|
|
UINT ConnectDataSize;
|
|
|
|
PVOID DisconnectData;
|
|
|
|
UINT FilledDisconnectData;
|
|
|
|
UINT DisconnectDataSize;
|
|
|
|
PVOID ConnectOptions;
|
|
|
|
UINT FilledConnectOptions;
|
|
|
|
UINT ConnectOptionsSize;
|
|
|
|
PVOID DisconnectOptions;
|
|
|
|
UINT FilledDisconnectOptions;
|
|
|
|
UINT DisconnectOptionsSize;
|
2004-07-18 22:49:18 +00:00
|
|
|
LIST_ENTRY PendingIrpList[MAX_FUNCTIONS];
|
|
|
|
LIST_ENTRY DatagramList;
|
2004-12-25 21:30:20 +00:00
|
|
|
LIST_ENTRY PendingConnections;
|
2004-07-18 22:49:18 +00:00
|
|
|
} AFD_FCB, *PAFD_FCB;
|
|
|
|
|
|
|
|
/* bind.c */
|
|
|
|
|
2012-08-20 05:48:52 +00:00
|
|
|
NTSTATUS WarmSocketForBind( PAFD_FCB FCB, ULONG ShareType );
|
2008-11-30 10:10:19 +00:00
|
|
|
NTSTATUS NTAPI
|
2004-07-18 22:49:18 +00:00
|
|
|
AfdBindSocket(PDEVICE_OBJECT DeviceObject, PIRP Irp,
|
|
|
|
PIO_STACK_LOCATION IrpSp);
|
|
|
|
|
|
|
|
/* connect.c */
|
|
|
|
|
2004-12-25 21:30:20 +00:00
|
|
|
NTSTATUS MakeSocketIntoConnection( PAFD_FCB FCB );
|
2004-07-18 22:49:18 +00:00
|
|
|
NTSTATUS WarmSocketForConnection( PAFD_FCB FCB );
|
2008-11-30 10:10:19 +00:00
|
|
|
NTSTATUS NTAPI
|
2004-07-18 22:49:18 +00:00
|
|
|
AfdStreamSocketConnect(PDEVICE_OBJECT DeviceObject, PIRP Irp,
|
|
|
|
PIO_STACK_LOCATION IrpSp);
|
- Implement IOCTL_AFD_GET_CONNECT_DATA, IOCTL_AFD_SET_CONNECT_DATA, IOCTL_AFD_SET_CONNECT_DATA_SIZE, IOCTL_AFD_GET_DISCONNECT_DATA, IOCTL_AFD_SET_DISCONNECT_DATA, IOCTL_AFD_SET_DISCONNECT_DATA_SIZE, IOCTL_AFD_SET_CONNECT_OPTIONS, IOCTL_AFD_GET_CONNECT_OPTIONS, IOCTL_AFD_SET_CONNECT_OPTIONS_SIZE, IOCTL_AFD_SET_DISCONNECT_OPTIONS, IOCTL_AFD_GET_DISCONNECT_OPTIONS, IOCTL_AFD_SET_DISCONNECT_OPTIONS_SIZE
- Check that the socket allows connections in AfdDisconnect and AfdStreamSocketConnect
- Allocate the receive window in connectionless sockets when the socket is bound instead of at FCB creation
- Remove a horrible hack in UnlockRequest
- Remove an incorrect call to MmUnmapLockedPages (the pages aren't mapped!)
- Replace the recursive mutex with a KMUTEX for now (eventually I want to move to a fast mutex)
- Fix a leak in LockRequest in failure case
svn path=/branches/aicom-network-branch/; revision=44370
2009-12-02 23:57:57 +00:00
|
|
|
NTSTATUS NTAPI
|
|
|
|
AfdGetConnectData(PDEVICE_OBJECT DeviceObject, PIRP Irp,
|
|
|
|
PIO_STACK_LOCATION IrpSp);
|
|
|
|
NTSTATUS NTAPI
|
|
|
|
AfdSetConnectData(PDEVICE_OBJECT DeviceObject, PIRP Irp,
|
|
|
|
PIO_STACK_LOCATION IrpSp);
|
|
|
|
NTSTATUS NTAPI
|
|
|
|
AfdSetConnectDataSize(PDEVICE_OBJECT DeviceObject, PIRP Irp,
|
|
|
|
PIO_STACK_LOCATION IrpSp);
|
|
|
|
NTSTATUS NTAPI
|
|
|
|
AfdGetConnectOptions(PDEVICE_OBJECT DeviceObject, PIRP Irp,
|
|
|
|
PIO_STACK_LOCATION IrpSp);
|
|
|
|
NTSTATUS NTAPI
|
|
|
|
AfdSetConnectOptions(PDEVICE_OBJECT DeviceObject, PIRP Irp,
|
|
|
|
PIO_STACK_LOCATION IrpSp);
|
|
|
|
NTSTATUS NTAPI
|
|
|
|
AfdSetConnectOptionsSize(PDEVICE_OBJECT DeviceObject, PIRP Irp,
|
|
|
|
PIO_STACK_LOCATION IrpSp);
|
2004-07-18 22:49:18 +00:00
|
|
|
|
|
|
|
/* context.c */
|
|
|
|
|
2008-11-30 10:10:19 +00:00
|
|
|
NTSTATUS NTAPI
|
2005-05-08 02:16:32 +00:00
|
|
|
AfdGetContext( PDEVICE_OBJECT DeviceObject, PIRP Irp,
|
2004-07-18 22:49:18 +00:00
|
|
|
PIO_STACK_LOCATION IrpSp );
|
2008-11-30 10:10:19 +00:00
|
|
|
NTSTATUS NTAPI
|
2009-10-26 03:11:44 +00:00
|
|
|
AfdGetContextSize( PDEVICE_OBJECT DeviceObject, PIRP Irp,
|
|
|
|
PIO_STACK_LOCATION IrpSp );
|
|
|
|
NTSTATUS NTAPI
|
2005-05-08 02:16:32 +00:00
|
|
|
AfdSetContext( PDEVICE_OBJECT DeviceObject, PIRP Irp,
|
2004-07-18 22:49:18 +00:00
|
|
|
PIO_STACK_LOCATION IrpSp );
|
|
|
|
|
|
|
|
/* info.c */
|
|
|
|
|
2008-11-30 10:10:19 +00:00
|
|
|
NTSTATUS NTAPI
|
2005-05-08 02:16:32 +00:00
|
|
|
AfdGetInfo( PDEVICE_OBJECT DeviceObject, PIRP Irp,
|
2004-07-18 22:49:18 +00:00
|
|
|
PIO_STACK_LOCATION IrpSp );
|
|
|
|
|
2009-07-09 16:47:11 +00:00
|
|
|
NTSTATUS NTAPI
|
|
|
|
AfdSetInfo( PDEVICE_OBJECT DeviceObject, PIRP Irp,
|
|
|
|
PIO_STACK_LOCATION IrpSp );
|
|
|
|
|
2008-11-30 10:10:19 +00:00
|
|
|
NTSTATUS NTAPI
|
2009-03-13 17:25:48 +00:00
|
|
|
AfdGetSockName( PDEVICE_OBJECT DeviceObject, PIRP Irp,
|
|
|
|
PIO_STACK_LOCATION IrpSp );
|
|
|
|
|
|
|
|
NTSTATUS NTAPI
|
|
|
|
AfdGetPeerName( PDEVICE_OBJECT DeviceObject, PIRP Irp,
|
|
|
|
PIO_STACK_LOCATION IrpSp );
|
2004-12-11 14:59:32 +00:00
|
|
|
|
2004-07-18 22:49:18 +00:00
|
|
|
/* listen.c */
|
2004-12-25 21:30:20 +00:00
|
|
|
NTSTATUS AfdWaitForListen( PDEVICE_OBJECT DeviceObject, PIRP Irp,
|
|
|
|
PIO_STACK_LOCATION IrpSp );
|
2004-07-18 22:49:18 +00:00
|
|
|
|
|
|
|
NTSTATUS AfdListenSocket(PDEVICE_OBJECT DeviceObject, PIRP Irp,
|
|
|
|
PIO_STACK_LOCATION IrpSp);
|
|
|
|
|
2004-12-25 21:30:20 +00:00
|
|
|
NTSTATUS AfdAccept( PDEVICE_OBJECT DeviceObject, PIRP Irp,
|
|
|
|
PIO_STACK_LOCATION IrpSp );
|
|
|
|
|
2004-07-18 22:49:18 +00:00
|
|
|
/* lock.c */
|
|
|
|
|
2005-05-08 02:16:32 +00:00
|
|
|
PAFD_WSABUF LockBuffers( PAFD_WSABUF Buf, UINT Count,
|
2004-11-15 18:24:57 +00:00
|
|
|
PVOID AddressBuf, PINT AddressLen,
|
2012-09-04 03:01:15 +00:00
|
|
|
BOOLEAN Write, BOOLEAN LockAddress,
|
|
|
|
KPROCESSOR_MODE LockMode );
|
2004-11-15 18:24:57 +00:00
|
|
|
VOID UnlockBuffers( PAFD_WSABUF Buf, UINT Count, BOOL Address );
|
- Implement IOCTL_AFD_GET_CONNECT_DATA, IOCTL_AFD_SET_CONNECT_DATA, IOCTL_AFD_SET_CONNECT_DATA_SIZE, IOCTL_AFD_GET_DISCONNECT_DATA, IOCTL_AFD_SET_DISCONNECT_DATA, IOCTL_AFD_SET_DISCONNECT_DATA_SIZE, IOCTL_AFD_SET_CONNECT_OPTIONS, IOCTL_AFD_GET_CONNECT_OPTIONS, IOCTL_AFD_SET_CONNECT_OPTIONS_SIZE, IOCTL_AFD_SET_DISCONNECT_OPTIONS, IOCTL_AFD_GET_DISCONNECT_OPTIONS, IOCTL_AFD_SET_DISCONNECT_OPTIONS_SIZE
- Check that the socket allows connections in AfdDisconnect and AfdStreamSocketConnect
- Allocate the receive window in connectionless sockets when the socket is bound instead of at FCB creation
- Remove a horrible hack in UnlockRequest
- Remove an incorrect call to MmUnmapLockedPages (the pages aren't mapped!)
- Replace the recursive mutex with a KMUTEX for now (eventually I want to move to a fast mutex)
- Fix a leak in LockRequest in failure case
svn path=/branches/aicom-network-branch/; revision=44370
2009-12-02 23:57:57 +00:00
|
|
|
BOOLEAN SocketAcquireStateLock( PAFD_FCB FCB );
|
2006-01-07 08:07:41 +00:00
|
|
|
NTSTATUS NTAPI UnlockAndMaybeComplete
|
2004-07-18 22:49:18 +00:00
|
|
|
( PAFD_FCB FCB, NTSTATUS Status, PIRP Irp,
|
2009-03-28 15:49:29 +00:00
|
|
|
UINT Information );
|
2004-07-18 22:49:18 +00:00
|
|
|
VOID SocketStateUnlock( PAFD_FCB FCB );
|
2008-08-01 21:07:09 +00:00
|
|
|
NTSTATUS LostSocket( PIRP Irp );
|
2004-11-17 05:17:22 +00:00
|
|
|
PAFD_HANDLE LockHandles( PAFD_HANDLE HandleArray, UINT HandleCount );
|
|
|
|
VOID UnlockHandles( PAFD_HANDLE HandleArray, UINT HandleCount );
|
2012-09-04 03:01:15 +00:00
|
|
|
PVOID LockRequest( PIRP Irp, PIO_STACK_LOCATION IrpSp, BOOLEAN Output, KPROCESSOR_MODE *LockMode );
|
2004-07-18 22:49:18 +00:00
|
|
|
VOID UnlockRequest( PIRP Irp, PIO_STACK_LOCATION IrpSp );
|
2011-06-11 12:46:04 +00:00
|
|
|
PVOID GetLockedData( PIRP Irp, PIO_STACK_LOCATION IrpSp );
|
2011-06-24 14:06:48 +00:00
|
|
|
NTSTATUS LeaveIrpUntilLater( PAFD_FCB FCB, PIRP Irp, UINT Function );
|
|
|
|
NTSTATUS QueueUserModeIrp(PAFD_FCB FCB, PIRP Irp, UINT Function);
|
2004-07-18 22:49:18 +00:00
|
|
|
|
|
|
|
/* main.c */
|
|
|
|
|
|
|
|
VOID OskitDumpBuffer( PCHAR Buffer, UINT Len );
|
2004-09-05 04:26:30 +00:00
|
|
|
VOID DestroySocket( PAFD_FCB FCB );
|
2013-05-08 10:55:46 +00:00
|
|
|
DRIVER_CANCEL AfdCancelHandler;
|
2011-06-22 00:17:19 +00:00
|
|
|
VOID RetryDisconnectCompletion(PAFD_FCB FCB);
|
2011-07-18 11:27:01 +00:00
|
|
|
BOOLEAN CheckUnlockExtraBuffers(PAFD_FCB FCB, PIO_STACK_LOCATION IrpSp);
|
2004-07-18 22:49:18 +00:00
|
|
|
|
|
|
|
/* read.c */
|
|
|
|
|
2013-05-08 10:55:46 +00:00
|
|
|
IO_COMPLETION_ROUTINE ReceiveComplete;
|
2001-07-04 20:40:24 +00:00
|
|
|
|
2013-05-08 10:55:46 +00:00
|
|
|
IO_COMPLETION_ROUTINE PacketSocketRecvComplete;
|
2001-07-04 20:40:24 +00:00
|
|
|
|
2008-11-30 10:10:19 +00:00
|
|
|
NTSTATUS NTAPI
|
2013-05-08 10:55:46 +00:00
|
|
|
AfdConnectedSocketReadData(PDEVICE_OBJECT DeviceObject, PIRP Irp, PIO_STACK_LOCATION IrpSp, BOOLEAN Short);
|
2008-11-30 10:10:19 +00:00
|
|
|
NTSTATUS NTAPI
|
2005-05-08 02:16:32 +00:00
|
|
|
AfdPacketSocketReadData(PDEVICE_OBJECT DeviceObject, PIRP Irp,
|
2004-07-18 22:49:18 +00:00
|
|
|
PIO_STACK_LOCATION IrpSp );
|
2001-07-04 20:40:24 +00:00
|
|
|
|
2004-07-18 22:49:18 +00:00
|
|
|
/* select.c */
|
2001-07-04 20:40:24 +00:00
|
|
|
|
2008-11-30 10:10:19 +00:00
|
|
|
NTSTATUS NTAPI
|
2005-05-08 02:16:32 +00:00
|
|
|
AfdSelect( PDEVICE_OBJECT DeviceObject, PIRP Irp,
|
2004-07-18 22:49:18 +00:00
|
|
|
PIO_STACK_LOCATION IrpSp );
|
2008-11-30 10:10:19 +00:00
|
|
|
NTSTATUS NTAPI
|
2005-05-08 02:16:32 +00:00
|
|
|
AfdEventSelect( PDEVICE_OBJECT DeviceObject, PIRP Irp,
|
2004-11-21 20:54:52 +00:00
|
|
|
PIO_STACK_LOCATION IrpSp );
|
2008-11-30 10:10:19 +00:00
|
|
|
NTSTATUS NTAPI
|
2005-05-08 02:16:32 +00:00
|
|
|
AfdEnumEvents( PDEVICE_OBJECT DeviceObject, PIRP Irp,
|
2004-11-21 20:54:52 +00:00
|
|
|
PIO_STACK_LOCATION IrpSp );
|
2004-07-18 22:49:18 +00:00
|
|
|
VOID PollReeval( PAFD_DEVICE_EXTENSION DeviceObject, PFILE_OBJECT FileObject );
|
2005-01-22 06:47:33 +00:00
|
|
|
VOID KillSelectsForFCB( PAFD_DEVICE_EXTENSION DeviceExt,
|
2005-02-06 07:56:45 +00:00
|
|
|
PFILE_OBJECT FileObject, BOOLEAN ExclusiveOnly );
|
2009-10-03 21:34:34 +00:00
|
|
|
VOID ZeroEvents( PAFD_HANDLE HandleArray,
|
|
|
|
UINT HandleCount );
|
|
|
|
VOID SignalSocket(
|
|
|
|
PAFD_ACTIVE_POLL Poll OPTIONAL, PIRP _Irp OPTIONAL,
|
|
|
|
PAFD_POLL_INFO PollReq, NTSTATUS Status);
|
2001-07-04 20:40:24 +00:00
|
|
|
|
2004-07-18 22:49:18 +00:00
|
|
|
/* tdi.c */
|
2001-01-14 17:44:38 +00:00
|
|
|
|
2001-05-01 22:44:07 +00:00
|
|
|
NTSTATUS TdiOpenAddressFile(
|
2004-07-18 22:49:18 +00:00
|
|
|
PUNICODE_STRING DeviceName,
|
|
|
|
PTRANSPORT_ADDRESS Name,
|
2012-08-20 05:48:52 +00:00
|
|
|
ULONG ShareType,
|
2004-07-18 22:49:18 +00:00
|
|
|
PHANDLE AddressHandle,
|
|
|
|
PFILE_OBJECT *AddressObject);
|
2001-07-04 20:40:24 +00:00
|
|
|
|
|
|
|
NTSTATUS TdiAssociateAddressFile(
|
|
|
|
HANDLE AddressHandle,
|
|
|
|
PFILE_OBJECT ConnectionObject);
|
2001-05-01 22:44:07 +00:00
|
|
|
|
2011-06-04 20:31:05 +00:00
|
|
|
NTSTATUS TdiDisassociateAddressFile(
|
|
|
|
PFILE_OBJECT ConnectionObject);
|
|
|
|
|
2004-07-18 22:49:18 +00:00
|
|
|
NTSTATUS TdiListen
|
|
|
|
( PIRP *Irp,
|
|
|
|
PFILE_OBJECT ConnectionObject,
|
|
|
|
PTDI_CONNECTION_INFORMATION *RequestConnectionInfo,
|
2004-12-25 21:30:20 +00:00
|
|
|
PTDI_CONNECTION_INFORMATION *ReturnConnectionInfo,
|
2003-12-25 Casper S. Hornstrup <chorns@users.sourceforge.net>
* apps/utils/net/roshttpd/error.cpp (ReportErrorStr): Cast to wchar_t*,
not __wchar_t*.
* apps/utils/net/roshttpd/makefile (TARGET_CPPFLAGS): Add -Wno-deprecated.
(TARGET_GCCLIBS): Add stdc++.
* apps/utils/net/roshttpd/common/socket.cpp: Include <string.h>.
* apps/utils/net/roshttpd/common/thread.cpp (CThread::CThread): Fix
warning.
* drivers/net/afd/afd/afd.c (ListenRequestLookasideList): New variable.
(DriverEntry): Initialize ListenRequestLookasideList.
* drivers/net/afd/afd/dispatch.c (AfdDispCompleteListen): New function.
(AfdDispListen): Partial implement.
* drivers/net/afd/afd/opnclose.c (AfdInitializeFCB): Initialize
NewFCB->ListenRequestQueue.
(AfdKillListenRequests): New function.
(AfdClose): Call AfdKillListenRequests.
* drivers/net/afd/afd/routines.c (DumpName): New function.
* drivers/net/afd/afd/tdi.c (TdiAddressSizeFromType): New function.
(TdiBuildConnectionInfo): Initialize ConnInfo->OptionsLength.
(TdiBuildNullConnectionInfo): New function.
(TdiOpenAddressFileIPv4, TdiOpenConnectionEndpointFile): EaName is
0-terminated.
(TdiListen): New function.
* drivers/net/afd/include/afd.h (AFDFCB): Add ListenRequestQueue.
(AFD_LISTEN_REQUEST): New structure.
(ListenRequestLookasideList): Declare.
(DumpName, TdiListen): Add prototypes.
* drivers/net/tcpip/datalink/lan.c (BindAdapter): Initialize
AnsiAddress.Length and AnsiAddress.MaximumLength.
* drivers/net/tcpip/include/debug.h: Define DEBUG_TCP.
* drivers/net/tcpip/include/routines.h (DisplayTCPPacket): Add
prototype.
(DISPLAY_TCP_PACKET): Define.
* drivers/net/tcpip/include/tcp.h (TCPListen): Add prototype.
* drivers/net/tcpip/include/titypes.h (ADDRESS_FILE): Add Connection.
* drivers/net/tcpip/network/ip.c (IPLocateNTEOnInterface): Cleanup.
* drivers/net/tcpip/tcpip/address.c (AddrSearchNext): Port is in
network byte order.
* drivers/net/tcpip/tcpip/dispatch.c (DispTdiAssociateAddress):
Initialize AddrFile->Connection.
(DispTdiListen): Implement.
* drivers/net/tcpip/tcpip/fileobjs.c (FileOpenAddress): Don't
initialize AddrFile->Connections.
* drivers/net/tcpip/tcpip/routines.c: Include <tcp.h>.
(DisplayIPPacket): Enable.
(DisplayTCPHeader, DisplayTCPPacket): New functions.
* drivers/net/tcpip/transport/tcp/tcp.c: Include <routines.h>.
(TCPListen, TCPiReceive): New functions.
(TCPReceive): Partial implement.
* lib/msafd/misc/helpers.c (CreateHelperDLLDatabase): Add
{SOCK_STREAM,IPPROTO_TCP,0} and {SOCK_DGRAM,IPPROTO_UDP,0} mappings.
* lib/ntdll/ldr/utils.c (LdrLoadDll): Print name of DLL if not found.
* lib/ws2_32/include/ws2_32.h (Initialized): Declare.
(WINSOCK_THREAD_BLOCK): Remove Initialized member.
* (WSAINITIALIZED, WSASETINITIALIZED): Update.
* lib/ws2_32/misc/catalog.c (CreateCatalog): Add
{SOCK_STREAM,IPPROTO_TCP,0} and {SOCK_DGRAM,IPPROTO_UDP,0} mappings.
(Initialized): New variable.
(DllMain): Don't initialize p->Initialized.
* ntoskrnl/dbg/kdb.c: Include <ctype.h>.
* subsys/win32k/ntuser/message.c (NtUserDispatchMessage): Kill noisy
message.
svn path=/trunk/; revision=7232
2003-12-25 14:06:15 +00:00
|
|
|
PIO_COMPLETION_ROUTINE CompletionRoutine,
|
|
|
|
PVOID CompletionContext);
|
|
|
|
|
2004-07-18 22:49:18 +00:00
|
|
|
NTSTATUS TdiReceive
|
|
|
|
( PIRP *Irp,
|
|
|
|
PFILE_OBJECT ConnectionObject,
|
|
|
|
USHORT Flags,
|
|
|
|
PCHAR Buffer,
|
|
|
|
UINT BufferLength,
|
|
|
|
PIO_COMPLETION_ROUTINE CompletionRoutine,
|
|
|
|
PVOID CompletionContext);
|
2001-01-14 17:44:38 +00:00
|
|
|
|
2004-07-18 22:49:18 +00:00
|
|
|
NTSTATUS TdiSend
|
|
|
|
( PIRP *Irp,
|
|
|
|
PFILE_OBJECT ConnectionObject,
|
|
|
|
USHORT Flags,
|
|
|
|
PCHAR Buffer,
|
|
|
|
UINT BufferLength,
|
|
|
|
PIO_COMPLETION_ROUTINE CompletionRoutine,
|
|
|
|
PVOID CompletionContext);
|
2001-01-14 17:44:38 +00:00
|
|
|
|
2004-07-18 22:49:18 +00:00
|
|
|
NTSTATUS TdiReceiveDatagram(
|
|
|
|
PIRP *Irp,
|
|
|
|
PFILE_OBJECT TransportObject,
|
|
|
|
USHORT Flags,
|
|
|
|
PCHAR Buffer,
|
|
|
|
UINT BufferLength,
|
|
|
|
PTDI_CONNECTION_INFORMATION From,
|
|
|
|
PIO_COMPLETION_ROUTINE CompletionRoutine,
|
|
|
|
PVOID CompletionContext);
|
2001-01-14 17:44:38 +00:00
|
|
|
|
2004-07-18 22:49:18 +00:00
|
|
|
NTSTATUS TdiSendDatagram(
|
|
|
|
PIRP *Irp,
|
|
|
|
PFILE_OBJECT TransportObject,
|
|
|
|
PCHAR Buffer,
|
|
|
|
UINT BufferLength,
|
|
|
|
PTDI_CONNECTION_INFORMATION To,
|
|
|
|
PIO_COMPLETION_ROUTINE CompletionRoutine,
|
|
|
|
PVOID CompletionContext);
|
|
|
|
|
2009-12-05 16:29:41 +00:00
|
|
|
NTSTATUS TdiQueryMaxDatagramLength(
|
|
|
|
PFILE_OBJECT FileObject,
|
|
|
|
PUINT MaxDatagramLength);
|
|
|
|
|
2004-07-18 22:49:18 +00:00
|
|
|
/* write.c */
|
|
|
|
|
2008-11-30 10:10:19 +00:00
|
|
|
NTSTATUS NTAPI
|
2005-05-08 02:16:32 +00:00
|
|
|
AfdConnectedSocketWriteData(PDEVICE_OBJECT DeviceObject, PIRP Irp,
|
2004-07-18 22:49:18 +00:00
|
|
|
PIO_STACK_LOCATION IrpSp, BOOLEAN Short);
|
2008-11-30 10:10:19 +00:00
|
|
|
NTSTATUS NTAPI
|
2005-05-08 02:16:32 +00:00
|
|
|
AfdPacketSocketWriteData(PDEVICE_OBJECT DeviceObject, PIRP Irp,
|
2004-07-18 22:49:18 +00:00
|
|
|
PIO_STACK_LOCATION IrpSp);
|
|
|
|
|
2014-01-29 11:00:53 +00:00
|
|
|
#endif /* _AFD_H */
|