diff --git a/reactos/drivers/net/ndis/include/debug.h b/reactos/drivers/net/ndis/include/debug.h index e217a10bfe2..2ebd73b51e2 100644 --- a/reactos/drivers/net/ndis/include/debug.h +++ b/reactos/drivers/net/ndis/include/debug.h @@ -22,7 +22,7 @@ #ifdef DBG -extern DWORD DebugTraceLevel; +extern ULONG DebugTraceLevel; #ifdef _MSC_VER diff --git a/reactos/drivers/net/ndis/include/efilter.h b/reactos/drivers/net/ndis/include/efilter.h index 84375b4da47..375180a990b 100644 --- a/reactos/drivers/net/ndis/include/efilter.h +++ b/reactos/drivers/net/ndis/include/efilter.h @@ -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 @@ EthFilterDprIndicateReceive( IN UINT PacketSize); VOID -STDCALL +NTAPI EthFilterDprIndicateReceiveComplete( IN PETH_FILTER Filter); diff --git a/reactos/drivers/net/ndis/include/ndissys.h b/reactos/drivers/net/ndis/include/ndissys.h index 275a33f4fbb..0a9ee799955 100644 --- a/reactos/drivers/net/ndis/include/ndissys.h +++ b/reactos/drivers/net/ndis/include/ndissys.h @@ -10,22 +10,29 @@ #ifndef __NDISSYS_H #define __NDISSYS_H -#define NDIS50 1 /* Use NDIS 5.0 structures by default */ - -#ifdef _MSC_VER -#include -#include -#include +typedef unsigned long NDIS_STATS; #include +#include +#include + +#if _MSC_VER +/* FIXME: These were removed and are no longer used! */ +#define NdisWorkItemHalt NdisMaxWorkItems +#define NdisWorkItemSendLoopback (NdisMaxWorkItems + 1) #else /* _MSC_VER */ -#include -#include -#include -#include -#include +/* 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 +#endif + +#define NDIS_MINIPORT_WORK_QUEUE_SIZE 10 + struct _ADAPTER_BINDING; typedef struct _INTERNAL_NDIS_MINIPORT_WORK_ITEM { @@ -34,16 +41,21 @@ typedef struct _INTERNAL_NDIS_MINIPORT_WORK_ITEM { 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 /* 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)) diff --git a/reactos/drivers/net/ndis/ndis.def b/reactos/drivers/net/ndis/ndis.def index 89c80c59611..3c3d0595f20 100644 --- a/reactos/drivers/net/ndis/ndis.def +++ b/reactos/drivers/net/ndis/ndis.def @@ -128,7 +128,6 @@ NdisIMRevertBack@8 NdisIMSwitchToMiniport@8 NdisInitAnsiString@8 NdisInitializeEvent@4 -NdisInitializeInterrupt@40 NdisInitializeReadWriteLock@4 NdisInitializeString@8 NdisInitializeTimer@12 @@ -239,13 +238,11 @@ NdisReadPcmciaAttributeMemory@16 NdisReinitializePacket@4 NdisRegisterAdapter@24 NdisRegisterAdapterShutdownHandler@12 -NdisRegisterMac@24 NdisRegisterProtocol@16 ;NdisRegisterTdiCallBack ? NdisReleaseAdapterResources@4 NdisReleaseReadWriteLock@8 NdisReleaseSpinLock@4 -NdisRemoveInterrupt@4 NdisRequest@12 NdisReset@8 NdisResetEvent@4 diff --git a/reactos/drivers/net/ndis/ndis.xml b/reactos/drivers/net/ndis/ndis.xml index 0850bd2f67e..5dc7353a876 100644 --- a/reactos/drivers/net/ndis/ndis.xml +++ b/reactos/drivers/net/ndis/ndis.xml @@ -3,9 +3,9 @@ include + - - + ntoskrnl hal diff --git a/reactos/drivers/net/ndis/ndis/40gone.c b/reactos/drivers/net/ndis/ndis/40gone.c index ce1c56066a5..47dca8ffc5c 100644 --- a/reactos/drivers/net/ndis/ndis/40gone.c +++ b/reactos/drivers/net/ndis/ndis/40gone.c @@ -105,6 +105,7 @@ NdisAllocateSharedMemory( /* * @unimplemented */ +#undef NdisCompleteBufferPhysicalMapping VOID EXPORT NdisCompleteBufferPhysicalMapping( @@ -119,6 +120,7 @@ NdisCompleteBufferPhysicalMapping( /* * @unimplemented */ +#undef NdisCompleteRequest VOID EXPORT NdisCompleteRequest( @@ -133,6 +135,7 @@ NdisCompleteRequest( /* * @unimplemented */ +#undef NdisCompleteReset VOID EXPORT NdisCompleteReset( @@ -146,6 +149,7 @@ NdisCompleteReset( /* * @unimplemented */ +#undef NdisCompleteSend VOID EXPORT NdisCompleteSend( @@ -160,6 +164,7 @@ NdisCompleteSend( /* * @unimplemented */ +#undef NdisCompleteTransferData VOID EXPORT NdisCompleteTransferData( @@ -175,6 +180,7 @@ NdisCompleteTransferData( /* * @unimplemented */ +#undef NdisIndicateReceive VOID EXPORT NdisIndicateReceive( @@ -194,6 +200,7 @@ NdisIndicateReceive( /* * @unimplemented */ +#undef NdisIndicateReceiveComplete VOID EXPORT NdisIndicateReceiveComplete( @@ -206,6 +213,7 @@ NdisIndicateReceiveComplete( /* * @unimplemented */ +#undef NdisIndicateStatus VOID EXPORT NdisIndicateStatus( @@ -221,6 +229,7 @@ NdisIndicateStatus( /* * @unimplemented */ +#undef NdisIndicateStatusComplete VOID EXPORT NdisIndicateStatusComplete( @@ -265,6 +274,7 @@ NdisReadBindingInformation ( /* * @unimplemented */ +#undef NdisReadDmaCounter ULONG EXPORT NdisReadDmaCounter( @@ -279,6 +289,7 @@ NdisReadDmaCounter( /* * @unimplemented */ +#undef NdisStartBufferPhysicalMapping VOID EXPORT NdisStartBufferPhysicalMapping( @@ -296,22 +307,7 @@ NdisStartBufferPhysicalMapping( /* * @unimplemented */ -BOOLEAN -EXPORT -NdisSynchronizeWithInterrupt( - IN PNDIS_INTERRUPT Interrupt, - IN PVOID SynchronizeFunction, - IN PVOID SynchronizeContext) -{ - UNIMPLEMENTED - - return FALSE; -} - - -/* - * @unimplemented - */ +#undef NdisUnmapIoSpace VOID EXPORT NdisUnmapIoSpace( diff --git a/reactos/drivers/net/ndis/ndis/50gone.c b/reactos/drivers/net/ndis/ndis/50gone.c index 51b863ca76b..2a627c41612 100644 --- a/reactos/drivers/net/ndis/ndis/50gone.c +++ b/reactos/drivers/net/ndis/ndis/50gone.c @@ -209,33 +209,6 @@ NdisIMSwitchToMiniport( } -/* - * @unimplemented - */ -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 */ @@ -370,29 +343,6 @@ NdisRegisterAdapterShutdownHandler( } -/* - * @unimplemented - */ -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 */ @@ -411,24 +361,6 @@ NdisReleaseAdapterResources( } -/* - * @unimplemented - */ -VOID -EXPORT -NdisRemoveInterrupt( - IN PNDIS_INTERRUPT Interrupt) -/* - * FUNCTION: - * ARGUMENTS: - * NOTES: - * NDIS 4.0 - */ -{ - UNIMPLEMENTED -} - - /* * @unimplemented */ diff --git a/reactos/drivers/net/ndis/ndis/SOURCES b/reactos/drivers/net/ndis/ndis/SOURCES index 441f582864b..59f44969c63 100644 --- a/reactos/drivers/net/ndis/ndis/SOURCES +++ b/reactos/drivers/net/ndis/ndis/SOURCES @@ -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 \ - control.c \ - hardware.c \ - io.c \ - main.c \ - memory.c \ - miniport.c \ - protocol.c \ - string.c \ - stubs.c \ - time.c \ - RESOURCE.RC +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 MSC_WARNING_LEVEL=/W3 /WX + +DLLDEF=$(O)/ndis.def diff --git a/reactos/drivers/net/ndis/ndis/buffer.c b/reactos/drivers/net/ndis/ndis/buffer.c index 9891314cd2c..d3f5ffdec3c 100644 --- a/reactos/drivers/net/ndis/ndis/buffer.c +++ b/reactos/drivers/net/ndis/ndis/buffer.c @@ -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 @@ UINT CopyPacketToBufferChain( 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 @@ UINT CopyPacketToBufferChain( /* * @implemented */ +#undef NdisAdjustBufferLength VOID EXPORT NdisAdjustBufferLength( @@ -306,6 +307,7 @@ NdisAdjustBufferLength( /* * @implemented */ +#undef NDIS_BUFFER_TO_SPAN_PAGES ULONG EXPORT NDIS_BUFFER_TO_SPAN_PAGES( @@ -464,7 +466,7 @@ NdisAllocatePacket( { 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 @@ NdisAllocatePacketPoolEx( * NDIS 5.0 */ { - PNDIS_PACKET_POOL Pool; + PNDISI_PACKET_POOL Pool; UINT Size, Length, i; PNDIS_PACKET Packet, NextPacket; @@ -562,7 +564,7 @@ NdisAllocatePacketPoolEx( } 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 @@ NdisAllocatePacketPoolEx( /* * @implemented */ +#undef NdisBufferLength ULONG EXPORT NdisBufferLength( @@ -620,6 +623,7 @@ NdisBufferLength( /* * @unimplemented */ +#undef NdisBufferVirtualAddress PVOID EXPORT NdisBufferVirtualAddress( @@ -696,12 +700,12 @@ NdisCopyFromPacketToPacket( *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 @@ NdisFreePacketPool( /* * @implemented */ +#undef NdisFreeBuffer VOID EXPORT NdisFreeBuffer( @@ -901,16 +906,17 @@ NdisFreePacket( 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 @@ NdisGetBufferPhysicalArraySize( /* * @implemented */ +#undef NdisGetFirstBufferFromPacket VOID EXPORT NdisGetFirstBufferFromPacket( @@ -1014,6 +1021,7 @@ NdisPacketPoolUsage( /* * @implemented */ +#undef NdisQueryBuffer VOID EXPORT NdisQueryBuffer( @@ -1039,6 +1047,7 @@ NdisQueryBuffer( /* * @implemented */ +#undef NdisQueryBufferSafe VOID EXPORT NdisQueryBufferSafe( @@ -1062,6 +1071,7 @@ NdisQueryBufferSafe( /* * @implemented */ +#undef NdisQueryBufferOffset VOID EXPORT NdisQueryBufferOffset( diff --git a/reactos/drivers/net/ndis/ndis/cl.c b/reactos/drivers/net/ndis/ndis/cl.c index 4fe4420157e..b9783cfbf5d 100644 --- a/reactos/drivers/net/ndis/ndis/cl.c +++ b/reactos/drivers/net/ndis/ndis/cl.c @@ -15,7 +15,7 @@ * @unimplemented */ NDIS_STATUS -DDKAPI +EXPORT NdisClAddParty( IN NDIS_HANDLE NdisVcHandle, IN NDIS_HANDLE ProtocolPartyContext, @@ -38,7 +38,7 @@ NdisClAddParty( * @unimplemented */ NDIS_STATUS -DDKAPI +EXPORT NdisClCloseAddressFamily( IN NDIS_HANDLE NdisAfHandle) /* @@ -58,7 +58,7 @@ NdisClCloseAddressFamily( * @unimplemented */ NDIS_STATUS -DDKAPI +EXPORT NdisClCloseCall( IN NDIS_HANDLE NdisVcHandle, IN NDIS_HANDLE NdisPartyHandle OPTIONAL, @@ -81,7 +81,7 @@ NdisClCloseCall( * @unimplemented */ NDIS_STATUS -DDKAPI +EXPORT NdisClDeregisterSap( IN NDIS_HANDLE NdisSapHandle) /* @@ -101,7 +101,7 @@ NdisClDeregisterSap( * @unimplemented */ NDIS_STATUS -DDKAPI +EXPORT NdisClDropParty( IN NDIS_HANDLE NdisPartyHandle, IN PVOID Buffer OPTIONAL, @@ -123,7 +123,7 @@ NdisClDropParty( * @unimplemented */ VOID -DDKAPI +EXPORT NdisClIncomingCallComplete( IN NDIS_STATUS Status, IN NDIS_HANDLE NdisVcHandle, @@ -143,7 +143,7 @@ NdisClIncomingCallComplete( * @unimplemented */ NDIS_STATUS -DDKAPI +EXPORT NdisClMakeCall( IN NDIS_HANDLE NdisVcHandle, IN OUT PCO_CALL_PARAMETERS CallParameters, @@ -166,7 +166,7 @@ NdisClMakeCall( * @unimplemented */ NDIS_STATUS -DDKAPI +EXPORT NdisClModifyCallQoS( IN NDIS_HANDLE NdisVcHandle, IN PCO_CALL_PARAMETERS CallParameters) @@ -187,7 +187,7 @@ NdisClModifyCallQoS( * @unimplemented */ NDIS_STATUS -DDKAPI +EXPORT NdisClOpenAddressFamily( IN NDIS_HANDLE NdisBindingHandle, IN PCO_ADDRESS_FAMILY AddressFamily, @@ -212,7 +212,7 @@ NdisClOpenAddressFamily( * @unimplemented */ NDIS_STATUS -DDKAPI +EXPORT NdisClRegisterSap( IN NDIS_HANDLE NdisAfHandle, IN NDIS_HANDLE ProtocolSapContext, diff --git a/reactos/drivers/net/ndis/ndis/control.c b/reactos/drivers/net/ndis/ndis/control.c index 3d8bdd485dd..d5919e7a073 100644 --- a/reactos/drivers/net/ndis/ndis/control.c +++ b/reactos/drivers/net/ndis/ndis/control.c @@ -16,6 +16,7 @@ /* * @implemented */ +#undef NdisReinitializePacket VOID EXPORT NdisReinitializePacket( @@ -49,6 +50,7 @@ NdisAcquireReadWriteLock( /* * @implemented */ +#undef NdisAcquireSpinLock VOID EXPORT NdisAcquireSpinLock( @@ -66,6 +68,7 @@ NdisAcquireSpinLock( /* * @implemented */ +#undef NdisAllocateSpinLock VOID EXPORT NdisAllocateSpinLock( @@ -83,6 +86,7 @@ NdisAllocateSpinLock( /* * @implemented */ +#undef NdisDprAcquireSpinLock VOID EXPORT NdisDprAcquireSpinLock( @@ -101,6 +105,7 @@ NdisDprAcquireSpinLock( /* * @implemented */ +#undef NdisDprReleaseSpinLock VOID EXPORT NdisDprReleaseSpinLock( @@ -118,6 +123,7 @@ NdisDprReleaseSpinLock( /* * @implemented */ +#undef NdisFreeSpinLock VOID EXPORT NdisFreeSpinLock( @@ -169,6 +175,7 @@ NdisInitializeEvent( /* * @implemented */ +#undef NdisReleaseSpinLock VOID EXPORT NdisReleaseSpinLock( diff --git a/reactos/drivers/net/ndis/ndis/efilter.c b/reactos/drivers/net/ndis/ndis/efilter.c index af020c54b6b..8c72e8b65d0 100644 --- a/reactos/drivers/net/ndis/ndis/efilter.c +++ b/reactos/drivers/net/ndis/ndis/efilter.c @@ -10,9 +10,10 @@ */ #include "ndissys.h" +#include "efilter.h" BOOLEAN -EXPORT +NTAPI EthCreateFilter( IN UINT MaximumMulticastAddresses, IN PUCHAR AdapterAddress, @@ -32,15 +33,15 @@ EthCreateFilter( * 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 @@ EthFilterDprIndicateReceive( * 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 @@ EthFilterDprIndicateReceiveComplete( 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 @@ EthFilterDprIndicateReceiveComplete( AdapterBinding = CONTAINING_RECORD(CurrentEntry, ADAPTER_BINDING, AdapterListEntry); (*AdapterBinding->ProtocolBinding->Chars.ReceiveCompleteHandler)( - AdapterBinding->NdisOpenBlock.NdisCommonOpenBlock.ProtocolBindingContext); + AdapterBinding->NdisOpenBlock.ProtocolBindingContext); CurrentEntry = CurrentEntry->Flink; } diff --git a/reactos/drivers/net/ndis/ndis/hardware.c b/reactos/drivers/net/ndis/ndis/hardware.c index e3453c4ceba..5fff17b0de0 100644 --- a/reactos/drivers/net/ndis/ndis/hardware.c +++ b/reactos/drivers/net/ndis/ndis/hardware.c @@ -12,7 +12,6 @@ * */ -#include #include "ndissys.h" diff --git a/reactos/drivers/net/ndis/ndis/io.c b/reactos/drivers/net/ndis/ndis/io.c index bd8a6dbdfa7..83fddfa8b62 100644 --- a/reactos/drivers/net/ndis/ndis/io.c +++ b/reactos/drivers/net/ndis/ndis/io.c @@ -11,11 +11,10 @@ * 3 Oct 2003 Vizzini - Formatting and minor bugfixes */ -#include #include "ndissys.h" -VOID STDCALL HandleDeferredProcessing( +VOID NTAPI HandleDeferredProcessing( IN PKDPC Dpc, IN PVOID DeferredContext, IN PVOID SystemArgument1, @@ -71,7 +70,7 @@ VOID STDCALL HandleDeferredProcessing( } -BOOLEAN STDCALL ServiceRoutine( +BOOLEAN NTAPI ServiceRoutine( IN PKINTERRUPT Interrupt, IN PVOID ServiceContext) /* @@ -125,6 +124,7 @@ NdisCompleteDmaTransfer( /* * @unimplemented */ +#undef NdisFlushBuffer VOID EXPORT NdisFlushBuffer( @@ -138,6 +138,7 @@ NdisFlushBuffer( /* * @unimplemented */ +#undef NdisGetCacheFillSize ULONG EXPORT NdisGetCacheFillSize( @@ -239,7 +240,7 @@ NdisImmediateWritePortUshort( } -IO_ALLOCATION_ACTION STDCALL NdisMapRegisterCallback ( +IO_ALLOCATION_ACTION NTAPI NdisMapRegisterCallback ( IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PVOID MapRegisterBase, @@ -415,14 +416,14 @@ NdisMAllocateMapRegisters( } 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 @@ NdisMCompleteBufferPhysicalMapping( /* * @unimplemented */ +#undef NdisMCompleteDmaTransfer VOID EXPORT NdisMCompleteDmaTransfer( @@ -938,6 +940,7 @@ NdisMRegisterIoPortRange( /* * @unimplemented */ +#undef NdisMSetupDmaTransfer VOID EXPORT NdisMSetupDmaTransfer( diff --git a/reactos/drivers/net/ndis/ndis/main.c b/reactos/drivers/net/ndis/ndis/main.c index c5587851ff4..dc7f7367296 100644 --- a/reactos/drivers/net/ndis/ndis/main.c +++ b/reactos/drivers/net/ndis/ndis/main.c @@ -11,20 +11,19 @@ * 3 Oct 2003 Vizzini - formatting and minor bugfixing */ -#include #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 @@ VOID STDCALL MainUnload( NTSTATUS -STDCALL +NTAPI DriverEntry( PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath) @@ -71,7 +70,7 @@ DriverEntry( * @implemented */ VOID -CDECL +_cdecl NdisWriteErrorLogEntry( IN NDIS_HANDLE NdisAdapterHandle, IN NDIS_ERROR_CODE ErrorCode, diff --git a/reactos/drivers/net/ndis/ndis/memory.c b/reactos/drivers/net/ndis/ndis/memory.c index 9da4f63eeba..f0aee2bfcf9 100644 --- a/reactos/drivers/net/ndis/ndis/memory.c +++ b/reactos/drivers/net/ndis/ndis/memory.c @@ -51,6 +51,7 @@ NdisAllocateMemoryWithTag( /* * @unimplemented */ +#undef NdisCreateLookaheadBufferFromSharedMemory VOID EXPORT NdisCreateLookaheadBufferFromSharedMemory( @@ -65,6 +66,7 @@ NdisCreateLookaheadBufferFromSharedMemory( /* * @unimplemented */ +#undef NdisDestroyLookaheadBufferFromSharedMemory VOID EXPORT NdisDestroyLookaheadBufferFromSharedMemory( @@ -241,11 +243,8 @@ NdisMAllocateSharedMemoryAsync( } -/* - * @implemented - */ VOID -STDCALL +NTAPI NdisMFreeSharedMemoryPassive( PVOID Context) /* diff --git a/reactos/drivers/net/ndis/ndis/miniport.c b/reactos/drivers/net/ndis/ndis/miniport.c index 4bb90da1db2..daf8924f7a0 100644 --- a/reactos/drivers/net/ndis/ndis/miniport.c +++ b/reactos/drivers/net/ndis/ndis/miniport.c @@ -10,7 +10,7 @@ * 20 Aug 2003 vizzini - DMA support * 3 Oct 2003 vizzini - SendPackets support */ -#include + #include "ndissys.h" #include "efilter.h" @@ -228,7 +228,7 @@ MiniIndicateData( (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 @@ MiniIndicateData( /* call the receive handler */ (*AdapterBinding->ProtocolBinding->Chars.ReceiveHandler)( - AdapterBinding->NdisOpenBlock.NdisCommonOpenBlock.ProtocolBindingContext, + AdapterBinding->NdisOpenBlock.ProtocolBindingContext, MacReceiveContext, HeaderBuffer, HeaderBufferSize, @@ -258,7 +258,7 @@ MiniIndicateData( } -VOID STDCALL +VOID NTAPI MiniIndicateReceivePacket( IN NDIS_HANDLE Miniport, IN PPNDIS_PACKET PacketArray, @@ -317,7 +317,7 @@ MiniIndicateReceivePacket( } -VOID STDCALL +VOID NTAPI MiniResetComplete( IN NDIS_HANDLE MiniportAdapterHandle, IN NDIS_STATUS Status, @@ -328,7 +328,7 @@ MiniResetComplete( -VOID STDCALL +VOID NTAPI MiniRequestComplete( IN PADAPTER_BINDING AdapterBinding, IN PNDIS_REQUEST Request, @@ -338,13 +338,13 @@ MiniRequestComplete( if( AdapterBinding->ProtocolBinding->Chars.RequestCompleteHandler ) { (*AdapterBinding->ProtocolBinding->Chars.RequestCompleteHandler)( - AdapterBinding->NdisOpenBlock.NdisCommonOpenBlock.ProtocolBindingContext, + AdapterBinding->NdisOpenBlock.ProtocolBindingContext, Request, Status); } } -VOID STDCALL +VOID NTAPI MiniSendComplete( IN NDIS_HANDLE MiniportAdapterHandle, IN PNDIS_PACKET Packet, @@ -365,13 +365,13 @@ MiniSendComplete( AdapterBinding = (PADAPTER_BINDING)Packet->Reserved[0]; (*AdapterBinding->ProtocolBinding->Chars.SendCompleteHandler)( - AdapterBinding->NdisOpenBlock.NdisCommonOpenBlock.ProtocolBindingContext, + AdapterBinding->NdisOpenBlock.ProtocolBindingContext, Packet, Status); } -VOID STDCALL +VOID NTAPI MiniSendResourcesAvailable( IN NDIS_HANDLE MiniportAdapterHandle) { @@ -379,7 +379,7 @@ MiniSendResourcesAvailable( } -VOID STDCALL +VOID NTAPI MiniTransferDataComplete( IN NDIS_HANDLE MiniportAdapterHandle, IN PNDIS_PACKET Packet, @@ -393,7 +393,7 @@ MiniTransferDataComplete( AdapterBinding = (PADAPTER_BINDING)Packet->Reserved[0]; (*AdapterBinding->ProtocolBinding->Chars.SendCompleteHandler)( - AdapterBinding->NdisOpenBlock.NdisCommonOpenBlock.ProtocolBindingContext, + AdapterBinding->NdisOpenBlock.ProtocolBindingContext, Packet, Status); } @@ -807,7 +807,7 @@ NdisMQueryInformationComplete( } -VOID STDCALL MiniportDpc( +VOID NTAPI MiniportDpc( IN PKDPC Dpc, IN PVOID DeferredContext, IN PVOID SystemArgument1, @@ -971,9 +971,10 @@ NdisMDeregisterAdapterShutdownHandler( * ARGUMENTS: MiniportHandle: Handle passed into MiniportInitialize */ { - NDIS_DbgPrint(DEBUG_MINIPORT, ("Called.\n")); PLOGICAL_ADAPTER Adapter = (PLOGICAL_ADAPTER)MiniportHandle; + NDIS_DbgPrint(DEBUG_MINIPORT, ("Called.\n")); + if(Adapter->BugcheckContext->ShutdownHandler) KeDeregisterBugCheckCallback(Adapter->BugcheckContext->CallbackRecord); } @@ -1104,7 +1105,7 @@ NdisInitializeWrapper( } -VOID STDCALL NdisIBugcheckCallback( +VOID NTAPI NdisIBugcheckCallback( IN PVOID Buffer, IN ULONG Length) /* @@ -1261,7 +1262,7 @@ DoQueries( NTSTATUS -STDCALL +NTAPI NdisIForwardIrpAndWaitCompletionRoutine( PDEVICE_OBJECT Fdo, PIRP Irp, @@ -1277,7 +1278,7 @@ NdisIForwardIrpAndWaitCompletionRoutine( NTSTATUS -STDCALL +NTAPI NdisIForwardIrpAndWait(PLOGICAL_ADAPTER Adapter, PIRP Irp) { KEVENT Event; @@ -1298,7 +1299,7 @@ NdisIForwardIrpAndWait(PLOGICAL_ADAPTER Adapter, PIRP Irp) NTSTATUS -STDCALL +NTAPI NdisIPnPStartDevice( IN PDEVICE_OBJECT DeviceObject, PIRP Irp) @@ -1478,9 +1479,9 @@ NdisIPnPStartDevice( { Success = EthCreateFilter(32, /* FIXME: Query this from miniport. */ Adapter->Address.Type.Medium802_3, - &Adapter->NdisMiniportBlock.FilterDbs.EthDB); + &Adapter->NdisMiniportBlock.EthDB); if (Success) - Adapter->NdisMiniportBlock.FilterDbs.EthDB->Miniport = (PNDIS_MINIPORT_BLOCK)Adapter; + ((PETHI_FILTER)Adapter->NdisMiniportBlock.EthDB)->Miniport = (PNDIS_MINIPORT_BLOCK)Adapter; else NdisStatus = NDIS_STATUS_RESOURCES; } @@ -1519,7 +1520,7 @@ NdisIPnPStartDevice( NTSTATUS -STDCALL +NTAPI NdisIPnPStopDevice( IN PDEVICE_OBJECT DeviceObject, PIRP Irp) @@ -1571,7 +1572,7 @@ NdisIPnPStopDevice( NTSTATUS -STDCALL +NTAPI NdisIDispatchPnp( IN PDEVICE_OBJECT DeviceObject, PIRP Irp) @@ -1616,7 +1617,7 @@ NdisIDispatchPnp( NTSTATUS -STDCALL +NTAPI NdisIAddDevice( IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT PhysicalDeviceObject) @@ -1868,6 +1869,7 @@ NdisMRegisterMiniport( /* * @implemented */ +#undef NdisMResetComplete VOID EXPORT NdisMResetComplete( @@ -1882,6 +1884,7 @@ NdisMResetComplete( /* * @implemented */ +#undef NdisMSendComplete VOID EXPORT NdisMSendComplete( @@ -1904,6 +1907,7 @@ NdisMSendComplete( /* * @implemented */ +#undef NdisMSendResourcesAvailable VOID EXPORT NdisMSendResourcesAvailable( @@ -1916,6 +1920,7 @@ NdisMSendResourcesAvailable( /* * @implemented */ +#undef NdisMTransferDataComplete VOID EXPORT NdisMTransferDataComplete( diff --git a/reactos/drivers/net/ndis/ndis/protocol.c b/reactos/drivers/net/ndis/ndis/protocol.c index da703d4bab7..40451030168 100644 --- a/reactos/drivers/net/ndis/ndis/protocol.c +++ b/reactos/drivers/net/ndis/ndis/protocol.c @@ -9,17 +9,10 @@ * CSH 01/08-2000 Created * 09-13-2003 Vizzini Updates for SendPackets support */ -#include + #include "ndissys.h" #include -VOID -EXPORT -NdisMSendComplete( - IN NDIS_HANDLE MiniportAdapterHandle, - IN PNDIS_PACKET Packet, - IN NDIS_STATUS Status); - #define SERVICES_KEY L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\" #define LINKAGE_KEY L"\\Linkage" #define PARAMETERS_KEY L"\\Parameters\\" @@ -113,7 +106,7 @@ ProIndicatePacket( } -NDIS_STATUS STDCALL +NDIS_STATUS NTAPI ProRequest( IN NDIS_HANDLE MacBindingHandle, IN PNDIS_REQUEST NdisRequest) @@ -188,7 +181,7 @@ ProRequest( } -NDIS_STATUS STDCALL +NDIS_STATUS NTAPI ProReset( IN NDIS_HANDLE MacBindingHandle) { @@ -198,7 +191,7 @@ ProReset( } -NDIS_STATUS STDCALL +NDIS_STATUS NTAPI ProSend( IN NDIS_HANDLE MacBindingHandle, IN PNDIS_PACKET Packet) @@ -391,7 +384,7 @@ ProSend( } -VOID STDCALL +VOID NTAPI ProSendPackets( IN NDIS_HANDLE NdisBindingHandle, IN PPNDIS_PACKET PacketArray, @@ -401,7 +394,7 @@ ProSendPackets( } -NDIS_STATUS STDCALL +NDIS_STATUS NTAPI ProTransferData( IN NDIS_HANDLE MacBindingHandle, IN NDIS_HANDLE MacReceiveContext, @@ -610,18 +603,18 @@ NdisOpenAdapter( AdapterBinding->ProtocolBinding = Protocol; AdapterBinding->Adapter = Adapter; - AdapterBinding->NdisOpenBlock.NdisCommonOpenBlock.ProtocolBindingContext = ProtocolBindingContext; + AdapterBinding->NdisOpenBlock.ProtocolBindingContext = ProtocolBindingContext; /* Set fields required by some NDIS macros */ - AdapterBinding->NdisOpenBlock.NdisCommonOpenBlock.BindingHandle = (NDIS_HANDLE)AdapterBinding; + AdapterBinding->NdisOpenBlock.BindingHandle = (NDIS_HANDLE)AdapterBinding; /* Set handlers (some NDIS macros require these) */ - AdapterBinding->NdisOpenBlock.NdisCommonOpenBlock.RequestHandler = ProRequest; - AdapterBinding->NdisOpenBlock.NdisCommonOpenBlock.ResetHandler = ProReset; - AdapterBinding->NdisOpenBlock.NdisCommonOpenBlock.SendHandler = ProSend; - AdapterBinding->NdisOpenBlock.NdisCommonOpenBlock.SendPacketsHandler = ProSendPackets; - AdapterBinding->NdisOpenBlock.NdisCommonOpenBlock.TransferDataHandler = ProTransferData; + AdapterBinding->NdisOpenBlock.RequestHandler = ProRequest; + AdapterBinding->NdisOpenBlock.ResetHandler = ProReset; + AdapterBinding->NdisOpenBlock.SendHandler = ProSend; + AdapterBinding->NdisOpenBlock.SendPacketsHandler = ProSendPackets; + AdapterBinding->NdisOpenBlock.TransferDataHandler = ProTransferData; #if 0 /* XXX this looks fishy */ @@ -937,6 +930,7 @@ NdisReset( /* * @implemented */ +#undef NdisSend VOID EXPORT NdisSend( @@ -958,6 +952,7 @@ NdisSend( /* * @implemented */ +#undef NdisSendPackets VOID EXPORT NdisSendPackets( @@ -972,6 +967,7 @@ NdisSendPackets( /* * @implemented */ +#undef NdisTransferData VOID EXPORT NdisTransferData( diff --git a/reactos/drivers/net/ndis/ndis/string.c b/reactos/drivers/net/ndis/ndis/string.c index 86602ebc29b..d44e166b088 100644 --- a/reactos/drivers/net/ndis/ndis/string.c +++ b/reactos/drivers/net/ndis/ndis/string.c @@ -16,6 +16,7 @@ /* * @implemented */ +#undef NdisAnsiStringToUnicodeString NDIS_STATUS EXPORT NdisAnsiStringToUnicodeString( @@ -74,6 +75,7 @@ NdisEqualString( /* * @implemented */ +#undef NdisInitAnsiString VOID EXPORT NdisInitAnsiString( @@ -127,6 +129,7 @@ NdisInitializeString( /* * @implemented */ +#undef NdisInitUnicodeString VOID EXPORT NdisInitUnicodeString( @@ -151,6 +154,7 @@ NdisInitUnicodeString( /* * @implemented */ +#undef NdisUnicodeStringToAnsiString NDIS_STATUS EXPORT NdisUnicodeStringToAnsiString( @@ -179,6 +183,7 @@ NdisUnicodeStringToAnsiString( /* * @implemented */ +#undef NdisUpcaseUnicodeString NTSTATUS EXPORT NdisUpcaseUnicodeString( diff --git a/reactos/drivers/net/ndis/ndis/stubs.c b/reactos/drivers/net/ndis/ndis/stubs.c index 9490e84f6af..76825486940 100644 --- a/reactos/drivers/net/ndis/ndis/stubs.c +++ b/reactos/drivers/net/ndis/ndis/stubs.c @@ -117,19 +117,19 @@ NdisMapFile( typedef struct _NDIS_HANDLE_OBJECT { HANDLE FileHandle; - BOOL Mapped; + BOOLEAN Mapped; ULONG FileLength; PVOID MapBuffer; } NDIS_HANDLE_OBJECT, *PNDIS_HANDLE_OBJECT; -inline +__inline PNDIS_HANDLE_OBJECT NDIS_HANDLE_TO_POBJECT ( NDIS_HANDLE handle ) { return (PNDIS_HANDLE_OBJECT)handle; } -inline +__inline NDIS_HANDLE NDIS_POBJECT_TO_HANDLE ( PNDIS_HANDLE_OBJECT obj ) { @@ -220,6 +220,7 @@ NdisIMRegisterLayeredMiniport( /* * @unimplemented */ +#undef NdisMWanIndicateReceive VOID EXPORT NdisMWanIndicateReceive( @@ -236,6 +237,7 @@ NdisMWanIndicateReceive( /* * @unimplemented */ +#undef NdisMWanIndicateReceiveComplete VOID EXPORT NdisMWanIndicateReceiveComplete( @@ -248,6 +250,7 @@ NdisMWanIndicateReceiveComplete( /* * @unimplemented */ +#undef NdisMWanSendComplete VOID EXPORT NdisMWanSendComplete( @@ -584,6 +587,7 @@ NdisInterlockedIncrement( /* * @implemented */ +#undef NdisInterlockedPopEntrySList PSINGLE_LIST_ENTRY EXPORT NdisInterlockedPopEntrySList( @@ -603,6 +607,7 @@ NdisInterlockedPopEntrySList( /* * @implemented */ +#undef NdisInterlockedPushEntrySList PSINGLE_LIST_ENTRY EXPORT NdisInterlockedPushEntrySList( diff --git a/reactos/drivers/net/ndis/ndis/time.c b/reactos/drivers/net/ndis/ndis/time.c index 60d93fad60f..b9fca107e8c 100644 --- a/reactos/drivers/net/ndis/ndis/time.c +++ b/reactos/drivers/net/ndis/ndis/time.c @@ -20,7 +20,7 @@ #include "ndissys.h" -VOID STDCALL +VOID NTAPI MiniportTimerDpc( PKDPC Dpc, PVOID DeferredContext, @@ -74,6 +74,7 @@ NdisCancelTimer( /* * @implemented */ +#undef NdisGetCurrentSystemTime VOID EXPORT NdisGetCurrentSystemTime ( @@ -214,6 +215,7 @@ NdisMSetPeriodicTimer( /* * @implemented */ +#undef NdisMSetTimer VOID EXPORT NdisMSetTimer( diff --git a/reactos/w32api/include/ddk/ndis.h b/reactos/w32api/include/ddk/ndis.h index b1509034aec..899b70a509f 100644 --- a/reactos/w32api/include/ddk/ndis.h +++ b/reactos/w32api/include/ddk/ndis.h @@ -387,13 +387,7 @@ typedef struct _NDIS_GUID { #define NDIS_GUID_UNICODE_STRING 0x00000008 #define NDIS_GUID_ARRAY 0x00000010 - -typedef struct _NDIS_PACKET_POOL { - NDIS_SPIN_LOCK SpinLock; - struct _NDIS_PACKET *FreeList; - UINT PacketLength; - UCHAR Buffer[1]; -} NDIS_PACKET_POOL, * PNDIS_PACKET_POOL; +typedef HANDLE PNDIS_PACKET_POOL; /* NDIS_PACKET_PRIVATE.Flags constants */ #define fPACKET_CONTAINS_MEDIA_SPECIFIC_INFO 0x40 @@ -4349,8 +4343,6 @@ typedef struct _NDIS_ARC_BUF { #endif /* ARCNET */ -#define NDIS_MINIPORT_WORK_QUEUE_SIZE 10 - typedef struct _NDIS_LOG { PNDIS_MINIPORT_BLOCK Miniport; KSPIN_LOCK LogLock; @@ -4362,18 +4354,25 @@ typedef struct _NDIS_LOG { UCHAR LogBuf[1]; } NDIS_LOG, *PNDIS_LOG; -typedef struct _FILTERDBS { - _ANONYMOUS_UNION union { - PETH_FILTER EthDB; - PNULL_FILTER NullDB; - } DUMMYUNIONNAME; - PTR_FILTER TrDB; - PFDDI_FILTER FddiDB; #if ARCNET +#define FILTERDBS_ARCNET_S \ PARC_FILTER ArcDB; #else /* !ARCNET */ +#define FILTERDBS_ARCNET_S \ PVOID XXXDB; #endif /* !ARCNET */ + +#define FILTERDBS_S \ + _ANONYMOUS_UNION union { \ + PETH_FILTER EthDB; \ + PNULL_FILTER NullDB; \ + } DUMMYUNIONNAME; \ + PTR_FILTER TrDB; \ + PFDDI_FILTER FddiDB; \ + FILTERDBS_ARCNET_S + +typedef struct _FILTERDBS { + FILTERDBS_S } FILTERDBS, *PFILTERDBS; @@ -4414,7 +4413,11 @@ struct _NDIS_MINIPORT_BLOCK { USHORT CFHangCurrentTick; NDIS_STATUS ResetStatus; NDIS_HANDLE ResetOpen; +#ifdef __cplusplus FILTERDBS FilterDbs; +#else + FILTERDBS_S +#endif FILTER_PACKET_INDICATION_HANDLER PacketIndicateHandler; NDIS_M_SEND_COMPLETE_HANDLER SendCompleteHandler; NDIS_M_SEND_RESOURCES_HANDLER SendResourcesHandler; @@ -4576,81 +4579,92 @@ typedef VOID (DDKAPI *SEND_PACKETS_HANDLER)( IN PPNDIS_PACKET PacketArray, IN UINT NumberOfPackets); +#if defined(NDIS_WRAPPER) +#define NDIS_COMMON_OPEN_BLOCK_WRAPPER_S \ + ULONG Flags; \ + ULONG References; \ + KSPIN_LOCK SpinLock; \ + NDIS_HANDLE FilterHandle; \ + ULONG ProtocolOptions; \ + USHORT CurrentLookahead; \ + USHORT ConnectDampTicks; \ + USHORT DisconnectDampTicks; \ + W_SEND_HANDLER WSendHandler; \ + W_TRANSFER_DATA_HANDLER WTransferDataHandler; \ + W_SEND_PACKETS_HANDLER WSendPacketsHandler; \ + W_CANCEL_SEND_PACKETS_HANDLER CancelSendPacketsHandler; \ + ULONG WakeUpEnable; \ + PKEVENT CloseCompleteEvent; \ + QUEUED_CLOSE QC; \ + ULONG AfReferences; \ + PNDIS_OPEN_BLOCK NextGlobalOpen; +#else +#define NDIS_COMMON_OPEN_BLOCK_WRAPPER_S +#endif + +#define NDIS_COMMON_OPEN_BLOCK_S \ + PVOID MacHandle; \ + NDIS_HANDLE BindingHandle; \ + PNDIS_MINIPORT_BLOCK MiniportHandle; \ + PNDIS_PROTOCOL_BLOCK ProtocolHandle; \ + NDIS_HANDLE ProtocolBindingContext; \ + PNDIS_OPEN_BLOCK MiniportNextOpen; \ + PNDIS_OPEN_BLOCK ProtocolNextOpen; \ + NDIS_HANDLE MiniportAdapterContext; \ + BOOLEAN Reserved1; \ + BOOLEAN Reserved2; \ + BOOLEAN Reserved3; \ + BOOLEAN Reserved4; \ + PNDIS_STRING BindDeviceName; \ + KSPIN_LOCK Reserved5; \ + PNDIS_STRING RootDeviceName; \ + _ANONYMOUS_UNION union { \ + SEND_HANDLER SendHandler; \ + WAN_SEND_HANDLER WanSendHandler; \ + } DUMMYUNIONNAME; \ + TRANSFER_DATA_HANDLER TransferDataHandler; \ + SEND_COMPLETE_HANDLER SendCompleteHandler; \ + TRANSFER_DATA_COMPLETE_HANDLER TransferDataCompleteHandler; \ + RECEIVE_HANDLER ReceiveHandler; \ + RECEIVE_COMPLETE_HANDLER ReceiveCompleteHandler; \ + WAN_RECEIVE_HANDLER WanReceiveHandler; \ + REQUEST_COMPLETE_HANDLER RequestCompleteHandler; \ + RECEIVE_PACKET_HANDLER ReceivePacketHandler; \ + SEND_PACKETS_HANDLER SendPacketsHandler; \ + RESET_HANDLER ResetHandler; \ + REQUEST_HANDLER RequestHandler; \ + RESET_COMPLETE_HANDLER ResetCompleteHandler; \ + STATUS_HANDLER StatusHandler; \ + STATUS_COMPLETE_HANDLER StatusCompleteHandler; \ + NDIS_COMMON_OPEN_BLOCK_WRAPPER_S typedef struct _NDIS_COMMON_OPEN_BLOCK { - PVOID MacHandle; - NDIS_HANDLE BindingHandle; - PNDIS_MINIPORT_BLOCK MiniportHandle; - PNDIS_PROTOCOL_BLOCK ProtocolHandle; - NDIS_HANDLE ProtocolBindingContext; - PNDIS_OPEN_BLOCK MiniportNextOpen; - PNDIS_OPEN_BLOCK ProtocolNextOpen; - NDIS_HANDLE MiniportAdapterContext; - BOOLEAN Reserved1; - BOOLEAN Reserved2; - BOOLEAN Reserved3; - BOOLEAN Reserved4; - PNDIS_STRING BindDeviceName; - KSPIN_LOCK Reserved5; - PNDIS_STRING RootDeviceName; - _ANONYMOUS_UNION union { - SEND_HANDLER SendHandler; - WAN_SEND_HANDLER WanSendHandler; - } DUMMYUNIONNAME; - TRANSFER_DATA_HANDLER TransferDataHandler; - SEND_COMPLETE_HANDLER SendCompleteHandler; - TRANSFER_DATA_COMPLETE_HANDLER TransferDataCompleteHandler; - RECEIVE_HANDLER ReceiveHandler; - RECEIVE_COMPLETE_HANDLER ReceiveCompleteHandler; - WAN_RECEIVE_HANDLER WanReceiveHandler; - REQUEST_COMPLETE_HANDLER RequestCompleteHandler; - RECEIVE_PACKET_HANDLER ReceivePacketHandler; - SEND_PACKETS_HANDLER SendPacketsHandler; - RESET_HANDLER ResetHandler; - REQUEST_HANDLER RequestHandler; - RESET_COMPLETE_HANDLER ResetCompleteHandler; - STATUS_HANDLER StatusHandler; - STATUS_COMPLETE_HANDLER StatusCompleteHandler; -#if defined(NDIS_WRAPPER) - ULONG Flags; - ULONG References; - KSPIN_LOCK SpinLock; - NDIS_HANDLE FilterHandle; - ULONG ProtocolOptions; - USHORT CurrentLookahead; - USHORT ConnectDampTicks; - USHORT DisconnectDampTicks; - W_SEND_HANDLER WSendHandler; - W_TRANSFER_DATA_HANDLER WTransferDataHandler; - W_SEND_PACKETS_HANDLER WSendPacketsHandler; - W_CANCEL_SEND_PACKETS_HANDLER CancelSendPacketsHandler; - ULONG WakeUpEnable; - PKEVENT CloseCompleteEvent; - QUEUED_CLOSE QC; - ULONG AfReferences; - PNDIS_OPEN_BLOCK NextGlobalOpen; -#endif /* _NDIS_ */ + NDIS_COMMON_OPEN_BLOCK_S } NDIS_COMMON_OPEN_BLOCK; struct _NDIS_OPEN_BLOCK { - NDIS_COMMON_OPEN_BLOCK NdisCommonOpenBlock; +#ifdef __cplusplus + NDIS_COMMON_OPEN_BLOCK NdisCommonOpenBlock; +#else + NDIS_COMMON_OPEN_BLOCK_S +#endif #if defined(NDIS_WRAPPER) - struct _NDIS_OPEN_CO - { - struct _NDIS_CO_AF_BLOCK * NextAf; - W_CO_CREATE_VC_HANDLER MiniportCoCreateVcHandler; - W_CO_REQUEST_HANDLER MiniportCoRequestHandler; - CO_CREATE_VC_HANDLER CoCreateVcHandler; - CO_DELETE_VC_HANDLER CoDeleteVcHandler; - PVOID CmActivateVcCompleteHandler; - PVOID CmDeactivateVcCompleteHandler; - PVOID CoRequestCompleteHandler; - LIST_ENTRY ActiveVcHead; - LIST_ENTRY InactiveVcHead; - LONG PendingAfNotifications; - PKEVENT AfNotifyCompleteEvent; - }; + struct _NDIS_OPEN_CO + { + struct _NDIS_CO_AF_BLOCK * NextAf; + W_CO_CREATE_VC_HANDLER MiniportCoCreateVcHandler; + W_CO_REQUEST_HANDLER MiniportCoRequestHandler; + CO_CREATE_VC_HANDLER CoCreateVcHandler; + CO_DELETE_VC_HANDLER CoDeleteVcHandler; + PVOID CmActivateVcCompleteHandler; + PVOID CmDeactivateVcCompleteHandler; + PVOID CoRequestCompleteHandler; + LIST_ENTRY ActiveVcHead; + LIST_ENTRY InactiveVcHead; + LONG PendingAfNotifications; + PKEVENT AfNotifyCompleteEvent; + }; #endif /* _NDIS_ */ };