Author: arty
Date: Sun Aug 3 02:23:42 2008
New Revision: 35056
URL:
http://svn.reactos.org/svn/reactos?rev=35056&view=rev
Log:
Merge aicom-network-fixes up to 35055
Modified:
trunk/reactos/drivers/network/afd/afd/listen.c
trunk/reactos/drivers/network/afd/afd/lock.c
trunk/reactos/drivers/network/afd/afd/main.c
trunk/reactos/drivers/network/afd/afd/read.c
trunk/reactos/drivers/network/afd/afd/select.c
trunk/reactos/drivers/network/tcpip/datalink/lan.c
trunk/reactos/drivers/network/tcpip/tcpip/main.c
trunk/reactos/drivers/network/tcpip/tcpip/pool.c
Modified: trunk/reactos/drivers/network/afd/afd/listen.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/li…
==============================================================================
--- trunk/reactos/drivers/network/afd/afd/listen.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/afd/afd/listen.c [iso-8859-1] Sun Aug 3 02:23:42 2008
@@ -18,7 +18,10 @@
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));
Modified: trunk/reactos/drivers/network/afd/afd/lock.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/lo…
==============================================================================
--- trunk/reactos/drivers/network/afd/afd/lock.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/afd/afd/lock.c [iso-8859-1] Sun Aug 3 02:23:42 2008
@@ -237,6 +237,9 @@
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()
@@ -246,8 +249,6 @@
} 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 );
Modified: trunk/reactos/drivers/network/afd/afd/main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/ma…
==============================================================================
--- trunk/reactos/drivers/network/afd/afd/main.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/afd/afd/main.c [iso-8859-1] Sun Aug 3 02:23:42 2008
@@ -313,6 +313,8 @@
ASSERT(FileObject == IrpSp->FileObject);
}
+ Irp->IoStatus.Information = 0;
+
switch(IrpSp->MajorFunction)
{
/* opening and closing handles to the device */
@@ -457,7 +459,6 @@
default:
Status = STATUS_NOT_IMPLEMENTED;
- Irp->IoStatus.Information = 0;
AFD_DbgPrint(MIN_TRACE, ("Unknown IOCTL (0x%x)\n",
IrpSp->Parameters.DeviceIoControl.
IoControlCode));
Modified: trunk/reactos/drivers/network/afd/afd/read.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/re…
==============================================================================
--- trunk/reactos/drivers/network/afd/afd/read.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/afd/afd/read.c [iso-8859-1] Sun Aug 3 02:23:42 2008
@@ -129,7 +129,7 @@
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));
@@ -197,7 +197,10 @@
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 );
}
@@ -212,6 +215,12 @@
PollReeval( FCB->DeviceExt, FCB->FileObject );
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;
}
Modified: trunk/reactos/drivers/network/afd/afd/select.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/se…
==============================================================================
--- trunk/reactos/drivers/network/afd/afd/select.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/afd/afd/select.c [iso-8859-1] Sun Aug 3 02:23:42 2008
@@ -262,6 +262,8 @@
AFD_DbgPrint(MID_TRACE,("Returning %x\n", Status));
+ Irp->IoStatus.Status = Status;
+
return Status;
}
Modified: trunk/reactos/drivers/network/tcpip/datalink/lan.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/data…
==============================================================================
--- trunk/reactos/drivers/network/tcpip/datalink/lan.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/tcpip/datalink/lan.c [iso-8859-1] Sun Aug 3 02:23:42
2008
@@ -860,8 +860,10 @@
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) ) {
Modified: trunk/reactos/drivers/network/tcpip/tcpip/main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/tcpi…
==============================================================================
--- trunk/reactos/drivers/network/tcpip/tcpip/main.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/tcpip/tcpip/main.c [iso-8859-1] Sun Aug 3 02:23:42
2008
@@ -518,6 +518,8 @@
if( Complete )
IRPFinish( Irp, Status );
+ else
+ Irp->IoStatus.Status = Status;
return Status;
}
Modified: trunk/reactos/drivers/network/tcpip/tcpip/pool.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/tcpi…
==============================================================================
--- trunk/reactos/drivers/network/tcpip/tcpip/pool.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/tcpip/tcpip/pool.c [iso-8859-1] Sun Aug 3 02:23:42
2008
@@ -48,11 +48,20 @@
}
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 );
}