30 if (
FCB->RemoteAddress)
38 if( !
FCB->RemoteAddress )
72 IPAddr->Address[0].AddressType));
74 IPAddr->Address[0].AddressLength));
76 IPAddr->Address[0].Address[0].sin_port));
78 IPAddr->Address[0].Address[0].in_addr));
105 FCB->ListenIrp.InFlightRequest =
NULL;
120 if (
FCB->ListenIrp.ConnectionReturnInfo)
125 FCB->ListenIrp.ConnectionReturnInfo =
NULL;
128 if (
FCB->ListenIrp.ConnectionCallInfo)
133 FCB->ListenIrp.ConnectionCallInfo =
NULL;
146 return Irp->IoStatus.Status;
157 FCB->LocalAddress->Address[0].AddressType;
160 Qelt->
Seq =
FCB->ConnSeq++;
164 ConnectionReturnInfo->RemoteAddress));
170 FCB->ListenIrp.ConnectionReturnInfo->RemoteAddress );
183 Tail.Overlay.ListEntry ),
194 FCB->LocalAddress->Address[0].AddressType);
198 FCB->LocalAddress->Address[0].AddressType);
202 FCB->Connection.Object,
203 &
FCB->ListenIrp.ConnectionCallInfo,
204 &
FCB->ListenIrp.ConnectionReturnInfo,
218 FCB->PollState &= ~AFD_EVENT_ACCEPT;
259 ( &
FCB->ListenIrp.ConnectionCallInfo,
260 FCB->LocalAddress->Address[0].AddressType );
265 ( &
FCB->ListenIrp.ConnectionReturnInfo,
266 FCB->LocalAddress->Address[0].AddressType );
273 FCB->ListenIrp.ConnectionCallInfo =
NULL;
280 FCB->Connection.Object,
281 &
FCB->ListenIrp.ConnectionCallInfo,
282 &
FCB->ListenIrp.ConnectionReturnInfo,
322 FCB->PollState &= ~AFD_EVENT_ACCEPT;
326 }
else if (
FCB->NonBlocking) {
351 FCB->EventSelectDisabled &= ~AFD_EVENT_ACCEPT;
353 for( PendingConn =
FCB->PendingConnections.Flink;
354 PendingConn != &
FCB->PendingConnections;
355 PendingConn = PendingConn->Flink ) {
360 AcceptData->SequenceNumber,
361 PendingConnObj->
Seq));
363 if( PendingConnObj->
Seq == AcceptData->SequenceNumber ) {
369 ( AcceptData->ListenHandle,
396 FCB->PollState &= ~AFD_EVENT_ACCEPT;
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
#define SOCKET_STATE_CLOSED
struct _AFD_FCB * PAFD_FCB
#define TAG_AFD_TDI_CONNECTION_INFORMATION
#define FUNCTION_PREACCEPT
#define TAG_AFD_ACCEPT_QUEUE
#define SOCKET_STATE_LISTENING
#define SOCKET_STATE_BOUND
struct _AFD_DEVICE_EXTENSION * PAFD_DEVICE_EXTENSION
#define TAG_AFD_TRANSPORT_ADDRESS
#define NT_SUCCESS(StatCode)
_In_ PIO_STACK_LOCATION IrpSp
NTSTATUS MakeSocketIntoConnection(PAFD_FCB FCB)
NTSTATUS WarmSocketForConnection(PAFD_FCB FCB)
static IO_COMPLETION_ROUTINE ListenComplete
NTSTATUS AfdAccept(PDEVICE_OBJECT DeviceObject, PIRP Irp, PIO_STACK_LOCATION IrpSp)
static NTSTATUS SatisfyPreAccept(PIRP Irp, PAFD_TDI_OBJECT_QELT Qelt)
NTSTATUS AfdListenSocket(PDEVICE_OBJECT DeviceObject, PIRP Irp, PIO_STACK_LOCATION IrpSp)
static NTSTATUS SatisfyAccept(PAFD_DEVICE_EXTENSION DeviceExt, PIRP Irp, PFILE_OBJECT NewFileObject, PAFD_TDI_OBJECT_QELT Qelt)
NTSTATUS AfdWaitForListen(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 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 PollReeval(PAFD_DEVICE_EXTENSION DeviceExt, PFILE_OBJECT FileObject)
NTSTATUS TdiListen(PIRP *Irp, PFILE_OBJECT ConnectionObject, PTDI_CONNECTION_INFORMATION *RequestConnectionInfo, PTDI_CONNECTION_INFORMATION *ReturnConnectionInfo, PIO_COMPLETION_ROUTINE CompletionRoutine, PVOID CompletionContext)
#define AFD_DbgPrint(_t_, _x_)
#define IO_NETWORK_INCREMENT
#define RemoveEntryList(Entry)
#define InsertTailList(ListHead, Entry)
#define ExAllocatePoolWithTag(hernya, size, tag)
#define IsListEmpty(ListHead)
#define RemoveHeadList(ListHead)
_Must_inspect_result_ _In_ PFILE_OBJECT NewFileObject
IoSetCancelRoutine(Irp, CancelRoutine)
#define ExFreePoolWithTag(_P, _T)
#define UNREFERENCED_PARAMETER(P)
#define IoCompleteRequest
#define STATUS_FILE_CLOSED
NTSTATUS NTAPI ObReferenceObjectByHandle(IN HANDLE Handle, IN ACCESS_MASK DesiredAccess, IN POBJECT_TYPE ObjectType, IN KPROCESSOR_MODE AccessMode, OUT PVOID *Object, OUT POBJECT_HANDLE_INFORMATION HandleInformation OPTIONAL)
struct _AFD_RECEIVED_ACCEPT_DATA * PAFD_RECEIVED_ACCEPT_DATA
BOOLEAN UseDelayedAcceptance
TRANSPORT_ADDRESS Address
PTDI_CONNECTION_INFORMATION ConnInfo
struct _TA_ADDRESS_IP * PTA_IP_ADDRESS
NTSTATUS TdiBuildNullConnectionInfo(PTDI_CONNECTION_INFORMATION *ConnectionInfo, ULONG Type)
VOID TaCopyTransportAddressInPlace(PTRANSPORT_ADDRESS Target, PTRANSPORT_ADDRESS Source)
NTSTATUS TdiBuildNullConnectionInfoInPlace(PTDI_CONNECTION_INFORMATION ConnInfo, ULONG Type)
NTSTATUS TdiBuildConnectionInfo(PTDI_CONNECTION_INFORMATION *ConnectionInfo, PTRANSPORT_ADDRESS Address)
PTRANSPORT_ADDRESS TaCopyTransportAddress(PTRANSPORT_ADDRESS OtherAddress)
#define CONTAINING_RECORD(address, type, field)
#define STATUS_INVALID_PARAMETER
#define STATUS_UNSUCCESSFUL
_In_ PDEVICE_OBJECT DeviceObject
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
#define ObDereferenceObject