16 if (
FCB->ReceiveIrp.InFlightRequest)
return;
19 if (
FCB->TdiReceiveClosed)
return;
22 if (
FCB->Recv.Content ==
FCB->Recv.Size)
25 if (
FCB->Recv.BytesUsed != 0)
29 FCB->Recv.Window +
FCB->Recv.BytesUsed,
30 FCB->Recv.Content -
FCB->Recv.BytesUsed);
32 FCB->Recv.Content -=
FCB->Recv.BytesUsed;
33 FCB->Recv.BytesUsed = 0;
45 FCB->Connection.Object,
47 FCB->Recv.Window +
FCB->Recv.Content,
48 FCB->Recv.Size -
FCB->Recv.Content,
58 if (
FCB->TdiReceiveClosed)
89 UINT BytesAvailable =
FCB->Recv.Content -
FCB->Recv.BytesUsed;
91 return !BytesAvailable &&
FCB->TdiReceiveClosed;
96 PUINT TotalBytesCopied ) {
99 FCB->Recv.Content -
FCB->Recv.BytesUsed;
101 *TotalBytesCopied = 0;
131 FCB->Recv.Window + FcbBytesCopied,
156 UINT TotalBytesCopied = 0;
207 (
FCB, RecvReq, &TotalBytesCopied );
212 &NextIrp->Tail.Overlay.ListEntry);
221 if( NextIrp ==
Irp ) {
231 if(
FCB->Recv.Content -
FCB->Recv.BytesUsed &&
239 FCB->PollState &= ~AFD_EVENT_RECEIVE;
280 FCB->ReceiveIrp.InFlightRequest =
NULL;
316 PUINT TotalBytesCopied ) {
336 if( ExtraBuffers && Map[1].
Mdl && Map[2].
Mdl ) {
342 (
"Wierd address count %d\n",
389 if (*TotalBytesCopied == DatagramRecv->
Len)
400 Irp->IoStatus.Information = *TotalBytesCopied;
404 FCB->Recv.Content -= DatagramRecv->
Len;
421 UINT TotalBytesCopied = 0;
433 FCB->EventSelectDisabled &= ~AFD_EVENT_RECEIVE;
482 FCB->PollState &= ~AFD_EVENT_RECEIVE;
493 FCB->PollState &= ~AFD_EVENT_RECEIVE;
499 FCB->PollState &= ~AFD_EVENT_RECEIVE;
505 Irp->IoStatus.Information = 0;
508 &
Irp->Tail.Overlay.ListEntry );
519 TotalBytesCopied = 0;
559 FCB->ReceiveIrp.InFlightRequest =
NULL;
591 return Irp->IoStatus.Status;
594 if (
FCB->TdiReceiveClosed)
605 DatagramRecv->
Len =
Irp->IoStatus.Information;
609 FCB->AddressFrom->RemoteAddress));
627 FCB->Recv.Content += DatagramRecv->
Len;
645 RecvReq, DatagramRecv));
649 (
FCB, NextIrp, DatagramRecv,
675 FCB->PollState &= ~AFD_EVENT_RECEIVE;
680 ( &
FCB->ReceiveIrp.InFlightRequest,
681 FCB->AddressFile.Object,
712 FCB->EventSelectDisabled &= ~AFD_EVENT_RECEIVE;
721 if (
FCB->TdiReceiveClosed)
762 FCB->PollState &= ~AFD_EVENT_RECEIVE;
773 FCB->PollState &= ~AFD_EVENT_RECEIVE;
779 FCB->PollState &= ~AFD_EVENT_RECEIVE;
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
struct _AFD_MAPBUF * PAFD_MAPBUF
#define SOCKET_STATE_CLOSED
IO_COMPLETION_ROUTINE ReceiveComplete
#define SOCKET_STATE_CONNECTED
struct _AFD_FCB * PAFD_FCB
#define TAG_AFD_STORED_DATAGRAM
#define SOCKET_STATE_LISTENING
DRIVER_CANCEL AfdCancelHandler
IO_COMPLETION_ROUTINE PacketSocketRecvComplete
#define SOCKET_STATE_CONNECTING
#define SOCKET_STATE_BOUND
struct _AFD_STORED_DATAGRAM AFD_STORED_DATAGRAM
#define TAG_AFD_TRANSPORT_ADDRESS
#define EXTRA_LOCK_BUFFERS
_In_ PSCSI_REQUEST_BLOCK _In_opt_ PVOID BufferAddress
#define NT_SUCCESS(StatCode)
_In_ PIO_STACK_LOCATION IrpSp
PVOID LockRequest(PIRP Irp, PIO_STACK_LOCATION IrpSp, BOOLEAN Output, KPROCESSOR_MODE *LockMode)
VOID UnlockBuffers(PAFD_WSABUF Buf, UINT Count, BOOL Address)
VOID UnlockRequest(PIRP Irp, PIO_STACK_LOCATION IrpSp)
NTSTATUS LostSocket(PIRP Irp)
NTSTATUS NTAPI UnlockAndMaybeComplete(PAFD_FCB FCB, NTSTATUS Status, PIRP Irp, UINT Information)
PAFD_WSABUF LockBuffers(PAFD_WSABUF Buf, UINT Count, PVOID AddressBuf, PINT AddressLen, BOOLEAN Write, BOOLEAN LockAddress, KPROCESSOR_MODE LockMode)
VOID SocketStateUnlock(PAFD_FCB FCB)
NTSTATUS LeaveIrpUntilLater(PAFD_FCB FCB, PIRP Irp, UINT Function)
BOOLEAN SocketAcquireStateLock(PAFD_FCB FCB)
PVOID GetLockedData(PIRP Irp, PIO_STACK_LOCATION IrpSp)
BOOLEAN CheckUnlockExtraBuffers(PAFD_FCB FCB, PIO_STACK_LOCATION IrpSp)
VOID PollReeval(PAFD_DEVICE_EXTENSION DeviceExt, PFILE_OBJECT FileObject)
NTSTATUS TdiReceiveDatagram(PIRP *Irp, PFILE_OBJECT TransportObject, USHORT Flags, PCHAR Buffer, UINT BufferLength, PTDI_CONNECTION_INFORMATION Addr, 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)
#define AFD_DbgPrint(_t_, _x_)
#define IO_NETWORK_INCREMENT
#define RemoveEntryList(Entry)
#define InsertTailList(ListHead, Entry)
#define InsertHeadList(ListHead, Entry)
#define ExAllocatePoolWithTag(hernya, size, tag)
#define IsListEmpty(ListHead)
#define RemoveHeadList(ListHead)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
IoSetCancelRoutine(Irp, CancelRoutine)
PVOID NTAPI MmMapLockedPages(IN PMDL Mdl, IN KPROCESSOR_MODE AccessMode)
VOID NTAPI MmUnmapLockedPages(IN PVOID BaseAddress, IN PMDL Mdl)
#define ExFreePoolWithTag(_P, _T)
_In_ UINT _In_ UINT BytesToCopy
static VOID RefillSocketBuffer(PAFD_FCB FCB)
NTSTATUS NTAPI AfdConnectedSocketReadData(PDEVICE_OBJECT DeviceObject, PIRP Irp, PIO_STACK_LOCATION IrpSp, BOOLEAN Short)
static NTSTATUS NTAPI SatisfyPacketRecvRequest(PAFD_FCB FCB, PIRP Irp, PAFD_STORED_DATAGRAM DatagramRecv, PUINT TotalBytesCopied)
static NTSTATUS ReceiveActivity(PAFD_FCB FCB, PIRP Irp)
NTSTATUS NTAPI AfdPacketSocketReadData(PDEVICE_OBJECT DeviceObject, PIRP Irp, PIO_STACK_LOCATION IrpSp)
static VOID HandleReceiveComplete(PAFD_FCB FCB, NTSTATUS Status, ULONG_PTR Information)
static NTSTATUS TryToSatisfyRecvRequestFromBuffer(PAFD_FCB FCB, PAFD_RECV_INFO RecvReq, PUINT TotalBytesCopied)
static BOOLEAN CantReadMore(PAFD_FCB FCB)
#define UNREFERENCED_PARAMETER(P)
#define IoCompleteRequest
#define STATUS_FILE_CLOSED
#define STATUS_ACCESS_VIOLATION
#define AFD_EVENT_RECEIVE
#define AFD_EVENT_DISCONNECT
#define AFD_ENDPOINT_CONNECTIONLESS
#define STATUS_BUFFER_OVERFLOW
PTRANSPORT_ADDRESS Address
#define TDI_RECEIVE_NORMAL
PTRANSPORT_ADDRESS TaCopyTransportAddress(PTRANSPORT_ADDRESS OtherAddress)
#define RtlCopyMemory(Destination, Source, Length)
#define RtlMoveMemory(Destination, Source, Length)
#define CONTAINING_RECORD(address, type, field)
#define STATUS_INVALID_PARAMETER
_In_ PDEVICE_OBJECT DeviceObject
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
_In_ WDFDEVICE _In_ PVOID _In_opt_ PMDL Mdl
_In_ WDFREQUEST _In_ NTSTATUS _In_ ULONG_PTR Information