Commit in reactos/drivers/net/ndis on ndis_wip_22102004
Makefile+2-21.22.2.1 -> 1.22.2.2
ndis/protocol.c+6-71.20.6.1 -> 1.20.6.2
+8-9
2 modified files
- Merge from HEAD: The loop in protocol.c was wrong and was rewritten by Andrew Munger with help from Thomas Weidenmueller.
- Remove -DDBG=1 from makefile.

reactos/drivers/net/ndis
Makefile 1.22.2.1 -> 1.22.2.2
diff -u -r1.22.2.1 -r1.22.2.2
--- Makefile	22 Oct 2004 19:52:05 -0000	1.22.2.1
+++ Makefile	23 Nov 2004 18:46:27 -0000	1.22.2.2
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.22.2.1 2004/10/22 19:52:05 navaraf Exp $
+# $Id: Makefile,v 1.22.2.2 2004/11/23 18:46:27 navaraf Exp $
 
 PATH_TO_TOP = ../../..
 
@@ -8,7 +8,7 @@
 
 TARGET_PCH = include/ndissys.h
 
-TARGET_CFLAGS = -I./include -D__USE_W32API -DDBG=1 -Wall -Werror
+TARGET_CFLAGS = -I./include -D__USE_W32API -Wall -Werror
 
 TARGET_CFLAGS += -DNDIS_WRAPPER -DNDIS50 -DNDIS50_MINIPORT -DBINARY_COMPATIBLE
 

reactos/drivers/net/ndis/ndis
protocol.c 1.20.6.1 -> 1.20.6.2
diff -u -r1.20.6.1 -r1.20.6.2
--- protocol.c	22 Oct 2004 19:52:06 -0000	1.20.6.1
+++ protocol.c	23 Nov 2004 18:46:27 -0000	1.20.6.2
@@ -661,7 +661,7 @@
   UINT MinSize;
   HANDLE DriverKeyHandle = NULL;
   PKEY_VALUE_PARTIAL_INFORMATION KeyInformation = NULL;
-  UINT DataOffset = 0;
+  WCHAR *DataPtr;
 
   NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
 
@@ -807,8 +807,9 @@
       }
   }
 
-  DataOffset = 0;
-  while((KeyInformation->Data)[DataOffset])
+  for (DataPtr = (WCHAR *)KeyInformation->Data;
+       *DataPtr != 0;
+       DataPtr += wcslen(DataPtr) + 1)
     {
       /* BindContext is for tracking pending binding operations */
       VOID *BindContext = 0;
@@ -817,7 +818,7 @@
       WCHAR *RegistryPathStr = NULL;
       ULONG PathLength = 0;
 
-      RtlInitUnicodeString(&DeviceName, (WCHAR *)KeyInformation->Data);	/* we know this is 0-term */
+      RtlInitUnicodeString(&DeviceName, DataPtr);	/* we know this is 0-term */
 
       /*
        * RegistryPath should be:
@@ -828,7 +829,7 @@
        */
 
       PathLength = sizeof(SERVICES_KEY) +                               /* \Registry\Machine\System\CurrentControlSet\Services\ */
-          wcslen( ((WCHAR *)KeyInformation->Data)+8 ) * sizeof(WCHAR) + /* Adapter1  (extracted from \Device\Adapter1)          */
+          wcslen( DataPtr + 8 ) * sizeof(WCHAR) + /* Adapter1  (extracted from \Device\Adapter1)          */
           sizeof(PARAMETERS_KEY) +                                      /* \Parameters\                                         */
           ProtocolCharacteristics->Name.Length;                         /* Tcpip                                                */
 
@@ -881,8 +882,6 @@
           // what to do here?
         }
        */
-
-      DataOffset += wcslen((WCHAR *)KeyInformation->Data);
     }
 
   *Status             = NDIS_STATUS_SUCCESS;
CVSspam 0.2.8