26 if (
FCB->ConnectOptionsSize == 0)
60 if (
FCB->ConnectOptions)
64 FCB->ConnectOptionsSize = 0;
65 FCB->FilledConnectOptions = 0;
72 if (!
FCB->ConnectOptions)
79 FCB->ConnectOptionsSize = ConnectOptionsSize;
98 if (!ConnectOptionsSize)
107 if (
FCB->ConnectOptions)
110 FCB->ConnectOptionsSize = 0;
111 FCB->FilledConnectOptions = 0;
120 FCB->ConnectOptionsSize = *ConnectOptionsSize;
138 if (
FCB->ConnectDataSize == 0)
172 if (
FCB->ConnectData)
176 FCB->ConnectDataSize = 0;
177 FCB->FilledConnectData = 0;
190 FCB->ConnectDataSize = ConnectDataSize;
209 if (!ConnectDataSize)
218 if (
FCB->ConnectData)
221 FCB->ConnectDataSize = 0;
222 FCB->FilledConnectData = 0;
231 FCB->ConnectDataSize = *ConnectDataSize;
241 if( !
FCB->TdiDeviceName.Length || !
FCB->TdiDeviceName.Buffer ) {
247 &
FCB->Connection.Handle,
248 &
FCB->Connection.Object );
252 FCB->Connection.Object );
282 if (!
FCB->Recv.Window)
291 if (!
FCB->Send.Window)
303 FCB->Connection.Object,
340 Irp->IoStatus.Status));
343 FCB->ConnectIrp.InFlightRequest =
NULL;
388 FCB->FilledConnectData =
MIN(
FCB->ConnectReturnInfo->UserDataLength,
FCB->ConnectDataSize);
389 if (
FCB->FilledConnectData)
392 FCB->ConnectReturnInfo->UserData,
393 FCB->FilledConnectData);
396 FCB->FilledConnectOptions =
MIN(
FCB->ConnectReturnInfo->OptionsLength,
FCB->ConnectOptionsSize);
397 if (
FCB->FilledConnectOptions)
400 FCB->ConnectReturnInfo->Options,
401 FCB->FilledConnectOptions);
407 Tail.Overlay.ListEntry);
455 if (
FCB->RemoteAddress)
463 if( !
FCB->RemoteAddress )
471 switch(
FCB->State ) {
480 if (
FCB->LocalAddress)
488 if(
FCB->LocalAddress ) {
502 if (
FCB->RemoteAddress)
510 if( !
FCB->RemoteAddress ) {
520 if (
FCB->ConnectReturnInfo)
526 ( &
FCB->ConnectReturnInfo,
531 if (
FCB->ConnectCallInfo)
543 FCB->ConnectCallInfo->UserData =
FCB->ConnectData;
544 FCB->ConnectCallInfo->UserDataLength =
FCB->ConnectDataSize;
545 FCB->ConnectCallInfo->Options =
FCB->ConnectOptions;
546 FCB->ConnectCallInfo->OptionsLength =
FCB->ConnectOptionsSize;
555 FCB->Connection.Object,
556 FCB->ConnectCallInfo,
557 FCB->ConnectReturnInfo,
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
#define SOCKET_STATE_CLOSED
IO_COMPLETION_ROUTINE ReceiveComplete
#define SOCKET_STATE_CONNECTED
#define SOCKET_STATE_CREATED
struct _AFD_FCB * PAFD_FCB
#define TAG_AFD_TDI_CONNECTION_INFORMATION
#define TAG_AFD_CONNECT_OPTIONS
#define TAG_AFD_CONNECT_DATA
#define SOCKET_STATE_CONNECTING
#define SOCKET_STATE_BOUND
#define TAG_AFD_DATA_BUFFER
#define TAG_AFD_TRANSPORT_ADDRESS
#define NT_SUCCESS(StatCode)
_In_ PIO_STACK_LOCATION IrpSp
NTSTATUS WarmSocketForBind(PAFD_FCB FCB, ULONG ShareType)
NTSTATUS MakeSocketIntoConnection(PAFD_FCB FCB)
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 AfdStreamSocketConnect(PDEVICE_OBJECT DeviceObject, PIRP Irp, PIO_STACK_LOCATION IrpSp)
NTSTATUS NTAPI AfdGetConnectOptions(PDEVICE_OBJECT DeviceObject, PIRP Irp, PIO_STACK_LOCATION IrpSp)
NTSTATUS NTAPI AfdGetConnectData(PDEVICE_OBJECT DeviceObject, PIRP Irp, PIO_STACK_LOCATION IrpSp)
NTSTATUS NTAPI AfdSetConnectOptions(PDEVICE_OBJECT DeviceObject, PIRP Irp, PIO_STACK_LOCATION IrpSp)
NTSTATUS WarmSocketForConnection(PAFD_FCB FCB)
static IO_COMPLETION_ROUTINE StreamSocketConnectComplete
NTSTATUS NTAPI AfdSetConnectOptionsSize(PDEVICE_OBJECT DeviceObject, PIRP Irp, PIO_STACK_LOCATION IrpSp)
PVOID LockRequest(PIRP Irp, PIO_STACK_LOCATION IrpSp, BOOLEAN Output, KPROCESSOR_MODE *LockMode)
VOID UnlockRequest(PIRP Irp, PIO_STACK_LOCATION IrpSp)
NTSTATUS QueueUserModeIrp(PAFD_FCB FCB, PIRP Irp, UINT Function)
NTSTATUS LostSocket(PIRP Irp)
NTSTATUS NTAPI UnlockAndMaybeComplete(PAFD_FCB FCB, NTSTATUS Status, PIRP Irp, UINT Information)
VOID SocketStateUnlock(PAFD_FCB FCB)
NTSTATUS LeaveIrpUntilLater(PAFD_FCB FCB, PIRP Irp, UINT Function)
BOOLEAN SocketAcquireStateLock(PAFD_FCB FCB)
void OskitDumpBuffer(PCHAR Data, UINT Len)
VOID PollReeval(PAFD_DEVICE_EXTENSION DeviceExt, PFILE_OBJECT FileObject)
NTSTATUS TdiAssociateAddressFile(HANDLE AddressHandle, PFILE_OBJECT ConnectionObject)
NTSTATUS TdiOpenConnectionEndpointFile(PUNICODE_STRING DeviceName, PHANDLE ConnectionHandle, PFILE_OBJECT *ConnectionObject)
NTSTATUS TdiQueryMaxDatagramLength(PFILE_OBJECT FileObject, PUINT MaxDatagramLength)
NTSTATUS TdiConnect(PIRP *Irp, PFILE_OBJECT ConnectionObject, PTDI_CONNECTION_INFORMATION ConnectionCallInfo, PTDI_CONNECTION_INFORMATION ConnectionReturnInfo, PIO_COMPLETION_ROUTINE CompletionRoutine, PVOID CompletionContext)
NTSTATUS TdiReceive(PIRP *Irp, PFILE_OBJECT TransportObject, USHORT Flags, PCHAR Buffer, UINT BufferLength, PIO_COMPLETION_ROUTINE CompletionRoutine, PVOID CompletionContext)
NTSTATUS NTAPI AfdConnectedSocketWriteData(PDEVICE_OBJECT DeviceObject, PIRP Irp, PIO_STACK_LOCATION IrpSp, BOOLEAN Short)
#define AFD_DbgPrint(_t_, _x_)
#define IO_NETWORK_INCREMENT
#define ExAllocatePoolWithTag(hernya, size, tag)
#define IsListEmpty(ListHead)
#define RemoveHeadList(ListHead)
IoSetCancelRoutine(Irp, CancelRoutine)
#define ExFreePoolWithTag(_P, _T)
#define UNREFERENCED_PARAMETER(P)
#define IoCompleteRequest
#define STATUS_FILE_CLOSED
#define AFD_SHARE_WILDCARD
#define AFD_EVENT_CONNECT_FAIL
#define AFD_ENDPOINT_CONNECTIONLESS
#define AFD_EVENT_CONNECT
#define STATUS_BUFFER_TOO_SMALL
TRANSPORT_ADDRESS RemoteAddress
struct _IO_STACK_LOCATION::@1579::@1580 DeviceIoControl
union _IO_STACK_LOCATION::@1579 Parameters
#define TDI_RECEIVE_NORMAL
NTSTATUS TdiBuildConnectionInfo(PTDI_CONNECTION_INFORMATION *ConnectionInfo, PTRANSPORT_ADDRESS Address)
PTRANSPORT_ADDRESS TaBuildNullTransportAddress(UINT AddressType)
PTRANSPORT_ADDRESS TaCopyTransportAddress(PTRANSPORT_ADDRESS OtherAddress)
#define RtlCopyMemory(Destination, Source, Length)
#define CONTAINING_RECORD(address, type, field)
#define STATUS_INVALID_PARAMETER
#define STATUS_NO_SUCH_DEVICE
_In_ PDEVICE_OBJECT DeviceObject
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize