Mixed-tag commit in reactos/drivers on MAIN & arty_afd_20040709
net/tcpip/tcpip/irp.c+2MAIN1.2 -> 1.3
               /main.c+6-1MAIN1.26 -> 1.27
net/tcpip/transport/tcp/tcp.c+1-1MAIN1.12 -> 1.13
net/afd/afd/lock.c+2-1arty_afd_200407091.1.2.1 -> 1.1.2.2
           /main.c+6-4arty_afd_200407091.1.2.2 -> 1.1.2.3
           /tdi.c+2arty_afd_200407091.13.4.2 -> 1.13.4.3
           /write.c+2-2arty_afd_200407091.1.2.3 -> 1.1.2.4
lib/oskittcp/oskittcp/interface.c+2MAIN1.3 -> 1.4
                     /uipc_socket.c+4MAIN1.3 -> 1.4
+27-9
9 modified files
oskittcp: fixed handling of uio in send.
afd: fixed send.
tcpip: fixed double-complete of send irp.

reactos/drivers/net/tcpip/tcpip
irp.c 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- irp.c	9 Jun 2004 18:11:38 -0000	1.2
+++ irp.c	15 Jul 2004 03:21:47 -0000	1.3
@@ -16,6 +16,8 @@
 #include <info.h>
 
 NTSTATUS IRPFinish( PIRP Irp, NTSTATUS Status ) {
+    TI_DbgPrint(MID_TRACE,("Called: Irp %x, Status %x Event %x\n", Irp, Status, Irp->UserEvent));
+
     IoSetCancelRoutine( Irp, NULL );
 
     if( Status == STATUS_PENDING )

reactos/drivers/net/tcpip/tcpip
main.c 1.26 -> 1.27
diff -u -r1.26 -r1.27
--- main.c	8 Jul 2004 06:36:04 -0000	1.26
+++ main.c	15 Jul 2004 03:21:47 -0000	1.27
@@ -488,6 +488,7 @@
  */
 {
   NTSTATUS Status;
+  BOOL Complete = TRUE;
   PIO_STACK_LOCATION IrpSp;
 
   IrpSp = IoGetCurrentIrpStackLocation(Irp);
@@ -509,6 +510,7 @@
 
   case TDI_SEND:
     Status = DispTdiSend(Irp);
+    Complete = FALSE; /* Completed in DispTdiSend */
     break;
 
   case TDI_SEND_DATAGRAM:
@@ -562,7 +564,10 @@
 
   TI_DbgPrint(DEBUG_IRP, ("Leaving. Status = (0x%X).\n", Status));
 
-  return IRPFinish( Irp, Status );
+  if( Complete ) 
+      IRPFinish( Irp, Status );
+
+  return Status;
 }
 
 

reactos/drivers/net/tcpip/transport/tcp
tcp.c 1.12 -> 1.13
diff -u -r1.12 -r1.13
--- tcp.c	8 Jul 2004 06:36:04 -0000	1.12
+++ tcp.c	15 Jul 2004 03:21:47 -0000	1.13
@@ -290,7 +290,7 @@
 			   Connection->SocketContext));
 
     Status = OskitTCPSend( Connection->SocketContext, 
-			 BufferData, PacketSize, (OSK_UINT *)DataUsed, 0 );
+			 BufferData, PacketSize, DataUsed, 0 );
 
     KeReleaseSpinLock(&Connection->Lock, OldIrql);
 

reactos/drivers/net/afd/afd
lock.c 1.1.2.1 -> 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- lock.c	9 Jul 2004 04:41:18 -0000	1.1.2.1
+++ lock.c	15 Jul 2004 03:21:47 -0000	1.1.2.2
@@ -1,4 +1,4 @@
-/* $Id: lock.c,v 1.1.2.1 2004/07/09 04:41:18 arty Exp $
+/* $Id: lock.c,v 1.1.2.2 2004/07/15 03:21:47 arty Exp $
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
  * FILE:             drivers/net/afd/afd/lock.c
@@ -110,6 +110,7 @@
 }
 
 VOID SocketStateUnlock( PAFD_FCB FCB ) {
+    ASSERT(FCB->LockCount > 0);
     FCB->LockCount--;
 
     if( !FCB->LockCount ) {

reactos/drivers/net/afd/afd
main.c 1.1.2.2 -> 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- main.c	14 Jul 2004 16:54:14 -0000	1.1.2.2
+++ main.c	15 Jul 2004 03:21:47 -0000	1.1.2.3
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.1.2.2 2004/07/14 16:54:14 arty Exp $
+/* $Id: main.c,v 1.1.2.3 2004/07/15 03:21:47 arty Exp $
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
  * FILE:             drivers/net/afd/afd/main.c
@@ -162,9 +162,11 @@
     /* Cancel our pending requests */
     for( i = 0; i < IN_FLIGHT_REQUESTS; i++ ) {
 	NTSTATUS Status = STATUS_NO_SUCH_FILE;
-	InFlightRequest[i]->InFlightRequest->IoStatus.Status = Status;
-	InFlightRequest[i]->InFlightRequest->IoStatus.Information = 0;
-	IoCancelIrp( InFlightRequest[i]->InFlightRequest );
+	if( InFlightRequest[i]->InFlightRequest ) {
+	    InFlightRequest[i]->InFlightRequest->IoStatus.Status = Status;
+	    InFlightRequest[i]->InFlightRequest->IoStatus.Information = 0;
+	    IoCancelIrp( InFlightRequest[i]->InFlightRequest );
+	}
     }
 
     SocketStateUnlock( FCB );

reactos/drivers/net/afd/afd
tdi.c 1.13.4.2 -> 1.13.4.3
diff -u -r1.13.4.2 -r1.13.4.3
--- tdi.c	14 Jul 2004 16:54:14 -0000	1.13.4.2
+++ tdi.c	15 Jul 2004 03:21:47 -0000	1.13.4.3
@@ -59,6 +59,8 @@
     NTSTATUS Status;
 
     AFD_DbgPrint(MID_TRACE, ("Called\n"));
+
+    AFD_DbgPrint(MID_TRACE, ("Irp->UserEvent = %x\n", Irp->UserEvent));
     
     Status = IoCallDriver(DeviceObject, Irp);
     AFD_DbgPrint(MID_TRACE, ("IoCallDriver: %08x\n", Status));

reactos/drivers/net/afd/afd
write.c 1.1.2.3 -> 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- write.c	14 Jul 2004 16:54:14 -0000	1.1.2.3
+++ write.c	15 Jul 2004 03:21:47 -0000	1.1.2.4
@@ -1,4 +1,4 @@
-/* $Id: write.c,v 1.1.2.3 2004/07/14 16:54:14 arty Exp $
+/* $Id: write.c,v 1.1.2.4 2004/07/15 03:21:47 arty Exp $
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
  * FILE:             drivers/net/afd/afd/write.c
@@ -36,7 +36,7 @@
 	
 	while( !IsListEmpty( &FCB->PendingIrpList[FUNCTION_SEND] ) ) {
 	    NextIrpEntry = 
-		RemoveHeadList(&FCB->PendingIrpList[FUNCTION_RECV]);
+		RemoveHeadList(&FCB->PendingIrpList[FUNCTION_SEND]);
 	    NextIrp = 
 		CONTAINING_RECORD(NextIrpEntry, IRP, Tail.Overlay.ListEntry);
 	    SendReq = NextIrp->AssociatedIrp.SystemBuffer;

reactos/drivers/lib/oskittcp/oskittcp
interface.c 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- interface.c	8 Jul 2004 06:39:30 -0000	1.3
+++ interface.c	15 Jul 2004 03:21:47 -0000	1.4
@@ -207,9 +207,11 @@
     struct uio uio = { 0 };
     int error = 0;
     OskitDumpBuffer( Data, Len );
+    uio.uio_resid = Len;
     mb.m_data = Data;
     mb.m_len  = Len;
     error = sosend( socket, NULL, &uio, (struct mbuf *)&mb, NULL, 0 );
+    printf("uio.uio_resid = %d\n", uio.uio_resid);
     *OutLen = uio.uio_resid;
     return error;
 }

reactos/drivers/lib/oskittcp/oskittcp
uipc_socket.c 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- uipc_socket.c	8 Jul 2004 06:39:30 -0000	1.3
+++ uipc_socket.c	15 Jul 2004 03:21:47 -0000	1.4
@@ -440,8 +440,12 @@
 					MH_ALIGN(m, len);
 			}
 			space -= len;
+#ifndef __REACTOS__
 			error = uiomove(mtod(m, caddr_t), (int)len, uio);
 			resid = uio->uio_resid;
+#else
+			resid = 0;
+#endif
 			m->m_len = len;
 			*mp = m;
 			top->m_pkthdr.len += len;
CVSspam 0.2.8