MS DDK compatibility fixes.
Modified: trunk/reactos/drivers/net/ndis/include/debug.h
Modified: trunk/reactos/drivers/net/ndis/include/efilter.h
Modified: trunk/reactos/drivers/net/ndis/include/ndissys.h
Modified: trunk/reactos/drivers/net/ndis/ndis/40gone.c
Modified: trunk/reactos/drivers/net/ndis/ndis/50gone.c
Modified: trunk/reactos/drivers/net/ndis/ndis/SOURCES
Modified: trunk/reactos/drivers/net/ndis/ndis/buffer.c
Modified: trunk/reactos/drivers/net/ndis/ndis/cl.c
Modified: trunk/reactos/drivers/net/ndis/ndis/control.c
Modified: trunk/reactos/drivers/net/ndis/ndis/efilter.c
Modified: trunk/reactos/drivers/net/ndis/ndis/hardware.c
Modified: trunk/reactos/drivers/net/ndis/ndis/io.c
Modified: trunk/reactos/drivers/net/ndis/ndis/main.c
Modified: trunk/reactos/drivers/net/ndis/ndis/memory.c
Modified: trunk/reactos/drivers/net/ndis/ndis/miniport.c
Modified: trunk/reactos/drivers/net/ndis/ndis/protocol.c
Modified: trunk/reactos/drivers/net/ndis/ndis/string.c
Modified: trunk/reactos/drivers/net/ndis/ndis/stubs.c
Modified: trunk/reactos/drivers/net/ndis/ndis/time.c
Modified: trunk/reactos/drivers/net/ndis/ndis.def
Modified: trunk/reactos/drivers/net/ndis/ndis.xml
Modified: trunk/reactos/w32api/include/ddk/ndis.h

Modified: trunk/reactos/drivers/net/ndis/include/debug.h
--- trunk/reactos/drivers/net/ndis/include/debug.h	2005-08-23 20:18:55 UTC (rev 17487)
+++ trunk/reactos/drivers/net/ndis/include/debug.h	2005-08-23 22:11:03 UTC (rev 17488)
@@ -22,7 +22,7 @@
 
 #ifdef DBG
 
-extern DWORD DebugTraceLevel;
+extern ULONG DebugTraceLevel;
 
 #ifdef _MSC_VER
 

Modified: trunk/reactos/drivers/net/ndis/include/efilter.h
--- trunk/reactos/drivers/net/ndis/include/efilter.h	2005-08-23 20:18:55 UTC (rev 17487)
+++ trunk/reactos/drivers/net/ndis/include/efilter.h	2005-08-23 22:11:03 UTC (rev 17488)
@@ -8,15 +8,54 @@
 #ifndef __EFILTER_H
 #define __EFILTER_H
 
+#define DECLARE_UNKNOWN_STRUCT(BaseName) \
+  typedef struct _##BaseName BaseName, *P##BaseName;
+
+#define DECLARE_UNKNOWN_PROTOTYPE(Name) \
+  typedef VOID (*(Name))(VOID);
+
+#define ETH_LENGTH_OF_ADDRESS 6
+
+DECLARE_UNKNOWN_STRUCT(ETH_BINDING_INFO)
+
+DECLARE_UNKNOWN_PROTOTYPE(ETH_ADDRESS_CHANGE)
+DECLARE_UNKNOWN_PROTOTYPE(ETH_FILTER_CHANGE)
+DECLARE_UNKNOWN_PROTOTYPE(ETH_DEFERRED_CLOSE)
+
+typedef struct ETHI_FILTER {
+  PNDIS_SPIN_LOCK  Lock;
+  CHAR  (*MCastAddressBuf)[ETH_LENGTH_OF_ADDRESS];
+  struct _NDIS_MINIPORT_BLOCK  *Miniport;
+  UINT  CombinedPacketFilter;
+  PETH_BINDING_INFO  OpenList;
+  ETH_ADDRESS_CHANGE  AddressChangeAction;
+  ETH_FILTER_CHANGE  FilterChangeAction;
+  ETH_DEFERRED_CLOSE  CloseAction;
+  UINT  MaxMulticastAddresses;
+  UINT  NumAddresses;
+  UCHAR AdapterAddress[ETH_LENGTH_OF_ADDRESS];
+  UINT  OldCombinedPacketFilter;
+  CHAR  (*OldMCastAddressBuf)[ETH_LENGTH_OF_ADDRESS];
+  UINT  OldNumAddresses;
+  PETH_BINDING_INFO  DirectedList;
+  PETH_BINDING_INFO  BMList;
+  PETH_BINDING_INFO  MCastSet;
+#if defined(NDIS_WRAPPER)
+  UINT  NumOpens;
+  PVOID  BindListLock;
+#endif
+} ETHI_FILTER, *PETHI_FILTER;
+
+
 BOOLEAN
-STDCALL
+NTAPI
 EthCreateFilter(
     IN  UINT                MaximumMulticastAddresses,
     IN  PUCHAR              AdapterAddress,
     OUT PETH_FILTER         * Filter);
 
 VOID
-STDCALL
+NTAPI
 EthFilterDprIndicateReceive(
     IN	PETH_FILTER Filter,
     IN	NDIS_HANDLE MacReceiveContext,
@@ -28,7 +67,7 @@
     IN	UINT        PacketSize);
 
 VOID
-STDCALL
+NTAPI
 EthFilterDprIndicateReceiveComplete(
     IN  PETH_FILTER Filter);
 

Modified: trunk/reactos/drivers/net/ndis/include/ndissys.h
--- trunk/reactos/drivers/net/ndis/include/ndissys.h	2005-08-23 20:18:55 UTC (rev 17487)
+++ trunk/reactos/drivers/net/ndis/include/ndissys.h	2005-08-23 22:11:03 UTC (rev 17488)
@@ -10,22 +10,29 @@
 #ifndef __NDISSYS_H
 #define __NDISSYS_H
 
-#define NDIS50 1    /* Use NDIS 5.0 structures by default */
+typedef unsigned long NDIS_STATS;
+#include <ndis.h>
+#include <xfilter.h>
+#include <afilter.h>
 
-#ifdef _MSC_VER
-#include <basetsd.h>
-#include <ntddk.h>
-#include <windef.h>
-#include <ndis.h>
+#if _MSC_VER
+/* FIXME: These were removed and are no longer used! */
+#define NdisWorkItemHalt NdisMaxWorkItems
+#define NdisWorkItemSendLoopback (NdisMaxWorkItems + 1)
 #else /* _MSC_VER */
-#include <ddk/ntddk.h>
-#include <ddk/ntifs.h>
-#include <ddk/ndis.h>
-#include <ddk/xfilter.h>
-#include <ddk/afilter.h>
+/* FIXME: We miss the ATM headers. */
 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
+
+#define NDIS_MINIPORT_WORK_QUEUE_SIZE 10
+
 struct _ADAPTER_BINDING;
 
 typedef struct _INTERNAL_NDIS_MINIPORT_WORK_ITEM {
@@ -34,16 +41,21 @@
     NDIS_MINIPORT_WORK_ITEM RealWorkItem;
 } INTERNAL_NDIS_MINIPORT_WORK_ITEM, *PINTERNAL_NDIS_MINIPORT_WORK_ITEM;
 
+typedef struct _NDISI_PACKET_POOL {
+  NDIS_SPIN_LOCK  SpinLock;
+  struct _NDIS_PACKET *FreeList;
+  UINT  PacketLength;
+  UCHAR  Buffer[1];
+} NDISI_PACKET_POOL, * PNDISI_PACKET_POOL;
+
 #include "miniport.h"
 #include "protocol.h"
 
 #include <debug.h>
 
 /* Exported functions */
-#ifdef _MSC_VER
-#define EXPORT __declspec(dllexport)
-#else
-#define EXPORT STDCALL
+#ifndef EXPORT
+#define EXPORT NTAPI
 #endif
 
 #define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24))

Modified: trunk/reactos/drivers/net/ndis/ndis/40gone.c
--- trunk/reactos/drivers/net/ndis/ndis/40gone.c	2005-08-23 20:18:55 UTC (rev 17487)
+++ trunk/reactos/drivers/net/ndis/ndis/40gone.c	2005-08-23 22:11:03 UTC (rev 17488)
@@ -105,6 +105,7 @@
 /*
  * @unimplemented
  */
+#undef NdisCompleteBufferPhysicalMapping
 VOID
 EXPORT
 NdisCompleteBufferPhysicalMapping(
@@ -119,6 +120,7 @@
 /*
  * @unimplemented
  */
+#undef NdisCompleteRequest
 VOID
 EXPORT
 NdisCompleteRequest(
@@ -133,6 +135,7 @@
 /*
  * @unimplemented
  */
+#undef NdisCompleteReset
 VOID
 EXPORT
 NdisCompleteReset(
@@ -146,6 +149,7 @@
 /*
  * @unimplemented
  */
+#undef NdisCompleteSend
 VOID
 EXPORT
 NdisCompleteSend(
@@ -160,6 +164,7 @@
 /*
  * @unimplemented
  */
+#undef NdisCompleteTransferData
 VOID
 EXPORT
 NdisCompleteTransferData(
@@ -175,6 +180,7 @@
 /*
  * @unimplemented
  */
+#undef NdisIndicateReceive
 VOID
 EXPORT
 NdisIndicateReceive(
@@ -194,6 +200,7 @@
 /*
  * @unimplemented
  */
+#undef NdisIndicateReceiveComplete
 VOID
 EXPORT
 NdisIndicateReceiveComplete(
@@ -206,6 +213,7 @@
 /*
  * @unimplemented
  */
+#undef NdisIndicateStatus
 VOID
 EXPORT
 NdisIndicateStatus(
@@ -221,6 +229,7 @@
 /*
  * @unimplemented
  */
+#undef NdisIndicateStatusComplete
 VOID
 EXPORT
 NdisIndicateStatusComplete(
@@ -265,6 +274,7 @@
 /*
  * @unimplemented
  */
+#undef NdisReadDmaCounter
 ULONG
 EXPORT
 NdisReadDmaCounter(
@@ -279,6 +289,7 @@
 /*
  * @unimplemented
  */
+#undef NdisStartBufferPhysicalMapping
 VOID
 EXPORT
 NdisStartBufferPhysicalMapping(
@@ -296,22 +307,7 @@
 /*
  * @unimplemented
  */
-BOOLEAN
-EXPORT
-NdisSynchronizeWithInterrupt(
-    IN  PNDIS_INTERRUPT Interrupt,
-    IN  PVOID           SynchronizeFunction,
-    IN  PVOID           SynchronizeContext)
-{
-    UNIMPLEMENTED
-
-    return FALSE;
-}
-
-
-/*
- * @unimplemented
- */
+#undef NdisUnmapIoSpace
 VOID
 EXPORT
 NdisUnmapIoSpace(

Modified: trunk/reactos/drivers/net/ndis/ndis/50gone.c
--- trunk/reactos/drivers/net/ndis/ndis/50gone.c	2005-08-23 20:18:55 UTC (rev 17487)
+++ trunk/reactos/drivers/net/ndis/ndis/50gone.c	2005-08-23 22:11:03 UTC (rev 17488)
@@ -214,33 +214,6 @@
  */
 VOID
 EXPORT
-NdisInitializeInterrupt(
-    OUT     PNDIS_STATUS                Status,
-    IN OUT  PNDIS_INTERRUPT             Interrupt,
-    IN      NDIS_HANDLE                 NdisAdapterHandle,
-    IN      PNDIS_INTERRUPT_SERVICE     InterruptServiceRoutine,
-    IN      PVOID                       InterruptContext,
-    IN      PNDIS_DEFERRED_PROCESSING   DeferredProcessingRoutine,
-    IN      UINT                        InterruptVector,
-    IN      UINT                        InterruptLevel,
-    IN      BOOLEAN                     SharedInterrupt,
-    IN      NDIS_INTERRUPT_MODE         InterruptMode)
-/*
- * FUNCTION:
- * ARGUMENTS:
- * NOTES:
- *    NDIS 4.0
- */
-{
-    UNIMPLEMENTED
-}
-
-
-/*
- * @unimplemented
- */
-VOID
-EXPORT
 NdisMapIoSpace(
     OUT PNDIS_STATUS            Status,
     OUT PVOID                   *VirtualAddress,
@@ -375,29 +348,6 @@
  */
 VOID
 EXPORT
-NdisRegisterMac(
-    OUT PNDIS_STATUS                Status,
-    OUT PNDIS_HANDLE                NdisMacHandle,
-    IN  NDIS_HANDLE                 NdisWrapperHandle,
-    IN  NDIS_HANDLE                 MacMacContext,
-    IN  PNDIS_MAC_CHARACTERISTICS   MacCharacteristics,
-    IN  UINT                        CharacteristicsLength)
-/*
- * FUNCTION:
- * ARGUMENTS:
- * NOTES:
- *    NDIS 4.0
- */
-{
-    UNIMPLEMENTED
-}
-
-
-/*
- * @unimplemented
- */
-VOID
-EXPORT
 NdisReleaseAdapterResources(
     IN  NDIS_HANDLE NdisAdapterHandle)
 /*
@@ -416,24 +366,6 @@
  */
 VOID
 EXPORT
-NdisRemoveInterrupt(
-    IN  PNDIS_INTERRUPT Interrupt)
-/*
- * FUNCTION:
- * ARGUMENTS:
- * NOTES:
- *    NDIS 4.0
- */
-{
-    UNIMPLEMENTED
-}
-
-
-/*
- * @unimplemented
- */
-VOID
-EXPORT
 NdisSetupDmaTransfer(
     OUT PNDIS_STATUS    Status,
     IN  PNDIS_HANDLE    NdisDmaHandle,

Modified: trunk/reactos/drivers/net/ndis/ndis/SOURCES
--- trunk/reactos/drivers/net/ndis/ndis/SOURCES	2005-08-23 20:18:55 UTC (rev 17487)
+++ trunk/reactos/drivers/net/ndis/ndis/SOURCES	2005-08-23 22:11:03 UTC (rev 17488)
@@ -1,32 +1,15 @@
-### THIS FILE IS OFFICIALLY OBSOLETE ###
-### SEE ../README.TXT ###
-
 TARGETNAME=ndis
-TARGETPATH=..\objects
+TARGETPATH=obj
 TARGETTYPE=EXPORT_DRIVER
 
-TARGETLIBS=
+C_DEFINES=-DNDIS_WRAPPER=1 -DNDIS50=1 -DNDIS51=1 -DNDIS50_MINIPORT=1 -DNDIS51_MINIPORT=1
 
-C_DEFINES=$(C_DEFINES) -DUNICODE -DNDIS_WRAPPER -DBINARY_COMPATIBLE=1
+INCLUDES=..\include;..\..\..\..\include;..\..\..\..\include\reactos
 
-INCLUDES=..\include;..\..\..\..\include\net;$(BASEDIR)\INC
+SOURCES= 40gone.c 50gone.c buffer.c cl.c cm.c co.c config.c control.c \
+         efilter.c hardware.c io.c main.c memory.c miniport.c protocol.c \
+         string.c stubs.c time.c
 
-SOURCES= 40gone.c \
-         50gone.c \
-         buffer.c \
-         cl.c \
-         cm.c \
-         co.c \
-		 control.c \
-		 hardware.c \
-		 io.c \
-         main.c \
-		 memory.c \
-         miniport.c \
-		 protocol.c \
-		 string.c \
-         stubs.c \
-		 time.c \
-         RESOURCE.RC
-
 MSC_WARNING_LEVEL=/W3 /WX
+
+DLLDEF=$(O)/ndis.def

Modified: trunk/reactos/drivers/net/ndis/ndis/buffer.c
--- trunk/reactos/drivers/net/ndis/ndis/buffer.c	2005-08-23 20:18:55 UTC (rev 17487)
+++ trunk/reactos/drivers/net/ndis/ndis/buffer.c	2005-08-23 22:11:03 UTC (rev 17488)
@@ -12,10 +12,10 @@
 
 
 __inline ULONG SkipToOffset(
-    PNDIS_BUFFER Buffer,
-    UINT Offset,
-    PUCHAR *Data,
-    PUINT Size)
+    IN PNDIS_BUFFER Buffer,
+    IN UINT Offset,
+    IN OUT PUCHAR *Data,
+    IN OUT PUINT Size)
 /*
  * FUNCTION: Skips Offset bytes into a buffer chain
  * ARGUMENTS:
@@ -237,7 +237,7 @@
     if (SkipToOffset(DstBuffer, DstOffset, &DstData, &DstSize) == 0xFFFFFFFF)
         return 0;
     /* Skip SrcOffset bytes in the source packet */
-    NdisGetFirstBufferFromPacket(SrcPacket, &SrcBuffer, (PVOID)&SrcData, &SrcSize, &Total);
+    NdisGetFirstBufferFromPacket(SrcPacket, &SrcBuffer, (PVOID*)&SrcData, &SrcSize, &Total);
     if (SkipToOffset(SrcBuffer, SrcOffset, &SrcData, &SrcSize) == 0xFFFFFFFF)
         return 0;
     /* Copy the data */
@@ -287,6 +287,7 @@
 /*
  * @implemented
  */
+#undef NdisAdjustBufferLength
 VOID
 EXPORT
 NdisAdjustBufferLength(
@@ -306,6 +307,7 @@
 /*
  * @implemented
  */
+#undef NDIS_BUFFER_TO_SPAN_PAGES
 ULONG
 EXPORT
 NDIS_BUFFER_TO_SPAN_PAGES(
@@ -464,7 +466,7 @@
 {
     KIRQL OldIrql;
     PNDIS_PACKET Temp;
-    PNDIS_PACKET_POOL Pool = (PNDIS_PACKET_POOL)PoolHandle;
+    PNDISI_PACKET_POOL Pool = (PNDISI_PACKET_POOL)PoolHandle;
 
     NDIS_DbgPrint(MAX_TRACE, ("Status (0x%X)  Packet (0x%X)  PoolHandle (0x%X).\n",
         Status, Packet, PoolHandle));
@@ -541,7 +543,7 @@
  *    NDIS 5.0
  */
 {
-    PNDIS_PACKET_POOL Pool;
+    PNDISI_PACKET_POOL Pool;
     UINT Size, Length, i;
     PNDIS_PACKET Packet, NextPacket;
 
@@ -562,7 +564,7 @@
         }
 
         Length = sizeof(NDIS_PACKET) + ProtocolReservedLength;
-        Size   = sizeof(NDIS_PACKET_POOL) + Length * NumberOfDescriptors;
+        Size   = sizeof(NDISI_PACKET_POOL) + Length * NumberOfDescriptors;
 
         Pool   = ExAllocatePool(NonPagedPool, Size);
         if (Pool) 
@@ -598,6 +600,7 @@
 /*
  * @implemented
  */
+#undef NdisBufferLength
 ULONG
 EXPORT
 NdisBufferLength(
@@ -620,6 +623,7 @@
 /*
  * @unimplemented
  */
+#undef NdisBufferVirtualAddress
 PVOID
 EXPORT
 NdisBufferVirtualAddress(
@@ -696,12 +700,12 @@
     *BytesCopied = 0;
 
     /* Skip DestinationOffset bytes in the destination packet */
-    NdisGetFirstBufferFromPacket(Destination, &DstBuffer, (PVOID)&DstData, &DstSize, &Total);
+    NdisGetFirstBufferFromPacket(Destination, &DstBuffer, (PVOID*)&DstData, &DstSize, &Total);
     if (SkipToOffset(DstBuffer, DestinationOffset, &DstData, &DstSize) == 0xFFFFFFFF)
         return;
 
     /* Skip SourceOffset bytes in the source packet */
-    NdisGetFirstBufferFromPacket(Source, &SrcBuffer, (PVOID)&SrcData, &SrcSize, &Total);
+    NdisGetFirstBufferFromPacket(Source, &SrcBuffer, (PVOID*)&SrcData, &SrcSize, &Total);
     if (SkipToOffset(SrcBuffer, SourceOffset, &SrcData, &SrcSize) == 0xFFFFFFFF)
         return;
 
@@ -859,6 +863,7 @@
 /*
  * @implemented
  */
+#undef NdisFreeBuffer
 VOID
 EXPORT
 NdisFreeBuffer(
@@ -901,16 +906,17 @@
 
     NDIS_DbgPrint(MAX_TRACE, ("Packet (0x%X).\n", Packet));
 
-    KeAcquireSpinLock(&Packet->Private.Pool->SpinLock.SpinLock, &OldIrql);
-    Packet->Private.Head           = (PNDIS_BUFFER)Packet->Private.Pool->FreeList;
-    Packet->Private.Pool->FreeList = Packet;
-    KeReleaseSpinLock(&Packet->Private.Pool->SpinLock.SpinLock, OldIrql);
+    KeAcquireSpinLock(&((NDISI_PACKET_POOL*)Packet->Private.Pool)->SpinLock.SpinLock, &OldIrql);
+    Packet->Private.Head           = (PNDIS_BUFFER)((NDISI_PACKET_POOL*)Packet->Private.Pool)->FreeList;
+    ((NDISI_PACKET_POOL*)Packet->Private.Pool)->FreeList = Packet;
+    KeReleaseSpinLock(&((NDISI_PACKET_POOL*)Packet->Private.Pool)->SpinLock.SpinLock, OldIrql);
 }
 
 
 /*
  * @implemented
  */
+#undef NdisGetBufferPhysicalArraySize
 VOID
 EXPORT
 NdisGetBufferPhysicalArraySize(
@@ -933,6 +939,7 @@
 /*
  * @implemented
  */
+#undef NdisGetFirstBufferFromPacket
 VOID
 EXPORT
 NdisGetFirstBufferFromPacket(
@@ -1014,6 +1021,7 @@
 /*
  * @implemented
  */
+#undef NdisQueryBuffer
 VOID
 EXPORT
 NdisQueryBuffer(
@@ -1039,6 +1047,7 @@
 /*
  * @implemented
  */
+#undef NdisQueryBufferSafe
 VOID
 EXPORT
 NdisQueryBufferSafe(
@@ -1062,6 +1071,7 @@
 /*
  * @implemented
  */
+#undef NdisQueryBufferOffset
 VOID
 EXPORT
 NdisQueryBufferOffset(

Modified: trunk/reactos/drivers/net/ndis/ndis/cl.c
--- trunk/reactos/drivers/net/ndis/ndis/cl.c	2005-08-23 20:18:55 UTC (rev 17487)
+++ trunk/reactos/drivers/net/ndis/ndis/cl.c	2005-08-23 22:11:03 UTC (rev 17488)
@@ -15,7 +15,7 @@
  * @unimplemented
  */
 NDIS_STATUS
-DDKAPI
+EXPORT
 NdisClAddParty(
     IN      NDIS_HANDLE         NdisVcHandle,
     IN      NDIS_HANDLE         ProtocolPartyContext,
@@ -38,7 +38,7 @@
  * @unimplemented
  */
 NDIS_STATUS
-DDKAPI
+EXPORT
 NdisClCloseAddressFamily(
     IN  NDIS_HANDLE NdisAfHandle)
 /*
@@ -58,7 +58,7 @@
  * @unimplemented
  */
 NDIS_STATUS
-DDKAPI
+EXPORT
 NdisClCloseCall(
     IN  NDIS_HANDLE NdisVcHandle,
     IN  NDIS_HANDLE NdisPartyHandle OPTIONAL,
@@ -81,7 +81,7 @@
  * @unimplemented
  */
 NDIS_STATUS
-DDKAPI
+EXPORT
 NdisClDeregisterSap(
     IN  NDIS_HANDLE NdisSapHandle)
 /*
@@ -101,7 +101,7 @@
  * @unimplemented
  */
 NDIS_STATUS
-DDKAPI
+EXPORT
 NdisClDropParty(
     IN  NDIS_HANDLE NdisPartyHandle,
     IN  PVOID       Buffer  OPTIONAL,
@@ -123,7 +123,7 @@
  * @unimplemented
  */
 VOID
-DDKAPI
+EXPORT
 NdisClIncomingCallComplete(
     IN  NDIS_STATUS         Status,
     IN  NDIS_HANDLE         NdisVcHandle,
@@ -143,7 +143,7 @@
  * @unimplemented
  */
 NDIS_STATUS
-DDKAPI
+EXPORT
 NdisClMakeCall(
     IN      NDIS_HANDLE         NdisVcHandle,
     IN OUT  PCO_CALL_PARAMETERS CallParameters,
@@ -166,7 +166,7 @@
  * @unimplemented
  */
 NDIS_STATUS
-DDKAPI
+EXPORT
 NdisClModifyCallQoS(
     IN  NDIS_HANDLE         NdisVcHandle,
     IN  PCO_CALL_PARAMETERS CallParameters)
@@ -187,7 +187,7 @@
  * @unimplemented
  */
 NDIS_STATUS
-DDKAPI
+EXPORT
 NdisClOpenAddressFamily(
     IN  NDIS_HANDLE                     NdisBindingHandle,
     IN  PCO_ADDRESS_FAMILY              AddressFamily,
@@ -212,7 +212,7 @@
  * @unimplemented
  */
 NDIS_STATUS
-DDKAPI
+EXPORT
 NdisClRegisterSap(
     IN  NDIS_HANDLE     NdisAfHandle,
     IN  NDIS_HANDLE     ProtocolSapContext,

Modified: trunk/reactos/drivers/net/ndis/ndis/control.c
--- trunk/reactos/drivers/net/ndis/ndis/control.c	2005-08-23 20:18:55 UTC (rev 17487)
+++ trunk/reactos/drivers/net/ndis/ndis/control.c	2005-08-23 22:11:03 UTC (rev 17488)
@@ -16,6 +16,7 @@
 /*
  * @implemented
  */
+#undef NdisReinitializePacket
 VOID
 EXPORT
 NdisReinitializePacket(
@@ -49,6 +50,7 @@
 /*
  * @implemented
  */
+#undef NdisAcquireSpinLock
 VOID
 EXPORT
 NdisAcquireSpinLock(
@@ -66,6 +68,7 @@
 /*
  * @implemented
  */
+#undef NdisAllocateSpinLock
 VOID
 EXPORT
 NdisAllocateSpinLock(
@@ -83,6 +86,7 @@
 /*
  * @implemented
  */
+#undef NdisDprAcquireSpinLock
 VOID
 EXPORT
 NdisDprAcquireSpinLock(
@@ -101,6 +105,7 @@
 /*
  * @implemented
  */
+#undef NdisDprReleaseSpinLock
 VOID
 EXPORT
 NdisDprReleaseSpinLock(
@@ -118,6 +123,7 @@
 /*
  * @implemented
  */
+#undef NdisFreeSpinLock
 VOID
 EXPORT
 NdisFreeSpinLock(
@@ -169,6 +175,7 @@
 /*
  * @implemented
  */
+#undef NdisReleaseSpinLock
 VOID
 EXPORT
 NdisReleaseSpinLock(

Modified: trunk/reactos/drivers/net/ndis/ndis/efilter.c
--- trunk/reactos/drivers/net/ndis/ndis/efilter.c	2005-08-23 20:18:55 UTC (rev 17487)
+++ trunk/reactos/drivers/net/ndis/ndis/efilter.c	2005-08-23 22:11:03 UTC (rev 17488)
@@ -10,9 +10,10 @@
  */
 
 #include "ndissys.h"
+#include "efilter.h"
 
 BOOLEAN
-EXPORT
+NTAPI
 EthCreateFilter(
     IN  UINT                MaximumMulticastAddresses,
     IN  PUCHAR              AdapterAddress,
@@ -32,15 +33,15 @@
  *       shouldn't be problem.
  */
 {
-  PETH_FILTER NewFilter;
+  PETHI_FILTER NewFilter;
 
-  NewFilter = ExAllocatePool(NonPagedPool, sizeof(ETH_FILTER));
+  NewFilter = ExAllocatePool(NonPagedPool, sizeof(ETHI_FILTER));
   if (NewFilter != NULL)
     {
-      RtlZeroMemory(NewFilter, sizeof(ETH_FILTER));
+      RtlZeroMemory(NewFilter, sizeof(ETHI_FILTER));
       NewFilter->MaxMulticastAddresses = MaximumMulticastAddresses;
       RtlCopyMemory(NewFilter->AdapterAddress, AdapterAddress, ETH_LENGTH_OF_ADDRESS);
-      *Filter = NewFilter;
+      *Filter = (PETH_FILTER)NewFilter;
       return TRUE;
     }
   return FALSE;
@@ -87,7 +88,7 @@
      * in the boot process with Filter NULL.  We need to investigate whether
      * this should be handled or not allowed. */
     if( !Filter ) return;
-    MiniIndicateData((PLOGICAL_ADAPTER)Filter->Miniport,
+    MiniIndicateData((PLOGICAL_ADAPTER)((PETHI_FILTER)Filter)->Miniport,
 		     MacReceiveContext,
 		     HeaderBuffer,
 		     HeaderBufferSize,
@@ -119,7 +120,7 @@
 
   if( !Filter ) return;
 
-  Adapter = (PLOGICAL_ADAPTER)Filter->Miniport;
+  Adapter = (PLOGICAL_ADAPTER)((PETHI_FILTER)Filter)->Miniport;
 
   NDIS_DbgPrint(MAX_TRACE, ("acquiring miniport block lock\n"));
   KeAcquireSpinLock(&Adapter->NdisMiniportBlock.Lock, &OldIrql);
@@ -131,7 +132,7 @@
           AdapterBinding = CONTAINING_RECORD(CurrentEntry, ADAPTER_BINDING, AdapterListEntry);
 
           (*AdapterBinding->ProtocolBinding->Chars.ReceiveCompleteHandler)(
-              AdapterBinding->NdisOpenBlock.NdisCommonOpenBlock.ProtocolBindingContext);
+              AdapterBinding->NdisOpenBlock.ProtocolBindingContext);
 
           CurrentEntry = CurrentEntry->Flink;
         }

Modified: trunk/reactos/drivers/net/ndis/ndis/hardware.c
--- trunk/reactos/drivers/net/ndis/ndis/hardware.c	2005-08-23 20:18:55 UTC (rev 17487)
+++ trunk/reactos/drivers/net/ndis/ndis/hardware.c	2005-08-23 22:11:03 UTC (rev 17488)
@@ -12,7 +12,6 @@
  *
  */
 
-#include <roscfg.h>
 #include "ndissys.h"
 
 

Modified: trunk/reactos/drivers/net/ndis/ndis/io.c
--- trunk/reactos/drivers/net/ndis/ndis/io.c	2005-08-23 20:18:55 UTC (rev 17487)
+++ trunk/reactos/drivers/net/ndis/ndis/io.c	2005-08-23 22:11:03 UTC (rev 17488)
@@ -11,11 +11,10 @@
  *   3  Oct 2003 Vizzini - Formatting and minor bugfixes
  */
 
-#include <roscfg.h>
 #include "ndissys.h"
 
 
-VOID STDCALL HandleDeferredProcessing(
+VOID NTAPI HandleDeferredProcessing(
     IN  PKDPC   Dpc,
     IN  PVOID   DeferredContext,
     IN  PVOID   SystemArgument1,
@@ -71,7 +70,7 @@
 }
 
 
-BOOLEAN STDCALL ServiceRoutine(
+BOOLEAN NTAPI ServiceRoutine(
     IN  PKINTERRUPT Interrupt,
     IN  PVOID       ServiceContext)
 /*
@@ -125,6 +124,7 @@
 /*
  * @unimplemented
  */
+#undef NdisFlushBuffer
 VOID
 EXPORT
 NdisFlushBuffer(
@@ -138,6 +138,7 @@
 /*
  * @unimplemented
  */
+#undef NdisGetCacheFillSize
 ULONG
 EXPORT
 NdisGetCacheFillSize(
@@ -239,7 +240,7 @@
 }
 
 
-IO_ALLOCATION_ACTION STDCALL NdisMapRegisterCallback (
+IO_ALLOCATION_ACTION NTAPI NdisMapRegisterCallback (
     IN PDEVICE_OBJECT  DeviceObject,
     IN PIRP            Irp,
     IN PVOID           MapRegisterBase,
@@ -415,14 +416,14 @@
     }
 
   memset(Adapter->NdisMiniportBlock.MapRegisters, 0, BaseMapRegistersNeeded * sizeof(MAP_REGISTER_ENTRY));
-  Adapter->NdisMiniportBlock.BaseMapRegistersNeeded = BaseMapRegistersNeeded;
+  Adapter->NdisMiniportBlock.BaseMapRegistersNeeded = (USHORT)BaseMapRegistersNeeded;
 
   while(BaseMapRegistersNeeded)
     {
       NDIS_DbgPrint(MAX_TRACE, ("iterating, basemapregistersneeded = %d\n", BaseMapRegistersNeeded));
 
       BaseMapRegistersNeeded--;
-      Adapter->NdisMiniportBlock.CurrentMapRegister = BaseMapRegistersNeeded;
+      Adapter->NdisMiniportBlock.CurrentMapRegister = (USHORT)BaseMapRegistersNeeded;
       KeRaiseIrql(DISPATCH_LEVEL, &OldIrql);
         {
           NtStatus = AdapterObject->DmaOperations->AllocateAdapterChannel(
@@ -565,6 +566,7 @@
 /*
  * @unimplemented
  */
+#undef NdisMCompleteDmaTransfer
 VOID
 EXPORT
 NdisMCompleteDmaTransfer(
@@ -938,6 +940,7 @@
 /*
  * @unimplemented
  */
+#undef NdisMSetupDmaTransfer
 VOID
 EXPORT
 NdisMSetupDmaTransfer(

Modified: trunk/reactos/drivers/net/ndis/ndis/main.c
--- trunk/reactos/drivers/net/ndis/ndis/main.c	2005-08-23 20:18:55 UTC (rev 17487)
+++ trunk/reactos/drivers/net/ndis/ndis/main.c	2005-08-23 22:11:03 UTC (rev 17488)
@@ -11,20 +11,19 @@
  *   3  Oct 2003 Vizzini - formatting and minor bugfixing
  */
 
-#include <roscfg.h>
 #include "ndissys.h"
 
 
 #ifdef DBG
 
 /* See debug.h for debug/trace constants */
-DWORD DebugTraceLevel = MIN_TRACE;
-//DWORD DebugTraceLevel = DEBUG_ULTRA;
+ULONG DebugTraceLevel = MIN_TRACE;
+//ULONG DebugTraceLevel = DEBUG_ULTRA;
 
 #endif /* DBG */
 
 
-VOID STDCALL MainUnload(
+VOID NTAPI MainUnload(
     PDRIVER_OBJECT DriverObject)
 /*
  * FUNCTION: Unloads the driver
@@ -37,7 +36,7 @@
 
 
 NTSTATUS
-STDCALL
+NTAPI
 DriverEntry(
     PDRIVER_OBJECT DriverObject,
     PUNICODE_STRING RegistryPath)
@@ -71,7 +70,7 @@
  * @implemented
  */
 VOID
-CDECL
+_cdecl
 NdisWriteErrorLogEntry(
     IN  NDIS_HANDLE     NdisAdapterHandle,
     IN  NDIS_ERROR_CODE ErrorCode,

Modified: trunk/reactos/drivers/net/ndis/ndis/memory.c
--- trunk/reactos/drivers/net/ndis/ndis/memory.c	2005-08-23 20:18:55 UTC (rev 17487)
+++ trunk/reactos/drivers/net/ndis/ndis/memory.c	2005-08-23 22:11:03 UTC (rev 17488)
@@ -51,6 +51,7 @@
 /*
  * @unimplemented
  */
+#undef NdisCreateLookaheadBufferFromSharedMemory
 VOID
 EXPORT
 NdisCreateLookaheadBufferFromSharedMemory(
@@ -65,6 +66,7 @@
 /*
  * @unimplemented
  */
+#undef NdisDestroyLookaheadBufferFromSharedMemory
 VOID
 EXPORT
 NdisDestroyLookaheadBufferFromSharedMemory(
@@ -241,11 +243,8 @@
 }
 
 
-/*
- * @implemented
- */
 VOID
-STDCALL
+NTAPI
 NdisMFreeSharedMemoryPassive(
     PVOID Context)
 /*

Modified: trunk/reactos/drivers/net/ndis/ndis/miniport.c
--- trunk/reactos/drivers/net/ndis/ndis/miniport.c	2005-08-23 20:18:55 UTC (rev 17487)
+++ trunk/reactos/drivers/net/ndis/ndis/miniport.c	2005-08-23 22:11:03 UTC (rev 17488)
@@ -10,7 +10,7 @@
  *   20 Aug 2003 vizzini - DMA support
  *   3  Oct 2003 vizzini - SendPackets support
  */
-#include <roscfg.h>
+
 #include "ndissys.h"
 #include "efilter.h"
 
@@ -228,7 +228,7 @@
 	      (MID_TRACE,
 	       ("XXX (%x) %x %x %x %x %x %x %x XXX\n",
 		*AdapterBinding->ProtocolBinding->Chars.ReceiveHandler,
-		AdapterBinding->NdisOpenBlock.NdisCommonOpenBlock.ProtocolBindingContext,
+		AdapterBinding->NdisOpenBlock.ProtocolBindingContext,
 		MacReceiveContext,
 		HeaderBuffer,
 		HeaderBufferSize,
@@ -238,7 +238,7 @@
 
           /* call the receive handler */
           (*AdapterBinding->ProtocolBinding->Chars.ReceiveHandler)(
-              AdapterBinding->NdisOpenBlock.NdisCommonOpenBlock.ProtocolBindingContext,
+              AdapterBinding->NdisOpenBlock.ProtocolBindingContext,
               MacReceiveContext,
               HeaderBuffer,
               HeaderBufferSize,
@@ -258,7 +258,7 @@
 }
 
 
-VOID STDCALL
[truncated at 1000 lines; 735 more skipped]