Mixed-tag commit in reactos on MAIN & arty_afd_20040709
include/afd/shared.h+1-1arty_afd_200407091.7.16.4 -> 1.7.16.5
lib/msafd/misc/dllmain.c+10arty_afd_200407091.13.10.2 -> 1.13.10.3
              /helpers.c+16arty_afd_200407091.9.12.4 -> 1.9.12.5
drivers/lib/oskittcp/makefile+3-2MAIN1.1 -> 1.2
drivers/lib/oskittcp/oskittcp/tcp_input.c+5-4MAIN1.3 -> 1.4
                             /tcp_output.c+1MAIN1.2 -> 1.3
drivers/net/tcpip/makefile+2-2MAIN1.17 -> 1.18
drivers/net/tcpip/include/ip.h+3-3MAIN1.11 -> 1.12
                         /memtrack.h+5MAIN1.2 -> 1.3
                         /receive.h+1-1MAIN1.3 -> 1.4
drivers/net/tcpip/network/ip.c+23-39MAIN1.10 -> 1.11
                         /neighbor.c+14-5MAIN1.5 -> 1.6
                         /receive.c+7-10MAIN1.9 -> 1.10
drivers/net/tcpip/tcpip/interface.c+11-25MAIN1.2 -> 1.3
                       /main.c+4-1MAIN1.27 -> 1.28
                       /memtrack.c+1MAIN1.3 -> 1.4
                       /ninfo.c+8-16MAIN1.2 -> 1.3
drivers/net/afd/afd/bind.c+3-2arty_afd_200407091.1.2.3 -> 1.1.2.4
                   /connect.c+3-2arty_afd_200407091.1.2.3 -> 1.1.2.4
                   /context.c+3-3arty_afd_200407091.1.2.1 -> 1.1.2.2
                   /info.c+2-3arty_afd_200407091.1.2.2 -> 1.1.2.3
                   /listen.c+3-2arty_afd_200407091.1.2.2 -> 1.1.2.3
                   /lock.c+23-6arty_afd_200407091.1.2.2 -> 1.1.2.3
                   /read.c+8-4arty_afd_200407091.1.2.3 -> 1.1.2.4
                   /write.c+12-6arty_afd_200407091.1.2.5 -> 1.1.2.6
+172-137
25 modified files
msafd + afd: Changed type of PVOID args to PAFD_WSABUF, avoiding some casts.
Added some tracing.
Converted afd.sys to use METHOD_NEITHER in the correct places.
oskittcp: Added some tracking in tcp_input and tcp_output to help look for
the ack bug.
tcpip: some cleaning.  Realized that an NTE was getting sent to IPReceive as
the Context parameter, but was later treated as IP_INTERFACE.  Changed
prototypes to keep this from happening again. 

reactos/include/afd
shared.h 1.7.16.4 -> 1.7.16.5
diff -u -r1.7.16.4 -r1.7.16.5
--- shared.h	16 Jul 2004 14:35:21 -0000	1.7.16.4
+++ shared.h	18 Jul 2004 22:03:48 -0000	1.7.16.5
@@ -13,8 +13,8 @@
 /* Extra definition of WSABUF for AFD so that I don't have to include any
  * userland winsock headers. */
 typedef struct _AFD_WSABUF {
-    PCHAR buf;
     UINT  len;
+    PCHAR buf;
 } AFD_WSABUF, *PAFD_WSABUF;
 
 typedef struct _AFD_CREATE_PACKET {

reactos/lib/msafd/misc
dllmain.c 1.13.10.2 -> 1.13.10.3
diff -u -r1.13.10.2 -r1.13.10.3
--- dllmain.c	16 Jul 2004 22:35:22 -0000	1.13.10.2
+++ dllmain.c	18 Jul 2004 22:03:48 -0000	1.13.10.3
@@ -244,6 +244,8 @@
 	return (SOCKET)Sock;
 
 error:
+	AFD_DbgPrint(MID_TRACE,("Ending\n"));
+
 	return 0;
 }
 
@@ -740,6 +742,8 @@
 	UINT						BindAddressLength;
 	PSOCKADDR					BindAddress;
 
+	AFD_DbgPrint(MID_TRACE,("Called\n"));
+
 	/* Get the Socket Structure associate to this Socket*/
 	Socket = GetSocketStructure(Handle);
 
@@ -828,6 +832,8 @@
 										lpCalleeData->len);
 	 }
 
+	AFD_DbgPrint(MID_TRACE,("Ending\n"));
+
 	return STATUS_SUCCESS;
 }
 int
@@ -843,6 +849,8 @@
 	PSOCKET_INFORMATION			Socket = NULL;
 	NTSTATUS					Status;
 
+	AFD_DbgPrint(MID_TRACE,("Called\n"));
+
 	/* Get the Socket Structure associate to this Socket*/
 	Socket = GetSocketStructure(Handle);
 
@@ -885,6 +893,8 @@
 		WaitForSingleObject(SockEvent, 0);
 	}
 
+	AFD_DbgPrint(MID_TRACE,("Ending\n"));
+
 	return 0;
 }
 

reactos/lib/msafd/misc
helpers.c 1.9.12.4 -> 1.9.12.5
diff -u -r1.9.12.4 -r1.9.12.5
--- helpers.c	17 Jul 2004 16:09:16 -0000	1.9.12.4
+++ helpers.c	18 Jul 2004 22:03:48 -0000	1.9.12.5
@@ -35,6 +35,8 @@
     PLIST_ENTRY	        Helpers;
     INT                 Status;
 
+    AFD_DbgPrint(MID_TRACE,("Called\n"));
+
     /* Check in our Current Loaded Helpers */
     for (Helpers = SockHelpersListHead.Flink;
          Helpers != &SockHelpersListHead; 
@@ -160,6 +162,8 @@
     ULONG               MappingSize;
     LONG                Status;
 
+    AFD_DbgPrint(MID_TRACE,("Called: TransportName %ws\n", TransportName));
+
     /* Allocate a Buffer */
     TransportKey = HeapAlloc(GlobalHeap, 0, (54 + wcslen(TransportName)) * sizeof(WCHAR));
 
@@ -227,6 +231,8 @@
     HKEY	KeyHandle;
     LONG	Status;
 
+    AFD_DbgPrint(MID_TRACE,("Called\n"));
+    
     /* Open the Transports Key */
     Status = RegOpenKeyExW (HKEY_LOCAL_MACHINE,
                             L"SYSTEM\\CurrentControlSet\\Services\\Winsock\\Parameters",  
@@ -486,15 +492,25 @@
     /* The Windows version returns more detailed information on which of the 3 parameters failed...we should do this later */
     ULONG    Row;
     
+    AFD_DbgPrint(MID_TRACE,("Called, Mapping rows = %d\n", Mapping->Rows));
+
     /* Loop through Mapping to Find a matching one */
     for (Row = 0; Row < Mapping->Rows; Row++) {
+	AFD_DbgPrint(MID_TRACE,("Examining: row %d: AF %d type %d proto %d\n",
+				Row,
+				(INT)Mapping->Mapping[Row].AddressFamily,
+				(INT)Mapping->Mapping[Row].SocketType,
+				(INT)Mapping->Mapping[Row].Protocol));
+
         /* Check of all three values Match */
         if (((INT)Mapping->Mapping[Row].AddressFamily == AddressFamily) && 
             ((INT)Mapping->Mapping[Row].SocketType == SocketType) && 
             ((INT)Mapping->Mapping[Row].Protocol == Protocol)) {
+	    AFD_DbgPrint(MID_TRACE,("Found\n"));
             return TRUE;
         }
     }
+    AFD_DbgPrint(MID_TRACE,("Not found\n"));
     return FALSE;
 }
 

reactos/drivers/lib/oskittcp
makefile 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- makefile	29 May 2004 00:15:44 -0000	1.1
+++ makefile	18 Jul 2004 22:03:48 -0000	1.2
@@ -1,6 +1,6 @@
 
 
-# $Id: makefile,v 1.1 2004/05/29 00:15:44 sedwards Exp $
+# $Id: makefile,v 1.2 2004/07/18 22:03:48 arty Exp $
 
 PATH_TO_TOP = ../../..
 
@@ -10,7 +10,8 @@
 
 TARGET_NAME = oskittcp
 
-TARGET_CFLAGS = -g -D__REACTOS__=1 -DKERNEL -Iinclude/freebsd -Iinclude/freebsd/sys/include -Iinclude/freebsd/src/sys -Iinclude/freebsd/dev/include -Iinclude/freebsd/net/include -Iinclude -I$(PATH_TO_TOP)/w32api/include -I$(PATH_TO_TOP)/include -DMEMTRACK
+#-DMEMTRACK
+TARGET_CFLAGS = -g -D__REACTOS__=1 -DKERNEL -Iinclude/freebsd -Iinclude/freebsd/sys/include -Iinclude/freebsd/src/sys -Iinclude/freebsd/dev/include -Iinclude/freebsd/net/include -Iinclude -I$(PATH_TO_TOP)/w32api/include -I$(PATH_TO_TOP)/include
 
 # require os code to explicitly request A/W version of structs/functions
 TARGET_CFLAGS += -D_DISABLE_TIDENTS

reactos/drivers/lib/oskittcp/oskittcp
tcp_input.c 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- tcp_input.c	8 Jul 2004 06:39:30 -0000	1.3
+++ tcp_input.c	18 Jul 2004 22:03:48 -0000	1.4
@@ -195,9 +195,9 @@
 	if (ti == (struct tcpiphdr *)tp || ti->ti_seq != tp->rcv_nxt)
 		return (0);
 	do {
-		tp->rcv_nxt += ti->ti_len;
-		OS_DbgPrint(OSK_MID_TRACE,("Added %d to rcv_nxt\n",
-					   ti->ti_len));
+		tp->rcv_nxt += ti->ti_len - sizeof( struct ip );
+		OS_DbgPrint(OSK_MID_TRACE,("Added %d to rcv_nxt (result %d)\n",
+					   ti->ti_len - sizeof(struct ip), tp->rcv_nxt));
 		flags = ti->ti_flags & TH_FIN;
 		remque(ti);
 		m = REASS_MBUF(ti);
@@ -598,7 +598,8 @@
 			 * we have enough buffer space to take it.
 			 */
 			++tcpstat.tcps_preddat;
-			tp->rcv_nxt += ti->ti_len;
+			tp->rcv_nxt += ti->ti_len - sizeof(struct ip);
+			OS_DbgPrint(OSK_MID_TRACE,("Added %d to rcv_nxt\n", ti->ti_len - sizeof(struct ip)));
 			tcpstat.tcps_rcvpack++;
 			tcpstat.tcps_rcvbyte += ti->ti_len;
 			/*

reactos/drivers/lib/oskittcp/oskittcp
tcp_output.c 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- tcp_output.c	9 Jun 2004 18:11:37 -0000	1.2
+++ tcp_output.c	18 Jul 2004 22:03:48 -0000	1.3
@@ -570,6 +570,7 @@
 		ti->ti_seq = htonl(tp->snd_max);
 
 	ti->ti_ack = htonl(tp->rcv_nxt);
+	printf("ti->ti_ack = %d\n", ti->ti_ack);
 
 	if (optlen) {
 		(void)memcpy(ti + 1, opt, optlen);

reactos/drivers/net/tcpip
makefile 1.17 -> 1.18
diff -u -r1.17 -r1.18
--- makefile	9 Jun 2004 18:11:37 -0000	1.17
+++ makefile	18 Jul 2004 22:03:49 -0000	1.18
@@ -1,4 +1,4 @@
-# $Id: makefile,v 1.17 2004/06/09 18:11:37 arty Exp $
+# $Id: makefile,v 1.18 2004/07/18 22:03:49 arty Exp $
 
 PATH_TO_TOP = ../../..
 
@@ -8,10 +8,10 @@
 
 TARGET_NAME = tcpip
 
+# -DMEMTRACK
 TARGET_CFLAGS = \
 	-D__USE_W32API \
 	-DNDIS40 \
-	-DMEMTRACK \
 	-I./include \
 	-I$(PATH_TO_TOP)/drivers/lib/oskittcp/include \
 	-I$(PATH_TO_TOP)/w32api/include \

reactos/drivers/net/tcpip/include
ip.h 1.11 -> 1.12
diff -u -r1.11 -r1.12
--- ip.h	9 Jun 2004 18:11:37 -0000	1.11
+++ ip.h	18 Jul 2004 22:03:49 -0000	1.12
@@ -148,12 +148,12 @@
 /* Information about an IP interface */
 typedef struct _IP_INTERFACE {
     DEFINE_TAG
+    LIST_ENTRY NTEListHead;       /* List of NTEs on this interface */
+    LIST_ENTRY ADEListHead;       /* List of ADEs on this interface */
     LIST_ENTRY ListEntry;         /* Entry on list */
     ULONG RefCount;               /* Reference count */
     OBJECT_FREE_ROUTINE Free;     /* Routine used to free resources used by the object */
     KSPIN_LOCK Lock;              /* Spin lock for this object */
-    LIST_ENTRY NTEListHead;       /* List of NTEs on this interface */
-    LIST_ENTRY ADEListHead;       /* List of ADEs on this interface */
     PVOID Context;                /* Pointer to link layer context information */
     UINT  HeaderSize;             /* Size of link level header */
     UINT  MinFrameSize;           /* Minimum frame size in bytes */
@@ -239,7 +239,7 @@
     PVOID SystemArgument2);
 
 VOID IPDispatchProtocol(
-    PNET_TABLE_ENTRY NTE,
+    PIP_INTERFACE IF,
     PIP_PACKET IPPacket);
 
 VOID IPRegisterProtocol(

reactos/drivers/net/tcpip/include
memtrack.h 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- memtrack.h	9 Jun 2004 18:11:37 -0000	1.2
+++ memtrack.h	18 Jul 2004 22:03:49 -0000	1.3
@@ -69,6 +69,11 @@
 #define TrackDump()
 #define Untrack(x)
 #define TrackTag(x)
+#define exAllocatePoolWithTag(x,y,z) ExAllocatePoolWithTag(x,y,z)
+#define exAllocatePool(x,y) ExAllocatePool(x,y)
+#define exFreePool(x) ExFreePool(x)
+#define TrackWithTag(w,x,y,z)
+#define UntrackFL(x,y,z)
 #endif
 
 #endif/*MEMMTRAC_H*/

reactos/drivers/net/tcpip/include
receive.h 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- receive.h	4 Jul 2001 20:40:22 -0000	1.3
+++ receive.h	18 Jul 2004 22:03:49 -0000	1.4
@@ -56,7 +56,7 @@
     VOID);
 
 VOID IPReceive(
-    PVOID Context,
+    PIP_INTERFACE IF,
     PIP_PACKET IPPacket);
 
 #endif /* __RECEIVE_H */

reactos/drivers/net/tcpip/network
ip.c 1.10 -> 1.11
diff -u -r1.10 -r1.11
--- ip.c	9 Jun 2004 18:11:38 -0000	1.10
+++ ip.c	18 Jul 2004 22:03:49 -0000	1.11
@@ -19,7 +19,7 @@
 #include <route.h>
 #include <icmp.h>
 #include <pool.h>
-
+#include <tilists.h>
 
 KTIMER IPTimer;
 KDPC IPTimeoutDpc;
@@ -534,10 +534,8 @@
  */
 {
     KIRQL OldIrql;
-    PLIST_ENTRY CurrentIFEntry;
-    PLIST_ENTRY CurrentADEEntry;
-    PIP_INTERFACE CurrentIF;
-    PADDRESS_ENTRY CurrentADE;
+    IF_LIST_ITER(CurrentIF);
+    ADE_LIST_ITER(CurrentADE);
 
 //    TI_DbgPrint(DEBUG_IP, ("Called. Address (0x%X)  AddressType (0x%X).\n",
 //        Address, AddressType));
@@ -547,24 +545,17 @@
     KeAcquireSpinLock(&InterfaceListLock, &OldIrql);
 
     /* Search the interface list */
-    CurrentIFEntry = InterfaceListHead.Flink;
-    while (CurrentIFEntry != &InterfaceListHead) {
-	      CurrentIF = CONTAINING_RECORD(CurrentIFEntry, IP_INTERFACE, ListEntry);
-
+    ForEachInterface(CurrentIF) {
         /* Search the address entry list and return the ADE if found */
-        CurrentADEEntry = CurrentIF->ADEListHead.Flink;
-        while (CurrentADEEntry != &CurrentIF->ADEListHead) {
-	        CurrentADE = CONTAINING_RECORD(CurrentADEEntry, ADDRESS_ENTRY, ListEntry);
+	ForEachADE(CurrentIF->ADEListHead,CurrentADE) {
             if ((AddrIsEqual(Address, CurrentADE->Address)) && 
                 (CurrentADE->Type == AddressType)) {
                 ReferenceObject(CurrentADE);
                 KeReleaseSpinLock(&InterfaceListLock, OldIrql);
                 return CurrentADE;
             }
-            CurrentADEEntry = CurrentADEEntry->Flink;
-        }
-        CurrentIFEntry = CurrentIFEntry->Flink;
-    }
+        } EndFor(CurrentADE);
+    } EndFor(CurrentIF);
 
     KeReleaseSpinLock(&InterfaceListLock, OldIrql);
 
@@ -586,10 +577,8 @@
  */
 {
     KIRQL OldIrql;
-    PLIST_ENTRY CurrentIFEntry;
-    PLIST_ENTRY CurrentADEEntry;
-    PIP_INTERFACE CurrentIF;
-    PADDRESS_ENTRY CurrentADE;
+    ADE_LIST_ITER(CurrentADE);
+    IF_LIST_ITER(CurrentIF);
     BOOLEAN LoopbackIsRegistered = FALSE;
 
     TI_DbgPrint(DEBUG_IP, ("Called. AddressType (0x%X).\n", AddressType));
@@ -597,38 +586,30 @@
     KeAcquireSpinLock(&InterfaceListLock, &OldIrql);
 
     /* Search the interface list */
-    CurrentIFEntry = InterfaceListHead.Flink;
-    while (CurrentIFEntry != &InterfaceListHead) {
-	      CurrentIF = CONTAINING_RECORD(CurrentIFEntry, IP_INTERFACE, ListEntry);
-
+    ForEachInterface(CurrentIF) {
         if (CurrentIF != Loopback) {
             /* Search the address entry list and return the first appropriate ADE found */
-            CurrentADEEntry = CurrentIF->ADEListHead.Flink;
-            while (CurrentADEEntry != &CurrentIF->ADEListHead) {
-	            CurrentADE = CONTAINING_RECORD(CurrentADEEntry, ADDRESS_ENTRY, ListEntry);
-                if (CurrentADE->Type == AddressType)
+	    TI_DbgPrint(DEBUG_IP,("Checking interface %x\n", CurrentIF));
+	    ForEachADE(CurrentIF->ADEListHead,CurrentADE) {
+                if (CurrentADE->Type == AddressType) {
                     ReferenceObject(CurrentADE);
                     KeReleaseSpinLock(&InterfaceListLock, OldIrql);
                     return CurrentADE;
                 }
-                CurrentADEEntry = CurrentADEEntry->Flink;
+	    } EndFor(CurrentADE);
         } else
             LoopbackIsRegistered = TRUE;
-        CurrentIFEntry = CurrentIFEntry->Flink;
-    }
+    } EndFor(CurrentIF);
 
     /* No address was found. Use loopback interface if available */
     if (LoopbackIsRegistered) {
-        CurrentADEEntry = Loopback->ADEListHead.Flink;
-        while (CurrentADEEntry != &Loopback->ADEListHead) {
-	        CurrentADE = CONTAINING_RECORD(CurrentADEEntry, ADDRESS_ENTRY, ListEntry);
+	ForEachADE(CurrentIF->ADEListHead,CurrentADE) {
             if (CurrentADE->Type == AddressType) {
                 ReferenceObject(CurrentADE);
                 KeReleaseSpinLock(&InterfaceListLock, OldIrql);
                 return CurrentADE;
             }
-            CurrentADEEntry = CurrentADEEntry->Flink;
-        }
+        } EndFor(CurrentADE);
     }
 
     KeReleaseSpinLock(&InterfaceListLock, OldIrql);
@@ -665,7 +646,7 @@
 
 
 VOID IPDispatchProtocol(
-    PNET_TABLE_ENTRY NTE,
+    PIP_INTERFACE IPInterface,
     PIP_PACKET IPPacket)
 /*
  * FUNCTION: IP protocol dispatcher
@@ -692,7 +673,7 @@
     }
 
     /* Call the appropriate protocol handler */
-    (*ProtocolTable[Protocol])(NTE, IPPacket);
+    (*ProtocolTable[Protocol])(IPInterface, IPPacket);
 }
 
 
@@ -850,7 +831,10 @@
     }
 
     /* Add interface to the global interface list */
-    ExInterlockedInsertTailList(&InterfaceListHead, &IF->ListEntry, &InterfaceListLock);
+    ASSERT(&IF->ListEntry);
+    ExInterlockedInsertTailList(&InterfaceListHead, 
+				&IF->ListEntry, 
+				&InterfaceListLock);
 
     KeReleaseSpinLock(&IF->Lock, OldIrql);
 

reactos/drivers/net/tcpip/network
neighbor.c 1.5 -> 1.6
diff -u -r1.5 -r1.6
--- neighbor.c	9 Jun 2004 18:11:38 -0000	1.5
+++ neighbor.c	18 Jul 2004 22:03:49 -0000	1.6
@@ -228,15 +228,24 @@
           a request for the neighbor */
 
       /* FIXME: Choose first NTE. We might want to give an NTE as argument */
-      CurrentEntry = NCE->Interface->NTEListHead.Flink;
-      if (!IsListEmpty(CurrentEntry))
+      if (!NCE->Interface || !NCE->Interface->NTEListHead.Flink) {
+	  TI_DbgPrint(MID_TRACE, 
+		      ("NCE->Interface: %x, "
+		       "NCE->Interface->NTEListHead.Flink %x\n",
+		       NCE->Interface,
+		       NCE->Interface ? NCE->Interface->NTEListHead.Flink : 0));
+      }
+      if (!IsListEmpty(&NCE->Interface->NTEListHead))
         {
-          NTE = CONTAINING_RECORD(CurrentEntry, NET_TABLE_ENTRY, IFListEntry);
-          ARPTransmit(NCE->Address, NTE);
+	    CurrentEntry = NCE->Interface->NTEListHead.Flink;
+	    NTE = CONTAINING_RECORD(CurrentEntry, NET_TABLE_ENTRY, 
+				    IFListEntry);
+	    ARPTransmit(NCE->Address, NTE);
         }
       else
         {
-          TI_DbgPrint(MIN_TRACE, ("Interface at 0x%X has zero NTE.\n", NCE->Interface));
+	    TI_DbgPrint(MIN_TRACE, ("Interface at 0x%X has zero NTE.\n", 
+				    NCE->Interface));
         }
     }
   else

reactos/drivers/net/tcpip/network
receive.c 1.9 -> 1.10
diff -u -r1.9 -r1.10
--- receive.c	9 Jun 2004 18:11:38 -0000	1.9
+++ receive.c	18 Jul 2004 22:03:49 -0000	1.10
@@ -479,7 +479,7 @@
     DISPLAY_IP_PACKET(Datagram);
 
     /* Give the packet to the protocol dispatcher */
-    IPDispatchProtocol(NTE, Datagram);
+    IPDispatchProtocol(IF, Datagram);
 
     /* We're done with this datagram */
     exFreePool(Datagram->Header);
@@ -529,9 +529,7 @@
 {
 }
 
-VOID IPv4Receive(
-  PVOID Context,
-  PIP_PACKET IPPacket)
+VOID IPv4Receive( PIP_INTERFACE IF, PIP_PACKET IPPacket)
 /*
  * FUNCTION: Receives an IPv4 datagram (or fragment)
  * ARGUMENTS:
@@ -580,11 +578,11 @@
     /* FIXME: Possibly forward packets with multicast addresses */
     
     /* FIXME: Should we allow packets to be received on the wrong interface? */
-    NTE = IPLocateNTEOnInterface((PIP_INTERFACE)Context, &IPPacket->DstAddr, &AddressType);
+    NTE = IPLocateNTEOnInterface(IF, &IPPacket->DstAddr, &AddressType);
     
     if (NTE) {
 	/* This packet is destined for us */
-	ProcessFragment((PIP_INTERFACE)Context, IPPacket, NTE);
+	ProcessFragment(IF, IPPacket, NTE);
 	
 	/* Done with this NTE */
 	DereferenceObject(NTE);
@@ -608,12 +606,11 @@
 }
 
 
-VOID IPReceive( PVOID Context,
-	        PIP_PACKET IPPacket )
+VOID IPReceive( PIP_INTERFACE IF, PIP_PACKET IPPacket )
 /*
  * FUNCTION: Receives an IP datagram (or fragment)
  * ARGUMENTS:
- *     Context  = Pointer to context information (IP_INTERFACE)
+ *     IF       = Interface
  *     IPPacket = Pointer to IP packet
  */
 {
@@ -625,7 +622,7 @@
   switch (Version) {
   case 4:
     IPPacket->Type = IP_ADDRESS_V4;
-    IPv4Receive(Context, IPPacket);
+    IPv4Receive(IF, IPPacket);
     break;
   case 6:
     IPPacket->Type = IP_ADDRESS_V6;

reactos/drivers/net/tcpip/tcpip
interface.c 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- interface.c	9 Jun 2004 18:11:38 -0000	1.2
+++ interface.c	18 Jul 2004 22:03:49 -0000	1.3
@@ -14,24 +14,19 @@
 #include <address.h>
 #include <pool.h>
 #include <ip.h>
+#include <tilists.h>
 
 NTSTATUS GetInterfaceIPv4Address( PIP_INTERFACE Interface, 
 				  ULONG TargetType,
 				  PULONG Address ) {
-    PLIST_ENTRY CurrentIFEntry;
-    PLIST_ENTRY CurrentADEEntry;
-    PADDRESS_ENTRY CurrentADE;
-    
-    CurrentADEEntry = Interface->ADEListHead.Flink;
-    while (CurrentADEEntry != &Interface->ADEListHead)
-    {
-	CurrentADE = CONTAINING_RECORD(CurrentADEEntry, ADDRESS_ENTRY, ListEntry);
+    ADE_LIST_ITER(CurrentADE);
+
+    ForEachADE(Interface->ADEListHead,CurrentADE) {
 	if (CurrentADE->Type == TargetType) {
 	    *Address = CurrentADE->Address->Address.IPv4Address;
 	    return STATUS_SUCCESS;
 	}
-	CurrentADEEntry = CurrentADEEntry->Flink;
-    }
+    } EndFor(CurrentADE);
     
     return STATUS_UNSUCCESSFUL;
 }
@@ -39,15 +34,13 @@
 UINT CountInterfaces() {
     DWORD Count = 0;
     KIRQL OldIrql;
-    PLIST_ENTRY CurrentIFEntry;
+    IF_LIST_ITER(CurrentIF);
 
     KeAcquireSpinLock(&InterfaceListLock, &OldIrql);
     
-    CurrentIFEntry = InterfaceListHead.Flink;
-    while (CurrentIFEntry != &InterfaceListHead) {
+    ForEachInterface(CurrentIF) {
 	Count++;
-	CurrentIFEntry = CurrentIFEntry->Flink;
-    }
+    } EndFor(CurrentIF);
 
     KeReleaseSpinLock(&InterfaceListLock, OldIrql);
 
@@ -56,19 +49,12 @@
 
 UINT CountInterfaceAddresses( PIP_INTERFACE Interface ) {
     UINT AddrCount = 0;
-    PADDRESS_ENTRY CurrentADE;
-    PLIST_ENTRY CurrentADEntry;
+    ADE_LIST_ITER(CurrentADE);
 
-    CurrentADEntry = Interface->ADEListHead.Flink;
-    
-    while( CurrentADEntry != &Interface->ADEListHead ) {
-	CurrentADEntry = CurrentADEntry->Flink;
-	CurrentADE = CONTAINING_RECORD(CurrentADEntry, 
-				       ADDRESS_ENTRY, 
-				       ListEntry);
+    ForEachADE(Interface->ADEListHead,CurrentADE) {
 	if( CurrentADE->Type == ADE_UNICAST )
 	    AddrCount++;
-    }
+    } EndFor(CurrentADE);
 
     return AddrCount;
 }

reactos/drivers/net/tcpip/tcpip
main.c 1.27 -> 1.28
diff -u -r1.27 -r1.28
--- main.c	15 Jul 2004 03:21:47 -0000	1.27
+++ main.c	18 Jul 2004 22:03:49 -0000	1.28
@@ -20,7 +20,7 @@
 #include <info.h>
 #include <memtrack.h>
 
-#define NDEBUG
+//#define NDEBUG
 
 #ifndef NDEBUG
 DWORD DebugTraceLevel = 0x7fffffff;
@@ -208,7 +208,9 @@
 
 	/* XXX This should probably be done in IoCreateFile() */
     /* Parameter checks */
+
     Address = (PTA_IP_ADDRESS)(EaInfo->EaName + EaInfo->EaNameLength + 1); //0-term
+
     if ((EaInfo->EaValueLength < sizeof(TA_IP_ADDRESS)) ||
       (Address->TAAddressCount != 1) ||
       (Address->Address[0].AddressLength < TDI_ADDRESS_LENGTH_IP) ||
@@ -227,6 +229,7 @@
 CP
     /* Open address file object */
 
+
     /* Protocol depends on device object so find the protocol */
     if (DeviceObject == TCPDeviceObject)
       Protocol = IPPROTO_TCP;

reactos/drivers/net/tcpip/tcpip
memtrack.c 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- memtrack.c	12 Jun 2004 04:46:18 -0000	1.3
+++ memtrack.c	18 Jul 2004 22:03:49 -0000	1.4
@@ -5,6 +5,7 @@
 #include <memtrack.h>
 
 #ifdef MEMTRACK
+
 LIST_ENTRY AllocatedObjectsList;
 KSPIN_LOCK AllocatedObjectsLock;
 DWORD TagsToShow[MEMTRACK_MAX_TAGS_TO_TRACK] = { 0 };

reactos/drivers/net/tcpip/tcpip
ninfo.c 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- ninfo.c	9 Jun 2004 18:11:38 -0000	1.2
+++ ninfo.c	18 Jul 2004 22:03:49 -0000	1.3
@@ -15,11 +15,12 @@
 #include <prefix.h>
 #include <ip.h>
 #include <route.h>
+#include <tilists.h>
 
 TDI_STATUS InfoTdiQueryGetAddrTable( PNDIS_BUFFER Buffer, 
 				     PUINT BufferSize ) {
-    PIP_INTERFACE CurrentIF;
-    PLIST_ENTRY CurrentIFEntry;
+    
+    IF_LIST_ITER(CurrentIF);
     TDI_STATUS Status = TDI_INVALID_REQUEST;
     KIRQL OldIrql;
     UINT Count = 1; /* Start adapter indices at 1 */
@@ -32,11 +33,7 @@
     
     KeAcquireSpinLock(&InterfaceListLock, &OldIrql);
     
-    CurrentIFEntry = InterfaceListHead.Flink;
-    while (CurrentIFEntry != &InterfaceListHead)
-    {
-	CurrentIF = CONTAINING_RECORD(CurrentIFEntry, IP_INTERFACE, ListEntry);
-
+    ForEachInterface(CurrentIF) {
 	IpCurrent->Index     = Count;
 	IpCurrent->Addr      = 0;
 	IpCurrent->BcastAddr = 0;
@@ -53,9 +50,8 @@
 				 ADE_ADDRMASK,
 				 &IpAddress->Mask );
 	IpCurrent++;
-	CurrentIFEntry = CurrentIFEntry->Flink;
 	Count++;
-    }
+    } EndFor(CurrentIF);
     
     KeReleaseSpinLock(&InterfaceListLock, OldIrql);
 
@@ -155,8 +151,7 @@
 TDI_STATUS InfoTdiQueryGetIPSnmpInfo( PNDIS_BUFFER Buffer,
 				      PUINT BufferSize ) {
     KIRQL OldIrql;
-    PIP_INTERFACE CurrentIF;
-    PLIST_ENTRY CurrentIFEntry;
+    IF_LIST_ITER(CurrentIF);
     IPSNMP_INFO SnmpInfo;
     UINT IfCount = CountInterfaces();
     UINT AddrCount = 0;
@@ -171,13 +166,10 @@
     AddrCount = 0;
     KeAcquireSpinLock(&InterfaceListLock, &OldIrql);
     
-    CurrentIFEntry = InterfaceListHead.Flink;
-    while (CurrentIFEntry != &InterfaceListHead)
-    {
+    ForEachInterface(CurrentIF) {
 	CurrentIF = CONTAINING_RECORD(CurrentIFEntry, IP_INTERFACE, ListEntry);
 	AddrCount += CountInterfaceAddresses( CurrentIF );
-	CurrentIFEntry = CurrentIFEntry->Flink;
-    }
+    } EndFor(CurrentIF);
     
     KeReleaseSpinLock(&InterfaceListLock, OldIrql);
     

reactos/drivers/net/afd/afd
bind.c 1.1.2.3 -> 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- bind.c	16 Jul 2004 14:35:21 -0000	1.1.2.3
+++ bind.c	18 Jul 2004 22:03:49 -0000	1.1.2.4
@@ -1,4 +1,4 @@
-/* $Id: bind.c,v 1.1.2.3 2004/07/16 14:35:21 arty Exp $
+/* $Id: bind.c,v 1.1.2.4 2004/07/18 22:03:49 arty Exp $
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
  * FILE:             drivers/net/afd/afd/bind.c
@@ -43,7 +43,8 @@
     NTSTATUS Status = STATUS_SUCCESS;
     PFILE_OBJECT FileObject = IrpSp->FileObject;
     PAFD_FCB FCB = FileObject->FsContext;
-    PAFD_BIND_DATA BindReq = Irp->AssociatedIrp.SystemBuffer;
+    PAFD_BIND_DATA BindReq = 
+	IrpSp->Parameters.DeviceIoControl.Type3InputBuffer;
     
     AFD_DbgPrint(MID_TRACE,("Called\n"));
     

reactos/drivers/net/afd/afd
connect.c 1.1.2.3 -> 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- connect.c	16 Jul 2004 14:35:21 -0000	1.1.2.3
+++ connect.c	18 Jul 2004 22:03:49 -0000	1.1.2.4
@@ -1,4 +1,4 @@
-/* $Id: connect.c,v 1.1.2.3 2004/07/16 14:35:21 arty Exp $
+/* $Id: connect.c,v 1.1.2.4 2004/07/18 22:03:49 arty Exp $
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
  * FILE:             drivers/net/afd/afd/connect.c
@@ -126,7 +126,8 @@
     NTSTATUS Status = STATUS_INVALID_PARAMETER;
     PFILE_OBJECT FileObject = IrpSp->FileObject;
     PAFD_FCB FCB = FileObject->FsContext;
-    PAFD_CONNECT_INFO ConnectReq = Irp->AssociatedIrp.SystemBuffer;
+    PAFD_CONNECT_INFO ConnectReq = 
+	IrpSp->Parameters.DeviceIoControl.Type3InputBuffer;
     AFD_DbgPrint(MID_TRACE,("Called on %x\n", FCB));
 
     if( !SocketAcquireStateLock( FCB ) ) return LostSocket( Irp );

reactos/drivers/net/afd/afd
context.c 1.1.2.1 -> 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- context.c	9 Jul 2004 04:41:18 -0000	1.1.2.1
+++ context.c	18 Jul 2004 22:03:49 -0000	1.1.2.2
@@ -1,4 +1,4 @@
-/* $Id: context.c,v 1.1.2.1 2004/07/09 04:41:18 arty Exp $
+/* $Id: context.c,v 1.1.2.2 2004/07/18 22:03:49 arty Exp $
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
  * FILE:             drivers/net/afd/afd/context.c
@@ -25,7 +25,7 @@
     if( FCB->ContextSize < ContextSize ) ContextSize = FCB->ContextSize;
     
     if( FCB->Context ) {
-	RtlCopyMemory( Irp->AssociatedIrp.SystemBuffer,
+	RtlCopyMemory( Irp->UserBuffer,
 		       FCB->Context,
 		       ContextSize );
 	Status = STATUS_SUCCESS;
@@ -58,7 +58,7 @@
     if( FCB->Context ) {
 	Status = STATUS_SUCCESS;
 	RtlCopyMemory( FCB->Context, 
-		       Irp->AssociatedIrp.SystemBuffer,
+		       IrpSp->Parameters.DeviceIoControl.Type3InputBuffer,
 		       IrpSp->Parameters.DeviceIoControl.InputBufferLength );
     }
 

reactos/drivers/net/afd/afd
info.c 1.1.2.2 -> 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- info.c	16 Jul 2004 14:35:21 -0000	1.1.2.2
+++ info.c	18 Jul 2004 22:03:49 -0000	1.1.2.3
@@ -1,4 +1,4 @@
-/* $Id: info.c,v 1.1.2.2 2004/07/16 14:35:21 arty Exp $
+/* $Id: info.c,v 1.1.2.3 2004/07/18 22:03:49 arty Exp $
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
  * FILE:             drivers/net/afd/afd/info.c
@@ -16,7 +16,7 @@
 AfdGetInfo( PDEVICE_OBJECT DeviceObject, PIRP Irp, 
 	    PIO_STACK_LOCATION IrpSp ) {
     NTSTATUS Status = STATUS_SUCCESS;
-    PAFD_INFO InfoReq = Irp->AssociatedIrp.SystemBuffer;
+    PAFD_INFO InfoReq = IrpSp->Parameters.DeviceIoControl.Type3InputBuffer;
     PFILE_OBJECT FileObject = IrpSp->FileObject;
     PAFD_FCB FCB = FileObject->FsContext;
 
@@ -50,4 +50,3 @@
 
     return UnlockAndMaybeComplete( FCB, Status, Irp, 0, NULL );
 }
-

reactos/drivers/net/afd/afd
listen.c 1.1.2.2 -> 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- listen.c	16 Jul 2004 14:35:21 -0000	1.1.2.2
+++ listen.c	18 Jul 2004 22:03:49 -0000	1.1.2.3
@@ -1,4 +1,4 @@
-/* $Id: listen.c,v 1.1.2.2 2004/07/16 14:35:21 arty Exp $
+/* $Id: listen.c,v 1.1.2.3 2004/07/18 22:03:49 arty Exp $
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
  * FILE:             drivers/net/afd/afd/listen.c
@@ -28,7 +28,8 @@
     NTSTATUS Status = STATUS_SUCCESS;
     PFILE_OBJECT FileObject = IrpSp->FileObject;
     PAFD_FCB FCB = FileObject->FsContext;
-    PAFD_LISTEN_DATA ListenReq = Irp->AssociatedIrp.SystemBuffer;
+    PAFD_LISTEN_DATA ListenReq = 
+	IrpSp->Parameters.DeviceIoControl.Type3InputBuffer;
 
     AFD_DbgPrint(MID_TRACE,("Called\n"));
 

reactos/drivers/net/afd/afd
lock.c 1.1.2.2 -> 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- lock.c	15 Jul 2004 03:21:47 -0000	1.1.2.2
+++ lock.c	18 Jul 2004 22:03:49 -0000	1.1.2.3
@@ -1,4 +1,4 @@
-/* $Id: lock.c,v 1.1.2.2 2004/07/15 03:21:47 arty Exp $
+/* $Id: lock.c,v 1.1.2.3 2004/07/18 22:03:49 arty Exp $
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
  * FILE:             drivers/net/afd/afd/lock.c
@@ -17,6 +17,9 @@
     /* Copy the buffer array so we don't lose it */
     UINT Size = sizeof(AFD_WSABUF) * Count;
     PAFD_WSABUF NewBuf = ExAllocatePool( PagedPool, Size * 2 );
+    PMDL NewMdl;
+
+    AFD_DbgPrint(MID_TRACE,("Called\n"));
 
     if( NewBuf ) {
 	PAFD_MAPBUF MapBuf = (PAFD_MAPBUF)(NewBuf + Count);
@@ -26,18 +29,32 @@
 	    AFD_DbgPrint(MID_TRACE,("Locking buffer %d (%x:%d)\n",
 				    i, NewBuf[i].buf, NewBuf[i].len));
 
-	    MapBuf[i].Mdl = IoAllocateMdl( NewBuf[i].buf, 
-					   NewBuf[i].len,
-					   FALSE,
-					   FALSE,
-					   NULL );
+	    if( NewBuf[i].len ) {
+		NewMdl = IoAllocateMdl( NewBuf[i].buf, 
+					NewBuf[i].len,
+					FALSE,
+					FALSE,
+					NULL );
+	    } else {
+		MapBuf[i].Mdl = NULL;
+		continue;
+	    }
+
+	    AFD_DbgPrint(MID_TRACE,("NewMdl @ %x\n", NewMdl));
+
+	    MapBuf[i].Mdl = NewMdl;
+
 	    if( MapBuf[i].Mdl ) {
+		AFD_DbgPrint(MID_TRACE,("Probe and lock pages\n"));
 		MmProbeAndLockPages( MapBuf[i].Mdl, KernelMode, 
 				     Write ? IoModifyAccess : IoReadAccess );
+		AFD_DbgPrint(MID_TRACE,("MmProbeAndLock finished\n"));
 	    }
 	}
     }
 
+    AFD_DbgPrint(MID_TRACE,("Leaving %x\n", NewBuf));
+
     return NewBuf;
 }
 

reactos/drivers/net/afd/afd
read.c 1.1.2.3 -> 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- read.c	16 Jul 2004 14:35:21 -0000	1.1.2.3
+++ read.c	18 Jul 2004 22:03:49 -0000	1.1.2.4
@@ -1,4 +1,4 @@
-/* $Id: read.c,v 1.1.2.3 2004/07/16 14:35:21 arty Exp $
+/* $Id: read.c,v 1.1.2.4 2004/07/18 22:03:49 arty Exp $
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
  * FILE:             drivers/net/afd/afd/read.c
@@ -69,6 +69,7 @@
     PAFD_FCB FCB = (PAFD_FCB)Context;
     PLIST_ENTRY NextIrpEntry;
     PIRP NextIrp;
+    PIO_STACK_LOCATION NextIrpSp;
     PAFD_RECV_INFO RecvReq;
     UINT TotalBytesCopied = 0;
 
@@ -96,7 +97,8 @@
 		RemoveHeadList(&FCB->PendingIrpList[FUNCTION_RECV]);
 	    NextIrp = 
 		CONTAINING_RECORD(NextIrpEntry, IRP, Tail.Overlay.ListEntry);
-	    RecvReq = NextIrp->AssociatedIrp.SystemBuffer;
+	    NextIrpSp = IoGetCurrentIrpStackLocation( NextIrp );
+	    RecvReq = NextIrpSp->Parameters.DeviceIoControl.Type3InputBuffer;
 
 	    AFD_DbgPrint(MID_TRACE,("RecvReq @ %x\n", RecvReq));
 
@@ -164,7 +166,8 @@
     NTSTATUS Status = STATUS_INVALID_PARAMETER;
     PFILE_OBJECT FileObject = IrpSp->FileObject;
     PAFD_FCB FCB = FileObject->FsContext;
-    PAFD_RECV_INFO RecvReq = Irp->AssociatedIrp.SystemBuffer;
+    PAFD_RECV_INFO RecvReq = 
+	IrpSp->Parameters.DeviceIoControl.Type3InputBuffer;
     UINT TotalBytesCopied = 0;
 
     AFD_DbgPrint(MID_TRACE,("Called on %x\n", FCB));
@@ -291,7 +294,8 @@
     NTSTATUS Status = STATUS_SUCCESS;
     PFILE_OBJECT FileObject = IrpSp->FileObject;
     PAFD_FCB FCB = FileObject->FsContext;
-    PAFD_RECV_INFO RecvReq = Irp->AssociatedIrp.SystemBuffer;
+    PAFD_RECV_INFO RecvReq = 
+	IrpSp->Parameters.DeviceIoControl.Type3InputBuffer;
     PLIST_ENTRY ListEntry;
     PAFD_STORED_DATAGRAM DatagramRecv;
 

reactos/drivers/net/afd/afd
write.c 1.1.2.5 -> 1.1.2.6
diff -u -r1.1.2.5 -r1.1.2.6
--- write.c	16 Jul 2004 14:35:21 -0000	1.1.2.5
+++ write.c	18 Jul 2004 22:03:49 -0000	1.1.2.6
@@ -1,4 +1,4 @@
-/* $Id: write.c,v 1.1.2.5 2004/07/16 14:35:21 arty Exp $
+/* $Id: write.c,v 1.1.2.6 2004/07/18 22:03:49 arty Exp $
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
  * FILE:             drivers/net/afd/afd/write.c
@@ -21,6 +21,7 @@
     PAFD_FCB FCB = (PAFD_FCB)Context;
     PLIST_ENTRY NextIrpEntry;
     PIRP NextIrp = NULL;
+    PIO_STACK_LOCATION NextIrpSp;
     PAFD_SEND_INFO SendReq;
     PAFD_MAPBUF Map;
     UINT TotalBytesCopied = 0, SpaceAvail, i, CopySize = 0;
@@ -39,7 +40,8 @@
 		RemoveHeadList(&FCB->PendingIrpList[FUNCTION_SEND]);
 	    NextIrp = 
 		CONTAINING_RECORD(NextIrpEntry, IRP, Tail.Overlay.ListEntry);
-	    SendReq = NextIrp->AssociatedIrp.SystemBuffer;
+	    NextIrpSp = IoGetCurrentIrpStackLocation( NextIrp );
+	    SendReq = NextIrpSp->Parameters.DeviceIoControl.Type3InputBuffer;
 
 	    UnlockBuffers( SendReq->BufferArray,
 			   SendReq->BufferCount );
@@ -66,7 +68,8 @@
 	    RemoveHeadList(&FCB->PendingIrpList[FUNCTION_RECV]);
 	NextIrp = 
 	    CONTAINING_RECORD(NextIrpEntry, IRP, Tail.Overlay.ListEntry);
-	SendReq = NextIrp->AssociatedIrp.SystemBuffer;
+	NextIrpSp = IoGetCurrentIrpStackLocation( NextIrp );
+	SendReq = NextIrpSp->Parameters.DeviceIoControl.Type3InputBuffer;
 	Map = (PAFD_MAPBUF)(SendReq->BufferArray + SendReq->BufferCount);
 
 	AFD_DbgPrint(MID_TRACE,("SendReq @ %x\n", SendReq));
@@ -137,7 +140,8 @@
     NTSTATUS Status = STATUS_SUCCESS;
     PFILE_OBJECT FileObject = IrpSp->FileObject;
     PAFD_FCB FCB = FileObject->FsContext;
-    PAFD_SEND_INFO SendReq = Irp->AssociatedIrp.SystemBuffer;
+    PAFD_SEND_INFO SendReq = 
+	IrpSp->Parameters.DeviceIoControl.Type3InputBuffer;
     UINT TotalBytesCopied = 0, i, CopySize = 0, 
 	SpaceAvail = 0, TotalBytesEncountered = 0;
 
@@ -159,7 +163,8 @@
 					SendReq->BufferCount,
 					FALSE );
     
-    AFD_DbgPrint(MID_TRACE,("FCB->Send.BytesUsed = %d\n", FCB->Send.BytesUsed));
+    AFD_DbgPrint(MID_TRACE,("FCB->Send.BytesUsed = %d\n", 
+			    FCB->Send.BytesUsed));
 
     if( !FCB->Send.BytesUsed ) {
 	SpaceAvail = FCB->Send.Size - FCB->Send.BytesUsed;
@@ -231,7 +236,8 @@
     NTSTATUS Status = STATUS_SUCCESS;
     PFILE_OBJECT FileObject = IrpSp->FileObject;
     PAFD_FCB FCB = FileObject->FsContext;
-    PAFD_SEND_INFO_UDP SendReq = Irp->AssociatedIrp.SystemBuffer;
+    PAFD_SEND_INFO_UDP SendReq = 
+	IrpSp->Parameters.DeviceIoControl.Type3InputBuffer;
    
     AFD_DbgPrint(MID_TRACE,("Called on %x\n", FCB));
 
CVSspam 0.2.8