ReactOS  0.4.15-dev-1397-g19779b3
ndisuio.h
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: See COPYING in the top level directory
3  * PROJECT: ReactOS NDIS User I/O driver
4  * FILE: ndisuio.h
5  * PURPOSE: NDISUIO definitions
6  */
7 
8 #ifndef __NDISUIO_H
9 #define __NDISUIO_H
10 
11 #include <ndis.h>
12 #include <nuiouser.h>
13 
18 
20 {
21  /* Asynchronous completion */
24 
25  /* NDIS binding information */
27 
28  /* Reference count information */
31 
32  /* NDIS pools */
35 
36  /* Receive packet list */
39 
40  /* Mac options */
42 
43  /* Device name */
45 
46  /* Global list entry */
48 
49  /* Spin lock */
52 
53 typedef struct _NDISUIO_OPEN_ENTRY
54 {
55  /* File object */
57 
58  /* Tracks how this adapter was opened (write-only or read-write) */
60 
61  /* List entry */
64 
65 typedef struct _NDISUIO_PACKET_ENTRY
66 {
67  /* Length of data at the end of the struct */
69 
70  /* Entry on the packet list */
72 
73  /* Packet data */
76 
77 /* NDIS version info */
78 #define NDIS_MAJOR_VERSION 5
79 #define NDIS_MINOR_VERSION 0
80 
81 /* createclose.c */
83 NTAPI
85  PIRP Irp);
86 
88 NTAPI
90  PIRP Irp);
91 
92 /* ioctl.c */
94 NTAPI
96  PIRP Irp);
97 
98 /* misc.c */
102  PVOID Buffer,
104  BOOLEAN Front);
105 
108  PVOID Buffer,
109  ULONG BufferSize);
110 
111 VOID
113  BOOLEAN FreePool);
114 
117 
118 VOID
120 
121 VOID
123  PNDISUIO_OPEN_ENTRY OpenEntry);
124 
125 /* protocol.c */
126 VOID
127 NTAPI
131 
132 VOID
133 NTAPI
136 
138 NTAPI
141 
142 VOID
143 NTAPI
147 
148 VOID
149 NTAPI
154 
155 VOID
156 NTAPI
159 
160 VOID
161 NTAPI
165 
167 NTAPI
169  NDIS_HANDLE MacReceiveContext,
170  PVOID HeaderBuffer,
171  UINT HeaderBufferSize,
172  PVOID LookAheadBuffer,
173  UINT LookaheadBufferSize,
174  UINT PacketSize);
175 
176 VOID
177 NTAPI
179 
180 VOID
181 NTAPI
186 
187 VOID
188 NTAPI
190 
191 VOID
192 NTAPI
194  NDIS_HANDLE BindContext,
196  PVOID SystemSpecific1,
198 
199 VOID
200 NTAPI
203  NDIS_HANDLE UnbindContext);
204 
205 /* readwrite.c */
206 NTSTATUS
207 NTAPI
209  PIRP Irp);
210 
211 NTSTATUS
212 NTAPI
214  PIRP Irp);
215 
216 #endif /* __NDISUIO_H */
_Must_inspect_result_ _Out_ PNDIS_STATUS _Out_ PNDIS_STATUS _Out_ PNDIS_HANDLE _Out_ PUINT _In_ UINT _In_ NDIS_HANDLE _In_ NDIS_HANDLE ProtocolBindingContext
Definition: ndis.h:6013
Definition: ndisuio.h:65
_Must_inspect_result_ _In_ WDFUSBDEVICE _In_opt_ WDFREQUEST _In_opt_ PWDF_REQUEST_SEND_OPTIONS _In_ PWDF_USB_CONTROL_SETUP_PACKET _In_opt_ PWDF_MEMORY_DESCRIPTOR _Out_opt_ PULONG BytesTransferred
Definition: wdfusb.h:1331
_In_opt_ NDIS_HANDLE _In_opt_ NDIS_HANDLE _Inout_ PNDIS_REQUEST NdisRequest
Definition: ndis.h:1571
NDIS_STATUS NTAPI NduNetPnPEvent(NDIS_HANDLE ProtocolBindingContext, PNET_PNP_EVENT NetPnPEvent)
Definition: protocol.c:45
NDIS_HANDLE BufferPoolHandle
Definition: ndisuio.h:34
struct _NDISUIO_PACKET_ENTRY * PNDISUIO_PACKET_ENTRY
_In_ NDIS_HANDLE _In_ PNDIS_PACKET Packet
Definition: ndis.h:1548
_In_ NDIS_STATUS _In_ NDIS_STATUS OpenStatus
Definition: ndis.h:6034
struct _NDISUIO_OPEN_ENTRY NDISUIO_OPEN_ENTRY
PNDISUIO_ADAPTER_CONTEXT FindAdapterContextByName(PNDIS_STRING DeviceName)
Definition: misc.c:115
LONG NTSTATUS
Definition: precomp.h:26
VOID NTAPI NduCloseAdapterComplete(NDIS_HANDLE ProtocolBindingContext, NDIS_STATUS Status)
Definition: protocol.c:31
* PNDIS_STATUS
Definition: ndis.h:45
KSPIN_LOCK Spinlock
Definition: ndisuio.h:50
VOID NTAPI NduUnbindAdapter(PNDIS_STATUS Status, NDIS_HANDLE ProtocolBindingContext, NDIS_HANDLE UnbindContext)
Definition: protocol.c:550
_In_opt_ NDIS_HANDLE _In_ NDIS_STATUS GeneralStatus
Definition: ndis.h:1555
struct _NDISUIO_PACKET_ENTRY NDISUIO_PACKET_ENTRY
VOID NTAPI NduReceiveComplete(NDIS_HANDLE ProtocolBindingContext)
Definition: protocol.c:275
#define FreePool(P)
Definition: mntmgr.h:154
_In_ NDIS_HANDLE _In_ PNET_PNP_EVENT NetPnPEvent
Definition: ndis.h:6081
VOID ReferenceAdapterContext(PNDISUIO_ADAPTER_CONTEXT AdapterContext)
Definition: misc.c:142
NTSTATUS NTAPI NduDispatchWrite(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: readwrite.c:158
int NDIS_STATUS
Definition: ntddndis.h:471
VOID NTAPI NduSendComplete(NDIS_HANDLE ProtocolBindingContext, PNDIS_PACKET Packet, NDIS_STATUS Status)
Definition: protocol.c:106
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
Definition: wdfdevice.h:3272
PNDIS_PACKET CreatePacketFromPoolBuffer(PNDISUIO_ADAPTER_CONTEXT AdapterContext, PVOID Buffer, ULONG BufferSize)
Definition: misc.c:52
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
_In_ PIRP Irp
Definition: csq.h:116
VOID NTAPI NduResetComplete(NDIS_HANDLE ProtocolBindingContext, NDIS_STATUS Status)
Definition: protocol.c:137
VOID DereferenceAdapterContextWithOpenEntry(PNDISUIO_ADAPTER_CONTEXT AdapterContext, PNDISUIO_OPEN_ENTRY OpenEntry)
Definition: misc.c:149
unsigned char BOOLEAN
Definition: ndisuio.h:53
VOID NTAPI NduStatusComplete(NDIS_HANDLE ProtocolBindingContext)
Definition: protocol.c:292
UCHAR PacketData[1]
Definition: ndisuio.h:74
NDIS_HANDLE PacketPoolHandle
Definition: ndisuio.h:33
Definition: bufpool.h:45
VOID CleanupAndFreePacket(PNDIS_PACKET Packet, BOOLEAN FreePool)
Definition: misc.c:83
VOID NTAPI NduOpenAdapterComplete(NDIS_HANDLE ProtocolBindingContext, NDIS_STATUS Status, NDIS_STATUS OpenStatus)
Definition: protocol.c:16
Status
Definition: gdiplustypes.h:24
VOID NTAPI NduBindAdapter(PNDIS_STATUS Status, NDIS_HANDLE BindContext, PNDIS_STRING DeviceName, PVOID SystemSpecific1, PVOID SystemSpecific2)
Definition: protocol.c:538
struct _NDISUIO_ADAPTER_CONTEXT * PNDISUIO_ADAPTER_CONTEXT
NTSTATUS NTAPI NduDispatchDeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: ioctl.c:469
VOID NTAPI NduRequestComplete(NDIS_HANDLE ProtocolBindingContext, PNDIS_REQUEST NdisRequest, NDIS_STATUS Status)
Definition: protocol.c:151
* PFILE_OBJECT
Definition: iotypes.h:1978
PFILE_OBJECT FileObject
Definition: ndisuio.h:56
UNICODE_STRING DeviceName
Definition: ndisuio.h:44
NDIS_STATUS AsyncStatus
Definition: ndisuio.h:22
unsigned char UCHAR
Definition: xmlstorage.h:181
NTSTATUS NTAPI NduDispatchRead(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: readwrite.c:42
_In_ PVOID _In_ PVOID SystemSpecific2
Definition: ndis.h:637
Definition: typedefs.h:119
struct _NDISUIO_ADAPTER_CONTEXT NDISUIO_ADAPTER_CONTEXT
NTSTATUS NTAPI NduDispatchClose(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: createclose.c:40
NDIS_HANDLE BindingHandle
Definition: ndisuio.h:26
BOOLEAN WriteOnly
Definition: ndisuio.h:59
_In_opt_ NDIS_HANDLE _In_ NDIS_STATUS _In_ PVOID _In_ UINT StatusBufferSize
Definition: ndis.h:1555
_In_ USHORT PacketSize
Definition: iofuncs.h:1056
LIST_ENTRY ListEntry
Definition: ndisuio.h:47
LIST_ENTRY ListEntry
Definition: ndisuio.h:62
NDIS_HANDLE GlobalProtocolHandle
Definition: main.c:15
ULONG KSPIN_LOCK
Definition: env_spec_w32.h:72
KSPIN_LOCK GlobalAdapterListLock
Definition: main.c:16
unsigned int UINT
Definition: ndis.h:50
struct _NDISUIO_OPEN_ENTRY * PNDISUIO_OPEN_ENTRY
PDEVICE_OBJECT GlobalDeviceObject
Definition: main.c:14
_In_opt_ NDIS_HANDLE _In_ NDIS_STATUS _In_ PVOID StatusBuffer
Definition: ndis.h:1555
VOID NTAPI NduStatus(NDIS_HANDLE ProtocolBindingContext, NDIS_STATUS GeneralStatus, PVOID StatusBuffer, UINT StatusBufferSize)
Definition: protocol.c:282
NDIS_STATUS AllocateAndChainBuffer(PNDISUIO_ADAPTER_CONTEXT AdapterContext, PNDIS_PACKET Packet, PVOID Buffer, ULONG BufferSize, BOOLEAN Front)
Definition: misc.c:15
unsigned int ULONG
Definition: retypes.h:1
LIST_ENTRY OpenEntryList
Definition: ndisuio.h:30
ULONG PacketLength
Definition: ndisuio.h:68
LIST_ENTRY GlobalAdapterList
Definition: main.c:17
LIST_ENTRY PacketList
Definition: ndisuio.h:37
LIST_ENTRY ListEntry
Definition: ndisuio.h:71
NDIS_STATUS NTAPI NduReceive(NDIS_HANDLE ProtocolBindingContext, NDIS_HANDLE MacReceiveContext, PVOID HeaderBuffer, UINT HeaderBufferSize, PVOID LookAheadBuffer, UINT LookaheadBufferSize, UINT PacketSize)
Definition: protocol.c:166
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
Definition: wdfmemory.h:251
NTSTATUS NTAPI NduDispatchCreate(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: createclose.c:16
VOID NTAPI NduTransferDataComplete(NDIS_HANDLE ProtocolBindingContext, PNDIS_PACKET Packet, NDIS_STATUS Status, UINT BytesTransferred)
Definition: protocol.c:121