Author: cgutman
Date: Fri Mar 6 23:32:17 2009
New Revision: 39896
URL:
http://svn.reactos.org/svn/reactos?rev=39896&view=rev
Log:
- Merge aicom-network-fixes up to r39293
Modified:
trunk/reactos/drivers/network/afd/afd/listen.c
trunk/reactos/drivers/network/afd/afd/select.c
trunk/reactos/drivers/network/lan/lan/routines.c
trunk/reactos/drivers/network/tcpip/include/irp.h
trunk/reactos/drivers/network/tcpip/tcpip/buffer.c
trunk/reactos/drivers/network/tcpip/tcpip/dispatch.c
trunk/reactos/drivers/network/tcpip/tcpip/irp.c
trunk/reactos/drivers/network/tcpip/tcpip/main.c
trunk/reactos/drivers/network/tcpip/tcpip/mockbuffer.c
trunk/reactos/lib/drivers/ip/network/memtrack.c
trunk/reactos/lib/drivers/ip/network/neighbor.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] Fri Mar 6 23:32:17 2009
@@ -12,17 +12,15 @@
#include "tdiconn.h"
#include "debug.h"
-static VOID SatisfyAccept( PAFD_DEVICE_EXTENSION DeviceExt,
+static NTSTATUS SatisfyAccept( PAFD_DEVICE_EXTENSION DeviceExt,
PIRP Irp,
PFILE_OBJECT NewFileObject,
PAFD_TDI_OBJECT_QELT Qelt ) {
PAFD_FCB FCB = NewFileObject->FsContext;
NTSTATUS Status;
- if( !SocketAcquireStateLock( FCB ) ) {
- LostSocket( Irp );
- return;
- }
+ if( !SocketAcquireStateLock( FCB ) )
+ return LostSocket( Irp );
/* Transfer the connection to the new socket, launch the opening read */
AFD_DbgPrint(MID_TRACE,("Completing a real accept (FCB %x)\n", FCB));
@@ -50,9 +48,11 @@
IoCompleteRequest( Irp, IO_NETWORK_INCREMENT );
SocketStateUnlock( FCB );
-}
-
-static VOID SatisfyPreAccept( PIRP Irp, PAFD_TDI_OBJECT_QELT Qelt ) {
+
+ return Status;
+}
+
+static NTSTATUS SatisfyPreAccept( PIRP Irp, PAFD_TDI_OBJECT_QELT Qelt ) {
PAFD_RECEIVED_ACCEPT_DATA ListenReceive =
(PAFD_RECEIVED_ACCEPT_DATA)Irp->AssociatedIrp.SystemBuffer;
PTA_IP_ADDRESS IPAddr;
@@ -74,6 +74,7 @@
Irp->IoStatus.Status = STATUS_NO_MEMORY;
Irp->IoStatus.Information = 0;
IoCompleteRequest( Irp, IO_NETWORK_INCREMENT );
+ return STATUS_NO_MEMORY;
}
AFD_DbgPrint(MID_TRACE,("IPAddr->TAAddressCount %d\n",
@@ -92,6 +93,7 @@
Irp->IoStatus.Information = ((PCHAR)&IPAddr[1]) - ((PCHAR)ListenReceive);
Irp->IoStatus.Status = STATUS_SUCCESS;
IoCompleteRequest( Irp, IO_NETWORK_INCREMENT );
+ return STATUS_SUCCESS;
}
static NTSTATUS NTAPI ListenComplete
@@ -244,6 +246,7 @@
PIO_STACK_LOCATION IrpSp ) {
PFILE_OBJECT FileObject = IrpSp->FileObject;
PAFD_FCB FCB = FileObject->FsContext;
+ NTSTATUS Status;
AFD_DbgPrint(MID_TRACE,("Called\n"));
@@ -253,7 +256,7 @@
PLIST_ENTRY PendingConn = FCB->PendingConnections.Flink;
/* We have a pending connection ... complete this irp right away */
- SatisfyPreAccept
+ Status = SatisfyPreAccept
( Irp,
CONTAINING_RECORD
( PendingConn, AFD_TDI_OBJECT_QELT, ListEntry ) );
@@ -264,7 +267,7 @@
PollReeval( FCB->DeviceExt, FCB->FileObject );
SocketStateUnlock( FCB );
- return Irp->IoStatus.Status;
+ return Status;
} else {
AFD_DbgPrint(MID_TRACE,("Holding\n"));
@@ -341,7 +344,7 @@
ASSERT(NewFileObject->FsContext != FCB);
/* We have a pending connection ... complete this irp right away */
- SatisfyAccept( DeviceExt, Irp, NewFileObject, PendingConnObj );
+ Status = SatisfyAccept( DeviceExt, Irp, NewFileObject, PendingConnObj );
ObDereferenceObject( NewFileObject );
@@ -355,7 +358,7 @@
}
SocketStateUnlock( FCB );
- return Irp->IoStatus.Status;
+ return Status;
}
}
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] Fri Mar 6 23:32:17 2009
@@ -181,7 +181,7 @@
Irp->IoStatus.Status = STATUS_NO_MEMORY;
Irp->IoStatus.Information = 0;
IoCompleteRequest( Irp, IO_NETWORK_INCREMENT );
- return Irp->IoStatus.Status;
+ return STATUS_NO_MEMORY;
}
if( Exclusive ) {
@@ -262,8 +262,6 @@
KeReleaseSpinLock( &DeviceExt->Lock, OldIrql );
AFD_DbgPrint(MID_TRACE,("Returning %x\n", Status));
-
- Irp->IoStatus.Status = Status;
return Status;
}
Modified: trunk/reactos/drivers/network/lan/lan/routines.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/lan/lan/ro…
==============================================================================
--- trunk/reactos/drivers/network/lan/lan/routines.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/lan/lan/routines.c [iso-8859-1] Fri Mar 6 23:32:17
2009
@@ -87,23 +87,22 @@
NDIS_STATUS Status;
PCHAR NewData;
- NewData = ExAllocatePool( NonPagedPool, Len );
+ NewData = exAllocatePool( NonPagedPool, Len );
if( !NewData ) return NDIS_STATUS_NOT_ACCEPTED; // XXX
- TrackWithTag(EXALLOC_TAG, NewData, File, Line);
if( Data )
RtlCopyMemory(NewData, Data, Len);
NdisAllocatePacket( &Status, &Packet, GlobalPacketPool );
if( Status != NDIS_STATUS_SUCCESS ) {
- ExFreePool( NewData );
+ exFreePool( NewData );
return Status;
}
TrackWithTag(NDIS_PACKET_TAG, Packet, File, Line);
NdisAllocateBuffer( &Status, &Buffer, GlobalBufferPool, NewData, Len );
if( Status != NDIS_STATUS_SUCCESS ) {
- ExFreePool( NewData );
+ exFreePool( NewData );
FreeNdisPacket( Packet );
}
TrackWithTag(NDIS_BUFFER_TAG, Buffer, File, Line);
@@ -139,8 +138,7 @@
NdisQueryBuffer(Buffer, &Data, &Length);
NdisFreeBuffer(Buffer);
UntrackFL(File,Line,Buffer);
- ExFreePool(Data);
- UntrackFL(File,Line,Data);
+ exFreePool(Data);
}
/* Finally free the NDIS packet discriptor */
Modified: trunk/reactos/drivers/network/tcpip/include/irp.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/incl…
==============================================================================
--- trunk/reactos/drivers/network/tcpip/include/irp.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/tcpip/include/irp.h [iso-8859-1] Fri Mar 6 23:32:17
2009
@@ -10,10 +10,4 @@
VOID IRPRemember( PIRP Irp, PCHAR File, UINT Line );
NTSTATUS IRPFinish( PIRP Irp, NTSTATUS Status );
-#ifdef MEMTRACK
-#define RIRP(x) IRPRemember(x,__FILE__,__LINE__)
-#else
-#define RIRP(x)
-#endif
-
#endif/*__IRP_H*/
Modified: trunk/reactos/drivers/network/tcpip/tcpip/buffer.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/tcpi…
==============================================================================
--- trunk/reactos/drivers/network/tcpip/tcpip/buffer.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/tcpip/tcpip/buffer.c [iso-8859-1] Fri Mar 6 23:32:17
2009
@@ -365,7 +365,6 @@
NdisAllocateBuffer( &Status, &Buffer, GlobalBufferPool, NewData, Len );
if( Status != NDIS_STATUS_SUCCESS ) {
exFreePool( NewData );
- UntrackFL( File, Line, Packet, NDIS_PACKET_TAG );
FreeNdisPacket( Packet );
return Status;
}
Modified: trunk/reactos/drivers/network/tcpip/tcpip/dispatch.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/tcpi…
==============================================================================
--- trunk/reactos/drivers/network/tcpip/tcpip/dispatch.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/tcpip/tcpip/dispatch.c [iso-8859-1] Fri Mar 6 23:32:17
2009
@@ -106,7 +106,7 @@
Irp->IoStatus.Information));
TI_DbgPrint(DEBUG_IRP, ("Completing IRP at (0x%X).\n", Irp));
- IRPFinish(Irp, Irp->IoStatus.Status);
+ IRPFinish(Irp, Status);
TI_DbgPrint(DEBUG_IRP, ("Done Completing IRP\n"));
}
@@ -181,11 +181,11 @@
TCPRemoveIRP( TranContext->Handle.ConnectionContext, Irp );
+ IoReleaseCancelSpinLock(Irp->CancelIrql);
+
if( !ChewCreate( &WorkItem, sizeof(DISCONNECT_TYPE),
DispDoDisconnect, &DisType ) )
ASSERT(0);
-
- IoReleaseCancelSpinLock(Irp->CancelIrql);
return;
case TDI_SEND_DATAGRAM:
@@ -212,7 +212,7 @@
}
IoReleaseCancelSpinLock(Irp->CancelIrql);
- IoCompleteRequest(Irp, IO_NO_INCREMENT);
+ IRPFinish(Irp, STATUS_CANCELLED);
TI_DbgPrint(MAX_TRACE, ("Leaving.\n"));
}
@@ -256,7 +256,8 @@
IoReleaseCancelSpinLock(Irp->CancelIrql);
- DispDataRequestComplete(Irp, STATUS_CANCELLED, 0);
+ Irp->IoStatus.Information = 0;
+ IRPFinish(Irp, STATUS_CANCELLED);
TI_DbgPrint(MAX_TRACE, ("Leaving.\n"));
}
Modified: trunk/reactos/drivers/network/tcpip/tcpip/irp.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/tcpi…
==============================================================================
--- trunk/reactos/drivers/network/tcpip/tcpip/irp.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/tcpip/tcpip/irp.c [iso-8859-1] Fri Mar 6 23:32:17 2009
@@ -12,9 +12,7 @@
#include "precomp.h"
VOID IRPRemember( PIRP Irp, PCHAR File, UINT Line ) {
-#ifdef MEMTRACK
TrackWithTag( IRP_TAG, Irp, File, Line );
-#endif
}
NTSTATUS IRPFinish( PIRP Irp, NTSTATUS Status ) {
@@ -23,9 +21,7 @@
//DbgPrint("Called: Irp %x, Status %x Event %x\n", Irp, Status,
Irp->UserEvent);
-#ifdef MEMTRACK
- UntrackFL( __FILE__, __LINE__, Irp );
-#endif
+ UntrackFL( __FILE__, __LINE__, Irp, IRP_TAG );
Irp->IoStatus.Status = 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] Fri Mar 6 23:32:17
2009
@@ -406,7 +406,7 @@
NTSTATUS Status;
PTRANSPORT_CONTEXT Context;
- RIRP(Irp);
+ IRPRemember(Irp, __FILE__, __LINE__);
// DbgPrint("Called. DeviceObject is at (0x%X), IRP is at (0x%X).\n",
DeviceObject, Irp);
@@ -457,7 +457,7 @@
BOOLEAN Complete = TRUE;
PIO_STACK_LOCATION IrpSp;
- RIRP(Irp);
+ IRPRemember(Irp, __FILE__, __LINE__);
IrpSp = IoGetCurrentIrpStackLocation(Irp);
@@ -540,8 +540,6 @@
if( Complete )
IRPFinish( Irp, Status );
- else
- Irp->IoStatus.Status = Status;
return Status;
}
@@ -563,7 +561,7 @@
NTSTATUS Status;
PIO_STACK_LOCATION IrpSp;
- RIRP(Irp);
+ IRPRemember(Irp, __FILE__, __LINE__);
IrpSp = IoGetCurrentIrpStackLocation(Irp);
Modified: trunk/reactos/drivers/network/tcpip/tcpip/mockbuffer.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/tcpi…
==============================================================================
--- trunk/reactos/drivers/network/tcpip/tcpip/mockbuffer.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/tcpip/tcpip/mockbuffer.c [iso-8859-1] Fri Mar 6
23:32:17 2009
@@ -432,7 +432,6 @@
NewData = exAllocatePool( NonPagedPool, Len );
if( !NewData ) return NDIS_STATUS_NOT_ACCEPTED; // XXX
- TrackWithTag(EXALLOC_TAG, NewData, File, Line);
if( Data )
RtlCopyMemory(NewData, Data, Len);
Modified: trunk/reactos/lib/drivers/ip/network/memtrack.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/network/mem…
==============================================================================
--- trunk/reactos/lib/drivers/ip/network/memtrack.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/ip/network/memtrack.c [iso-8859-1] Fri Mar 6 23:32:17 2009
@@ -82,17 +82,14 @@
if( ThingInList->Thing == Thing ) {
RemoveEntryList(Entry);
- TcpipReleaseSpinLock( &AllocatedObjectsLock, OldIrql );
- ShowTrackedThing( "Alloc", ThingInList, FALSE );
-
- TrackDumpFL( FileName, LineNo );
- DbgPrint("TRACK: SPECIFIED ALREADY ALLOCATED ITEM %x\n", Thing);
- ShowTrackedThing( "Double Alloc (Item in list)", ThingInList, TRUE
);
- ShowTrackedThing( "Double Alloc (Item not in list)", TrackedThing,
TRUE );
- TcpipBugCheck( 0 );
+ TI_DbgPrint(MAX_TRACE,("TRACK: SPECIFIED ALREADY ALLOCATED ITEM
%x\n", Thing));
+ ShowTrackedThing( "Double Alloc (Item in list)", ThingInList, FALSE
);
+ ShowTrackedThing( "Double Alloc (Item not in list)", TrackedThing,
FALSE );
ExFreeToNPagedLookasideList( &AllocatedObjectsLookasideList,
ThingInList );
+
+ break;
}
Entry = Entry->Flink;
}
@@ -100,8 +97,6 @@
InsertHeadList( &AllocatedObjectsList, &TrackedThing->Entry );
TcpipReleaseSpinLock( &AllocatedObjectsLock, OldIrql );
-
- /*TrackDumpFL( FileName, LineNo );*/
}
BOOLEAN ShowTag( ULONG Tag ) {
Modified: trunk/reactos/lib/drivers/ip/network/neighbor.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/network/nei…
==============================================================================
--- trunk/reactos/lib/drivers/ip/network/neighbor.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/ip/network/neighbor.c [iso-8859-1] Fri Mar 6 23:32:17 2009
@@ -237,7 +237,7 @@
{
TI_DbgPrint(DEBUG_NCACHE, ("Called. NCE (0x%X).\n", NCE));
- if (NCE->State == NUD_INCOMPLETE)
+ if (NCE->State & NUD_INCOMPLETE)
{
/* This is the first solicitation of this neighbor. Broadcast
a request for the neighbor */