PAFD_TDI_OBJECT_QELT Qelt ) {
PAFD_FCB FCB = NewFileObject->FsContext;
- if( !SocketAcquireStateLock( FCB ) ) return;
+ if( !SocketAcquireStateLock( FCB ) ) {
+ LostSocket( Irp );
+ return;
+ }
/* Transfer the connection to the new socket, launch the opening read */
AFD_DbgPrint(MID_TRACE,("Completing a real accept (FCB %x)\n", FCB));
UINT Information,
PIO_COMPLETION_ROUTINE Completion ) {
+ Irp->IoStatus.Status = Status;
+ Irp->IoStatus.Information = Information;
+
if( Status == STATUS_PENDING ) {
/* We should firstly mark this IRP as pending, because
otherwise it may be completed by StreamSocketConnectComplete()
} else {
if ( Irp->MdlAddress ) UnlockRequest( Irp, IoGetCurrentIrpStackLocation( Irp ) );
SocketStateUnlock( FCB );
- Irp->IoStatus.Status = Status;
- Irp->IoStatus.Information = Information;
if( Completion )
Completion( FCB->DeviceExt->DeviceObject, Irp, FCB );
IoCompleteRequest( Irp, IO_NETWORK_INCREMENT );
ASSERT(FileObject == IrpSp->FileObject);
}
+ Irp->IoStatus.Information = 0;
+
switch(IrpSp->MajorFunction)
{
/* opening and closing handles to the device */
default:
Status = STATUS_NOT_IMPLEMENTED;
- Irp->IoStatus.Information = 0;
AFD_DbgPrint(MIN_TRACE, ("Unknown IOCTL (0x%x)\n",
IrpSp->Parameters.DeviceIoControl.
IoControlCode));
PIRP NextIrp;
PIO_STACK_LOCATION NextIrpSp;
PAFD_RECV_INFO RecvReq;
- UINT TotalBytesCopied = 0;
+ UINT TotalBytesCopied = 0, RetBytesCopied = 0;
NTSTATUS Status = STATUS_SUCCESS, RetStatus = STATUS_PENDING;
AFD_DbgPrint(MID_TRACE,("%x %x\n", FCB, Irp));
RecvReq->BufferCount, FALSE );
NextIrp->IoStatus.Status = Status;
NextIrp->IoStatus.Information = TotalBytesCopied;
- if( NextIrp == Irp ) RetStatus = Status;
+ if( NextIrp == Irp ) {
+ RetStatus = Status;
+ RetBytesCopied = TotalBytesCopied;
+ }
if( NextIrp->MdlAddress ) UnlockRequest( NextIrp, IoGetCurrentIrpStackLocation( NextIrp ) );
IoCompleteRequest( NextIrp, IO_NETWORK_INCREMENT );
}
AFD_DbgPrint(MID_TRACE,("RetStatus for irp %x is %x\n", Irp, RetStatus));
+ /* Sometimes we're called with a NULL Irp */
+ if( Irp ) {
+ Irp->IoStatus.Status = RetStatus;
+ Irp->IoStatus.Information = RetBytesCopied;
+ }
+
return RetStatus;
}
AFD_DbgPrint(MID_TRACE,("Returning %x\n", Status));
+ Irp->IoStatus.Status = Status;
+
return Status;
}
Status = ZwEnumerateKey( EnumKey, i, KeyBasicInformation,
Kbio, KbioLength, &ResultLength );
- TI_DbgPrint(DEBUG_DATALINK,("Couldn't enum key child %d\n", i));
- return Status;
+ if( !NT_SUCCESS(Status) ) {
+ TI_DbgPrint(DEBUG_DATALINK,("Couldn't enum key child %d\n", i));
+ return Status;
+ }
}
if( NT_SUCCESS(Status) ) {
if( Complete )
IRPFinish( Irp, Status );
+ else
+ Irp->IoStatus.Status = Status;
return Status;
}
}
PVOID TcpipAllocateFromNPagedLookasideList( PNPAGED_LOOKASIDE_LIST List ) {
- return ExAllocateFromNPagedLookasideList( List );
+ PVOID Buffer;
+
+ Buffer = ExAllocateFromNPagedLookasideList( List );
+
+ TI_DbgPrint(DEBUG_MEMORY, ("Allocated from Nonpaged Lookaside List at (0x%X).\n", Buffer));
+
+ return Buffer;
}
VOID TcpipFreeToNPagedLookasideList( PNPAGED_LOOKASIDE_LIST List,
PVOID Thing ) {
+
+ TI_DbgPrint(DEBUG_MEMORY, ("Freeing buffer (0x%X) to Nonpaged Lookaside List.\n", Thing));
+
ExFreeToNPagedLookasideList( List, Thing );
}