- Get NDIS (almost) compiling with msvc/ddk.
Modified: trunk/reactos/drivers/net/ndis/include/miniport.h
Modified: trunk/reactos/drivers/net/ndis/include/ndissys.h
Modified: trunk/reactos/drivers/net/ndis/ndis/buffer.c

Modified: trunk/reactos/drivers/net/ndis/include/miniport.h
--- trunk/reactos/drivers/net/ndis/include/miniport.h	2006-01-07 20:00:43 UTC (rev 20668)
+++ trunk/reactos/drivers/net/ndis/include/miniport.h	2006-01-07 20:33:48 UTC (rev 20669)
@@ -8,6 +8,7 @@
 #ifndef __MINIPORT_H
 #define __MINIPORT_H
 
+#include <ndis.h>
 #include <ndissys.h>
 
 struct _ADAPTER_BINDING;
@@ -70,6 +71,36 @@
 
 #define GET_MINIPORT_DRIVER(Handle)((PNDIS_M_DRIVER_BLOCK)Handle)
 
+#ifndef NUMBER_OF_WORK_ITEM_TYPES
+
+typedef enum _NDIS_WORK_ITEM_TYPE {
+  NdisWorkItemRequest,
+  NdisWorkItemSend,
+  NdisWorkItemReturnPackets,
+  NdisWorkItemResetRequested,
+  NdisWorkItemResetInProgress,
+  NdisWorkItemHalt,
+  NdisWorkItemSendLoopback,
+  NdisWorkItemMiniportCallback,
+  NdisMaxWorkItems
+} NDIS_WORK_ITEM_TYPE, *PNDIS_WORK_ITEM_TYPE;
+
+#define NUMBER_OF_WORK_ITEM_TYPES         NdisMaxWorkItems
+#define NUMBER_OF_SINGLE_WORK_ITEMS       6
+
+typedef struct _NDIS_MINIPORT_WORK_ITEM {
+    SINGLE_LIST_ENTRY  Link;
+    NDIS_WORK_ITEM_TYPE  WorkItemType;
+    PVOID  WorkItemContext;
+} NDIS_MINIPORT_WORK_ITEM, *PNDIS_MINIPORT_WORK_ITEM;
+
+typedef struct _X_FILTER FDDI_FILTER, *PFDDI_FILTER;
+
+typedef VOID (NTAPI *W_MINIPORT_CALLBACK)(
+  IN NDIS_HANDLE  MiniportAdapterContext,
+  IN PVOID  CallbackContext);
+#endif
+
 /* Information about a logical adapter */
 typedef struct _LOGICAL_ADAPTER
 {

Modified: trunk/reactos/drivers/net/ndis/include/ndissys.h
--- trunk/reactos/drivers/net/ndis/include/ndissys.h	2006-01-07 20:00:43 UTC (rev 20668)
+++ trunk/reactos/drivers/net/ndis/include/ndissys.h	2006-01-07 20:33:48 UTC (rev 20669)
@@ -11,9 +11,19 @@
 #define __NDISSYS_H
 
 typedef unsigned long NDIS_STATS;
+
+/* This magical flag combo seems to work. Filip should verify this */
+#undef NDIS_WRAPPER
+#define NDIS_LEGACY_DRIVER 1
+#define NDIS_LEGACY_MINIPORT 1
+#define NDIS_LEGACY_PROTOCOL 1
+#define NDIS51_MINIPORT 1
+#define NDIS_MINIPORT_DRIVER 1
 #include <ndis.h>
+#undef EXPORT
 #include <xfilter.h>
 #include <afilter.h>
+#include <atm.h>
 
 #if _MSC_VER
 /* FIXME: These were removed and are no longer used! */
@@ -23,13 +33,6 @@
 typedef struct _ATM_ADDRESS *PATM_ADDRESS;
 #endif /* _MSC_VER */
 
-/* FIXME: This should go away once NDK will be compatible with MS DDK headers. */
-#if _MSC_VER
-NTSTATUS NTAPI ZwDuplicateObject(IN HANDLE, IN HANDLE, IN HANDLE, OUT PHANDLE, IN ACCESS_MASK, IN ULONG, IN ULONG);
-#else
-#include <ndk/ntndk.h>
-#endif
-
 struct _ADAPTER_BINDING;
 
 typedef struct _NDISI_PACKET_POOL {

Modified: trunk/reactos/drivers/net/ndis/ndis/buffer.c
--- trunk/reactos/drivers/net/ndis/ndis/buffer.c	2006-01-07 20:00:43 UTC (rev 20668)
+++ trunk/reactos/drivers/net/ndis/ndis/buffer.c	2006-01-07 20:33:48 UTC (rev 20669)
@@ -8,7 +8,7 @@
  *   CSH 01/08-2000 Created
  */
 
-#include <buffer.h>
+#include <ndissys.h>
 
 
 __inline ULONG SkipToOffset(