Home | Info | Community | Development | myReactOS | Contact Us
Definition at line 378 of file event.c.
Referenced by InternalSendEventHandler().
{ PCONNECTION_ENDPOINT Connection = (PCONNECTION_ENDPOINT)arg; PTDI_BUCKET Bucket; PLIST_ENTRY Entry; PIRP Irp; NTSTATUS Status; PMDL Mdl; ReferenceObject(Connection); while ((Entry = ExInterlockedRemoveHeadList(&Connection->SendRequest, &Connection->Lock))) { UINT SendLen = 0; PVOID SendBuffer = 0; Bucket = CONTAINING_RECORD( Entry, TDI_BUCKET, Entry ); Irp = Bucket->Request.RequestContext; Mdl = Irp->MdlAddress; TI_DbgPrint(DEBUG_TCP, ("Getting the user buffer from %x\n", Mdl)); NdisQueryBuffer( Mdl, &SendBuffer, &SendLen ); TI_DbgPrint(DEBUG_TCP, ("Writing %d bytes to %x\n", SendLen, SendBuffer)); TI_DbgPrint(DEBUG_TCP, ("Connection: %x\n", Connection)); TI_DbgPrint (DEBUG_TCP, ("Connection->SocketContext: %x\n", Connection->SocketContext)); Status = TCPTranslateError(LibTCPSend(Connection, SendBuffer, SendLen, TRUE)); TI_DbgPrint(DEBUG_TCP,("TCP Bytes: %d\n", SendLen)); if( Status == STATUS_PENDING ) { ExInterlockedInsertHeadList(&Connection->SendRequest, &Bucket->Entry, &Connection->Lock); break; } else { TI_DbgPrint(DEBUG_TCP, ("Completing Send request: %x %x\n", Bucket->Request, Status)); Bucket->Status = Status; Bucket->Information = (Bucket->Status == STATUS_SUCCESS) ? SendLen : 0; CompleteBucket(Connection, Bucket, FALSE); } } // If we completed all outstanding send requests then finish all pending shutdown requests, // cancel the timer and dereference the connection if (IsListEmpty(&Connection->SendRequest)) { FlushShutdownQueue(Connection, STATUS_SUCCESS, FALSE); if (KeCancelTimer(&Connection->DisconnectTimer)) { DereferenceObject(Connection); } } DereferenceObject(Connection); }