ReactOS  0.4.12-dev-375-g61fed54
ndis.h
Go to the documentation of this file.
1 /*
2  * ndis.h
3  *
4  * Network Device Interface Specification definitions
5  *
6  * This file is part of the ReactOS DDK package.
7  *
8  * Contributors:
9  * Created by Casper S. Hornstrup <chorns@users.sourceforge.net>
10  *
11  * THIS SOFTWARE IS NOT COPYRIGHTED
12  *
13  * This source code is offered for use in the public domain. You may
14  * use, modify or distribute it freely.
15  *
16  * This code is distributed in the hope that it will be useful but
17  * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
18  * DISCLAIMED. This includes but is not limited to warranties of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20  *
21  * DEFINES: i386 - Target platform is i386
22  * NDIS_WRAPPER - Define only for NDIS library
23  * NDIS_MINIPORT_DRIVER - Define only for NDIS miniport drivers
24  * NDIS40 - Use NDIS 4.0 structures by default
25  * NDIS50 - Use NDIS 5.0 structures by default
26  * NDIS51 - Use NDIS 5.1 structures by default
27  * NDIS40_MINIPORT - Building NDIS 4.0 miniport driver
28  * NDIS50_MINIPORT - Building NDIS 5.0 miniport driver
29  * NDIS51_MINIPORT - Building NDIS 5.1 miniport driver
30  */
31 
32 #ifndef _NDIS_
33 #define _NDIS_
34 
35 #ifndef NDIS_WDM
36 #define NDIS_WDM 0
37 #endif
38 
39 #include "ntddk.h"
40 #include "netpnp.h"
41 #include "ntstatus.h"
42 #include "netevent.h"
43 #include <qos.h>
44 
46 
47 #include "ntddndis.h"
48 
49 #if !defined(_WINDEF_H)
50 typedef unsigned int UINT, *PUINT;
51 #endif
52 
53 #ifdef __cplusplus
54 extern "C" {
55 #endif
56 
57 __drv_Mode_impl(NDIS_INCLUDED)
58 
59 #ifndef __NET_PNP__
60 #define __NET_PNP__
61 
62 typedef enum _NET_DEVICE_POWER_STATE {
70 
71 typedef enum _NET_PNP_EVENT_CODE {
87 
88 typedef struct _NET_PNP_EVENT {
90  PVOID Buffer;
97 
98 #endif /* __NET_PNP__ */
99 
100 #if !defined(NDIS_WRAPPER)
101 
102 #if (defined(NDIS_MINIPORT_MAJOR_VERSION) || \
103  (defined(NDIS_MINIPORT_MINOR_VERSION)) || \
104  (defined(NDIS_PROTOCOL_MAJOR_VERSION)) || \
105  (defined(NDIS_PROTOCOL_MINOR_VERSION)) || \
106  (defined(NDIS_FILTER_MAJOR_VERSION)) || \
107  (defined(NDIS_FILTER_MINOR_VERSION)))
108 #error "Driver should not redefine NDIS reserved macros"
109 #endif
110 
111 #if defined(NDIS_MINIPORT_DRIVER)
112 
113 #if defined(NDIS620_MINIPORT)
114 #define NDIS_MINIPORT_MAJOR_VERSION 6
115 #define NDIS_MINIPORT_MINOR_VERSION 20
116 #elif defined(NDIS61_MINIPORT)
117 #define NDIS_MINIPORT_MAJOR_VERSION 6
118 #define NDIS_MINIPORT_MINOR_VERSION 1
119 #elif defined(NDIS60_MINIPORT)
120 #define NDIS_MINIPORT_MAJOR_VERSION 6
121 #define NDIS_MINIPORT_MINOR_VERSION 0
122 #elif defined(NDIS51_MINIPORT)
123 #define NDIS_MINIPORT_MAJOR_VERSION 5
124 #define NDIS_MINIPORT_MINOR_VERSION 1
125 #elif defined(NDIS50_MINIPORT)
126 #define NDIS_MINIPORT_MAJOR_VERSION 5
127 #define NDIS_MINIPORT_MINOR_VERSION 0
128 #else
129 #error "Only NDIS miniport drivers with version >= 5 are supported"
130 #endif
131 
132 #if ((NDIS_MINIPORT_MAJOR_VERSION == 6) && \
133  (NDIS_MINIPORT_MINOR_VERSION != 20) && \
134  (NDIS_MINIPORT_MINOR_VERSION != 1) && \
135  (NDIS_MINIPORT_MINOR_VERSION != 0))
136 #error "Invalid miniport major/minor version combination"
137 #elif ((NDIS_MINIPORT_MAJOR_VERSION == 5) && \
138  (NDIS_MINIPORT_MINOR_VERSION != 1) && \
139  (NDIS_MINIPORT_MINOR_VERSION != 0))
140 #error "Invalid miniport major/minor version combination"
141 #endif
142 
143 #if (NDIS_MINIPORT_MAJOR_VERSION == 6) && \
144  ((NDIS_MINIPORT_MINOR_VERSION == 20 && NTDDI_VERSION < NTDDI_WIN7) || \
145  (NDIS_MINIPORT_MINOR_VERSION == 1 && NTDDI_VERSION < NTDDI_VISTA) || \
146  (NDIS_MINIPORT_MINOR_VERSION == 0 && NTDDI_VERSION < NTDDI_VISTA))
147 #error "Wrong NDIS/DDI version"
148 #elif ((NDIS_MINIPORT_MAJOR_VERSION == 5) && \
149  (((NDIS_MINIPORT_MINOR_VERSION == 1) && (NTDDI_VERSION < NTDDI_WINXP)) || \
150  ((NDIS_MINIPORT_MINOR_VERSION == 0) && (NTDDI_VERSION < NTDDI_WIN2K))))
151 #error "Wrong NDIS/DDI version"
152 #endif
153 
154 
155 #endif /* defined(NDIS_MINIPORT_DRIVER) */
156 
157 #if defined(NDIS30)
158 #error "Only NDIS Protocol drivers version 4 or later are supported"
159 #endif
160 
161 #if defined(NDIS620)
162 #define NDIS_PROTOCOL_MAJOR_VERSION 6
163 #define NDIS_PROTOCOL_MINOR_VERSION 20
164 #define NDIS_FILTER_MAJOR_VERSION 6
165 #define NDIS_FILTER_MINOR_VERSION 20
166 #elif defined(NDIS61)
167 #define NDIS_PROTOCOL_MAJOR_VERSION 6
168 #define NDIS_PROTOCOL_MINOR_VERSION 1
169 #define NDIS_FILTER_MAJOR_VERSION 6
170 #define NDIS_FILTER_MINOR_VERSION 1
171 #elif defined(NDIS60)
172 #define NDIS_PROTOCOL_MAJOR_VERSION 6
173 #define NDIS_PROTOCOL_MINOR_VERSION 0
174 #define NDIS_FILTER_MAJOR_VERSION 6
175 #define NDIS_FILTER_MINOR_VERSION 0
176 #elif defined(NDIS51)
177 #define NDIS_PROTOCOL_MAJOR_VERSION 5
178 #define NDIS_PROTOCOL_MINOR_VERSION 1
179 #elif defined(NDIS50)
180 #define NDIS_PROTOCOL_MAJOR_VERSION 5
181 #define NDIS_PROTOCOL_MINOR_VERSION 0
182 #elif defined(NDIS40)
183 #define NDIS_PROTOCOL_MAJOR_VERSION 4
184 #define NDIS_PROTOCOL_MINOR_VERSION 0
185 #endif
186 
187 #if !defined(NDIS_MINIPORT_DRIVER) && !defined(NDIS_PROTOCOL_MAJOR_VERSION)
188 #define NDIS40
189 #define NDIS_PROTOCOL_MAJOR_VERSION 4
190 #define NDIS_PROTOCOL_MINOR_VERSION 0
191 #endif
192 
193 #if defined(NDIS_FILTER_MAJOR_VERSION)
194 
195 #if ((NDIS_FILTER_MAJOR_VERSION == 6) && \
196  (NDIS_FILTER_MINOR_VERSION != 20) && \
197  (NDIS_FILTER_MINOR_VERSION != 1) && \
198  (NDIS_FILTER_MINOR_VERSION != 0))
199 #error "Invalid Filter version"
200 #endif
201 
202 #endif /* defined(NDIS_FILTER_MAJOR_VERSION) */
203 
204 
205 #if defined(NDIS_PROTOCOL_MAJOR_VERSION)
206 
207 #if ((NDIS_PROTOCOL_MAJOR_VERSION == 6) && \
208  (NDIS_PROTOCOL_MINOR_VERSION != 20) && \
209  (NDIS_PROTOCOL_MINOR_VERSION != 1) && \
210  (NDIS_PROTOCOL_MINOR_VERSION != 0))
211 #error "Invalid Protocol version"
212 #elif ((NDIS_PROTOCOL_MAJOR_VERSION == 5) && \
213  (NDIS_PROTOCOL_MINOR_VERSION != 1) && (NDIS_PROTOCOL_MINOR_VERSION != 0))
214 #error "Invalid Protocol version"
215 #elif ((NDIS_PROTOCOL_MAJOR_VERSION == 4) && (NDIS_PROTOCOL_MINOR_VERSION != 0))
216 #error "Invalid Protocol major/minor version"
217 #endif
218 
219 #if ((NDIS_PROTOCOL_MAJOR_VERSION == 6) && (NTDDI_VERSION < NTDDI_VISTA))
220 #error "Wrong NDIS/DDI version"
221 #endif
222 
223 #endif /* defined(NDIS_PROTOCOL_MAJOR_VERSION) */
224 
225 #endif /* !defined(NDIS_WRAPPER) */
226 
227 #if !defined(NDIS_LEGACY_MINIPORT)
228 
229 #if ((defined(NDIS_MINIPORT_DRIVER) && (NDIS_MINIPORT_MAJOR_VERSION < 6)) || NDIS_WRAPPER)
230 #define NDIS_LEGACY_MINIPORT 1
231 #else
232 #define NDIS_LEGACY_MINIPORT 0
233 #endif
234 
235 #endif /* !defined(NDIS_LEGACY_MINIPORT) */
236 
237 #if !defined(NDIS_LEGACY_PROTOCOL)
238 
239 #if ((defined(NDIS_PROTOCOL_MAJOR_VERSION) && (NDIS_PROTOCOL_MAJOR_VERSION < 6)) || NDIS_WRAPPER)
240 #define NDIS_LEGACY_PROTOCOL 1
241 #else
242 #define NDIS_LEGACY_PROTOCOL 0
243 #endif
244 
245 #endif /* !defined(NDIS_LEGACY_PROTOCOL) */
246 
247 #if !defined(NDIS_LEGACY_DRIVER)
248 
249 #if (NDIS_LEGACY_MINIPORT || NDIS_LEGACY_PROTOCOL || NDIS_WRAPPER)
250 #define NDIS_LEGACY_DRIVER 1
251 #else
252 #define NDIS_LEGACY_DRIVER 0
253 #endif
254 
255 #endif /* !defined(NDIS_LEGACY_DRIVER) */
256 
257 #if !defined(NDIS_SUPPORT_NDIS6)
258 
259 #if ((defined (NDIS_MINIPORT_MAJOR_VERSION) && (NDIS_MINIPORT_MAJOR_VERSION >= 6)) || \
260  (defined (NDIS60)) || NDIS_WRAPPER)
261 #define NDIS_SUPPORT_NDIS6 1
262 #else
263 #define NDIS_SUPPORT_NDIS6 0
264 #endif
265 
266 #endif /* !defined(NDIS_SUPPORT_NDIS6) */
267 
268 #if !defined(NDIS_SUPPORT_NDIS61)
269 #if (((defined (NDIS_MINIPORT_MAJOR_VERSION) && (NDIS_MINIPORT_MAJOR_VERSION >= 6)) && \
270  (defined (NDIS_MINIPORT_MINOR_VERSION) && (NDIS_MINIPORT_MINOR_VERSION >= 1))) || \
271  (defined (NDIS61)) || NDIS_WRAPPER)
272 #define NDIS_SUPPORT_NDIS61 1
273 #else
274 #define NDIS_SUPPORT_NDIS61 0
275 #endif
276 #endif /* !defined(NDIS_SUPPORT_NDIS61) */
277 
278 #if !defined(NDIS_SUPPORT_NDIS620)
279 
280 #if (((defined (NDIS_MINIPORT_MAJOR_VERSION) && (NDIS_MINIPORT_MAJOR_VERSION >= 6)) && \
281  (defined (NDIS_MINIPORT_MINOR_VERSION) && (NDIS_MINIPORT_MINOR_VERSION >= 20))) || \
282  (defined (NDIS620)) || NDIS_WRAPPER)
283 #define NDIS_SUPPORT_NDIS620 1
284 #else
285 #define NDIS_SUPPORT_NDIS620 0
286 #endif
287 
288 #endif /* !defined(NDIS_SUPPORT_NDIS620) */
289 
290 #if (NDIS_SUPPORT_NDIS620)
291 #undef NDIS_SUPPORT_NDIS61
292 #define NDIS_SUPPORT_NDIS61 1
293 #endif
294 
295 #if (NDIS_SUPPORT_NDIS61)
296 #undef NDIS_SUPPORT_NDIS6
297 #define NDIS_SUPPORT_NDIS6 1
298 #endif
299 
300 #if defined(NDIS61_MINIPORT) || defined(NDIS60_MINIPORT) || defined(NDIS61) || \
301  defined(NDIS60) || defined(NDIS_WRAPPER) || defined(NDIS_LEGACY_DRIVER)
302 #define NDIS_SUPPORT_60_COMPATIBLE_API 1
303 #else
304 #define NDIS_SUPPORT_60_COMPATIBLE_API 0
305 #endif
306 
307 #if defined(NDIS_WRAPPER)
308 #define NDISAPI
309 #else
310 #define NDISAPI DECLSPEC_IMPORT
311 #endif
312 
313 typedef PVOID QUEUED_CLOSE; //FIXME : Doesn't exist in public headers
314 
315 typedef struct _X_FILTER FDDI_FILTER, *PFDDI_FILTER;
316 typedef struct _X_FILTER TR_FILTER, *PTR_FILTER;
317 typedef struct _X_FILTER NULL_FILTER, *PNULL_FILTER;
318 
320 
321 typedef struct _REFERENCE {
326 
327 /* NDIS base types */
328 
329 typedef struct _NDIS_SPIN_LOCK {
333 
334 typedef struct _NDIS_EVENT {
337 
339 
342 
344 
345 /* NDIS_STATUS constants */
346 #define NDIS_STATUS_SUCCESS ((NDIS_STATUS)STATUS_SUCCESS)
347 #define NDIS_STATUS_PENDING ((NDIS_STATUS)STATUS_PENDING)
348 #define NDIS_STATUS_NOT_RECOGNIZED ((NDIS_STATUS)0x00010001L)
349 #define NDIS_STATUS_NOT_COPIED ((NDIS_STATUS)0x00010002L)
350 #define NDIS_STATUS_NOT_ACCEPTED ((NDIS_STATUS)0x00010003L)
351 #define NDIS_STATUS_CALL_ACTIVE ((NDIS_STATUS)0x00010007L)
352 #define NDIS_STATUS_INDICATION_REQUIRED ((NDIS_STATUS)STATUS_NDIS_INDICATION_REQUIRED)
353 #define NDIS_STATUS_ONLINE ((NDIS_STATUS)0x40010003L)
354 #define NDIS_STATUS_RESET_START ((NDIS_STATUS)0x40010004L)
355 #define NDIS_STATUS_RESET_END ((NDIS_STATUS)0x40010005L)
356 #define NDIS_STATUS_RING_STATUS ((NDIS_STATUS)0x40010006L)
357 #define NDIS_STATUS_CLOSED ((NDIS_STATUS)0x40010007L)
358 #define NDIS_STATUS_WAN_LINE_UP ((NDIS_STATUS)0x40010008L)
359 #define NDIS_STATUS_WAN_LINE_DOWN ((NDIS_STATUS)0x40010009L)
360 #define NDIS_STATUS_WAN_FRAGMENT ((NDIS_STATUS)0x4001000AL)
361 #define NDIS_STATUS_MEDIA_CONNECT ((NDIS_STATUS)0x4001000BL)
362 #define NDIS_STATUS_MEDIA_DISCONNECT ((NDIS_STATUS)0x4001000CL)
363 #define NDIS_STATUS_HARDWARE_LINE_UP ((NDIS_STATUS)0x4001000DL)
364 #define NDIS_STATUS_HARDWARE_LINE_DOWN ((NDIS_STATUS)0x4001000EL)
365 #define NDIS_STATUS_INTERFACE_UP ((NDIS_STATUS)0x4001000FL)
366 #define NDIS_STATUS_INTERFACE_DOWN ((NDIS_STATUS)0x40010010L)
367 #define NDIS_STATUS_MEDIA_BUSY ((NDIS_STATUS)0x40010011L)
368 #define NDIS_STATUS_MEDIA_SPECIFIC_INDICATION ((NDIS_STATUS)0x40010012L)
369 #define NDIS_STATUS_WW_INDICATION NDIS_STATUS_MEDIA_SPECIFIC_INDICATION
370 #define NDIS_STATUS_LINK_SPEED_CHANGE ((NDIS_STATUS)0x40010013L)
371 #define NDIS_STATUS_WAN_GET_STATS ((NDIS_STATUS)0x40010014L)
372 #define NDIS_STATUS_WAN_CO_FRAGMENT ((NDIS_STATUS)0x40010015L)
373 #define NDIS_STATUS_WAN_CO_LINKPARAMS ((NDIS_STATUS)0x40010016L)
374 #if NDIS_SUPPORT_NDIS6
375 #define NDIS_STATUS_LINK_STATE ((NDIS_STATUS)0x40010017L)
376 #define NDIS_STATUS_NETWORK_CHANGE ((NDIS_STATUS)0x40010018L)
377 #define NDIS_STATUS_MEDIA_SPECIFIC_INDICATION_EX ((NDIS_STATUS)0x40010019L)
378 #define NDIS_STATUS_PORT_STATE ((NDIS_STATUS)0x40010022L)
379 #define NDIS_STATUS_OPER_STATUS ((NDIS_STATUS)0x40010023L)
380 #define NDIS_STATUS_PACKET_FILTER ((NDIS_STATUS)0x40010024L)
381 #endif /* NDIS_SUPPORT_NDIS6 */
382 #define NDIS_STATUS_WAN_CO_MTULINKPARAMS ((NDIS_STATUS)0x40010025L)
383 
384 #if NDIS_SUPPORT_NDIS6
385 
386 #define NDIS_STATUS_IP_OPER_STATUS ((NDIS_STATUS)0x40010026L)
387 
388 #define NDIS_STATUS_OFFLOAD_PAUSE ((NDIS_STATUS)0x40020001L)
389 #define NDIS_STATUS_UPLOAD_ALL ((NDIS_STATUS)0x40020002L)
390 #define NDIS_STATUS_OFFLOAD_RESUME ((NDIS_STATUS)0x40020003L)
391 #define NDIS_STATUS_OFFLOAD_PARTIAL_SUCCESS ((NDIS_STATUS)0x40020004L)
392 #define NDIS_STATUS_OFFLOAD_STATE_INVALID ((NDIS_STATUS)0x40020005L)
393 #define NDIS_STATUS_TASK_OFFLOAD_CURRENT_CONFIG ((NDIS_STATUS)0x40020006L)
394 #define NDIS_STATUS_TASK_OFFLOAD_HARDWARE_CAPABILITIES ((NDIS_STATUS)0x40020007L)
395 #define NDIS_STATUS_OFFLOAD_ENCASPULATION_CHANGE ((NDIS_STATUS)0x40020008L)
396 #define NDIS_STATUS_TCP_CONNECTION_OFFLOAD_HARDWARE_CAPABILITIES ((NDIS_STATUS)0x4002000BL)
397 
398 #if (NDIS_SUPPORT_NDIS61)
399 #define NDIS_STATUS_HD_SPLIT_CURRENT_CONFIG ((NDIS_STATUS)0x4002000CL)
400 #endif
401 
402 #if (NDIS_SUPPORT_NDIS620)
403 #define NDIS_STATUS_RECEIVE_QUEUE_STATE ((NDIS_STATUS)0x4002000DL)
404 #endif
405 
406 #define NDIS_STATUS_OFFLOAD_IM_RESERVED1 ((NDIS_STATUS)0x40020100L)
407 #define NDIS_STATUS_OFFLOAD_IM_RESERVED2 ((NDIS_STATUS)0x40020101L)
408 #define NDIS_STATUS_OFFLOAD_IM_RESERVED3 ((NDIS_STATUS)0x40020102L)
409 
410 #define NDIS_STATUS_DOT11_SCAN_CONFIRM ((NDIS_STATUS)0x40030000L)
411 #define NDIS_STATUS_DOT11_MPDU_MAX_LENGTH_CHANGED ((NDIS_STATUS)0x40030001L)
412 #define NDIS_STATUS_DOT11_ASSOCIATION_START ((NDIS_STATUS)0x40030002L)
413 #define NDIS_STATUS_DOT11_ASSOCIATION_COMPLETION ((NDIS_STATUS)0x40030003L)
414 #define NDIS_STATUS_DOT11_CONNECTION_START ((NDIS_STATUS)0x40030004L)
415 #define NDIS_STATUS_DOT11_CONNECTION_COMPLETION ((NDIS_STATUS)0x40030005L)
416 #define NDIS_STATUS_DOT11_ROAMING_START ((NDIS_STATUS)0x40030006L)
417 #define NDIS_STATUS_DOT11_ROAMING_COMPLETION ((NDIS_STATUS)0x40030007L)
418 #define NDIS_STATUS_DOT11_DISASSOCIATION ((NDIS_STATUS)0x40030008L)
419 #define NDIS_STATUS_DOT11_TKIPMIC_FAILURE ((NDIS_STATUS)0x40030009L)
420 #define NDIS_STATUS_DOT11_PMKID_CANDIDATE_LIST ((NDIS_STATUS)0x4003000AL)
421 #define NDIS_STATUS_DOT11_PHY_STATE_CHANGED ((NDIS_STATUS)0x4003000BL)
422 #define NDIS_STATUS_DOT11_LINK_QUALITY ((NDIS_STATUS)0x4003000CL)
423 #define NDIS_STATUS_DOT11_INCOMING_ASSOC_STARTED ((NDIS_STATUS)0x4003000DL)
424 #define NDIS_STATUS_DOT11_INCOMING_ASSOC_REQUEST_RECEIVED ((NDIS_STATUS)0x4003000EL)
425 #define NDIS_STATUS_DOT11_INCOMING_ASSOC_COMPLETION ((NDIS_STATUS)0x4003000FL)
426 #define NDIS_STATUS_DOT11_STOP_AP ((NDIS_STATUS)0x40030010L)
427 #define NDIS_STATUS_DOT11_PHY_FREQUENCY_ADOPTED ((NDIS_STATUS)0x40030011L)
428 #define NDIS_STATUS_DOT11_CAN_SUSTAIN_AP ((NDIS_STATUS)0x40030012L)
429 
430 #define NDIS_STATUS_WWAN_DEVICE_CAPS ((NDIS_STATUS)0x40041000)
431 #define NDIS_STATUS_WWAN_READY_INFO ((NDIS_STATUS)0x40041001)
432 #define NDIS_STATUS_WWAN_RADIO_STATE ((NDIS_STATUS)0x40041002)
433 #define NDIS_STATUS_WWAN_PIN_INFO ((NDIS_STATUS)0x40041003)
434 #define NDIS_STATUS_WWAN_PIN_LIST ((NDIS_STATUS)0x40041004)
435 #define NDIS_STATUS_WWAN_HOME_PROVIDER ((NDIS_STATUS)0x40041005)
436 #define NDIS_STATUS_WWAN_PREFERRED_PROVIDERS ((NDIS_STATUS)0x40041006)
437 #define NDIS_STATUS_WWAN_VISIBLE_PROVIDERS ((NDIS_STATUS)0x40041007)
438 #define NDIS_STATUS_WWAN_REGISTER_STATE ((NDIS_STATUS)0x40041008)
439 #define NDIS_STATUS_WWAN_PACKET_SERVICE ((NDIS_STATUS)0x40041009)
440 #define NDIS_STATUS_WWAN_SIGNAL_STATE ((NDIS_STATUS)0x4004100a)
441 #define NDIS_STATUS_WWAN_CONTEXT_STATE ((NDIS_STATUS)0x4004100b)
442 #define NDIS_STATUS_WWAN_PROVISIONED_CONTEXTS ((NDIS_STATUS)0x4004100c)
443 #define NDIS_STATUS_WWAN_SERVICE_ACTIVATION ((NDIS_STATUS)0x4004100d)
444 #define NDIS_STATUS_WWAN_SMS_CONFIGURATION ((NDIS_STATUS)0x4004100e)
445 #define NDIS_STATUS_WWAN_SMS_RECEIVE ((NDIS_STATUS)0x4004100f)
446 #define NDIS_STATUS_WWAN_SMS_SEND ((NDIS_STATUS)0x40041010)
447 #define NDIS_STATUS_WWAN_SMS_DELETE ((NDIS_STATUS)0x40041011)
448 #define NDIS_STATUS_WWAN_SMS_STATUS ((NDIS_STATUS)0x40041012)
449 #define NDIS_STATUS_WWAN_DNS_ADDRESS ((NDIS_STATUS)0x40041013)
450 
451 #define NDIS_STATUS_WWAN_VENDOR_SPECIFIC ((NDIS_STATUS)0x40043000)
452 
453 #endif /* NDIS_SUPPORT_NDIS6 */
454 
455 #if (NDIS_SUPPORT_NDIS620)
456 #define NDIS_STATUS_PM_WOL_PATTERN_REJECTED ((NDIS_STATUS)0x40030051L)
457 #define NDIS_STATUS_PM_OFFLOAD_REJECTED ((NDIS_STATUS)0x40030052L)
458 #define NDIS_STATUS_PM_CAPABILITIES_CHANGE ((NDIS_STATUS)0x40030053L)
459 #endif
460 
461 #define NDIS_STATUS_NOT_RESETTABLE ((NDIS_STATUS)0x80010001L)
462 #define NDIS_STATUS_SOFT_ERRORS ((NDIS_STATUS)0x80010003L)
463 #define NDIS_STATUS_HARD_ERRORS ((NDIS_STATUS)0x80010004L)
464 #define NDIS_STATUS_BUFFER_OVERFLOW ((NDIS_STATUS)STATUS_BUFFER_OVERFLOW)
465 #define NDIS_STATUS_FAILURE ((NDIS_STATUS)STATUS_UNSUCCESSFUL)
466 #define NDIS_STATUS_RESOURCES ((NDIS_STATUS)STATUS_INSUFFICIENT_RESOURCES)
467 #define NDIS_STATUS_CLOSING ((NDIS_STATUS)0xC0010002L)
468 #define NDIS_STATUS_BAD_VERSION ((NDIS_STATUS)0xC0010004L)
469 #define NDIS_STATUS_BAD_CHARACTERISTICS ((NDIS_STATUS)0xC0010005L)
470 #define NDIS_STATUS_ADAPTER_NOT_FOUND ((NDIS_STATUS)0xC0010006L)
471 #define NDIS_STATUS_OPEN_FAILED ((NDIS_STATUS)0xC0010007L)
472 #define NDIS_STATUS_DEVICE_FAILED ((NDIS_STATUS)0xC0010008L)
473 #define NDIS_STATUS_MULTICAST_FULL ((NDIS_STATUS)0xC0010009L)
474 #define NDIS_STATUS_MULTICAST_EXISTS ((NDIS_STATUS)0xC001000AL)
475 #define NDIS_STATUS_MULTICAST_NOT_FOUND ((NDIS_STATUS)0xC001000BL)
476 #define NDIS_STATUS_REQUEST_ABORTED ((NDIS_STATUS)0xC001000CL)
477 #define NDIS_STATUS_RESET_IN_PROGRESS ((NDIS_STATUS)0xC001000DL)
478 #define NDIS_STATUS_CLOSING_INDICATING ((NDIS_STATUS)0xC001000EL)
479 #define NDIS_STATUS_NOT_SUPPORTED ((NDIS_STATUS)STATUS_NOT_SUPPORTED)
480 #define NDIS_STATUS_INVALID_PACKET ((NDIS_STATUS)0xC001000FL)
481 #define NDIS_STATUS_OPEN_LIST_FULL ((NDIS_STATUS)0xC0010010L)
482 #define NDIS_STATUS_ADAPTER_NOT_READY ((NDIS_STATUS)0xC0010011L)
483 #define NDIS_STATUS_ADAPTER_NOT_OPEN ((NDIS_STATUS)0xC0010012L)
484 #define NDIS_STATUS_NOT_INDICATING ((NDIS_STATUS)0xC0010013L)
485 #define NDIS_STATUS_INVALID_LENGTH ((NDIS_STATUS)0xC0010014L)
486 #define NDIS_STATUS_INVALID_DATA ((NDIS_STATUS)0xC0010015L)
487 #define NDIS_STATUS_BUFFER_TOO_SHORT ((NDIS_STATUS)0xC0010016L)
488 #define NDIS_STATUS_INVALID_OID ((NDIS_STATUS)0xC0010017L)
489 #define NDIS_STATUS_ADAPTER_REMOVED ((NDIS_STATUS)0xC0010018L)
490 #define NDIS_STATUS_UNSUPPORTED_MEDIA ((NDIS_STATUS)0xC0010019L)
491 #define NDIS_STATUS_GROUP_ADDRESS_IN_USE ((NDIS_STATUS)0xC001001AL)
492 #define NDIS_STATUS_FILE_NOT_FOUND ((NDIS_STATUS)0xC001001BL)
493 #define NDIS_STATUS_ERROR_READING_FILE ((NDIS_STATUS)0xC001001CL)
494 #define NDIS_STATUS_ALREADY_MAPPED ((NDIS_STATUS)0xC001001DL)
495 #define NDIS_STATUS_RESOURCE_CONFLICT ((NDIS_STATUS)0xC001001EL)
496 #define NDIS_STATUS_NO_CABLE ((NDIS_STATUS)0xC001001FL)
497 
498 #define NDIS_STATUS_INVALID_SAP ((NDIS_STATUS)0xC0010020L)
499 #define NDIS_STATUS_SAP_IN_USE ((NDIS_STATUS)0xC0010021L)
500 #define NDIS_STATUS_INVALID_ADDRESS ((NDIS_STATUS)0xC0010022L)
501 #define NDIS_STATUS_VC_NOT_ACTIVATED ((NDIS_STATUS)0xC0010023L)
502 #define NDIS_STATUS_DEST_OUT_OF_ORDER ((NDIS_STATUS)0xC0010024L)
503 #define NDIS_STATUS_VC_NOT_AVAILABLE ((NDIS_STATUS)0xC0010025L)
504 #define NDIS_STATUS_CELLRATE_NOT_AVAILABLE ((NDIS_STATUS)0xC0010026L)
505 #define NDIS_STATUS_INCOMPATABLE_QOS ((NDIS_STATUS)0xC0010027L)
506 #define NDIS_STATUS_AAL_PARAMS_UNSUPPORTED ((NDIS_STATUS)0xC0010028L)
507 #define NDIS_STATUS_NO_ROUTE_TO_DESTINATION ((NDIS_STATUS)0xC0010029L)
508 
509 #define NDIS_STATUS_TOKEN_RING_OPEN_ERROR ((NDIS_STATUS)0xC0011000L)
510 #define NDIS_STATUS_INVALID_DEVICE_REQUEST ((NDIS_STATUS)STATUS_INVALID_DEVICE_REQUEST)
511 #define NDIS_STATUS_NETWORK_UNREACHABLE ((NDIS_STATUS)STATUS_NETWORK_UNREACHABLE)
512 #define NDIS_STATUS_HOST_UNREACHABLE ((NDIS_STATUS)STATUS_HOST_UNREACHABLE)
513 
514 #if NDIS_SUPPORT_NDIS6
515 
516 #define NDIS_STATUS_SEND_ABORTED ((NDIS_STATUS)STATUS_NDIS_REQUEST_ABORTED)
517 #define NDIS_STATUS_PAUSED ((NDIS_STATUS)STATUS_NDIS_PAUSED)
518 #define NDIS_STATUS_INTERFACE_NOT_FOUND ((NDIS_STATUS)STATUS_NDIS_INTERFACE_NOT_FOUND)
519 #define NDIS_STATUS_INVALID_PARAMETER ((NDIS_STATUS)STATUS_INVALID_PARAMETER)
520 #define NDIS_STATUS_UNSUPPORTED_REVISION ((NDIS_STATUS)STATUS_NDIS_UNSUPPORTED_REVISION)
521 #define NDIS_STATUS_INVALID_PORT ((NDIS_STATUS)STATUS_NDIS_INVALID_PORT)
522 #define NDIS_STATUS_INVALID_PORT_STATE ((NDIS_STATUS)STATUS_NDIS_INVALID_PORT_STATE)
523 #define NDIS_STATUS_INVALID_STATE ((NDIS_STATUS)STATUS_INVALID_DEVICE_STATE)
524 #define NDIS_STATUS_MEDIA_DISCONNECTED ((NDIS_STATUS)STATUS_NDIS_MEDIA_DISCONNECTED)
525 #define NDIS_STATUS_LOW_POWER_STATE ((NDIS_STATUS)STATUS_NDIS_LOW_POWER_STATE)
526 #define NDIS_STATUS_DOT11_AUTO_CONFIG_ENABLED ((NDIS_STATUS)STATUS_NDIS_DOT11_AUTO_CONFIG_ENABLED)
527 #define NDIS_STATUS_DOT11_MEDIA_IN_USE ((NDIS_STATUS)STATUS_NDIS_DOT11_MEDIA_IN_USE)
528 #define NDIS_STATUS_DOT11_POWER_STATE_INVALID ((NDIS_STATUS)STATUS_NDIS_DOT11_POWER_STATE_INVALID)
529 #define NDIS_STATUS_UPLOAD_IN_PROGRESS ((NDIS_STATUS)0xC0231001L)
530 #define NDIS_STATUS_REQUEST_UPLOAD ((NDIS_STATUS)0xC0231002L)
531 #define NDIS_STATUS_UPLOAD_REQUESTED ((NDIS_STATUS)0xC0231003L)
532 #define NDIS_STATUS_OFFLOAD_TCP_ENTRIES ((NDIS_STATUS)0xC0231004L)
533 #define NDIS_STATUS_OFFLOAD_PATH_ENTRIES ((NDIS_STATUS)0xC0231005L)
534 #define NDIS_STATUS_OFFLOAD_NEIGHBOR_ENTRIES ((NDIS_STATUS)0xC0231006L)
535 #define NDIS_STATUS_OFFLOAD_IP_ADDRESS_ENTRIES ((NDIS_STATUS)0xC0231007L)
536 #define NDIS_STATUS_OFFLOAD_HW_ADDRESS_ENTRIES ((NDIS_STATUS)0xC0231008L)
537 #define NDIS_STATUS_OFFLOAD_VLAN_ENTRIES ((NDIS_STATUS)0xC0231009L)
538 #define NDIS_STATUS_OFFLOAD_TCP_XMIT_BUFFER ((NDIS_STATUS)0xC023100AL)
539 #define NDIS_STATUS_OFFLOAD_TCP_RCV_BUFFER ((NDIS_STATUS)0xC023100BL)
540 #define NDIS_STATUS_OFFLOAD_TCP_RCV_WINDOW ((NDIS_STATUS)0xC023100CL)
541 #define NDIS_STATUS_OFFLOAD_VLAN_MISMATCH ((NDIS_STATUS)0xC023100DL)
542 #define NDIS_STATUS_OFFLOAD_DATA_NOT_ACCEPTED ((NDIS_STATUS)0xC023100EL)
543 #define NDIS_STATUS_OFFLOAD_POLICY ((NDIS_STATUS)0xC023100FL)
544 #define NDIS_STATUS_OFFLOAD_DATA_PARTIALLY_ACCEPTED ((NDIS_STATUS)0xC0231010L)
545 #define NDIS_STATUS_OFFLOAD_REQUEST_RESET ((NDIS_STATUS)0xC0231011L)
546 
547 #if NDIS_SUPPORT_NDIS620
548 #define NDIS_STATUS_PM_WOL_PATTERN_LIST_FULL ((NDIS_STATUS)STATUS_NDIS_PM_WOL_PATTERN_LIST_FULL)
549 #define NDIS_STATUS_PM_PROTOCOL_OFFLOAD_LIST_FULL ((NDIS_STATUS)STATUS_NDIS_PM_PROTOCOL_OFFLOAD_LIST_FULL)
550 #endif
551 
552 #endif /* NDIS_SUPPORT_NDIS6 */
553 
554 #if (NDIS_SUPPORT_NDIS620)
555 #define NDIS_STATUS_OFFLOAD_CONNECTION_REJECTED ((NDIS_STATUS)STATUS_NDIS_OFFLOAD_CONNECTION_REJECTED)
556 #endif
557 
558 /* NDIS error codes for error logging */
559 
560 #define NDIS_ERROR_CODE ULONG
561 
562 #define NDIS_ERROR_CODE_RESOURCE_CONFLICT EVENT_NDIS_RESOURCE_CONFLICT
563 #define NDIS_ERROR_CODE_OUT_OF_RESOURCES EVENT_NDIS_OUT_OF_RESOURCE
564 #define NDIS_ERROR_CODE_HARDWARE_FAILURE EVENT_NDIS_HARDWARE_FAILURE
565 #define NDIS_ERROR_CODE_ADAPTER_NOT_FOUND EVENT_NDIS_ADAPTER_NOT_FOUND
566 #define NDIS_ERROR_CODE_INTERRUPT_CONNECT EVENT_NDIS_INTERRUPT_CONNECT
567 #define NDIS_ERROR_CODE_DRIVER_FAILURE EVENT_NDIS_DRIVER_FAILURE
568 #define NDIS_ERROR_CODE_BAD_VERSION EVENT_NDIS_BAD_VERSION
569 #define NDIS_ERROR_CODE_TIMEOUT EVENT_NDIS_TIMEOUT
570 #define NDIS_ERROR_CODE_NETWORK_ADDRESS EVENT_NDIS_NETWORK_ADDRESS
571 #define NDIS_ERROR_CODE_UNSUPPORTED_CONFIGURATION EVENT_NDIS_UNSUPPORTED_CONFIGURATION
572 #define NDIS_ERROR_CODE_INVALID_VALUE_FROM_ADAPTER EVENT_NDIS_INVALID_VALUE_FROM_ADAPTER
573 #define NDIS_ERROR_CODE_MISSING_CONFIGURATION_PARAMETER EVENT_NDIS_MISSING_CONFIGURATION_PARAMETER
574 #define NDIS_ERROR_CODE_BAD_IO_BASE_ADDRESS EVENT_NDIS_BAD_IO_BASE_ADDRESS
575 #define NDIS_ERROR_CODE_RECEIVE_SPACE_SMALL EVENT_NDIS_RECEIVE_SPACE_SMALL
576 #define NDIS_ERROR_CODE_ADAPTER_DISABLED EVENT_NDIS_ADAPTER_DISABLED
577 
578 /* Memory allocation flags. Used by Ndis[Allocate|Free]Memory */
579 #define NDIS_MEMORY_CONTIGUOUS 0x00000001
580 #define NDIS_MEMORY_NONCACHED 0x00000002
581 
582 /* NIC attribute flags. Used by NdisMSetAttributes(Ex) */
583 #define NDIS_ATTRIBUTE_IGNORE_PACKET_TIMEOUT 0x00000001
584 #define NDIS_ATTRIBUTE_IGNORE_REQUEST_TIMEOUT 0x00000002
585 #define NDIS_ATTRIBUTE_IGNORE_TOKEN_RING_ERRORS 0x00000004
586 #define NDIS_ATTRIBUTE_BUS_MASTER 0x00000008
587 #define NDIS_ATTRIBUTE_INTERMEDIATE_DRIVER 0x00000010
588 #define NDIS_ATTRIBUTE_DESERIALIZE 0x00000020
589 #define NDIS_ATTRIBUTE_NO_HALT_ON_SUSPEND 0x00000040
590 #define NDIS_ATTRIBUTE_SURPRISE_REMOVE_OK 0x00000080
591 #define NDIS_ATTRIBUTE_NOT_CO_NDIS 0x00000100
592 #define NDIS_ATTRIBUTE_USES_SAFE_BUFFER_APIS 0x00000200
593 
594 /* Lock */
595 
596 #if NDIS_SUPPORT_60_COMPATIBLE_API
597 
598 typedef union _NDIS_RW_LOCK_REFCOUNT {
600  UCHAR cacheLine[16];
602 
603 typedef struct _NDIS_RW_LOCK {
604  __MINGW_EXTENSION union {
605  __MINGW_EXTENSION struct {
607  PVOID Context;
608  };
609  UCHAR Reserved[16];
610  };
611  __MINGW_EXTENSION union {
614  __MINGW_EXTENSION struct {
618  };
619  };
621 
622 typedef struct _LOCK_STATE {
624  KIRQL OldIrql;
626 
627 #endif /* NDIS_SUPPORT_60_COMPATIBLE_API */
628 
629 /* Timer */
630 
633 _Function_class_(NDIS_TIMER_FUNCTION)
634 typedef VOID
635 (NTAPI NDIS_TIMER_FUNCTION)(
636  _In_ PVOID SystemSpecific1,
640 typedef NDIS_TIMER_FUNCTION *PNDIS_TIMER_FUNCTION;
641 
642 typedef struct _NDIS_TIMER {
646 
647 /* Hardware */
648 
653 
654 /* Flag bits */
655 #define READABLE_LOCAL_CLOCK 0x00000001
656 #define CLOCK_NETWORK_DERIVED 0x00000002
657 #define CLOCK_PRECISION 0x00000004
658 #define RECEIVE_TIME_INDICATION_CAPABLE 0x00000008
659 #define TIMED_SEND_CAPABLE 0x00000010
660 #define TIME_STAMP_CAPABLE 0x00000020
661 
662 /* NDIS packet filter bits (OID_GEN_CURRENT_PACKET_FILTER) */
663 #define NDIS_PACKET_TYPE_DIRECTED 0x00000001
664 #define NDIS_PACKET_TYPE_MULTICAST 0x00000002
665 #define NDIS_PACKET_TYPE_ALL_MULTICAST 0x00000004
666 #define NDIS_PACKET_TYPE_BROADCAST 0x00000008
667 #define NDIS_PACKET_TYPE_SOURCE_ROUTING 0x00000010
668 #define NDIS_PACKET_TYPE_PROMISCUOUS 0x00000020
669 #define NDIS_PACKET_TYPE_SMT 0x00000040
670 #define NDIS_PACKET_TYPE_ALL_LOCAL 0x00000080
671 #define NDIS_PACKET_TYPE_GROUP 0x00001000
672 #define NDIS_PACKET_TYPE_ALL_FUNCTIONAL 0x00002000
673 #define NDIS_PACKET_TYPE_FUNCTIONAL 0x00004000
674 #define NDIS_PACKET_TYPE_MAC_FRAME 0x00008000
675 
676 /* NDIS protocol option bits (OID_GEN_PROTOCOL_OPTIONS) */
677 #define NDIS_PROT_OPTION_ESTIMATED_LENGTH 0x00000001
678 #define NDIS_PROT_OPTION_NO_LOOPBACK 0x00000002
679 #define NDIS_PROT_OPTION_NO_RSVD_ON_RCVPKT 0x00000004
680 
681 /* NDIS MAC option bits (OID_GEN_MAC_OPTIONS) */
682 #define NDIS_MAC_OPTION_COPY_LOOKAHEAD_DATA 0x00000001
683 #define NDIS_MAC_OPTION_RECEIVE_SERIALIZED 0x00000002
684 #define NDIS_MAC_OPTION_TRANSFERS_NOT_PEND 0x00000004
685 #define NDIS_MAC_OPTION_NO_LOOPBACK 0x00000008
686 #define NDIS_MAC_OPTION_FULL_DUPLEX 0x00000010
687 #define NDIS_MAC_OPTION_EOTX_INDICATION 0x00000020
688 #define NDIS_MAC_OPTION_8021P_PRIORITY 0x00000040
689 #define NDIS_MAC_OPTION_RESERVED 0x80000000
690 
691 #define NDIS_GUID_TO_OID 0x00000001
692 #define NDIS_GUID_TO_STATUS 0x00000002
693 #define NDIS_GUID_ANSI_STRING 0x00000004
694 #define NDIS_GUID_UNICODE_STRING 0x00000008
695 #define NDIS_GUID_ARRAY 0x00000010
696 
697 #if NDIS_LEGACY_DRIVER
698 
699 /* NDIS_PACKET_PRIVATE.Flags constants */
700 #define fPACKET_WRAPPER_RESERVED 0x3f
701 #define fPACKET_CONTAINS_MEDIA_SPECIFIC_INFO 0x40
702 #define fPACKET_ALLOCATED_BY_NDIS 0x80
703 
704 #define NDIS_FLAGS_PROTOCOL_ID_MASK 0x0000000f
705 #define NDIS_FLAGS_MULTICAST_PACKET 0x00000010
706 #define NDIS_FLAGS_RESERVED2 0x00000020
707 #define NDIS_FLAGS_RESERVED3 0x00000040
708 #define NDIS_FLAGS_DONT_LOOPBACK 0x00000080
709 #define NDIS_FLAGS_IS_LOOPBACK_PACKET 0x00000100
710 #define NDIS_FLAGS_LOOPBACK_ONLY 0x00000200
711 #define NDIS_FLAGS_RESERVED4 0x00000400
712 #define NDIS_FLAGS_DOUBLE_BUFFERED 0x00000800
713 #define NDIS_FLAGS_SENT_AT_DPC 0x00001000
714 #define NDIS_FLAGS_USES_SG_BUFFER_LIST 0x00002000
715 #define NDIS_FLAGS_USES_ORIGINAL_PACKET 0x00004000
716 #define NDIS_FLAGS_PADDED 0x00010000
717 #define NDIS_FLAGS_XLATE_AT_TOP 0x00020000
718 
720 
721 typedef struct _NDIS_PACKET_PRIVATE {
733 
734 typedef struct _NDIS_PACKET {
736  __MINGW_EXTENSION union {
737  __MINGW_EXTENSION struct {
740  };
741  __MINGW_EXTENSION struct {
744  };
745  __MINGW_EXTENSION struct {
746  UCHAR MacReserved[4 * sizeof(PVOID)];
747  };
748  };
752 
753 typedef struct _NDIS_PACKET_STACK {
757 
758 #endif /* NDIS_LEGACY_DRIVER */
759 
760 typedef enum _NDIS_CLASS_ID {
765 } NDIS_CLASS_ID;
766 
773 
774 #if NDIS_LEGACY_DRIVER
775 typedef struct _NDIS_PACKET_OOB_DATA {
776  __MINGW_EXTENSION union {
779  };
786 #endif
787 
788 /* Request types used by NdisRequest */
789 typedef enum _NDIS_REQUEST_TYPE {
802 #if NDIS_SUPPORT_NDIS6
803  NdisRequestMethod,
804 #endif
806 
807 #if NDIS_LEGACY_DRIVER
808 typedef struct _NDIS_REQUEST {
809  UCHAR MacReserved[4 * sizeof(PVOID)];
811  union _DATA {
825  } SET_INFORMATION;
826  } DATA;
827 #if (defined(NDIS50) || defined(NDIS51) || defined(NDIS50_MINIPORT) || defined(NDIS51_MINIPORT))
828  UCHAR NdisReserved[9 * sizeof(PVOID)];
829  __MINGW_EXTENSION union {
830  UCHAR CallMgrReserved[2 * sizeof(PVOID)];
831  UCHAR ProtocolReserved[2 * sizeof(PVOID)];
832  };
833  UCHAR MiniportReserved[2 * sizeof(PVOID)];
834 #endif
836 #endif /* NDIS_LEGACY_DRIVER */
837 
838 /* Wide Area Networks definitions */
839 
840 #if NDIS_LEGACY_DRIVER
841 typedef struct _NDIS_WAN_PACKET {
856 #endif
857 
858 /* DMA channel information */
859 
860 typedef struct _NDIS_DMA_DESCRIPTION {
869 
870 typedef struct _NDIS_DMA_BLOCK {
877 
879 
880 #define NDIS_DMA_24BITS ((NDIS_DMA_SIZE)0)
881 #define NDIS_DMA_32BITS ((NDIS_DMA_SIZE)1)
882 #define NDIS_DMA_64BITS ((NDIS_DMA_SIZE)2)
883 
884 typedef enum _NDIS_PROCESSOR_TYPE {
892 
897 
898 /* Possible hardware architecture */
899 typedef enum _NDIS_INTERFACE_TYPE {
919 
920 #define NdisInterruptLevelSensitive LevelSensitive
921 #define NdisInterruptLatched Latched
922 
924 
925 typedef enum _NDIS_PARAMETER_TYPE {
932 
933 typedef struct _BINARY_DATA {
936 } BINARY_DATA;
937 
940  union {
944  } ParameterData;
946 
948 
953 
954 typedef struct _NDIS_WAN_LINE_DOWN {
958 
959 typedef struct _NDIS_WAN_LINE_UP {
971 
972 typedef NTSTATUS
975  _Out_ HANDLE *TdiHandle);
976 
977 typedef NTSTATUS
979  _In_ PUNICODE_STRING UpperComponent,
980  _In_ PUNICODE_STRING LowerComponent,
981  _In_ PUNICODE_STRING BindList,
982  _In_ PVOID ReconfigBuffer,
983  _In_ UINT ReconfigBufferSize,
985 
986 typedef struct _OID_LIST OID_LIST, *POID_LIST;
987 
988 /* PnP state */
989 
999 
1000 #define NDIS_DEVICE_NOT_STOPPABLE 0x00000001
1001 #define NDIS_DEVICE_NOT_REMOVEABLE 0x00000002
1002 #define NDIS_DEVICE_NOT_SUSPENDABLE 0x00000004
1003 #define NDIS_DEVICE_DISABLE_PM 0x00000008
1004 #define NDIS_DEVICE_DISABLE_WAKE_UP 0x00000010
1005 #define NDIS_DEVICE_DISABLE_WAKE_ON_RECONNECT 0x00000020
1006 #define NDIS_DEVICE_RESERVED 0x00000040
1007 #define NDIS_DEVICE_DISABLE_WAKE_ON_MAGIC_PACKET 0x00000080
1008 #define NDIS_DEVICE_DISABLE_WAKE_ON_PATTERN_MATCH 0x00000100
1009 
1010 /* Protocol types supported by NDIS */
1011 #define NDIS_PROTOCOL_ID_DEFAULT 0x00
1012 #define NDIS_PROTOCOL_ID_TCP_IP 0x02
1013 #define NDIS_PROTOCOL_ID_IPX 0x06
1014 #define NDIS_PROTOCOL_ID_NBF 0x07
1015 #define NDIS_PROTOCOL_ID_MAX 0x0F
1016 #define NDIS_PROTOCOL_ID_MASK 0x0F
1017 
1019 
1020 #define CO_ADDRESS_FAMILY_Q2931 ((NDIS_AF)0x1)
1021 #define CO_ADDRESS_FAMILY_PSCHED ((NDIS_AF)0x2)
1022 #define CO_ADDRESS_FAMILY_L2TP ((NDIS_AF)0x3)
1023 #define CO_ADDRESS_FAMILY_IRDA ((NDIS_AF)0x4)
1024 #define CO_ADDRESS_FAMILY_1394 ((NDIS_AF)0x5)
1025 #define CO_ADDRESS_FAMILY_PPP ((NDIS_AF)0x6)
1026 #define CO_ADDRESS_FAMILY_INFINIBAND ((NDIS_AF)0x7)
1027 #define CO_ADDRESS_FAMILY_TAPI ((NDIS_AF)0x800)
1028 #define CO_ADDRESS_FAMILY_TAPI_PROXY ((NDIS_AF)0x801)
1029 
1030 #define CO_ADDRESS_FAMILY_PROXY 0x80000000
1031 
1032 typedef struct _CO_ADDRESS_FAMILY {
1037 
1038 typedef struct _CO_SPECIFIC_PARAMETERS {
1043 
1049 
1050 /* CO_MEDIA_PARAMETERS.Flags constants */
1051 #define RECEIVE_TIME_INDICATION 0x00000001
1052 #define USE_TIME_STAMPS 0x00000002
1053 #define TRANSMIT_VC 0x00000004
1054 #define RECEIVE_VC 0x00000008
1055 #define INDICATE_ERRED_PACKETS 0x00000010
1056 #define INDICATE_END_OF_TX 0x00000020
1057 #define RESERVE_RESOURCES_VC 0x00000040
1058 #define ROUND_DOWN_FLOW 0x00000080
1059 #define ROUND_UP_FLOW 0x00000100
1060 
1061 typedef struct _CO_MEDIA_PARAMETERS {
1067 
1068 /* CO_CALL_PARAMETERS.Flags constants */
1069 #define PERMANENT_VC 0x00000001
1070 #define CALL_PARAMETERS_CHANGED 0x00000002
1071 #define QUERY_CALL_PARAMETERS 0x00000004
1072 #define BROADCAST_VC 0x00000008
1073 #define MULTIPOINT_VC 0x00000010
1074 
1075 typedef struct _CO_CALL_PARAMETERS {
1080 
1081 typedef struct _CO_SAP {
1085 } CO_SAP, *PCO_SAP;
1086 
1087 #if NDIS_LEGACY_DRIVER
1088 typedef struct _NDIS_IPSEC_PACKET_INFO {
1089  __MINGW_EXTENSION union {
1090  struct {
1093  } Transmit;
1094  struct {
1099  } Receive;
1100  };
1102 #endif
1103 
1104 #if (NDIS_SUPPORT_NDIS6 || NDIS60)
1105 typedef struct _NDIS_IPSEC_OFFLOAD_V1_NET_BUFFER_LIST_INFO {
1106  __MINGW_EXTENSION union {
1107  struct {
1108  NDIS_HANDLE OffloadHandle;
1109  } Transmit;
1110  struct {
1111  USHORT SaDeleteReq:1;
1112  USHORT CryptoDone:1;
1113  USHORT NextCryptoDone:1;
1114  USHORT Pad:13;
1115  USHORT CryptoStatus;
1116  } Receive;
1117  };
1118 } NDIS_IPSEC_OFFLOAD_V1_NET_BUFFER_LIST_INFO, *PNDIS_IPSEC_OFFLOAD_V1_NET_BUFFER_LIST_INFO;
1119 #endif
1120 
1121 /* NDIS_MAC_FRAGMENT.Errors constants */
1122 #define WAN_ERROR_CRC 0x00000001
1123 #define WAN_ERROR_FRAMING 0x00000002
1124 #define WAN_ERROR_HARDWAREOVERRUN 0x00000004
1125 #define WAN_ERROR_BUFFEROVERRUN 0x00000008
1126 #define WAN_ERROR_TIMEOUT 0x00000010
1127 #define WAN_ERROR_ALIGNMENT 0x00000020
1128 
1129 typedef struct _NDIS_MAC_FRAGMENT {
1133 
1134 typedef struct _NDIS_MAC_LINE_DOWN {
1137 
1138 typedef struct _NDIS_MAC_LINE_UP {
1146 
1147 typedef struct _NDIS_PACKET_8021Q_INFO {
1148  __MINGW_EXTENSION union {
1149  struct {
1154  } TagHeader;
1156  };
1158 
1174 
1175 #if NDIS_LEGACY_DRIVER
1176 
1177 typedef struct _NDIS_PACKET_EXTENSION {
1180 
1181 typedef enum _NDIS_TASK {
1186 } NDIS_TASK, *PNDIS_TASK;
1187 
1188 typedef enum _NDIS_ENCAPSULATION {
1196 
1199  struct {
1202  } Flags;
1205 
1213 
1214 typedef struct _NDIS_TASK_OFFLOAD {
1222 
1224  struct {
1230  } V4Transmit;
1231  struct {
1234  ULONG TcpChecksum:1;
1235  ULONG UdpChecksum:1;
1236  ULONG IpChecksum:1;
1237  } V4Receive;
1238  struct {
1241  ULONG TcpChecksum:1;
1242  ULONG UdpChecksum:1;
1243  } V6Transmit;
1244  struct {
1247  ULONG TcpChecksum:1;
1248  ULONG UdpChecksum:1;
1249  } V6Receive;
1251 
1252 #define NDIS_TASK_TCP_LARGE_SEND_V0 0
1253 
1261 
1262 typedef struct _NDIS_TASK_IPSEC {
1263  struct {
1268  } Supported;
1269  struct {
1276  } V4AH;
1277  struct {
1279  ULONG RESERVED:1;
1282  ULONG Transport:1;
1283  ULONG Tunnel:1;
1284  ULONG Send:1;
1285  ULONG Receive:1;
1286  } V4ESP;
1288 
1289 #endif /* NDIS_LEGACY_DRIVER */
1290 
1291 #define IPSEC_TPT_UDPESP_ENCAPTYPE_IKE 0x00000001
1292 #define IPSEC_TUN_UDPESP_ENCAPTYPE_IKE 0x00000002
1293 #define IPSEC_TPTOVERTUN_UDPESP_ENCAPTYPE_IKE 0x00000004
1294 #define IPSEC_TPT_UDPESP_OVER_PURE_TUN_ENCAPTYPE_IKE 0x00000008
1295 #define IPSEC_TPT_UDPESP_ENCAPTYPE_OTHER 0x00000010
1296 #define IPSEC_TUN_UDPESP_ENCAPTYPE_OTHER 0x00000020
1297 #define IPSEC_TPTOVERTUN_UDPESP_ENCAPTYPE_OTHER 0x00000040
1298 #define IPSEC_TPT_UDPESP_OVER_PURE_TUN_ENCAPTYPE_OTHER 0x00000080
1299 
1300 #if NDIS_LEGACY_DRIVER
1301 
1302 /*
1303  * PNDIS_PACKET
1304  * NDIS_GET_ORIGINAL_PACKET(
1305  * IN PNDIS_PACKET Packet);
1306  */
1307 #define NDIS_GET_ORIGINAL_PACKET(Packet) \
1308  NDIS_PER_PACKET_INFO_FROM_PACKET(Packet, OriginalPacketInfo)
1309 
1310 /*
1311  * PVOID
1312  * NDIS_GET_PACKET_CANCEL_ID(
1313  * IN PNDIS_PACKET Packet);
1314  */
1315 #define NDIS_GET_PACKET_CANCEL_ID(Packet) \
1316  NDIS_PER_PACKET_INFO_FROM_PACKET(Packet, PacketCancelId)
1317 
1318 /*
1319  * PNDIS_PACKET_EXTENSION
1320  * NDIS_PACKET_EXTENSION_FROM_PACKET(
1321  * IN PNDIS_PACKET Packet);
1322  */
1323 #define NDIS_PACKET_EXTENSION_FROM_PACKET(Packet) \
1324  ((PNDIS_PACKET_EXTENSION)((PUCHAR)(Packet) \
1325  + (Packet)->Private.NdisPacketOobOffset + sizeof(NDIS_PACKET_OOB_DATA)))
1326 
1327 /*
1328  * PVOID
1329  * NDIS_PER_PACKET_INFO_FROM_PACKET(
1330  * IN OUT PNDIS_PACKET Packet,
1331  * IN NDIS_PER_PACKET_INFO InfoType);
1332  */
1333 #define NDIS_PER_PACKET_INFO_FROM_PACKET(Packet, InfoType) \
1334  ((PNDIS_PACKET_EXTENSION)((PUCHAR)(Packet) + (Packet)->Private.NdisPacketOobOffset \
1335  + sizeof(NDIS_PACKET_OOB_DATA)))->NdisPacketInfo[(InfoType)]
1336 
1337 /*
1338  * VOID
1339  * NDIS_SET_ORIGINAL_PACKET(
1340  * IN OUT PNDIS_PACKET Packet,
1341  * IN PNDIS_PACKET OriginalPacket);
1342  */
1343 #define NDIS_SET_ORIGINAL_PACKET(Packet, OriginalPacket) \
1344  NDIS_PER_PACKET_INFO_FROM_PACKET(Packet, OriginalPacketInfo) = (OriginalPacket)
1345 
1346 /*
1347  * VOID
1348  * NDIS_SET_PACKET_CANCEL_ID(
1349  * IN PNDIS_PACKET Packet
1350  * IN ULONG_PTR CancelId);
1351  */
1352 #define NDIS_SET_PACKET_CANCEL_ID(Packet, CancelId) \
1353  NDIS_PER_PACKET_INFO_FROM_PACKET(Packet, PacketCancelId) = (CancelId)
1354 
1355 #define NdisSetPacketCancelId(_Packet, _CancelId) NDIS_SET_PACKET_CANCEL_ID(_Packet, _CancelId)
1356 #define NdisGetPacketCancelId(_Packet) NDIS_GET_PACKET_CANCEL_ID(_Packet)
1357 
1358 #endif /* NDIS_LEGACY_DRIVER */
1359 
1360 #if NDIS_SUPPORT_NDIS6
1361 typedef struct _NDIS_GENERIC_OBJECT {
1363  PVOID Caller;
1364  PVOID CallersCaller;
1366 } NDIS_GENERIC_OBJECT, *PNDIS_GENERIC_OBJECT;
1367 #endif
1368 
1369 /* NDIS_TASK_OFFLOAD_HEADER.Version constants */
1370 #define NDIS_TASK_OFFLOAD_VERSION 1
1371 
1372 #define MAX_HASHES 4
1373 #define TRUNCATED_HASH_LEN 12
1374 
1375 #define CRYPTO_SUCCESS 0
1376 #define CRYPTO_GENERIC_ERROR 1
1377 #define CRYPTO_TRANSPORT_AH_AUTH_FAILED 2
1378 #define CRYPTO_TRANSPORT_ESP_AUTH_FAILED 3
1379 #define CRYPTO_TUNNEL_AH_AUTH_FAILED 4
1380 #define CRYPTO_TUNNEL_ESP_AUTH_FAILED 5
1381 #define CRYPTO_INVALID_PACKET_SYNTAX 6
1382 #define CRYPTO_INVALID_PROTOCOL 7
1383 
1385  __MINGW_EXTENSION union {
1386  struct {
1392  } Transmit;
1393  struct {
1401  } Receive;
1403  };
1405 
1406 typedef struct _NDIS_WAN_CO_FRAGMENT {
1409 
1410 typedef struct _NDIS_WAN_FRAGMENT {
1414 
1415 typedef struct _WAN_CO_LINKPARAMS {
1420 
1421 typedef struct _NDIS_WAN_GET_STATS {
1438 
1439 /* Call Manager */
1440 
1441 typedef VOID
1444  IN NDIS_HANDLE CallMgrVcContext,
1446 
1447 typedef NDIS_STATUS
1449  IN NDIS_HANDLE CallMgrVcContext,
1453 
1454 typedef NDIS_STATUS
1457 
1458 typedef NDIS_STATUS
1460  IN NDIS_HANDLE CallMgrVcContext,
1462  IN PVOID CloseData OPTIONAL,
1463  IN UINT Size OPTIONAL);
1464 
1465 typedef NDIS_STATUS
1468 
1469 typedef VOID
1472  IN NDIS_HANDLE CallMgrVcContext);
1473 
1474 typedef NDIS_STATUS
1477  IN PVOID CloseData OPTIONAL,
1478  IN UINT Size OPTIONAL);
1479 
1480 typedef VOID
1483  IN NDIS_HANDLE CallMgrVcContext,
1485 
1486 typedef NDIS_STATUS
1488  IN NDIS_HANDLE CallMgrVcContext,
1492 
1493 typedef NDIS_STATUS
1495  IN NDIS_HANDLE CallMgrVcContext,
1497 
1498 typedef NDIS_STATUS
1500  IN NDIS_HANDLE CallMgrBindingContext,
1504 
1505 typedef NDIS_STATUS
1508  IN PCO_SAP Sap,
1511 
1512 typedef NDIS_STATUS
1517 
1518 typedef NDIS_STATUS
1521 
1522 #define PROTOCOL_RESERVED_SIZE_IN_PACKET (4 * sizeof(PVOID))
1523 
1524 /* Prototypes for NDIS 5.0 protocol characteristics */
1525 
1527 typedef VOID
1528 (NTAPI *CO_SEND_COMPLETE_HANDLER)(
1532 
1534 typedef VOID
1535 (NTAPI *CO_STATUS_HANDLER)(
1541 
1543 typedef UINT
1544 (NTAPI *CO_RECEIVE_PACKET_HANDLER)(
1548 
1550 typedef NDIS_STATUS
1551 (NTAPI *CO_REQUEST_HANDLER)(
1556 
1558 typedef VOID
1559 (NTAPI *CO_REQUEST_COMPLETE_HANDLER)(
1565 
1585  CO_REQUEST_HANDLER CmRequestHandler;
1586  CO_REQUEST_COMPLETE_HANDLER CmRequestCompleteHandler;
1588 
1589 
1590 
1591 /* Call Manager clients */
1592 
1597 
1598 typedef VOID
1602 
1603 typedef VOID
1607  IN PCO_SAP Sap,
1609 
1610 typedef VOID
1614 
1615 typedef VOID
1621 
1622 typedef VOID
1627 
1628 typedef VOID
1633 
1634 typedef VOID
1640 
1641 typedef VOID
1645 
1646 typedef NDIS_STATUS
1651 
1652 typedef VOID
1656 
1657 typedef VOID
1659  IN NDIS_STATUS CloseStatus,
1661  IN PVOID CloseData OPTIONAL,
1662  IN UINT Size OPTIONAL);
1663 
1664 typedef VOID
1666  IN NDIS_STATUS DropStatus,
1668  IN PVOID CloseData OPTIONAL,
1669  IN UINT Size OPTIONAL);
1670 
1671 typedef VOID
1674 
1675 
1683  CO_REQUEST_HANDLER ClRequestHandler;
1684  CO_REQUEST_COMPLETE_HANDLER ClRequestCompleteHandler;
1700 
1701 
1702 /* NDIS protocol structures */
1703 
1704 /* Prototypes for NDIS 3.0 protocol characteristics */
1705 
1706 typedef VOID
1711 
1712 typedef VOID
1716 
1717 typedef VOID
1721 
1722 typedef VOID
1727 
1728 typedef VOID
1734 
1735 typedef VOID
1738 
1739 typedef VOID
1744 
1745 typedef VOID
1750 
1751 typedef VOID
1756  _In_ UINT BytesTransferred);
1757 
1758 typedef VOID
1760  VOID);
1761 
1762 typedef NDIS_STATUS
1765  _In_ NDIS_HANDLE MacReceiveContext,
1766  _In_ PVOID HeaderBuffer,
1767  _In_ UINT HeaderBufferSize,
1768  _In_ PVOID LookAheadBuffer,
1769  _In_ UINT LookaheadBufferSize,
1770  _In_ UINT PacketSize);
1771 
1772 typedef NDIS_STATUS
1774  _In_ NDIS_HANDLE NdisLinkHandle,
1775  _In_ PUCHAR Packet,
1777 
1778 typedef VOID
1781 
1782 /* Protocol characteristics for NDIS 3.0 protocols */
1783 
1784 #define NDIS30_PROTOCOL_CHARACTERISTICS_S \
1785  UCHAR MajorNdisVersion; \
1786  UCHAR MinorNdisVersion; \
1787  USHORT Filler; \
1788  _ANONYMOUS_UNION union { \
1789  UINT Reserved; \
1790  UINT Flags; \
1791  } DUMMYUNIONNAME; \
1792  OPEN_ADAPTER_COMPLETE_HANDLER OpenAdapterCompleteHandler; \
1793  CLOSE_ADAPTER_COMPLETE_HANDLER CloseAdapterCompleteHandler; \
1794  _ANONYMOUS_UNION union { \
1795  SEND_COMPLETE_HANDLER SendCompleteHandler; \
1796  WAN_SEND_COMPLETE_HANDLER WanSendCompleteHandler; \
1797  } DUMMYUNIONNAME2; \
1798  _ANONYMOUS_UNION union { \
1799  TRANSFER_DATA_COMPLETE_HANDLER TransferDataCompleteHandler; \
1800  WAN_TRANSFER_DATA_COMPLETE_HANDLER WanTransferDataCompleteHandler; \
1801  } DUMMYUNIONNAME3; \
1802  RESET_COMPLETE_HANDLER ResetCompleteHandler; \
1803  REQUEST_COMPLETE_HANDLER RequestCompleteHandler; \
1804  _ANONYMOUS_UNION union { \
1805  RECEIVE_HANDLER ReceiveHandler; \
1806  WAN_RECEIVE_HANDLER WanReceiveHandler; \
1807  } DUMMYUNIONNAME4; \
1808  RECEIVE_COMPLETE_HANDLER ReceiveCompleteHandler; \
1809  STATUS_HANDLER StatusHandler; \
1810  STATUS_COMPLETE_HANDLER StatusCompleteHandler; \
1811  NDIS_STRING Name;
1812 
1816 
1817 
1818 /* Prototypes for NDIS 4.0 protocol characteristics */
1819 
1820 typedef INT
1824 
1825 typedef VOID
1828  IN NDIS_HANDLE BindContext,
1830  IN PVOID SystemSpecific1,
1832 
1833 typedef VOID
1837  IN NDIS_HANDLE UnbindContext);
1838 
1839 typedef NDIS_STATUS
1843 
1844 typedef VOID
1846  VOID);
1847 
1848 /* Protocol characteristics for NDIS 4.0 protocols */
1849 
1854  __MINGW_EXTENSION union {
1857  };
1860  __MINGW_EXTENSION union {
1863  };
1864  __MINGW_EXTENSION union {
1867  };
1870  __MINGW_EXTENSION union {
1873  };
1884 
1885 typedef VOID
1886 (NTAPI PROTCOL_CO_AF_REGISTER_NOTIFY)(
1889 typedef PROTCOL_CO_AF_REGISTER_NOTIFY *CO_AF_REGISTER_NOTIFY_HANDLER;
1890 
1891 #if NDIS_LEGACY_PROTOCOL
1892 
1894 #ifdef __cplusplus
1895  NDIS40_PROTOCOL_CHARACTERISTICS Ndis40Chars;
1896 #else
1898 #endif
1900  CO_SEND_COMPLETE_HANDLER CoSendCompleteHandler;
1901  CO_STATUS_HANDLER CoStatusHandler;
1902  CO_RECEIVE_PACKET_HANDLER CoReceivePacketHandler;
1905 
1906 #if (defined(NDIS50) || defined(NDIS51))
1908 #else
1910 #endif
1911 
1913 
1914 #endif /* NDIS_LEGACY_PROTOCOL */
1915 
1916 /* Prototypes for NDIS_MINIPORT_CHARACTERISTICS */
1917 
1918 typedef BOOLEAN
1920  _In_ NDIS_HANDLE MiniportAdapterContext);
1921 
1922 typedef VOID
1924  _In_ NDIS_HANDLE MiniportAdapterContext);
1925 
1926 typedef VOID
1928  _In_ NDIS_HANDLE MiniportAdapterContext);
1929 
1930 typedef VOID
1932  _In_ NDIS_HANDLE MiniportAdapterContext);
1933 
1934 typedef VOID
1936  _In_ NDIS_HANDLE MiniportAdapterContext);
1937 
1938 typedef NDIS_STATUS
1942  _In_ PNDIS_MEDIUM MediumArray,
1944  _In_ NDIS_HANDLE MiniportAdapterContext,
1946 
1947 typedef VOID
1949  _Out_ PBOOLEAN InterruptRecognized,
1950  _Out_ PBOOLEAN QueueMiniportHandleInterrupt,
1951  _In_ NDIS_HANDLE MiniportAdapterContext);
1952 
1953 typedef NDIS_STATUS
1955  _In_ NDIS_HANDLE MiniportAdapterContext,
1956  _In_ NDIS_OID Oid,
1957  _In_ PVOID InformationBuffer,
1958  _In_ ULONG InformationBufferLength,
1960  _Out_ PULONG BytesNeeded);
1961 
1962 typedef NDIS_STATUS
1965  _In_ NDIS_HANDLE MiniportAdapterContext,
1967 
1968 typedef NDIS_STATUS
1970  _Out_ PBOOLEAN AddressingReset,
1971  _In_ NDIS_HANDLE MiniportAdapterContext);
1972 
1973 typedef NDIS_STATUS
1975  _In_ NDIS_HANDLE MiniportAdapterContext,
1977  _In_ UINT Flags);
1978 
1979 typedef NDIS_STATUS
1981  _In_ NDIS_HANDLE MiniportAdapterContext,
1982  _In_ NDIS_HANDLE NdisLinkHandle,
1984 
1985 typedef NDIS_STATUS
1987  _In_ NDIS_HANDLE MiniportAdapterContext,
1988  _In_ NDIS_OID Oid,
1989  _In_ PVOID InformationBuffer,
1990  _In_ ULONG InformationBufferLength,
1992  _Out_ PULONG BytesNeeded);
1993 
1994 typedef NDIS_STATUS
1997  _Out_ PUINT BytesTransferred,
1998  _In_ NDIS_HANDLE MiniportAdapterContext,
1999  _In_ NDIS_HANDLE MiniportReceiveContext,
2001  _In_ UINT BytesToTransfer);
2002 
2003 typedef NDIS_STATUS
2005 
2006 typedef VOID
2008  _In_ PVOID ShutdownContext);
2009 
2010 typedef VOID
2012  _In_ NDIS_HANDLE MiniportAdapterContext,
2014 
2015 typedef VOID
2017  _In_ NDIS_HANDLE MiniportAdapterContext,
2020 
2021 typedef VOID
2023  _In_ NDIS_HANDLE MiniportAdapterContext,
2026  _In_ ULONG Length,
2027  _In_ PVOID Context);
2028 
2029 /* NDIS structures available only to miniport drivers */
2030 
2031 #define NDIS30_MINIPORT_CHARACTERISTICS_S \
2032  UCHAR MajorNdisVersion; \
2033  UCHAR MinorNdisVersion; \
2034  UINT Reserved; \
2035  W_CHECK_FOR_HANG_HANDLER CheckForHangHandler; \
2036  W_DISABLE_INTERRUPT_HANDLER DisableInterruptHandler; \
2037  W_ENABLE_INTERRUPT_HANDLER EnableInterruptHandler; \
2038  W_HALT_HANDLER HaltHandler; \
2039  W_HANDLE_INTERRUPT_HANDLER HandleInterruptHandler; \
2040  W_INITIALIZE_HANDLER InitializeHandler; \
2041  W_ISR_HANDLER ISRHandler; \
2042  W_QUERY_INFORMATION_HANDLER QueryInformationHandler; \
2043  W_RECONFIGURE_HANDLER ReconfigureHandler; \
2044  W_RESET_HANDLER ResetHandler; \
2045  W_SEND_HANDLER SendHandler; \
2046  W_SET_INFORMATION_HANDLER SetInformationHandler; \
2047  W_TRANSFER_DATA_HANDLER TransferDataHandler;
2048 
2052 
2053 #ifdef __cplusplus
2054 
2055 #define NDIS40_MINIPORT_CHARACTERISTICS_S \
2056  NDIS30_MINIPORT_CHARACTERISTICS Ndis30Chars; \
2057  W_RETURN_PACKET_HANDLER ReturnPacketHandler; \
2058  W_SEND_PACKETS_HANDLER SendPacketsHandler; \
2059  W_ALLOCATE_COMPLETE_HANDLER AllocateCompleteHandler;
2060 
2061 #else /* !__cplusplus */
2062 
2063 #define NDIS40_MINIPORT_CHARACTERISTICS_S \
2064  NDIS30_MINIPORT_CHARACTERISTICS_S \
2065  W_RETURN_PACKET_HANDLER ReturnPacketHandler; \
2066  W_SEND_PACKETS_HANDLER SendPacketsHandler; \
2067  W_ALLOCATE_COMPLETE_HANDLER AllocateCompleteHandler;
2068 
2069 #endif /* !__cplusplus */
2070 
2074 
2075 /* Extensions for NDIS 5.0 miniports */
2076 
2078 _Function_class_(MINIPORT_CO_CREATE_VC)
2079 typedef NDIS_STATUS
2080 (NTAPI MINIPORT_CO_CREATE_VC)(
2081  _In_ NDIS_HANDLE MiniportAdapterContext,
2084 typedef MINIPORT_CO_CREATE_VC *W_CO_CREATE_VC_HANDLER;
2085 
2087 _Function_class_(MINIPORT_CO_DELETE_VC)
2088 typedef NDIS_STATUS
2089 (NTAPI MINIPORT_CO_DELETE_VC)(
2091 typedef MINIPORT_CO_DELETE_VC *W_CO_DELETE_VC_HANDLER;
2092 
2094 _Function_class_(MINIPORT_CO_ACTIVATE_VC)
2095 typedef NDIS_STATUS
2096 (NTAPI MINIPORT_CO_ACTIVATE_VC)(
2099 typedef MINIPORT_CO_ACTIVATE_VC *W_CO_ACTIVATE_VC_HANDLER;
2100 
2102 _Function_class_(MINIPORT_CO_DEACTIVATE_VC)
2103 typedef NDIS_STATUS
2104 (NTAPI MINIPORT_CO_DEACTIVATE_VC)(
2106 typedef MINIPORT_CO_DEACTIVATE_VC *W_CO_DEACTIVATE_VC_HANDLER;
2107 
2108 typedef VOID
2113 
2114 typedef NDIS_STATUS
2116  _In_ NDIS_HANDLE MiniportAdapterContext,
2119 
2120 #ifdef __cplusplus
2121 
2122 #define NDIS50_MINIPORT_CHARACTERISTICS_S \
2123  NDIS40_MINIPORT_CHARACTERISTICS Ndis40Chars; \
2124  W_CO_CREATE_VC_HANDLER CoCreateVcHandler; \
2125  W_CO_DELETE_VC_HANDLER CoDeleteVcHandler; \
2126  W_CO_ACTIVATE_VC_HANDLER CoActivateVcHandler; \
2127  W_CO_DEACTIVATE_VC_HANDLER CoDeactivateVcHandler; \
2128  W_CO_SEND_PACKETS_HANDLER CoSendPacketsHandler; \
2129  W_CO_REQUEST_HANDLER CoRequestHandler;
2130 
2131 #else /* !__cplusplus */
2132 
2133 #define NDIS50_MINIPORT_CHARACTERISTICS_S \
2134  NDIS40_MINIPORT_CHARACTERISTICS_S \
2135  W_CO_CREATE_VC_HANDLER CoCreateVcHandler; \
2136  W_CO_DELETE_VC_HANDLER CoDeleteVcHandler; \
2137  W_CO_ACTIVATE_VC_HANDLER CoActivateVcHandler; \
2138  W_CO_DEACTIVATE_VC_HANDLER CoDeactivateVcHandler; \
2139  W_CO_SEND_PACKETS_HANDLER CoSendPacketsHandler; \
2140  W_CO_REQUEST_HANDLER CoRequestHandler;
2141 
2142 #endif /* !__cplusplus */
2143 
2147 
2148 /* Extensions for NDIS 5.1 miniports */
2149 
2150 typedef VOID
2152  _In_ NDIS_HANDLE MiniportAdapterContext,
2153  _In_ PVOID CancelId);
2154 
2155 typedef VOID
2157  _In_ NDIS_HANDLE MiniportAdapterContext,
2158  _In_ NDIS_DEVICE_PNP_EVENT PnPEvent,
2159  _In_ PVOID InformationBuffer,
2160  _In_ ULONG InformationBufferLength);
2161 
2162 typedef VOID
2164  _In_ PVOID ShutdownContext);
2165 
2166 #ifdef __cplusplus
2167 
2168 #define NDIS51_MINIPORT_CHARACTERISTICS_S \
2169  NDIS50_MINIPORT_CHARACTERISTICS Ndis50Chars; \
2170  W_CANCEL_SEND_PACKETS_HANDLER CancelSendPacketsHandler; \
2171  W_PNP_EVENT_NOTIFY_HANDLER PnPEventNotifyHandler; \
2172  W_MINIPORT_SHUTDOWN_HANDLER AdapterShutdownHandler; \
2173  PVOID Reserved1; \
2174  PVOID Reserved2; \
2175  PVOID Reserved3; \
2176  PVOID Reserved4;
2177 
2178 #else
2179 
2180 #define NDIS51_MINIPORT_CHARACTERISTICS_S \
2181  NDIS50_MINIPORT_CHARACTERISTICS_S \
2182  W_CANCEL_SEND_PACKETS_HANDLER CancelSendPacketsHandler; \
2183  W_PNP_EVENT_NOTIFY_HANDLER PnPEventNotifyHandler; \
2184  W_MINIPORT_SHUTDOWN_HANDLER AdapterShutdownHandler; \
2185  PVOID Reserved1; \
2186  PVOID Reserved2; \
2187  PVOID Reserved3; \
2188  PVOID Reserved4;
2189 
2190 #endif
2191 
2195 
2196 #if defined(NDIS51_MINIPORT)
2197 typedef struct _NDIS_MINIPORT_CHARACTERISTICS {
2200 #elif defined(NDIS50_MINIPORT)
2201 typedef struct _NDIS_MINIPORT_CHARACTERISTICS {
2204 #elif defined(NDIS40_MINIPORT)
2205 typedef struct _NDIS_MINIPORT_CHARACTERISTICS {
2208 #else /* NDIS30 */
2212 #endif
2213 
2228 
2229 /* Structures available only to full MAC drivers */
2230 
2231 typedef BOOLEAN
2233  IN PVOID InterruptContext);
2234 
2235 typedef VOID
2237  IN PVOID SystemSpecific1,
2238  IN PVOID InterruptContext,
2241 
2242 typedef struct _NDIS_WRAPPER_HANDLE NDIS_WRAPPER_HANDLE, *PNDIS_WRAPPER_HANDLE;
2243 typedef struct _NDIS_PROTOCOL_BLOCK NDIS_PROTOCOL_BLOCK, *PNDIS_PROTOCOL_BLOCK;
2246 typedef struct _NDIS_OFFLOAD NDIS_OFFLOAD, *PNDIS_OFFLOAD;
2247 typedef struct _NDIS_AF_LIST NDIS_AF_LIST, *PNDIS_AF_LIST;
2248 typedef struct _X_FILTER ETH_FILTER, *PETH_FILTER;
2249 #if NDIS_SUPPORT_NDIS6
2250 typedef USHORT NET_FRAME_TYPE, *PNET_FRAME_TYPE;
2251 #endif
2252 
2253 typedef struct _NDIS_MINIPORT_TIMER {
2261 
2262 typedef struct _NDIS_INTERRUPT {
2273 
2274 
2275 typedef enum _NDIS_WORK_ITEM_TYPE {
2286 
2287 #define NUMBER_OF_WORK_ITEM_TYPES NdisMaxWorkItems
2288 #define NUMBER_OF_SINGLE_WORK_ITEMS 6
2289 
2295 
2296 struct _NDIS_WORK_ITEM;
2297 typedef VOID (NTAPI *NDIS_PROC)(struct _NDIS_WORK_ITEM *, PVOID);
2298 
2299 typedef struct _NDIS_WORK_ITEM {
2301  NDIS_PROC Routine;
2304 
2305 typedef struct _NDIS_BIND_PATHS {
2309 
2310 
2311 typedef VOID
2314 
2315 typedef VOID
2318  _In_ NDIS_HANDLE MacReceiveContext,
2319  _In_ PCHAR Address,
2320  _In_ PVOID HeaderBuffer,
2321  _In_ UINT HeaderBufferSize,
2322  _In_ PVOID LookaheadBuffer,
2323  _In_ UINT LookaheadBufferSize,
2324  _In_ UINT PacketSize);
2325 
2326 typedef VOID
2329 
2330 typedef VOID
2333  IN NDIS_HANDLE MacReceiveContext,
2334  IN PCHAR Address,
2335  IN UINT AddressLength,
2336  IN PVOID HeaderBuffer,
2337  IN UINT HeaderBufferSize,
2338  IN PVOID LookaheadBuffer,
2339  IN UINT LookaheadBufferSize,
2340  IN UINT PacketSize);
2341 
2342 typedef VOID
2344  _In_ NDIS_HANDLE Miniport,
2347 
2348 typedef VOID
2351 
2352 typedef VOID
2355  _In_ NDIS_HANDLE MacReceiveContext,
2356  _In_ PVOID HeaderBuffer,
2357  _In_ UINT HeaderBufferSize,
2358  _In_ PVOID LookaheadBuffer,
2359  _In_ UINT LookaheadBufferSize,
2360  _In_ UINT PacketSize);
2361 
2362 typedef VOID
2365  _In_ NDIS_HANDLE NdisLinkContext);
2366 
2367 typedef VOID
2371  _In_ NDIS_HANDLE NdisLinkContext,
2372  _In_ PUCHAR Packet,
2374 
2375 typedef VOID
2377  IN PNDIS_MINIPORT_BLOCK Miniport,
2378  IN NDIS_WORK_ITEM_TYPE WorkItemType,
2379  OUT PVOID *WorkItemContext);
2380 
2381 typedef NDIS_STATUS
2383  IN PNDIS_MINIPORT_BLOCK Miniport,
2384  IN NDIS_WORK_ITEM_TYPE WorkItemType,
2385  IN PVOID WorkItemContext);
2386 
2387 typedef NDIS_STATUS
2389  IN PNDIS_MINIPORT_BLOCK Miniport,
2390  IN NDIS_WORK_ITEM_TYPE WorkItemType,
2391  IN PVOID WorkItemContext);
2392 
2393 typedef VOID
2397 
2398 typedef VOID
2402  _In_ BOOLEAN AddressingReset);
2403 
2404 typedef VOID
2409 
2410 typedef VOID
2413 
2414 typedef BOOLEAN
2416  _In_ PNDIS_MINIPORT_BLOCK Miniport);
2417 
2418 typedef VOID
2420  _In_ NDIS_HANDLE MiniportHandle,
2424 
2425 typedef VOID
2428 
2429 typedef VOID
2434  _In_ UINT BytesTransferred);
2435 
2438  _In_ PVOID Packet,
2440 
2441 
2442 #if ARCNET
2443 
2444 #define ARC_SEND_BUFFERS 8
2445 #define ARC_HEADER_SIZE 4
2446 
2447 typedef struct _NDIS_ARC_BUF {
2448  NDIS_HANDLE ArcnetBufferPool;
2449  PUCHAR ArcnetLookaheadBuffer;
2450  UINT NumFree;
2451  ARC_BUFFER_LIST ArcnetBuffers[ARC_SEND_BUFFERS];
2452 } NDIS_ARC_BUF, *PNDIS_ARC_BUF;
2453 
2454 #endif /* ARCNET */
2455 
2456 typedef struct _NDIS_LOG {
2465 } NDIS_LOG, *PNDIS_LOG;
2466 
2467 #if ARCNET
2468 #define FILTERDBS_ARCNET_S \
2469  PARC_FILTER ArcDB;
2470 #else /* !ARCNET */
2471 #define FILTERDBS_ARCNET_S \
2472  PVOID XXXDB;
2473 #endif /* !ARCNET */
2474 
2475 #define FILTERDBS_S \
2476  _ANONYMOUS_UNION union { \
2477  PETH_FILTER EthDB; \
2478  PNULL_FILTER NullDB; \
2479  } DUMMYUNIONNAME; \
2480  PTR_FILTER TrDB; \
2481  PFDDI_FILTER FddiDB; \
2482  FILTERDBS_ARCNET_S
2483 
2484 typedef struct _FILTERDBS {
2485  FILTERDBS_S
2486 } FILTERDBS, *PFILTERDBS;
2487 
2525  FILTERDBS_S
2572 #if defined(NDIS_WRAPPER)
2573  PNDIS_MINIPORT_BLOCK NextGlobalMiniport;
2576  UCHAR SendFlags;
2577  UCHAR TrResetRing;
2578  UCHAR ArcnetAddress;
2579  UCHAR XState;
2580  _ANONYMOUS_UNION union {
2581 #if ARCNET
2582  PNDIS_ARC_BUF ArcBuf;
2583 #endif
2584  PVOID BusInterface;
2585  } DUMMYUNIONNAME;
2586  PNDIS_LOG Log;
2587  ULONG SlotNumber;
2590  SINGLE_LIST_ENTRY PatternList;
2591  NDIS_PNP_CAPABILITIES PMCapabilities;
2592  DEVICE_CAPABILITIES DeviceCaps;
2593  ULONG WakeUpEnable;
2594  DEVICE_POWER_STATE CurrentDevicePowerState;
2595  PIRP pIrpWaitWake;
2596  SYSTEM_POWER_STATE WaitWakeSystemState;
2597  LARGE_INTEGER VcIndex;
2598  KSPIN_LOCK VcCountLock;
2599  LIST_ENTRY WmiEnabledVcs;
2600  PNDIS_GUID pNdisGuidMap;
2601  PNDIS_GUID pCustomGuidMap;
2602  USHORT VcCount;
2603  USHORT cNdisGuidMap;
2604  USHORT cCustomGuidMap;
2605  USHORT CurrentMapRegister;
2606  PKEVENT AllocationEvent;
2607  USHORT BaseMapRegistersNeeded;
2608  USHORT SGMapRegistersNeeded;
2610  NDIS_TIMER MediaDisconnectTimer;
2611  USHORT MediaDisconnectTimeOut;
2612  USHORT InstanceNumber;
2613  NDIS_EVENT OpenReadyEvent;
2614  NDIS_PNP_DEVICE_STATE PnPDeviceState;
2615  NDIS_PNP_DEVICE_STATE OldPnPDeviceState;
2616  PGET_SET_DEVICE_DATA SetBusData;
2617  PGET_SET_DEVICE_DATA GetBusData;
2618  KDPC DeferredDpc;
2619 #if 0
2620  /* FIXME: */
2621  NDIS_STATS NdisStats;
2622 #else
2623  ULONG NdisStats;
2624 #endif
2625  PNDIS_PACKET IndicatedPacket[MAXIMUM_PROCESSORS];
2626  PKEVENT RemoveReadyEvent;
2627  PKEVENT AllOpensClosedEvent;
2628  PKEVENT AllRequestsCompletedEvent;
2629  ULONG InitTimeMs;
2631  PDMA_ADAPTER SystemAdapterObject;
2632  ULONG DriverVerifyFlags;
2633  POID_LIST OidList;
2634  USHORT InternalResetCount;
2635  USHORT MiniportResetCount;
2636  USHORT MediaSenseConnectCount;
2637  USHORT MediaSenseDisconnectCount;
2638  PNDIS_PACKET *xPackets;
2639  ULONG UserModeOpenReferences;
2640  _ANONYMOUS_UNION union {
2641  PVOID SavedSendHandler;
2642  PVOID SavedWanSendHandler;
2643  } DUMMYUNIONNAME2;
2644  PVOID SavedSendPacketsHandler;
2645  PVOID SavedCancelSendPacketsHandler;
2646  W_SEND_PACKETS_HANDLER WSendPacketsHandler;
2647  ULONG MiniportAttributes;
2648  PDMA_ADAPTER SavedSystemAdapterObject;
2649  USHORT NumOpens;
2650  USHORT CFHangXTicks;
2651  ULONG RequestCount;
2652  ULONG IndicatedPacketsCount;
2653  ULONG PhysicalMediumType;
2654  PNDIS_REQUEST LastRequest;
2655  LONG DmaAdapterRefCount;
2656  PVOID FakeMac;
2657  ULONG LockDbg;
2658  ULONG LockDbgX;
2659  PVOID LockThread;
2660  ULONG InfoFlags;
2661  KSPIN_LOCK TimerQueueLock;
2662  PKEVENT ResetCompletedEvent;
2663  PKEVENT QueuedBindingCompletedEvent;
2664  PKEVENT DmaResourcesReleasedEvent;
2665  FILTER_PACKET_INDICATION_HANDLER SavedPacketIndicateHandler;
2666  ULONG RegisteredInterrupts;
2667  PNPAGED_LOOKASIDE_LIST SGListLookasideList;
2668  ULONG ScatterGatherListSize;
2669 #endif /* _NDIS_ */
2670 };
2671 
2672 #if NDIS_LEGACY_DRIVER
2673 
2674 typedef NDIS_STATUS
2676  _In_ NDIS_HANDLE MacBindingHandle,
2677  _In_ NDIS_HANDLE LinkHandle,
2678  _In_ PVOID Packet);
2679 
2680 typedef VOID
2682  _In_ NDIS_HANDLE MiniportAdapterContext,
2685 
2686 typedef NDIS_STATUS
2690 
2691 typedef NDIS_STATUS
2694  _In_ NDIS_HANDLE MacReceiveContext,
2696  _In_ UINT BytesToTransfer,
2698  _Out_ PUINT BytesTransferred);
2699 
2700 typedef NDIS_STATUS
2703 
2704 typedef NDIS_STATUS
2708 
2709 #endif /* NDIS_LEGACY_DRIVER */
2710 
2711 #if defined(NDIS_WRAPPER)
2712 #define NDIS_COMMON_OPEN_BLOCK_WRAPPER_S \
2713  ULONG Flags; \
2714  ULONG References; \
2715  KSPIN_LOCK SpinLock; \
2716  NDIS_HANDLE FilterHandle; \
2717  ULONG ProtocolOptions; \
2718  USHORT CurrentLookahead; \
2719  USHORT ConnectDampTicks; \
2720  USHORT DisconnectDampTicks; \
2721  W_SEND_HANDLER WSendHandler; \
2722  W_TRANSFER_DATA_HANDLER WTransferDataHandler; \
2723  W_SEND_PACKETS_HANDLER WSendPacketsHandler; \
2724  W_CANCEL_SEND_PACKETS_HANDLER CancelSendPacketsHandler; \
2725  ULONG WakeUpEnable; \
2726  PKEVENT CloseCompleteEvent; \
2727  QUEUED_CLOSE QC; \
2728  ULONG AfReferences; \
2729  PNDIS_OPEN_BLOCK NextGlobalOpen;
2730 #else
2731 #define NDIS_COMMON_OPEN_BLOCK_WRAPPER_S
2732 #endif
2733 
2734 #define NDIS_COMMON_OPEN_BLOCK_S \
2735  PVOID MacHandle; \
2736  NDIS_HANDLE BindingHandle; \
2737  PNDIS_MINIPORT_BLOCK MiniportHandle; \
2738  PNDIS_PROTOCOL_BLOCK ProtocolHandle; \
2739  NDIS_HANDLE ProtocolBindingContext; \
2740  PNDIS_OPEN_BLOCK MiniportNextOpen; \
2741  PNDIS_OPEN_BLOCK ProtocolNextOpen; \
2742  NDIS_HANDLE MiniportAdapterContext; \
2743  BOOLEAN Reserved1; \
2744  BOOLEAN Reserved2; \
2745  BOOLEAN Reserved3; \
2746  BOOLEAN Reserved4; \
2747  PNDIS_STRING BindDeviceName; \
2748  KSPIN_LOCK Reserved5; \
2749  PNDIS_STRING RootDeviceName; \
2750  _ANONYMOUS_UNION union { \
2751  SEND_HANDLER SendHandler; \
2752  WAN_SEND_HANDLER WanSendHandler; \
2753  } DUMMYUNIONNAME; \
2754  TRANSFER_DATA_HANDLER TransferDataHandler; \
2755  SEND_COMPLETE_HANDLER SendCompleteHandler; \
2756  TRANSFER_DATA_COMPLETE_HANDLER TransferDataCompleteHandler; \
2757  RECEIVE_HANDLER ReceiveHandler; \
2758  RECEIVE_COMPLETE_HANDLER ReceiveCompleteHandler; \
2759  WAN_RECEIVE_HANDLER WanReceiveHandler; \
2760  REQUEST_COMPLETE_HANDLER RequestCompleteHandler; \
2761  RECEIVE_PACKET_HANDLER ReceivePacketHandler; \
2762  SEND_PACKETS_HANDLER SendPacketsHandler; \
2763  RESET_HANDLER ResetHandler; \
2764  REQUEST_HANDLER RequestHandler; \
2765  RESET_COMPLETE_HANDLER ResetCompleteHandler; \
2766  STATUS_HANDLER StatusHandler; \
2767  STATUS_COMPLETE_HANDLER StatusCompleteHandler; \
2768  NDIS_COMMON_OPEN_BLOCK_WRAPPER_S
2769 
2770 typedef struct _NDIS_COMMON_OPEN_BLOCK {
2773 
2775 {
2776 #ifdef __cplusplus
2777  NDIS_COMMON_OPEN_BLOCK NdisCommonOpenBlock;
2778 #else
2780 #endif
2781 };
2782 
2783 #include <xfilter.h>
2784 
2785 #define NDIS_M_MAX_LOOKAHEAD 526
2786 
2788 NDISAPI
2789 VOID
2790 NTAPI
2795 
2797 NDISAPI
2798 VOID
2799 NTAPI
2803 
2805 NDISAPI
2806 VOID
2807 NTAPI
2808 NdisSetTimer(
2811 
2812 NDISAPI
2813 VOID
2814 NTAPI
2816  _In_ PNDIS_TIMER NdisTimer,
2817  _In_ UINT MillisecondsPeriod);
2818 
2820 NDISAPI
2821 VOID
2822 NTAPI
2824  _In_ PNDIS_TIMER NdisTimer,
2827 
2829 NDISAPI
2830 PVOID
2831 NTAPI
2833  _In_ PNDIS_STRING NdisRoutineName);
2834 
2836 NDISAPI
2837 UINT
2838 NTAPI
2840 
2841 #if NDIS_LEGACY_DRIVER
2842 
2844 NDISAPI
2845 VOID
2846 NTAPI
2853 
2855 NDISAPI
2856 VOID
2857 NTAPI
2862 
2864 NDISAPI
2865 VOID
2866 NTAPI
2869 
2870 /*
2871 NDISAPI
2872 VOID
2873 NTAPI
2874 NdisFreeBuffer(
2875  IN PNDIS_BUFFER Buffer);
2876 */
2877 #define NdisFreeBuffer IoFreeMdl
2878 
2880 NDISAPI
2881 VOID
2882 NTAPI
2888 
2890 NDISAPI
2891 VOID
2892 NTAPI
2899 
2901 NDISAPI
2902 VOID
2903 NTAPI
2905  _In_ NDIS_HANDLE PacketPoolHandle,
2907 
2909 NDISAPI
2910 UINT
2911 NTAPI
2914 
2916 NDISAPI
2917 UINT
2918 NTAPI
2920  _In_ UINT ProtocolReservedSize);
2921 
2923 NDISAPI
2925 NTAPI
2928 
2930 NDISAPI
2932 NTAPI
2936 
2938 NDISAPI
2939 VOID
2940 NTAPI
2943 
2945 NDISAPI
2946 VOID
2947 NTAPI
2950 
2952 NDISAPI
2953 VOID
2954 NTAPI
2957 
2959 NDISAPI
2960 VOID
2961 NTAPI
2964 
2966 NDISAPI
2967 VOID
2968 NTAPI
2973 
2975 NDISAPI
2976 VOID
2977 NTAPI
2982 
2984 NDISAPI
2985 VOID
2986 NTAPI
2991 
2992 /*
2993  * VOID
2994  * NdisReinitializePacket(
2995  * IN OUT PNDIS_PACKET Packet);
2996  */
2997 #define NdisReinitializePacket(Packet) { \
2998  (Packet)->Private.Head = (PNDIS_BUFFER)NULL; \
2999  (Packet)->Private.ValidCounts = FALSE; \
3000 }
3001 
3002 /*
3003 NDISAPI
3004 VOID
3005 NTAPI
3006 NdisQueryBuffer(
3007  IN PNDIS_BUFFER Buffer,
3008  OUT PVOID *VirtualAddress OPTIONAL,
3009  OUT PUINT Length);
3010 */
3011 #define NdisQueryBuffer(_Buffer, _VirtualAddress, _Length) { \
3012  if (ARGUMENT_PRESENT(_VirtualAddress)) { \
3013  *(PVOID *)(_VirtualAddress) = MmGetSystemAddressForMdl(_Buffer); \
3014  } \
3015  *(_Length) = MmGetMdlByteCount(_Buffer); \
3016 }
3017 
3018 NDISAPI
3019 VOID
3020 NTAPI
3023  OUT PNDIS_BUFFER *_FirstBuffer,
3024  OUT PVOID *_FirstBufferVA,
3025  OUT PUINT _FirstBufferLength,
3026  OUT PUINT _TotalBufferLength);
3027 
3028 /*
3029  * VOID
3030  * NdisGetFirstBufferFromPacketSafe(
3031  * IN PNDIS_PACKET _Packet,
3032  * OUT PNDIS_BUFFER * _FirstBuffer,
3033  * OUT PVOID * _FirstBufferVA,
3034  * OUT PUINT _FirstBufferLength,
3035  * OUT PUINT _TotalBufferLength),
3036  * IN MM_PAGE_PRIORITY _Priority)
3037  */
3038 #define NdisGetFirstBufferFromPacketSafe(_Packet, \
3039  _FirstBuffer, \
3040  _FirstBufferVA, \
3041  _FirstBufferLength, \
3042  _TotalBufferLength, \
3043  _Priority) \
3044 { \
3045  PNDIS_BUFFER _Buffer; \
3046  \
3047  _Buffer = (_Packet)->Private.Head; \
3048  *(_FirstBuffer) = _Buffer; \
3049  if (_Buffer != NULL) { \
3050  *(_FirstBufferVA) = MmGetSystemAddressForMdlSafe(_Buffer, _Priority); \
3051  *(_FirstBufferLength) = MmGetMdlByteCount(_Buffer); \
3052  _Buffer = _Buffer->Next; \
3053  *(_TotalBufferLength) = *(_FirstBufferLength); \
3054  while (_Buffer != NULL) { \
3055  *(_TotalBufferLength) += MmGetMdlByteCount(_Buffer); \
3056  _Buffer = _Buffer->Next; \
3057  } \
3058  } \
3059  else { \
3060  *(_FirstBufferVA) = 0; \
3061  *(_FirstBufferLength) = 0; \
3062  *(_TotalBufferLength) = 0; \
3063  } \
3064 }
3065 
3066 /*
3067  * VOID
3068  * NdisRecalculatePacketCounts(
3069  * IN OUT PNDIS_PACKET Packet);
3070  */
3071 #define NdisRecalculatePacketCounts(Packet) { \
3072  PNDIS_BUFFER _Buffer = (Packet)->Private.Head; \
3073  if (_Buffer != NULL) { \
3074  while (_Buffer->Next != NULL) { \
3075  _Buffer = _Buffer->Next; \
3076  } \
3077  (Packet)->Private.Tail = _Buffer; \
3078  } \
3079  (Packet)->Private.ValidCounts = FALSE; \
3080 }
3081 
3082 /*
3083  * VOID
3084  * NdisChainBufferAtFront(
3085  * IN OUT PNDIS_PACKET Packet,
3086  * IN OUT PNDIS_BUFFER Buffer)
3087  */
3088 #define NdisChainBufferAtFront(Packet, \
3089  Buffer) \
3090 { \
3091  PNDIS_BUFFER _NdisBuffer = (Buffer); \
3092  \
3093  while (_NdisBuffer->Next != NULL) \
3094  _NdisBuffer = _NdisBuffer->Next; \
3095  \
3096  if ((Packet)->Private.Head == NULL) \
3097  (Packet)->Private.Tail = _NdisBuffer; \
3098  \
3099  _NdisBuffer->Next = (Packet)->Private.Head; \
3100  (Packet)->Private.Head = (Buffer); \
3101  (Packet)->Private.ValidCounts = FALSE; \
3102 }
3103 
3104 /*
3105  * VOID
3106  * NdisChainBufferAtBack(
3107  * IN OUT PNDIS_PACKET Packet,
3108  * IN OUT PNDIS_BUFFER Buffer)
3109  */
3110 #define NdisChainBufferAtBack(Packet, \
3111  Buffer) \
3112 { \
3113  PNDIS_BUFFER _NdisBuffer = (Buffer); \
3114  \
3115  while (_NdisBuffer->Next != NULL) \
3116  _NdisBuffer = _NdisBuffer->Next; \
3117  \
3118  _NdisBuffer->Next = NULL; \
3119  \
3120  if ((Packet)->Private.Head != NULL) \
3121  (Packet)->Private.Tail->Next = (Buffer); \
3122  else \
3123  (Packet)->Private.Head = (Buffer); \
3124  \
3125  (Packet)->Private.Tail = _NdisBuffer; \
3126  (Packet)->Private.ValidCounts = FALSE; \
3127 }
3128 
3129 NDISAPI
3130 VOID
3131 NTAPI
3135 
3136 NDISAPI
3137 VOID
3138 NTAPI
3142 
3144 NDISAPI
3145 VOID
3146 NTAPI
3154 
3155 NDISAPI
3156 VOID
3157 NTAPI
3166 
3168 __drv_preferredFunction("NdisAllocateMemoryWithTag", "Obsolete")
3169 NDISAPI
3171 NTAPI
3175  _In_ UINT Length,
3176  _In_ UINT MemoryFlags,
3178 
3179 #define NdisInitializeWorkItem(_WI_, _R_, _C_) { \
3180  (_WI_)->Context = _C_; \
3181  (_WI_)->Routine = _R_; \
3182 }
3183 
3185 NDISAPI
3187 NTAPI
3190 
3192 NDISAPI
3193 VOID
3194 NTAPI
3199  _In_ ULONG Code);
3200 
3201 #endif /* NDIS_LEGACY_DRIVER */
3202 
3204 NDISAPI
3205 VOID
3206 NTAPI
3207 NdisOpenFile(
3213 
3215 NDISAPI
3216 VOID
3217 NTAPI
3220 
3222 NDISAPI
3223 VOID
3224 NTAPI
3225 NdisMapFile(
3229 
3231 NDISAPI
3232 VOID
3233 NTAPI
3236 
3238 NDISAPI
3239 ULONG
3240 NTAPI
3242 
3243 #define NdisFlushBuffer(Buffer,WriteToDevice) \
3244  KeFlushIoBuffers((Buffer),!(WriteToDevice), TRUE)
3245 
3247 NDISAPI
3248 VOID
3249 NTAPI
3255  _In_ UINT Offset,
3256  _In_ UINT Length);
3257 
3258 /*
3259  * VOID
3260  * NdisCopyLookaheadData(
3261  * IN PVOID Destination,
3262  * IN PVOID Source,
3263  * IN ULONG Length,
3264  * IN ULONG ReceiveFlags);
3265  */
3266 
3267 #if defined(_M_IX86) || defined(_M_AMD64)
3268 #define NdisCopyLookaheadData(Destination, Source, Length, MacOptions) \
3269  RtlCopyMemory(Destination, Source, Length)
3270 #else
3271 #define NdisCopyLookaheadData(Destination, Source, Length, MacOptions) \
3272  { \
3273  if ((MacOptions) & NDIS_MAC_OPTION_COPY_LOOKAHEAD_DATA) \
3274  { \
3275  RtlCopyMemory(Destination, Source, Length); \
3276  } \
3277  else \
3278  { \
3279  PUCHAR _Src = (PUCHAR)(Source); \
3280  PUCHAR _Dest = (PUCHAR)(Destination); \
3281  PUCHAR _End = _Dest + (Length); \
3282  while (_Dest < _End) \
3283  *_Dest++ = *_Src++; \
3284  } \
3285  }
3286 #endif
3287 
3288 /*
3289 NDISAPI
3290 VOID
3291 NTAPI
3292 NdisAdjustBufferLength(
3293  IN PNDIS_BUFFER Buffer,
3294  IN UINT Length);
3295 */
3296 #define NdisAdjustBufferLength(Buffer, Length) \
3297  (((Buffer)->ByteCount) = (Length))
3298 
3299 #if NDIS_SUPPORT_NDIS6
3300 #define NdisAdjustMdlLength(_Mdl, _Length) \
3301  (((_Mdl)->ByteCount) = (_Length))
3302 #endif
3303 
3304 /*
3305 NDISAPI
3306 ULONG
3307 NTAPI
3308 NdisBufferLength(
3309  IN PNDIS_BUFFER Buffer);
3310 */
3311 #define NdisBufferLength MmGetMdlByteCount
3312 
3313 /*
3314 NDISAPI
3315 PVOID
3316 NTAPI
3317 NdisBufferVirtualAddress(
3318  IN PNDIS_BUFFER Buffer);
3319 */
3320 #define NdisBufferVirtualAddress MmGetSystemAddressForMdl
3321 
3322 #define NdisBufferVirtualAddressSafe MmGetSystemAddressForMdlSafe
3323 
3324 NDISAPI
3325 ULONG
3326 NTAPI
3329 
3330 /*
3331 NDISAPI
3332 VOID
3333 NTAPI
3334 NdisGetBufferPhysicalArraySize(
3335  IN PNDIS_BUFFER Buffer,
3336  OUT PUINT ArraySize);
3337 */
3338 #define NdisGetBufferPhysicalArraySize(Buffer, ArraySize) \
3339  (*(ArraySize) = NDIS_BUFFER_TO_SPAN_PAGES(Buffer))
3340 
3341 /*
3342 NDISAPI
3343 VOID
3344 NTAPI
3345 NdisQueryBufferOffset(
3346  IN PNDIS_BUFFER Buffer,
3347  OUT PUINT Offset,
3348  OUT PUINT Length);
3349 */
3350 #define NdisQueryBufferOffset(_Buffer, _Offset, _Length) { \
3351  *(_Offset) = MmGetMdlByteOffset(_Buffer); \
3352  *(_Length) = MmGetMdlByteCount(_Buffer); \
3353 }
3354 
3355 /*
3356  * PVOID
3357  * NDIS_BUFFER_LINKAGE(
3358  * IN PNDIS_BUFFER Buffer);
3359  */
3360 #define NDIS_BUFFER_LINKAGE(Buffer) (Buffer)->Next
3361 
3362 /*
3363  * VOID
3364  * NdisGetNextBuffer(
3365  * IN PNDIS_BUFFER CurrentBuffer,
3366  * OUT PNDIS_BUFFER * NextBuffer)
3367  */
3368 #define NdisGetNextBuffer(CurrentBuffer, \
3369  NextBuffer) \
3370 { \
3371  *(NextBuffer) = (CurrentBuffer)->Next; \
3372 }
3373 
3374 #if NDIS_LEGACY_DRIVER
3375 
3376 #define NDIS_PACKET_FIRST_NDIS_BUFFER(_Packet) ((_Packet)->Private.Head)
3377 #define NDIS_PACKET_LAST_NDIS_BUFFER(_Packet) ((_Packet)->Private.Tail)
3378 #define NDIS_PACKET_VALID_COUNTS(_Packet) ((_Packet)->Private.ValidCounts)
3379 
3380 /*
3381  * UINT
3382  * NdisGetPacketFlags(
3383  * IN PNDIS_PACKET Packet);
3384  */
3385 #define NdisGetPacketFlags(Packet) (Packet)->Private.Flags
3386 
3387 /*
3388  * ULONG
3389  * NDIS_GET_PACKET_PROTOCOL_TYPE(
3390  * IN PNDIS_PACKET Packet);
3391  */
3392 #define NDIS_GET_PACKET_PROTOCOL_TYPE(_Packet) \
3393  ((_Packet)->Private.Flags & NDIS_PROTOCOL_ID_MASK)
3394 
3395 /*
3396  * PNDIS_PACKET_OOB_DATA
3397  * NDIS_OOB_DATA_FROM_PACKET(
3398  * IN PNDIS_PACKET Packet);
3399  */
3400 #define NDIS_OOB_DATA_FROM_PACKET(_Packet) \
3401  (PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
3402  (_Packet)->Private.NdisPacketOobOffset)
3403 
3404 /*
3405  * ULONG
3406  * NDIS_GET_PACKET_HEADER_SIZE(
3407  * IN PNDIS_PACKET Packet);
3408  */
3409 #define NDIS_GET_PACKET_HEADER_SIZE(_Packet) \
3410  ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
3411  (_Packet)->Private.NdisPacketOobOffset))->HeaderSize
3412 
3413 /*
3414  * NDIS_STATUS
3415  * NDIS_GET_PACKET_STATUS(
3416  * IN PNDIS_PACKET Packet);
3417  */
3418 #define NDIS_GET_PACKET_STATUS(_Packet) \
3419  ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
3420  (_Packet)->Private.NdisPacketOobOffset))->Status
3421 
3422 /*
3423  * ULONGLONG
3424  * NDIS_GET_PACKET_TIME_TO_SEND(
3425  * IN PNDIS_PACKET Packet);
3426  */
3427 #define NDIS_GET_PACKET_TIME_TO_SEND(_Packet) \
3428  ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
3429  (_Packet)->Private.NdisPacketOobOffset))->TimeToSend
3430 
3431 /*
3432  * ULONGLONG
3433  * NDIS_GET_PACKET_TIME_SENT(
3434  * IN PNDIS_PACKET Packet);
3435  */
3436 #define NDIS_GET_PACKET_TIME_SENT(_Packet) \
3437  ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
3438  (_Packet)->Private.NdisPacketOobOffset))->TimeSent
3439 
3440 /*
3441  * ULONGLONG
3442  * NDIS_GET_PACKET_TIME_RECEIVED(
3443  * IN PNDIS_PACKET Packet);
3444  */
3445 #define NDIS_GET_PACKET_TIME_RECEIVED(_Packet) \
3446  ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
3447  (_Packet)->Private.NdisPacketOobOffset))->TimeReceived
3448 
3449 /*
3450  * VOID
3451  * NDIS_GET_PACKET_MEDIA_SPECIFIC_INFO(
3452  * IN PNDIS_PACKET Packet,
3453  * IN PPVOID pMediaSpecificInfo,
3454  * IN PUINT pSizeMediaSpecificInfo);
3455  */
3456 #define NDIS_GET_PACKET_MEDIA_SPECIFIC_INFO(_Packet, \
3457  _pMediaSpecificInfo, \
3458  _pSizeMediaSpecificInfo) \
3459 { \
3460  if (!((_Packet)->Private.NdisPacketFlags & fPACKET_ALLOCATED_BY_NDIS) || \
3461  !((_Packet)->Private.NdisPacketFlags & fPACKET_CONTAINS_MEDIA_SPECIFIC_INFO)) \
3462  { \
3463  *(_pMediaSpecificInfo) = NULL; \
3464  *(_pSizeMediaSpecificInfo) = 0; \
3465  } \
3466  else \
3467  { \
3468  *(_pMediaSpecificInfo) = ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
3469  (_Packet)->Private.NdisPacketOobOffset))->MediaSpecificInformation; \
3470  *(_pSizeMediaSpecificInfo) = ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
3471  (_Packet)->Private.NdisPacketOobOffset))->SizeMediaSpecificInfo; \
3472  } \
3473 }
3474 
3475 /*
3476  * VOID
3477  * NDIS_SET_PACKET_HEADER_SIZE(
3478  * IN PNDIS_PACKET Packet,
3479  * IN UINT HdrSize);
3480  */
3481 #define NDIS_SET_PACKET_HEADER_SIZE(_Packet, _HdrSize) \
3482  ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
3483  (_Packet)->Private.NdisPacketOobOffset))->HeaderSize = (_HdrSize)
3484 
3485 /*
3486  * VOID
3487  * NDIS_SET_PACKET_STATUS(
3488  * IN PNDIS_PACKET Packet,
3489  * IN NDIS_STATUS Status);
3490  */
3491 #define NDIS_SET_PACKET_STATUS(_Packet, _Status) \
3492  ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
3493  (_Packet)->Private.NdisPacketOobOffset))->Status = (_Status)
3494 
3495 /*
3496  * VOID
3497  * NDIS_SET_PACKET_TIME_TO_SEND(
3498  * IN PNDIS_PACKET Packet,
3499  * IN ULONGLONG TimeToSend);
3500  */
3501 #define NDIS_SET_PACKET_TIME_TO_SEND(_Packet, _TimeToSend) \
3502  ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
3503  (_Packet)->Private.NdisPacketOobOffset))->TimeToSend = (_TimeToSend)
3504 
3505 /*
3506  * VOID
3507  * NDIS_SET_PACKET_TIME_SENT(
3508  * IN PNDIS_PACKET Packet,
3509  * IN ULONGLONG TimeSent);
3510  */
3511 #define NDIS_SET_PACKET_TIME_SENT(_Packet, _TimeSent) \
3512  ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
3513  (_Packet)->Private.NdisPacketOobOffset))->TimeSent = (_TimeSent)
3514 
3515 /*
3516  * VOID
3517  * NDIS_SET_PACKET_TIME_RECEIVED(
3518  * IN PNDIS_PACKET Packet,
3519  * IN ULONGLONG TimeReceived);
3520  */
3521 #define NDIS_SET_PACKET_TIME_RECEIVED(_Packet, _TimeReceived) \
3522  ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
3523  (_Packet)->Private.NdisPacketOobOffset))->TimeReceived = (_TimeReceived)
3524 
3525 /*
3526  * VOID
3527  * NDIS_SET_PACKET_MEDIA_SPECIFIC_INFO(
3528  * IN PNDIS_PACKET Packet,
3529  * IN PVOID MediaSpecificInfo,
3530  * IN UINT SizeMediaSpecificInfo);
3531  */
3532 #define NDIS_SET_PACKET_MEDIA_SPECIFIC_INFO(_Packet, \
3533  _MediaSpecificInfo, \
3534  _SizeMediaSpecificInfo) \
3535 { \
3536  if ((_Packet)->Private.NdisPacketFlags & fPACKET_ALLOCATED_BY_NDIS) \
3537  { \
3538  (_Packet)->Private.NdisPacketFlags |= fPACKET_CONTAINS_MEDIA_SPECIFIC_INFO; \
3539  ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
3540  (_Packet)->Private.NdisPacketOobOffset))->MediaSpecificInformation = \
3541  (_MediaSpecificInfo); \
3542  ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
3543  (_Packet)->Private.NdisPacketOobOffset))->SizeMediaSpecificInfo = \
3544  (_SizeMediaSpecificInfo); \
3545  } \
3546 }
3547 
3548 /*
3549  * VOID
3550  * NdisSetPacketFlags(
3551  * IN PNDIS_PACKET Packet,
3552  * IN UINT Flags);
3553  */
3554 #define NdisSetPacketFlags(Packet, Flags) (Packet)->Private.Flags |= (Flags)
3555 
3556 /*
3557  * VOID
3558  * NdisClearPacketFlags(
3559  * IN PNDIS_PACKET Packet,
3560  * IN UINT Flags);
3561  */
3562 #define NdisClearPacketFlags(Packet, Flags) (Packet)->Private.Flags &= ~(Flags)
3563 
3564 /*
3565  * VOID
3566  * NdisQueryPacket(
3567  * IN PNDIS_PACKET Packet,
3568  * OUT PUINT PhysicalBufferCount OPTIONAL,
3569  * OUT PUINT BufferCount OPTIONAL,
3570  * OUT PNDIS_BUFFER *FirstBuffer OPTIONAL,
3571  * OUT PUINT TotalPacketLength OPTIONAL);
3572  */
3573 static __inline
3574 VOID
3577  OUT PUINT PhysicalBufferCount OPTIONAL,
3578  OUT PUINT BufferCount OPTIONAL,
3579  OUT PNDIS_BUFFER *FirstBuffer OPTIONAL,
3580  OUT PUINT TotalPacketLength OPTIONAL)
3581 {
3582  if (FirstBuffer)
3583  *FirstBuffer = Packet->Private.Head;
3584  if (TotalPacketLength || BufferCount || PhysicalBufferCount) {
3585  if (!Packet->Private.ValidCounts) {
3586  UINT Offset;
3587  UINT PacketLength;
3588  PNDIS_BUFFER NdisBuffer;
3589  UINT _PhysicalBufferCount = 0;
3590  UINT _TotalPacketLength = 0;
3591  UINT Count = 0;
3592 
3593  for (NdisBuffer = Packet->Private.Head;
3594  NdisBuffer != (PNDIS_BUFFER)NULL;
3595  NdisBuffer = NdisBuffer->Next) {
3596  _PhysicalBufferCount += NDIS_BUFFER_TO_SPAN_PAGES(NdisBuffer);
3597  NdisQueryBufferOffset(NdisBuffer, &Offset, &PacketLength);
3598  _TotalPacketLength += PacketLength;
3599  Count++;
3600  }
3601  Packet->Private.PhysicalCount = _PhysicalBufferCount;
3602  Packet->Private.TotalLength = _TotalPacketLength;
3603  Packet->Private.Count = Count;
3604  Packet->Private.ValidCounts = TRUE;
3605  }
3606 
3607  if (PhysicalBufferCount)
3608  *PhysicalBufferCount = Packet->Private.PhysicalCount;
3609 
3610  if (BufferCount)
3611  *BufferCount = Packet->Private.Count;
3612 
3613  if (TotalPacketLength)
3614  *TotalPacketLength = Packet->Private.TotalLength;
3615  }
3616 }
3617 
3618 /*
3619  * VOID
3620  * NdisQueryPacketLength(
3621  * IN PNDIS_PACKET Packet,
3622  * OUT PUINT PhysicalBufferCount OPTIONAL,
3623  * OUT PUINT BufferCount OPTIONAL,
3624  * OUT PNDIS_BUFFER *FirstBuffer OPTIONAL,
3625  * OUT PUINT TotalPacketLength OPTIONAL);
3626  */
3627 #define NdisQueryPacketLength(_Packet, \
3628  _TotalPacketLength) \
3629 { \
3630  if (!(_Packet)->Private.ValidCounts) { \
3631  NdisQueryPacket(_Packet, NULL, NULL, NULL, _TotalPacketLength); \
3632  } \
3633  else *(_TotalPacketLength) = (_Packet)->Private.TotalLength; \
3634 }
3635 
3636 #endif /* NDIS_LEGACY_DRIVER */
3637 
3638 /* Memory management routines */
3639 
3640 /*
3641 NDISAPI
3642 VOID
3643 NTAPI
3644 NdisCreateLookaheadBufferFromSharedMemory(
3645  IN PVOID pSharedMemory,
3646  IN UINT LookaheadLength,
3647  OUT PVOID *pLookaheadBuffer);
3648 */
3649 #define NdisCreateLookaheadBufferFromSharedMemory(_S, _L, _B) ((*(_B)) = (_S))
3650 
3651 NDISAPI
3652 VOID
3653 NTAPI
3655  IN PVOID pLookaheadBuffer);
3656 
3657 #if defined(_M_IX86) || defined(_M_AMD64) || defined(_M_ARM) || defined(_M_PPC)
3658 
3659 /*
3660  * VOID
3661  * NdisMoveMappedMemory(
3662  * OUT PVOID Destination,
3663  * IN PVOID Source,
3664  * IN ULONG Length);
3665  */
3666 #define NdisMoveMappedMemory(Destination, Source, Length) \
3667  RtlCopyMemory(Destination, Source, Length)
3668 
3669 /*
3670  * VOID
3671  * NdisZeroMappedMemory(
3672  * IN PVOID Destination,
3673  * IN ULONG Length);
3674  */
3675 #define NdisZeroMappedMemory(Destination, Length) \
3676  RtlZeroMemory(Destination, Length)
3677 
3678 #else
3679 
3680 #define NdisMoveMappedMemory(Destination, Source, Length) \
3681 { \
3682  PUCHAR _Dest = Destination, _Src = Source, _End = _Dest + Length; \
3683  while (_Dest < _End) \
3684  *_Dest++ = _Src++; \
3685 }
3686 
3687 #define NdisZeroMappedMemory(Destination, Length) \
3688 { \
3689  PUCHAR _Dest = Destination, _End = _Dest + Length; \
3690  while (_Dest < _End) \
3691  *_Dest++ = 0; \
3692 }
3693 
3694 #endif /* _M_IX86 or _M_AMD64 */
3695 
3696 /*
3697  * VOID
3698  * NdisMoveFromMappedMemory(
3699  * OUT PVOID Destination,
3700  * IN PVOID Source,
3701  * IN ULONG Length);
3702  */
3703 #define NdisMoveFromMappedMemory(Destination, Source, Length) \
3704  NdisMoveMappedMemory(Destination, Source, Length)
3705 
3706 /*
3707  * VOID
3708  * NdisMoveToMappedMemory(
3709  * OUT PVOID Destination,
3710  * IN PVOID Source,
3711  * IN ULONG Length);
3712  */
3713 #define NdisMoveToMappedMemory(Destination, Source, Length) \
3714  NdisMoveMappedMemory(Destination, Source, Length)
3715 
3716 /*
3717  * VOID
3718  * NdisMUpdateSharedMemory(
3719  * IN NDIS_HANDLE MiniportAdapterHandle,
3720  * IN ULONG Length,
3721  * IN PVOID VirtualAddress,
3722  * IN NDIS_PHYSICAL_ADDRESS PhysicalAddress);
3723  */
3724 #define NdisMUpdateSharedMemory(_H, _L, _V, _P) \
3725  NdisUpdateSharedMemory(_H, _L, _V, _P)
3726 
3727 _When_(MemoryFlags==0, _IRQL_requires_max_(DISPATCH_LEVEL))
3730 NDISAPI
3731 VOID
3732 NTAPI
3735  _In_ UINT Length,
3736  _In_ _Pre_satisfies_(MemoryFlags == 0 || MemoryFlags == NDIS_MEMORY_NONCACHED || MemoryFlags == NDIS_MEMORY_CONTIGUOUS)
3737  UINT MemoryFlags);
3738 
3739 NDISAPI
3740 VOID
3741 NTAPI
3744  IN ULONG Tag);
3745 
3746 NDISAPI
3747 VOID
3748 NTAPI
3751  IN ULONG SharedMemoryAddress,
3752  OUT PUCHAR Buffer,
3753  IN ULONG Length);
3754 
3755 NDISAPI
3756 VOID
3757 NTAPI
3760  IN ULONG SharedMemoryAddress,
3761  IN PUCHAR Buffer,
3762  IN ULONG Length);
3763 
3765 NDISAPI
3766 VOID
3767 NTAPI
3776 
3778 NDISAPI
3780 NTAPI
3785  _In_ PVOID Context);
3786 
3787 #if defined(NDIS50)
3788 
3789 #define NdisUpdateSharedMemory(NdisAdapterHandle, \
3790  Length, \
3791  VirtualAddress, \
3792  PhysicalAddress)
3793 
3794 #else
3795 
3796 NDISAPI
3797 VOID
3798 NTAPI
3800  IN NDIS_HANDLE NdisAdapterHandle,
3801  IN ULONG Length,
3804 
3805 #endif /* defined(NDIS50) */
3806 
3807 /*
3808  * ULONG
3809  * NdisGetPhysicalAddressHigh(
3810  * IN NDIS_PHYSICAL_ADDRESS PhysicalAddress);
3811  */
3812 #define NdisGetPhysicalAddressHigh(PhysicalAddress) \
3813  ((PhysicalAddress).HighPart)
3814 
3815 /*
3816  * VOID
3817  * NdisSetPhysicalAddressHigh(
3818  * IN NDIS_PHYSICAL_ADDRESS PhysicalAddress,
3819  * IN ULONG Value);
3820  */
3821 #define NdisSetPhysicalAddressHigh(PhysicalAddress, Value) \
3822  ((PhysicalAddress).HighPart) = (Value)
3823 
3824 /*
3825  * ULONG
3826  * NdisGetPhysicalAddressLow(
3827  * IN NDIS_PHYSICAL_ADDRESS PhysicalAddress);
3828  */
3829 #define NdisGetPhysicalAddressLow(PhysicalAddress) \
3830  ((PhysicalAddress).LowPart)
3831 
3832 
3833 /*
3834  * VOID
3835  * NdisSetPhysicalAddressLow(
3836  * IN NDIS_PHYSICAL_ADDRESS PhysicalAddress,
3837  * IN ULONG Value);
3838  */
3839 #define NdisSetPhysicalAddressLow(PhysicalAddress, Value) \
3840  ((PhysicalAddress).LowPart) = (Value)
3841 
3842 /*
3843  * VOID
3844  * NDIS_PHYSICAL_ADDRESS_CONST(
3845  * IN ULONG Low,
3846  * IN LONG High);
3847  */
3848 #define NDIS_PHYSICAL_ADDRESS_CONST(Low, High) \
3849  { {(ULONG)(Low), (LONG)(High)} }
3850 
3851 /*
3852  * ULONG
3853  * NdisEqualMemory(
3854  * IN CONST VOID *Source1,
3855  * IN CONST VOID *Source2,
3856  * IN ULONG Length);
3857  */
3858 #define NdisEqualMemory(Source1, Source2, Length) \
3859  RtlEqualMemory(Source1, Source2, Length)
3860 
3861 /*
3862  * VOID
3863  * NdisFillMemory(
3864  * IN PVOID Destination,
3865  * IN ULONG Length,
3866  * IN UCHAR Fill);
3867  */
3868 #define NdisFillMemory(Destination, Length, Fill) \
3869  RtlFillMemory(Destination, Length, Fill)
3870 
3871 /*
3872  * VOID
3873  * NdisMoveMemory(
3874  * OUT PVOID Destination,
3875  * IN PVOID Source,
3876  * IN ULONG Length);
3877  */
3878 #define NdisMoveMemory(Destination, Source, Length) \
3879  RtlCopyMemory(Destination, Source, Length)
3880 
3881 
3882 /*
3883  * VOID
3884  * NdisRetrieveUlong(
3885  * IN PULONG DestinationAddress,
3886  * IN PULONG SourceAddress);
3887  */
3888 #define NdisRetrieveUlong(DestinationAddress, SourceAddress) \
3889  RtlRetrieveUlong(DestinationAddress, SourceAddress)
3890 
3891 
3892 /*
3893  * VOID
3894  * NdisStoreUlong(
3895  * IN PULONG DestinationAddress,
3896  * IN ULONG Value);
3897  */
3898 #define NdisStoreUlong(DestinationAddress, Value) \
3899  RtlStoreUlong(DestinationAddress, Value)
3900 
3901 
3902 /*
3903  * VOID
3904  * NdisZeroMemory(
3905  * IN PVOID Destination,
3906  * IN ULONG Length)
3907  */
3908 #define NdisZeroMemory(Destination, Length) \
3909  RtlZeroMemory(Destination, Length)
3910 
3911 typedef VOID
3913  IN PUCHAR Block,
3915  );
3916 
3917 /* Configuration routines */
3918 
3919 #if NDIS_LEGACY_DRIVER
3921 _Success_(*Status >= 0)
3922 NDISAPI
3923 VOID
3924 NTAPI
3929 #endif
3930 
3932 _Success_(*Status >= 0)
3933 NDISAPI
3934 VOID
3935 NTAPI
3942 
3943 NDISAPI
3944 VOID
3945 NTAPI
3951 
3952 NDISAPI
3953 VOID
3954 NTAPI
3960  OUT PUINT NumberOfFunctions);
3961 
3962 #if NDIS_LEGACY_MINIPORT
3963 
3965 NDISAPI
3966 ULONG
3967 NTAPI
3969  _In_ NDIS_HANDLE NdisAdapterHandle,
3971  _In_ ULONG Offset,
3973  _In_ ULONG Length);
3974 
3976 NDISAPI
3977 ULONG
3978 NTAPI
3980  _In_ NDIS_HANDLE NdisAdapterHandle,
3982  _In_ ULONG Offset,
3984  _In_ ULONG Length);
3985 
3987 NDISAPI
3988 ULONG
3989 NTAPI
3991  _In_ NDIS_HANDLE NdisAdapterHandle,
3992  _In_ ULONG Offset,
3994  _In_ ULONG Length);
3995 
3997 NDISAPI
3998 ULONG
3999 NTAPI
4001  _In_ NDIS_HANDLE NdisAdapterHandle,
4002  _In_ ULONG Offset,
4004  _In_ ULONG Length);
4005 
4006 #endif /* NDIS_LEGACY_MINIPORT */
4007 
4008 /* String management routines */
4009 
4010 /*
4011 NDISAPI
4012 NDIS_STATUS
4013 NTAPI
4014 NdisAnsiStringToUnicodeString(
4015  IN OUT PNDIS_STRING DestinationString,
4016  IN PNDIS_ANSI_STRING SourceString);
4017 */
4018 #define NdisAnsiStringToUnicodeString(_us, _as) RtlAnsiStringToUnicodeString(_us, _as, FALSE)
4019 
4020 /*
4021  * BOOLEAN
4022  * NdisEqualString(
4023  * IN PNDIS_STRING String1,
4024  * IN PNDIS_STRING String2,
4025  * IN BOOLEAN CaseInsensitive);
4026  */
4027 #define NdisEqualString RtlEqualString
4028 
4029 #define NdisEqualUnicodeString RtlEqualUnicodeString
4030 
4031 /*
4032 NDISAPI
4033 VOID
4034 NTAPI
4035 NdisInitAnsiString(
4036  IN OUT PNDIS_ANSI_STRING DestinationString,
4037  IN PCSTR SourceString);
4038 */
4039 #define NdisInitAnsiString RtlInitString
4040 
4041 NDISAPI
4042 VOID
4043 NTAPI
4047 
4048 /*
4049 NDISAPI
4050 NDIS_STATUS
4051 NTAPI
4052 NdisUnicodeStringToAnsiString(
4053  IN OUT PNDIS_ANSI_STRING DestinationString,
4054  IN PNDIS_STRING SourceString);
4055 */
4056 #define NdisUnicodeStringToAnsiString(_as, _us) RtlUnicodeStringToAnsiString(_as, _us, FALSE)
4057 
4058 #define NdisFreeString(_s) NdisFreeMemory((_s).Buffer, (_s).MaximumLength, 0)
4059 #define NdisPrintString(_s) DbgPrint("%ls", (_s).Buffer)
4060 
4061 /* Spin lock reoutines */
4062 
4063 /*
4064 NDISAPI
4065 VOID
4066 NTAPI
4067 NdisAllocateSpinLock(
4068  IN PNDIS_SPIN_LOCK SpinLock);
4069 */
4070 #define NdisAllocateSpinLock(_SpinLock) KeInitializeSpinLock(&(_SpinLock)->SpinLock)
4071 
4072 /*
4073 NDISAPI
4074 VOID
4075 NTAPI
4076 NdisFreeSpinLock(
4077  IN PNDIS_SPIN_LOCK SpinLock);
4078 */
4079 #define NdisFreeSpinLock(_SpinLock)
4080 
4081 /*
4082 NDISAPI
4083 VOID
4084 NTAPI
4085 NdisAcquireSpinLock(
4086  IN PNDIS_SPIN_LOCK SpinLock);
4087 */
4088 #define NdisAcquireSpinLock(_SpinLock) KeAcquireSpinLock(&(_SpinLock)->SpinLock, &(_SpinLock)->OldIrql)
4089 
4090 /*
4091 NDISAPI
4092 VOID
4093 NTAPI
4094 NdisReleaseSpinLock(
4095  IN PNDIS_SPIN_LOCK SpinLock);
4096 */
4097 #define NdisReleaseSpinLock(_SpinLock) KeReleaseSpinLock(&(_SpinLock)->SpinLock,(_SpinLock)->OldIrql)
4098 
4099 /*
4100 NDISAPI
4101 VOID
4102 NTAPI
4103 NdisDprAcquireSpinLock(
4104  IN PNDIS_SPIN_LOCK SpinLock);
4105 */
4106 #define NdisDprAcquireSpinLock(_SpinLock) KeAcquireSpinLockAtDpcLevel(&(_SpinLock)->SpinLock)
4107 
4108 /*
4109 NDISAPI
4110 VOID
4111 NTAPI
4112 NdisDprReleaseSpinLock(
4113  IN PNDIS_SPIN_LOCK SpinLock);
4114 */
4115 #define NdisDprReleaseSpinLock(_SpinLock) KeReleaseSpinLockFromDpcLevel(&(_SpinLock)->SpinLock)
4116 
4117 /* I/O routines */
4118 
4119 /*
4120  * VOID
4121  * NdisRawReadPortBufferUchar(
4122  * IN ULONG Port,
4123  * OUT PUCHAR Buffer,
4124  * IN ULONG Length);
4125  */
4126 #define NdisRawReadPortBufferUchar(Port, Buffer, Length) \
4127  READ_PORT_BUFFER_UCHAR((PUCHAR)(Port), (PUCHAR)(Buffer), (Length))
4128 
4129 /*
4130  * VOID
4131  * NdisRawReadPortBufferUlong(
4132  * IN ULONG Port,
4133  * OUT PULONG Buffer,
4134  * IN ULONG Length);
4135  */
4136 #define NdisRawReadPortBufferUlong(Port, Buffer, Length) \
4137  READ_PORT_BUFFER_ULONG((PULONG)(Port), (PULONG)(Buffer), (Length))
4138 
4139 /*
4140  * VOID
4141  * NdisRawReadPortBufferUshort(
4142  * IN ULONG Port,
4143  * OUT PUSHORT Buffer,
4144  * IN ULONG Length);
4145  */
4146 #define NdisRawReadPortBufferUshort(Port, Buffer, Length) \
4147  READ_PORT_BUFFER_USHORT((PUSHORT)(Port), (PUSHORT)(Buffer), (Length))
4148 
4149 /*
4150  * VOID
4151  * NdisRawReadPortUchar(
4152  * IN ULONG Port,
4153  * OUT PUCHAR Data);
4154  */
4155 #define NdisRawReadPortUchar(Port, Data) \
4156  *(Data) = READ_PORT_UCHAR((PUCHAR)(Port))
4157 
4158 /*
4159  * VOID
4160  * NdisRawReadPortUlong(
4161  * IN ULONG Port,
4162  * OUT PULONG Data);
4163  */
4164 #define NdisRawReadPortUlong(Port, Data) \
4165  *(Data) = READ_PORT_ULONG((PULONG)(Port))
4166 
4167 /*
4168  * VOID
4169  * NdisRawReadPortUshort(
4170  * IN ULONG Port,
4171  * OUT PUSHORT Data);
4172  */
4173 #define NdisRawReadPortUshort(Port, Data) \
4174  *(Data) = READ_PORT_USHORT((PUSHORT)(Port))
4175 
4176 /*
4177  * VOID
4178  * NdisRawWritePortBufferUchar(
4179  * IN ULONG Port,
4180  * IN PUCHAR Buffer,
4181  * IN ULONG Length);
4182  */
4183 #define NdisRawWritePortBufferUchar(Port, Buffer, Length) \
4184  WRITE_PORT_BUFFER_UCHAR((PUCHAR)(Port), (PUCHAR)(Buffer), (Length))
4185 
4186 /*
4187  * VOID
4188  * NdisRawWritePortBufferUlong(
4189  * IN ULONG Port,
4190  * IN PULONG Buffer,
4191  * IN ULONG Length);
4192  */
4193 #define NdisRawWritePortBufferUlong(Port, Buffer, Length) \
4194  WRITE_PORT_BUFFER_ULONG((PULONG)(Port), (PULONG)(Buffer), (Length))
4195 
4196 /*
4197  * VOID
4198  * NdisRawWritePortBufferUshort(
4199  * IN ULONG Port,
4200  * IN PUSHORT Buffer,
4201  * IN ULONG Length);
4202  */
4203 #define NdisRawWritePortBufferUshort(Port, Buffer, Length) \
4204  WRITE_PORT_BUFFER_USHORT((PUSHORT)(Port), (PUSHORT)(Buffer), (Length))
4205 
4206 /*
4207  * VOID
4208  * NdisRawWritePortUchar(
4209  * IN ULONG Port,
4210  * IN UCHAR Data);
4211  */
4212 #define NdisRawWritePortUchar(Port, Data) \
4213  WRITE_PORT_UCHAR((PUCHAR)(Port), (UCHAR)(Data))
4214 
4215 /*
4216  * VOID
4217  * NdisRawWritePortUlong(
4218  * IN ULONG Port,
4219  * IN ULONG Data);
4220  */
4221 #define NdisRawWritePortUlong(Port, Data) \
4222  WRITE_PORT_ULONG((PULONG)(Port), (ULONG)(Data))
4223 
4224 /*
4225  * VOID
4226  * NdisRawWritePortUshort(
4227  * IN ULONG Port,
4228  * IN USHORT Data);
4229  */
4230 #define NdisRawWritePortUshort(Port, Data) \
4231  WRITE_PORT_USHORT((PUSHORT)(Port), (USHORT)(Data))
4232 
4233 
4234 /*
4235  * VOID
4236  * NdisReadRegisterUchar(
4237  * IN PUCHAR Register,
4238  * OUT PUCHAR Data);
4239  */
4240 #define NdisReadRegisterUchar(Register, Data) \
4241  *(Data) = *(Register)
4242 
4243 /*
4244  * VOID
4245  * NdisReadRegisterUlong(
4246  * IN PULONG Register,
4247  * OUT PULONG Data);
4248  */
4249 #define NdisReadRegisterUlong(Register, Data) \
4250  *(Data) = *(Register)
4251 
4252 /*
4253  * VOID
4254  * NdisReadRegisterUshort(
4255  * IN PUSHORT Register,
4256  * OUT PUSHORT Data);
4257  */
4258 #define NdisReadRegisterUshort(Register, Data) \
4259  *(Data) = *(Register)
4260 
4261 /*
4262  * VOID
4263  * NdisReadRegisterUchar(
4264  * IN PUCHAR Register,
4265  * IN UCHAR Data);
4266  */
4267 #define NdisWriteRegisterUchar(Register, Data) \
4268  WRITE_REGISTER_UCHAR((Register), (Data))
4269 
4270 /*
4271  * VOID
4272  * NdisReadRegisterUlong(
4273  * IN PULONG Register,
4274  * IN ULONG Data);
4275  */
4276 #define NdisWriteRegisterUlong(Register, Data) \
4277  WRITE_REGISTER_ULONG((Register), (Data))
4278 
4279 /*
4280  * VOID
4281  * NdisReadRegisterUshort(
4282  * IN PUSHORT Register,
4283  * IN USHORT Data);
4284  */
4285 #define NdisWriteRegisterUshort(Register, Data) \
4286  WRITE_REGISTER_USHORT((Register), (Data))
4287 
4288 
4289 /* Linked lists */
4290 
4291 /*
4292  * VOID
4293  * NdisInitializeListHead(
4294  * IN PLIST_ENTRY ListHead);
4295  */
4296 #define NdisInitializeListHead InitializeListHead
4297 
4298 /*
4299  * PLIST_ENTRY
4300  * NdisInterlockedInsertHeadList(
4301  * IN PLIST_ENTRY ListHead,
4302  * IN PLIST_ENTRY ListEntry,
4303  * IN PNDIS_SPIN_LOCK SpinLock);
4304  */
4305 #define NdisInterlockedInsertHeadList(_ListHead, _ListEntry, _SpinLock) \
4306  ExInterlockedInsertHeadList(_ListHead, _ListEntry, &(_SpinLock)->SpinLock)
4307 
4308 /*
4309  * PLIST_ENTRY
4310  * NdisInterlockedInsertTailList(
4311  * IN PLIST_ENTRY ListHead,
4312  * IN PLIST_ENTRY ListEntry,
4313  * IN PNDIS_SPIN_LOCK SpinLock);
4314  */
4315 #define NdisInterlockedInsertTailList(_ListHead, _ListEntry, _SpinLock) \
4316  ExInterlockedInsertTailList(_ListHead, _ListEntry, &(_SpinLock)->SpinLock)
4317 
4318 /*
4319  * PLIST_ENTRY
4320  * NdisInterlockedRemoveHeadList(
4321  * IN PLIST_ENTRY ListHead,
4322  * IN PNDIS_SPIN_LOCK SpinLock);
4323 */
4324 #define NdisInterlockedRemoveHeadList(_ListHead, _SpinLock) \
4325  ExInterlockedRemoveHeadList(_ListHead, &(_SpinLock)->SpinLock)
4326 
4327 /*
4328  * VOID
4329  * NdisInitializeSListHead(
4330  * IN PSLIST_HEADER SListHead);
4331  */
4332 #define NdisInitializeSListHead(SListHead) ExInitializeSListHead(SListHead)
4333 
4334 /*
4335  * USHORT NdisQueryDepthSList(
4336  * IN PSLIST_HEADER SListHead);
4337  */
4338 #define NdisQueryDepthSList(SListHead) ExQueryDepthSList(SListHead)
4339 
4340 #define NdisInterlockedPushEntryList(ListHead, ListEntry, Lock) \
4341  ExInterlockedPushEntryList(ListHead, ListEntry, &(Lock)->SpinLock)
4342 
4343 #define NdisInterlockedPopEntryList(ListHead, Lock) \
4344  ExInterlockedPopEntryList(ListHead, &(Lock)->SpinLock)
4345 
4346 /* Non-paged lookaside lists */
4347 
4348 #define NdisInitializeNPagedLookasideList(_L, _AR, _FR, _Fl, _S, _T, _D) \
4349  ExInitializeNPagedLookasideList(_L, _AR, _FR, _Fl, _S, _T, _D)
4350 #define NdisDeleteNPagedLookasideList(_L) ExDeleteNPagedLookasideList(_L)
4351 #define NdisAllocateFromNPagedLookasideList(_L) ExAllocateFromNPagedLookasideList(_L)
4352 #define NdisFreeToNPagedLookasideList(_L, _E) ExFreeToNPagedLookasideList(_L, _E)
4353 
4354 /* Interlocked routines */
4355 
4356 /*
4357  * LONG
4358  * NdisInterlockedDecrement(
4359  * IN PLONG Addend);
4360  */
4361 #define NdisInterlockedDecrement(Addend) InterlockedDecrement(Addend)
4362 
4363 /*
4364  * LONG
4365  * NdisInterlockedIncrement(
4366  * IN PLONG Addend);
4367  */
4368 #define NdisInterlockedIncrement(Addend) InterlockedIncrement(Addend)
4369 
4370 /*
4371  * VOID
4372  * NdisInterlockedAddUlong(
4373  * IN PULONG Addend,
4374  * IN ULONG Increment,
4375  * IN PNDIS_SPIN_LOCK SpinLock);
4376  */
4377 #define NdisInterlockedAddUlong(_Addend, _Increment, _SpinLock) \
4378  ExInterlockedAddUlong(_Addend, _Increment, &(_SpinLock)->SpinLock)
4379 
4380 /* Miscellaneous routines */
4381 
4383 NDISAPI
4384 VOID
4385 NTAPI
4388 
4390 _Success_(*Status >= 0)
4391 NDISAPI
4392 VOID
4393 NTAPI
4400 
4402 _Success_(*Status >= 0)
4403 NDISAPI
4404 VOID
4405 NTAPI
4411 
4413 NDISAPI
4414 VOID
4415 __cdecl
4417  _In_ NDIS_HANDLE NdisAdapterHandle,
4420  ...);
4421 
4423 NDISAPI
4424 VOID
4425 NTAPI
4429 
4430 /*
4431  * VOID
4432  * NdisStallExecution(
4433  * IN UINT MicrosecondsToStall)
4434  */
4435 #define NdisStallExecution KeStallExecutionProcessor
4436 
4437 /*
4438 NDISAPI
4439 VOID
4440 NTAPI
4441 NdisGetCurrentSystemTime(
4442  IN PLARGE_INTEGER pSystemTime);
4443 */
4444 #define NdisGetCurrentSystemTime KeQuerySystemTime
4445 
4446 #if NDIS_SUPPORT_60_COMPATIBLE_API
4448 NDISAPI
4449 CCHAR
4450 NTAPI
4452 #endif
4453 
4454 NDISAPI
4455 VOID
4456 NTAPI
4458  OUT PULONG pCpuUsage);
4459 
4460 /* NDIS helper macros */
4461 
4462 /*
4463  * VOID
4464  * NDIS_INIT_FUNCTION(FunctionName)
4465  */
4466 #define NDIS_INIT_FUNCTION(FunctionName) \
4467  alloc_text(init, FunctionName)
4468 
4469 /*
4470  * VOID
4471  * NDIS_PAGABLE_FUNCTION(FunctionName)
4472  */
4473 #define NDIS_PAGEABLE_FUNCTION(FunctionName) \
4474  alloc_text(page, FunctionName)
4475 
4476 #define NDIS_PAGABLE_FUNCTION NDIS_PAGEABLE_FUNCTION
4477 
4478 
4479 /* NDIS 4.0 extensions */
4480 
4482 NDISAPI
4483 VOID
4484 NTAPI
4487  _In_ ULONG Length,
4491 
4492 NDISAPI
4493 VOID
4494 NTAPI
4498  IN NDIS_HANDLE NdisLinkContext,
4499  IN PUCHAR PacketBuffer,
4500  IN UINT PacketSize);
4501 
4502 NDISAPI
4503 VOID
4504 NTAPI
4507  IN NDIS_HANDLE NdisLinkContext);
4508 
4509 NDISAPI
4510 VOID
4511 NTAPI
4516 
4517 NDISAPI
4519 NTAPI
4521  IN NDIS_HANDLE NdisMacHandle,
4522  IN NDIS_HANDLE NdisWrapperHandle,
4525  OUT PNDIS_RESOURCE_LIST *AssignedResources);
4526 
4527 
4528 /* NDIS 5.0 extensions */
4529 
4531 NDISAPI
4533 NTAPI
4538  _In_ ULONG Tag);
4539 
4541 NDISAPI
4542 VOID
4543 NTAPI
4545  _Out_ PULONG pIdleCount,
4547  _Out_ PULONG pIndex);
4548 
4549 #if NDIS_LEGACY_DRIVER
4550 NDISAPI
4551 VOID
4552 NTAPI
4554  OUT PULONG pSystemUpTime);
4555 #endif
4556 
4557 #if NDIS_SUPPORT_60_COMPATIBLE_API
4558 
4563 NDISAPI
4564 VOID
4565 NTAPI
4570 
4572 NDISAPI
4573 VOID
4574 NTAPI
4577