Delete last trace of old headers in NDIS, and clean up some more old headers
[reactos.git] / reactos / drivers / net / ndis / include / ndissys.h
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS NDIS library
4 * FILE: ndissys.h
5 * PURPOSE: NDIS library definitions
6 * NOTES: Spin lock acquire order:
7 * - Miniport list lock
8 * - Adapter list lock
9 */
10 #ifndef __NDISSYS_H
11 #define __NDISSYS_H
12
13 #define NDIS50 1 /* Use NDIS 5.0 structures by default */
14
15 #ifdef _MSC_VER
16 #include <basetsd.h>
17 #include <ntddk.h>
18 #include <windef.h>
19 #include <ndis.h>
20 #else /* _MSC_VER */
21 #include <ddk/ntddk.h>
22 #include <ddk/ntifs.h>
23 #include <ddk/ndis.h>
24 #include <ddk/xfilter.h>
25 #include <ddk/afilter.h>
26 typedef struct _ATM_ADDRESS *PATM_ADDRESS;
27 #endif /* _MSC_VER */
28
29 struct _ADAPTER_BINDING;
30
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;
36
37 #include "miniport.h"
38 #include "protocol.h"
39
40 #include <debug.h>
41
42 /* Exported functions */
43 #ifdef _MSC_VER
44 #define EXPORT __declspec(dllexport)
45 #else
46 #define EXPORT STDCALL
47 #endif
48
49 #define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24))
50 #define NDIS_TAG 0x4e4d4953
51
52 #ifdef DBG
53
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)); \
58 } \
59 }
60
61 #else
62
63 #define DEBUG_REFCHECK(Object)
64
65 #endif
66
67
68 /*
69 * VOID ReferenceObject(
70 * PVOID Object)
71 */
72 #define ReferenceObject(Object) \
73 { \
74 DEBUG_REFCHECK(Object); \
75 NDIS_DbgPrint(DEBUG_REFCOUNT, ("Referencing object at (0x%X). RefCount (%d).\n", \
76 (Object), (Object)->RefCount)); \
77 \
78 InterlockedIncrement((PLONG)&((Object)->RefCount)); \
79 }
80
81 /*
82 * VOID DereferenceObject(
83 * PVOID Object)
84 */
85 #define DereferenceObject(Object) \
86 { \
87 DEBUG_REFCHECK(Object); \
88 NDIS_DbgPrint(DEBUG_REFCOUNT, ("Dereferencing object at (0x%X). RefCount (%d).\n", \
89 (Object), (Object)->RefCount)); \
90 \
91 if (InterlockedDecrement((PLONG)&((Object)->RefCount)) == 0) \
92 PoolFreeBuffer(Object); \
93 }
94
95
96 #define MIN(value1, value2) \
97 ((value1 < value2)? value1 : value2)
98
99 #define MAX(value1, value2) \
100 ((value1 > value2)? value1 : value2)
101
102 #endif /* __NDISSYS_H */
103
104 /* EOF */