25 SIZE_T TotalBytesCopied = 0, TotalBytesProcessed = 0, SpaceAvail,
i;
42 Irp->IoStatus.Information));
48 FCB->SendIrp.InFlightRequest =
NULL;
103 FCB->Send.Window +
Irp->IoStatus.Information,
104 FCB->Send.BytesUsed -
Irp->IoStatus.Information );
106 TotalBytesProcessed = 0;
107 SendLength =
Irp->IoStatus.Information;
108 HaltSendQueue =
FALSE;
116 TotalBytesCopied = (
ULONG_PTR)NextIrp->Tail.Overlay.DriverContext[3];
117 ASSERT(TotalBytesCopied != 0);
120 if (TotalBytesCopied > SendLength)
123 TotalBytesCopied -= SendLength;
124 NextIrp->Tail.Overlay.DriverContext[3] = (
PVOID)TotalBytesCopied;
127 FCB->Send.BytesUsed -= SendLength;
128 TotalBytesProcessed += SendLength;
133 &NextIrp->Tail.Overlay.ListEntry);
134 HaltSendQueue =
TRUE;
142 FCB->Send.BytesUsed -= TotalBytesCopied;
143 TotalBytesProcessed += TotalBytesCopied;
144 SendLength -= TotalBytesCopied;
168 SpaceAvail =
FCB->Send.Size -
FCB->Send.BytesUsed;
169 TotalBytesCopied = 0;
179 if (SendLength > SpaceAvail)
184 FCB->PollState &= ~AFD_EVENT_SEND;
192 FCB->PollState &= ~AFD_EVENT_SEND;
225 if (
FCB->Send.Size -
FCB->Send.BytesUsed != 0 && !
FCB->SendClosed &&
234 FCB->PollState &= ~AFD_EVENT_SEND;
239 if(
FCB->Send.BytesUsed )
242 FCB->Connection.Object,
273 Irp->IoStatus.Status,
274 Irp->IoStatus.Information));
280 FCB->SendIrp.InFlightRequest =
NULL;
345 FCB->EventSelectDisabled &= ~AFD_EVENT_SEND;
377 FCB->PollState &= ~AFD_EVENT_SEND;
383 FCB->AddressFile.Object,
393 Irp->IoStatus.Information = 0;
461 FCB->Send.BytesUsed));
463 SpaceAvail =
FCB->Send.Size -
FCB->Send.BytesUsed;
476 if (SendLength > SpaceAvail)
481 FCB->PollState &= ~AFD_EVENT_SEND;
488 FCB->PollState &= ~AFD_EVENT_SEND;
512 FCB->Send.Window +
FCB->Send.BytesUsed));
523 Irp->IoStatus.Information = TotalBytesCopied;
525 if( TotalBytesCopied == 0 ) {
540 FCB->PollState &= ~AFD_EVENT_SEND;
544 Irp->Tail.Overlay.DriverContext[3] = (
PVOID)
Irp->IoStatus.Information;
550 FCB->Connection.Object,
579 FCB->EventSelectDisabled &= ~AFD_EVENT_SEND;
600 if (
FCB->LocalAddress)
609 if(
FCB->LocalAddress ) {
631 (
MID_TRACE,(
"RemoteAddress #%d Type %u\n",
643 FCB->PollState &= ~AFD_EVENT_SEND;
649 FCB->AddressFile.Object,
659 Irp->IoStatus.Information = 0;
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
struct _AFD_MAPBUF * PAFD_MAPBUF
#define SOCKET_STATE_CLOSED
#define SOCKET_STATE_CONNECTED
#define SOCKET_STATE_CREATED
struct _AFD_FCB * PAFD_FCB
#define TAG_AFD_TDI_CONNECTION_INFORMATION
#define SOCKET_STATE_BOUND
#define TAG_AFD_TRANSPORT_ADDRESS
_In_ PSCSI_REQUEST_BLOCK _In_opt_ PVOID BufferAddress
#define NT_SUCCESS(StatCode)
_In_ PIO_STACK_LOCATION IrpSp
NTSTATUS WarmSocketForBind(PAFD_FCB FCB, ULONG ShareType)
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 QueueUserModeIrp(PAFD_FCB FCB, PIRP Irp, UINT Function)
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)
VOID RetryDisconnectCompletion(PAFD_FCB FCB)
VOID PollReeval(PAFD_DEVICE_EXTENSION DeviceExt, PFILE_OBJECT FileObject)
NTSTATUS TdiSendDatagram(PIRP *Irp, PFILE_OBJECT TransportObject, PCHAR Buffer, UINT BufferLength, PTDI_CONNECTION_INFORMATION Addr, PIO_COMPLETION_ROUTINE CompletionRoutine, PVOID CompletionContext)
NTSTATUS TdiSend(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)
static IO_COMPLETION_ROUTINE SendComplete
NTSTATUS NTAPI AfdPacketSocketWriteData(PDEVICE_OBJECT DeviceObject, PIRP Irp, PIO_STACK_LOCATION IrpSp)
static IO_COMPLETION_ROUTINE PacketSocketSendComplete
#define AFD_DbgPrint(_t_, _x_)
#define IO_NETWORK_INCREMENT
#define InsertHeadList(ListHead, Entry)
#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 _In_ PNDIS_PACKET _In_ UINT _Out_ PUINT BytesCopied
#define UNREFERENCED_PARAMETER(P)
#define IoCompleteRequest
#define STATUS_FILE_CLOSED
#define STATUS_INVALID_CONNECTION
#define STATUS_ACCESS_VIOLATION
#define AFD_SHARE_WILDCARD
#define AFD_ENDPOINT_CONNECTIONLESS
TDI_CONNECTION_INFORMATION TdiConnection
NTSTATUS TdiBuildConnectionInfo(PTDI_CONNECTION_INFORMATION *ConnectionInfo, PTRANSPORT_ADDRESS Address)
PTRANSPORT_ADDRESS TaBuildNullTransportAddress(UINT AddressType)
#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
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS _Inout_ PLARGE_INTEGER _Outptr_ PVOID * TargetAddress