Fix DHCP from crashing, silence tcp and iphlp
Modified: trunk/reactos/drivers/net/tcpip/tcpip/main.c
Modified: trunk/reactos/lib/iphlpapi/ifenum_reactos.c
Modified: trunk/reactos/lib/ws2_32/misc/dllmain.c
Modified: trunk/reactos/subsys/system/dhcp/dispatch.c

Modified: trunk/reactos/drivers/net/tcpip/tcpip/main.c
--- trunk/reactos/drivers/net/tcpip/tcpip/main.c	2005-05-24 19:52:43 UTC (rev 15484)
+++ trunk/reactos/drivers/net/tcpip/tcpip/main.c	2005-05-24 21:04:44 UTC (rev 15485)
@@ -9,7 +9,7 @@
  */
 #include "precomp.h"
 
-//#define NDEBUG
+#define NDEBUG
 
 #ifndef NDEBUG
 DWORD DebugTraceLevel = DEBUG_ULTRA & ~(DEBUG_LOCK | DEBUG_PBUFFER);

Modified: trunk/reactos/lib/iphlpapi/ifenum_reactos.c
--- trunk/reactos/lib/iphlpapi/ifenum_reactos.c	2005-05-24 19:52:43 UTC (rev 15484)
+++ trunk/reactos/lib/iphlpapi/ifenum_reactos.c	2005-05-24 21:04:44 UTC (rev 15485)
@@ -129,15 +129,15 @@
     DWORD allocationSizeForEntityArray = entrySize * MAX_TDI_ENTITIES, 
         arraySize = entrySize * MAX_TDI_ENTITIES;
 
-    DbgPrint("TdiGetSetOfThings(tcpFile %x,toiClass %x,toiType %x,toiId %x,"
-           "teiEntity %x,fixedPart %d,entrySize %d)\n",
-           (int)tcpFile, 
-           (int)toiClass, 
-           (int)toiType, 
-           (int)toiId, 
-           (int)teiEntity,
-           (int)fixedPart, 
-           (int)entrySize );
+    TRACE("TdiGetSetOfThings(tcpFile %x,toiClass %x,toiType %x,toiId %x,"
+          "teiEntity %x,fixedPart %d,entrySize %d)\n",
+          (int)tcpFile, 
+          (int)toiClass, 
+          (int)toiType, 
+          (int)toiId, 
+          (int)teiEntity,
+          (int)fixedPart, 
+          (int)entrySize );
 
     req.ID.toi_class                = toiClass;
     req.ID.toi_type                 = toiType;

Modified: trunk/reactos/lib/ws2_32/misc/dllmain.c
--- trunk/reactos/lib/ws2_32/misc/dllmain.c	2005-05-24 19:52:43 UTC (rev 15484)
+++ trunk/reactos/lib/ws2_32/misc/dllmain.c	2005-05-24 21:04:44 UTC (rev 15485)
@@ -17,10 +17,10 @@
 #ifdef DBG
 
 /* See debug.h for debug/trace constants */
-DWORD DebugTraceLevel = MIN_TRACE;
+//DWORD DebugTraceLevel = MIN_TRACE;
 //DWORD DebugTraceLevel = MAX_TRACE;
 //DWORD DebugTraceLevel = DEBUG_ULTRA;
-
+DWORD DebugTraceLevel = 0;
 #endif /* DBG */
 
 /* To make the linker happy */
@@ -386,8 +386,8 @@
 	  Sleep( timeout->tv_sec * 1000 + (timeout->tv_usec / 1000) );
       }
       return 0;
-  } else {
-      WS_DbgPrint(MID_TRACE,("Calling WSPSelect\n"));
+  } else if (Provider->ProcTable.lpWSPSelect) {
+      WS_DbgPrint(MID_TRACE,("Calling WSPSelect:%x\n", Provider->ProcTable.lpWSPSelect));
       Count = Provider->ProcTable.lpWSPSelect(
 	  nfds, readfds, writefds, exceptfds, (LPTIMEVAL)timeout, &Errno);
       
@@ -400,6 +400,9 @@
 	  WSASetLastError(Errno);
 	  return SOCKET_ERROR;
       }
+  } else {
+      WSASetLastError(WSAEINVAL);
+      return SOCKET_ERROR;
   }
 
   return Count;

Modified: trunk/reactos/subsys/system/dhcp/dispatch.c
--- trunk/reactos/subsys/system/dhcp/dispatch.c	2005-05-24 19:52:43 UTC (rev 15484)
+++ trunk/reactos/subsys/system/dhcp/dispatch.c	2005-05-24 21:04:44 UTC (rev 15485)
@@ -186,8 +186,10 @@
             if (errno == EAGAIN || errno == EINTR) {
                 time(&cur_time);
                 continue;
-            } else
+            } else {
                 error("poll: %m");
+                break;
+            }
         }
 
         /* Get the current time... */