2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS NDIS library
5 * PURPOSE: NDIS library definitions
6 * NOTES: Spin lock acquire order:
13 #define NDIS50 1 /* Use NDIS 5.0 structures by default */
21 #include <ddk/ntddk.h>
22 #include <ddk/ntifs.h>
24 #include <ddk/xfilter.h>
25 #include <ddk/afilter.h>
26 typedef struct _ATM_ADDRESS
*PATM_ADDRESS
;
29 struct _ADAPTER_BINDING
;
31 typedef struct _INTERNAL_NDIS_MINIPORT_WORK_ITEM
{
32 SINGLE_LIST_ENTRY Link
;
33 struct _ADAPTER_BINDING
*AdapterBinding
;
34 NDIS_MINIPORT_WORK_ITEM RealWorkItem
;
35 } INTERNAL_NDIS_MINIPORT_WORK_ITEM
, *PINTERNAL_NDIS_MINIPORT_WORK_ITEM
;
42 /* Exported functions */
44 #define EXPORT __declspec(dllexport)
46 #define EXPORT STDCALL
49 #define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24))
50 #define NDIS_TAG 0x4e4d4953
54 #define DEBUG_REFCHECK(Object) { \
55 if ((Object)->RefCount <= 0) { \
56 NDIS_DbgPrint(MIN_TRACE, ("Object at (0x%X) has invalid reference count (%d).\n", \
57 (Object), (Object)->RefCount)); \
63 #define DEBUG_REFCHECK(Object)
69 * VOID ReferenceObject(
72 #define ReferenceObject(Object) \
74 DEBUG_REFCHECK(Object); \
75 NDIS_DbgPrint(DEBUG_REFCOUNT, ("Referencing object at (0x%X). RefCount (%d).\n", \
76 (Object), (Object)->RefCount)); \
78 InterlockedIncrement((PLONG)&((Object)->RefCount)); \
82 * VOID DereferenceObject(
85 #define DereferenceObject(Object) \
87 DEBUG_REFCHECK(Object); \
88 NDIS_DbgPrint(DEBUG_REFCOUNT, ("Dereferencing object at (0x%X). RefCount (%d).\n", \
89 (Object), (Object)->RefCount)); \
91 if (InterlockedDecrement((PLONG)&((Object)->RefCount)) == 0) \
92 PoolFreeBuffer(Object); \
96 #define MIN(value1, value2) \
97 ((value1 < value2)? value1 : value2)
99 #define MAX(value1, value2) \
100 ((value1 > value2)? value1 : value2)
102 #endif /* __NDISSYS_H */