ReactOS  0.4.14-dev-52-g6116262
tdikrnl.h
Go to the documentation of this file.
1 /*
2  * tdikrnl.h
3  *
4  * TDI kernel mode definitions
5  *
6  * This file is part of the w32api 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  */
22 
23 #ifndef __TDIKRNL_H
24 #define __TDIKRNL_H
25 
26 #include "tdi.h"
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 #if defined(_TDI_)
33 #define TDIKRNLAPI
34 #else
35 #define TDIKRNLAPI DECLSPEC_IMPORT
36 #endif
37 
38 
39 typedef struct _TDI_REQUEST_KERNEL {
45 
46 /* Request codes */
47 #define TDI_ASSOCIATE_ADDRESS 0x01
48 #define TDI_DISASSOCIATE_ADDRESS 0x02
49 #define TDI_CONNECT 0x03
50 #define TDI_LISTEN 0x04
51 #define TDI_ACCEPT 0x05
52 #define TDI_DISCONNECT 0x06
53 #define TDI_SEND 0x07
54 #define TDI_RECEIVE 0x08
55 #define TDI_SEND_DATAGRAM 0x09
56 #define TDI_RECEIVE_DATAGRAM 0x0A
57 #define TDI_SET_EVENT_HANDLER 0x0B
58 #define TDI_QUERY_INFORMATION 0x0C
59 #define TDI_SET_INFORMATION 0x0D
60 #define TDI_ACTION 0x0E
61 
62 #define TDI_DIRECT_SEND 0x27
63 #define TDI_DIRECT_SEND_DATAGRAM 0x29
64 
65 #define TDI_TRANSPORT_ADDRESS_FILE 1
66 #define TDI_CONNECTION_FILE 2
67 #define TDI_CONTROL_CHANNEL_FILE 3
68 
69 /* Internal TDI IOCTLS */
70 #define IOCTL_TDI_QUERY_DIRECT_SEND_HANDLER _TDI_CONTROL_CODE(0x80, METHOD_NEITHER)
71 #define IOCTL_TDI_QUERY_DIRECT_SENDDG_HANDLER _TDI_CONTROL_CODE(0x81, METHOD_NEITHER)
72 
73 /* TdiAssociateAddress */
77 
78 /* TdiDisassociateAddress */
81 
82 /* TdiAccept */
87 
88 /* TdiConnect */
91 
92 /* TdiDisconnect */
95 
96 /* TdiListen */
99 
100 /* TdiReceive */
105 
106 /* TdiReceiveDatagram */
113 
114 /* TdiSend */
115 typedef struct _TDI_REQUEST_KERNEL_SEND {
119 
120 /* TdiSendDatagram */
125 
126 /* TdiSetEventHandler */
132 
133 /* TdiQueryInformation */
138 
139 /* TdiSetInformation */
144 
145 /* Event types */
146 #define TDI_EVENT_CONNECT 0
147 #define TDI_EVENT_DISCONNECT 1
148 #define TDI_EVENT_ERROR 2
149 #define TDI_EVENT_RECEIVE 3
150 #define TDI_EVENT_RECEIVE_DATAGRAM 4
151 #define TDI_EVENT_RECEIVE_EXPEDITED 5
152 #define TDI_EVENT_SEND_POSSIBLE 6
153 #define TDI_EVENT_CHAINED_RECEIVE 7
154 #define TDI_EVENT_CHAINED_RECEIVE_DATAGRAM 8
155 #define TDI_EVENT_CHAINED_RECEIVE_EXPEDITED 9
156 #define TDI_EVENT_ERROR_EX 10
157 
158 typedef NTSTATUS
160  _In_opt_ PVOID TdiEventContext,
161  _In_ LONG RemoteAddressLength,
162  _In_reads_bytes_(RemoteAddressLength) PVOID RemoteAddress,
163  _In_ LONG UserDataLength,
164  _In_reads_bytes_opt_(UserDataLength) PVOID UserData,
165  _In_ LONG OptionsLength,
166  _In_reads_bytes_opt_(OptionsLength) PVOID Options,
167  _Out_ CONNECTION_CONTEXT *ConnectionContext,
168  _Out_ PIRP *AcceptIrp);
169 
171 NTSTATUS
172 NTAPI
174  _In_opt_ PVOID TdiEventContext,
175  _In_ LONG RemoteAddressLength,
176  _In_reads_bytes_(RemoteAddressLength) PVOID RemoteAddress,
177  _In_ LONG UserDataLength,
178  _In_reads_bytes_opt_(UserDataLength) PVOID UserData,
179  _In_ LONG OptionsLength,
180  _In_reads_bytes_opt_(OptionsLength) PVOID Options,
181  _Out_ CONNECTION_CONTEXT *ConnectionContext,
182  _Out_ PIRP *AcceptIrp);
183 
184 typedef NTSTATUS
186  _In_opt_ PVOID TdiEventContext,
187  _In_opt_ CONNECTION_CONTEXT ConnectionContext,
188  _In_ LONG DisconnectDataLength,
189  _In_reads_bytes_opt_(DisconnectDataLength) PVOID DisconnectData,
190  _In_ LONG DisconnectInformationLength,
191  _In_reads_bytes_opt_(DisconnectInformationLength) PVOID DisconnectInformation,
192  _In_ ULONG DisconnectFlags);
193 
195 NTSTATUS
196 NTAPI
198  _In_opt_ PVOID TdiEventContext,
199  _In_opt_ CONNECTION_CONTEXT ConnectionContext,
200  _In_ LONG DisconnectDataLength,
201  _In_reads_bytes_opt_(DisconnectDataLength) PVOID DisconnectData,
202  _In_ LONG DisconnectInformationLength,
203  _In_reads_bytes_opt_(DisconnectInformationLength) PVOID DisconnectInformation,
204  _In_ ULONG DisconnectFlags);
205 
206 typedef NTSTATUS
208  _In_opt_ PVOID TdiEventContext,
210 
211 typedef NTSTATUS
213  _In_opt_ PVOID TdiEventContext,
215  _In_ PVOID Buffer);
216 
218 NTSTATUS
219 NTAPI
221  _In_opt_ PVOID TdiEventContext,
223 
224 typedef NTSTATUS
226  _In_opt_ PVOID TdiEventContext,
227  _In_opt_ CONNECTION_CONTEXT ConnectionContext,
228  _In_ ULONG ReceiveFlags,
229  _In_ ULONG BytesIndicated,
230  _In_ ULONG BytesAvailable,
231  _Out_ ULONG *BytesTaken,
232  _In_ PVOID Tsdu,
233  _Out_opt_ PIRP *IoRequestPacket);
234 
236 NTSTATUS
237 NTAPI
239  _In_opt_ PVOID TdiEventContext,
240  _In_opt_ CONNECTION_CONTEXT ConnectionContext,
241  _In_ ULONG ReceiveFlags,
242  _In_ ULONG BytesIndicated,
243  _In_ ULONG BytesAvailable,
244  _Out_ ULONG *BytesTaken,
245  _In_ PVOID Tsdu,
246  _Out_opt_ PIRP *IoRequestPacket);
247 
248 typedef NTSTATUS
250  _In_opt_ PVOID TdiEventContext,
251  _In_ LONG SourceAddressLength,
252  _In_reads_bytes_(SourceAddressLength) PVOID SourceAddress,
253  _In_ LONG OptionsLength,
254  _In_reads_bytes_opt_(OptionsLength) PVOID Options,
255  _In_ ULONG ReceiveDatagramFlags,
256  _In_ ULONG BytesIndicated,
257  _In_ ULONG BytesAvailable,
258  _Out_ ULONG *BytesTaken,
259  _In_ PVOID Tsdu,
260  _Out_opt_ PIRP *IoRequestPacket);
261 
265  _In_opt_ PVOID TdiEventContext,
266  _In_ LONG SourceAddressLength,
267  _In_reads_bytes_(SourceAddressLength) PVOID SourceAddress,
268  _In_ LONG OptionsLength,
269  _In_reads_bytes_opt_(OptionsLength) PVOID Options,
270  _In_ ULONG ReceiveDatagramFlags,
271  _In_ ULONG BytesIndicated,
272  _In_ ULONG BytesAvailable,
273  _Out_ ULONG *BytesTaken,
274  _In_ PVOID Tsdu,
275  _Out_opt_ PIRP *IoRequestPacket);
276 
277 typedef NTSTATUS
279  _In_opt_ PVOID TdiEventContext,
280  _In_opt_ CONNECTION_CONTEXT ConnectionContext,
281  _In_ ULONG ReceiveFlags,
282  _In_ ULONG BytesIndicated,
283  _In_ ULONG BytesAvailable,
284  _Out_ ULONG *BytesTaken,
285  _In_ PVOID Tsdu,
286  _Out_opt_ PIRP *IoRequestPacket);
287 
289 NTSTATUS
290 NTAPI
292  _In_opt_ PVOID TdiEventContext,
293  _In_opt_ CONNECTION_CONTEXT ConnectionContext,
294  _In_ ULONG ReceiveFlags,
295  _In_ ULONG BytesIndicated,
296  _In_ ULONG BytesAvailable,
297  _Out_ ULONG *BytesTaken,
298  _In_ PVOID Tsdu,
299  _Out_opt_ PIRP *IoRequestPacket);
300 
301 typedef NTSTATUS
303  _In_opt_ PVOID TdiEventContext,
304  _In_opt_ CONNECTION_CONTEXT ConnectionContext,
305  _In_ ULONG ReceiveFlags,
306  _In_ ULONG ReceiveLength,
308  _In_ PMDL Tsdu,
309  _In_ PVOID TsduDescriptor);
310 
312 NTSTATUS
313 NTAPI
315  _In_opt_ PVOID TdiEventContext,
316  _In_opt_ CONNECTION_CONTEXT ConnectionContext,
317  _In_ ULONG ReceiveFlags,
318  _In_ ULONG ReceiveLength,
320  _In_ PMDL Tsdu,
321  _In_ PVOID TsduDescriptor);
322 
323 typedef NTSTATUS
325  _In_opt_ PVOID TdiEventContext,
326  _In_ LONG SourceAddressLength,
327  _In_reads_bytes_(SourceAddressLength) PVOID SourceAddress,
328  _In_ LONG OptionsLength,
329  _In_reads_bytes_opt_(OptionsLength) PVOID Options,
330  _In_ ULONG ReceiveDatagramFlags,
331  _In_ ULONG ReceiveDatagramLength,
333  _In_ PMDL Tsdu,
334  _In_ PVOID TsduDescriptor);
335 
337 NTSTATUS
338 NTAPI
340  _In_opt_ PVOID TdiEventContext,
341  _In_ LONG SourceAddressLength,
342  _In_reads_bytes_(SourceAddressLength) PVOID SourceAddress,
343  _In_ LONG OptionsLength,
344  _In_reads_bytes_opt_(OptionsLength) PVOID Options,
345  _In_ ULONG ReceiveDatagramFlags,
346  _In_ ULONG ReceiveDatagramLength,
348  _In_ PMDL Tsdu,
349  _In_ PVOID TsduDescriptor);
350 
351 typedef NTSTATUS
353  _In_opt_ PVOID TdiEventContext,
354  _In_opt_ CONNECTION_CONTEXT ConnectionContext,
355  _In_ ULONG ReceiveFlags,
356  _In_ ULONG ReceiveLength,
358  _In_ PMDL Tsdu,
359  _In_ PVOID TsduDescriptor);
360 
362 NTSTATUS
363 NTAPI
365  _In_opt_ PVOID TdiEventContext,
366  _In_opt_ CONNECTION_CONTEXT ConnectionContext,
367  _In_ ULONG ReceiveFlags,
368  _In_ ULONG ReceiveLength,
370  _In_ PMDL Tsdu,
371  _In_ PVOID TsduDescriptor);
372 
373 typedef NTSTATUS
375  _In_opt_ PVOID TdiEventContext,
376  _In_opt_ PVOID ConnectionContext,
377  _In_ ULONG BytesAvailable);
378 
380 NTSTATUS
381 NTAPI
383  _In_opt_ PVOID TdiEventContext,
384  _In_opt_ PVOID ConnectionContext,
385  _In_ ULONG BytesAvailable);
386 
387 
388 
389 /* Macros and functions to build IRPs */
390 
391 #define TdiBuildBaseIrp( \
392  bIrp, bDevObj, bFileObj, bCompRoutine, bContxt, bIrpSp, bMinor) \
393 { \
394  bIrpSp->MajorFunction = IRP_MJ_INTERNAL_DEVICE_CONTROL; \
395  bIrpSp->MinorFunction = (bMinor); \
396  bIrpSp->DeviceObject = (bDevObj); \
397  bIrpSp->FileObject = (bFileObj); \
398  if (bCompRoutine) \
399  { \
400  IoSetCompletionRoutine(bIrp, bCompRoutine, bContxt, TRUE, TRUE, TRUE);\
401  } \
402  else \
403  IoSetCompletionRoutine(bIrp, NULL, NULL, FALSE, FALSE, FALSE); \
404 }
405 
406 /*
407  * VOID
408  * TdiBuildAccept(
409  * IN PIRP Irp,
410  * IN PDEVICE_OBJECT DevObj,
411  * IN PFILE_OBJECT FileObj,
412  * IN PVOID CompRoutine,
413  * IN PVOID Contxt,
414  * IN PTDI_CONNECTION_INFORMATION RequestConnectionInfo,
415  * OUT PTDI_CONNECTION_INFORMATION ReturnConnectionInfo);
416  */
417 #define TdiBuildAccept( \
418  Irp, DevObj, FileObj, CompRoutine, Contxt, \
419  RequestConnectionInfo, ReturnConnectionInfo) \
420 { \
421  PTDI_REQUEST_KERNEL_ACCEPT _Request; \
422  PIO_STACK_LOCATION _IrpSp; \
423  \
424  _IrpSp = IoGetNextIrpStackLocation(Irp); \
425  \
426  TdiBuildBaseIrp(Irp, DevObj, FileObj, CompRoutine, \
427  Contxt, _IrpSp, TDI_ACCEPT); \
428  \
429  _Request = (PTDI_REQUEST_KERNEL_ACCEPT)&_IrpSp->Parameters; \
430  _Request->RequestConnectionInformation = (RequestConnectionInfo); \
431  _Request->ReturnConnectionInformation = (ReturnConnectionInfo); \
432 }
433 
434 /*
435  * VOID
436  * TdiBuildAction(
437  * IN PIRP Irp,
438  * IN PDEVICE_OBJECT DevObj,
439  * IN PFILE_OBJECT FileObj,
440  * IN PVOID CompRoutine,
441  * IN PVOID Contxt,
442  * IN PMDL MdlAddr);
443  */
444 #define TdiBuildAction( \
445  Irp, DevObj, FileObj, CompRoutine, Contxt, MdlAddr) \
446 { \
447  PIO_STACK_LOCATION _IrpSp; \
448  \
449  _IrpSp = IoGetNextIrpStackLocation(Irp); \
450  \
451  TdiBuildBaseIrp(Irp, DevObj, FileObj, CompRoutine, \
452  Contxt, _IrpSp, TDI_ACTION); \
453  \
454  (Irp)->MdlAddress = (MdlAddr); \
455 }
456 
457 /*
458  * VOID
459  * TdiBuildAssociateAddress(
460  * IN PIRP Irp,
461  * IN PDEVICE_OBJECT DevObj,
462  * IN PFILE_OBJECT FileObj,
463  * IN PVOID CompRoutine,
464  * IN PVOID Contxt,
465  * IN HANDLE AddrHandle);
466  */
467 #define TdiBuildAssociateAddress( \
468  Irp, DevObj, FileObj, CompRoutine, Contxt, AddrHandle) \
469 { \
470  PTDI_REQUEST_KERNEL_ASSOCIATE _Request; \
471  PIO_STACK_LOCATION _IrpSp; \
472  \
473  _IrpSp = IoGetNextIrpStackLocation(Irp); \
474  \
475  TdiBuildBaseIrp(Irp, DevObj, FileObj, CompRoutine, \
476  Contxt, _IrpSp, TDI_ASSOCIATE_ADDRESS); \
477  \
478  _Request = (PTDI_REQUEST_KERNEL_ASSOCIATE)&_IrpSp->Parameters; \
479  _Request->AddressHandle = (HANDLE)(AddrHandle); \
480 }
481 
482 /*
483  * VOID
484  * TdiBuildConnect(
485  * IN PIRP Irp,
486  * IN PDEVICE_OBJECT DevObj,
487  * IN PFILE_OBJECT FileObj,
488  * IN PVOID CompRoutine,
489  * IN PVOID Contxt,
490  * IN PLARGE_INTEGER Time,
491  * IN PTDI_CONNECTION_INFORMATION RequestConnectionInfo,
492  * OUT PTDI_CONNECTION_INFORMATION ReturnConnectionInfo);
493  */
494 #define TdiBuildConnect( \
495  Irp, DevObj, FileObj, CompRoutine, Contxt, \
496  Time, RequestConnectionInfo, ReturnConnectionInfo) \
497 { \
498  PTDI_REQUEST_KERNEL _Request; \
499  PIO_STACK_LOCATION _IrpSp; \
500  \
501  _IrpSp = IoGetNextIrpStackLocation(Irp); \
502  \
503  TdiBuildBaseIrp(Irp, DevObj, FileObj, CompRoutine, \
504  Contxt, _IrpSp, TDI_CONNECT); \
505  \
506  _Request = (PTDI_REQUEST_KERNEL)&_IrpSp->Parameters; \
507  _Request->RequestConnectionInformation = (RequestConnectionInfo); \
508  _Request->ReturnConnectionInformation = (ReturnConnectionInfo); \
509  _Request->RequestSpecific = (PVOID)(Time); \
510 }
511 
512 /*
513  * VOID
514  * TdiBuildDisassociateAddress(
515  * IN PIRP Irp,
516  * IN PDEVICE_OBJECT DevObj,
517  * IN PFILE_OBJECT FileObj,
518  * IN PVOID CompRoutine,
519  * IN PVOID Contxt);
520  */
521 #define TdiBuildDisassociateAddress( \
522  Irp, DevObj, FileObj, CompRoutine, Contxt) \
523 { \
524  PIO_STACK_LOCATION _IrpSp; \
525  \
526  _IrpSp = IoGetNextIrpStackLocation(Irp); \
527  \
528  TdiBuildBaseIrp(Irp, DevObj, FileObj, CompRoutine, \
529  Contxt, _IrpSp, TDI_DISASSOCIATE_ADDRESS); \
530 }
531 
532 /*
533  * VOID
534  * TdiBuildDisconnect(
535  * IN PIRP Irp,
536  * IN PDEVICE_OBJECT DevObj,
537  * IN PFILE_OBJECT FileObj,
538  * IN PVOID CompRoutine,
539  * IN PVOID Contxt,
540  * IN PLARGE_INTEGER Time,
541  * IN PULONG Flags,
542  * IN PTDI_CONNECTION_INFORMATION RequestConnectionInfo,
543  * OUT PTDI_CONNECTION_INFORMATION ReturnConnectionInfo);
544  */
545 #define TdiBuildDisconnect( \
546  Irp, DevObj, FileObj, CompRoutine, Contxt, Time, \
547  Flags, RequestConnectionInfo, ReturnConnectionInfo) \
548 { \
549  PTDI_REQUEST_KERNEL _Request; \
550  PIO_STACK_LOCATION _IrpSp; \
551  \
552  _IrpSp = IoGetNextIrpStackLocation(Irp); \
553  \
554  TdiBuildBaseIrp(Irp, DevObj, FileObj, CompRoutine, \
555  Contxt, _IrpSp, TDI_DISCONNECT); \
556  \
557  _Request = (PTDI_REQUEST_KERNEL)&_IrpSp->Parameters; \
558  _Request->RequestConnectionInformation = (RequestConnectionInfo); \
559  _Request->ReturnConnectionInformation = (ReturnConnectionInfo); \
560  _Request->RequestSpecific = (PVOID)(Time); \
561  _Request->RequestFlags = (Flags); \
562 }
563 
564 /*
565  * PIRP
566  * TdiBuildInternalDeviceControlIrp(
567  * IN CCHAR IrpSubFunction,
568  * IN PDEVICE_OBJECT DeviceObject,
569  * IN PFILE_OBJECT FileObject,
570  * IN PKEVENT Event,
571  * IN PIO_STATUS_BLOCK IoStatusBlock);
572  */
573 #define TdiBuildInternalDeviceControlIrp( \
574  IrpSubFunction, DeviceObject, \
575  FileObject, Event, IoStatusBlock) \
576  IoBuildDeviceIoControlRequest( \
577  IrpSubFunction, DeviceObject, \
578  NULL, 0, NULL, 0, \
579  TRUE, Event, IoStatusBlock)
580 
581 /*
582  * VOID
583  * TdiBuildListen(
584  * IN PIRP Irp,
585  * IN PDEVICE_OBJECT DevObj,
586  * IN PFILE_OBJECT FileObj,
587  * IN PVOID CompRoutine,
588  * IN PVOID Contxt,
589  * IN ULONG Flags,
590  * IN PTDI_CONNECTION_INFORMATION RequestConnectionInfo,
591  * OUT PTDI_CONNECTION_INFORMATION ReturnConnectionInfo);
592  */
593 #define TdiBuildListen( \
594  Irp, DevObj, FileObj, CompRoutine, Contxt, \
595  Flags, RequestConnectionInfo, ReturnConnectionInfo) \
596 { \
597  PTDI_REQUEST_KERNEL _Request; \
598  PIO_STACK_LOCATION _IrpSp; \
599  \
600  _IrpSp = IoGetNextIrpStackLocation(Irp); \
601  \
602  TdiBuildBaseIrp(Irp, DevObj, FileObj, CompRoutine, \
603  Contxt, _IrpSp, TDI_LISTEN); \
604  \
605  _Request = (PTDI_REQUEST_KERNEL)&_IrpSp->Parameters; \
606  _Request->RequestConnectionInformation = (RequestConnectionInfo); \
607  _Request->ReturnConnectionInformation = (ReturnConnectionInfo); \
608  _Request->RequestFlags = (Flags); \
609 }
610 
612 VOID
613 NTAPI
615  _In_ PUCHAR NetbiosName,
616  _In_ BOOLEAN IsGroupName,
617  _Inout_ PTA_NETBIOS_ADDRESS NetworkName);
618 
620 NTSTATUS
621 NTAPI
624  _In_ BOOLEAN IsGroupName,
625  _In_ PUCHAR NetbiosName);
626 
627 /*
628  * VOID
629  * TdiBuildQueryInformation(
630  * IN PIRP Irp,
631  * IN PDEVICE_OBJECT DevObj,
632  * IN PFILE_OBJECT FileObj,
633  * IN PVOID CompRoutine,
634  * IN PVOID Contxt,
635  * IN UINT QType,
636  * IN PMDL MdlAddr);
637  */
638 #define TdiBuildQueryInformation( \
639  Irp, DevObj, FileObj, CompRoutine, Contxt, QType, MdlAddr) \
640 { \
641  PTDI_REQUEST_KERNEL_QUERY_INFORMATION _Request; \
642  PIO_STACK_LOCATION _IrpSp; \
643  \
644  _IrpSp = IoGetNextIrpStackLocation(Irp); \
645  \
646  TdiBuildBaseIrp(Irp, DevObj, FileObj, CompRoutine, \
647  Contxt, _IrpSp, TDI_QUERY_INFORMATION); \
648  \
649  _Request = (PTDI_REQUEST_KERNEL_QUERY_INFORMATION)&_IrpSp->Parameters; \
650  _Request->RequestConnectionInformation = NULL; \
651  _Request->QueryType = (ULONG)(QType); \
652  (Irp)->MdlAddress = (MdlAddr); \
653 }
654 
655 /*
656  * VOID
657  * TdiBuildReceive(
658  * IN PIRP Irp,
659  * IN PDEVICE_OBJECT DevObj,
660  * IN PFILE_OBJECT FileObj,
661  * IN PVOID CompRoutine,
662  * IN PVOID Contxt,
663  * IN PMDL MdlAddr,
664  * IN ULONG InFlags,
665  * IN ULONG ReceiveLen);
666  */
667 #define TdiBuildReceive( \
668  Irp, DevObj, FileObj, CompRoutine, Contxt, \
669  MdlAddr, InFlags, ReceiveLen) \
670 { \
671  PTDI_REQUEST_KERNEL_RECEIVE _Request; \
672  PIO_STACK_LOCATION _IrpSp; \
673  \
674  _IrpSp = IoGetNextIrpStackLocation(Irp); \
675  \
676  TdiBuildBaseIrp(Irp, DevObj, FileObj, CompRoutine, \
677  Contxt, _IrpSp, TDI_RECEIVE); \
678  \
679  _Request = (PTDI_REQUEST_KERNEL_RECEIVE)&_IrpSp->Parameters; \
680  _Request->ReceiveFlags = (InFlags); \
681  _Request->ReceiveLength = (ReceiveLen); \
682  (Irp)->MdlAddress = (MdlAddr); \
683 }
684 
685 /*
686  * VOID
687  * TdiBuildReceiveDatagram(
688  * IN PIRP Irp,
689  * IN PDEVICE_OBJECT DevObj,
690  * IN PFILE_OBJECT FileObj,
691  * IN PVOID CompRoutine,
692  * IN PVOID Contxt,
693  * IN PMDL MdlAddr,
694  * IN ULONG ReceiveLen,
695  * IN PTDI_CONNECTION_INFORMATION ReceiveDatagramInfo,
696  * OUT PTDI_CONNECTION_INFORMATION ReturnInfo,
697  * ULONG InFlags);
698  */
699 #define TdiBuildReceiveDatagram( \
700  Irp, DevObj, FileObj, CompRoutine, Contxt, MdlAddr, \
701  ReceiveLen, ReceiveDatagramInfo, ReturnInfo, InFlags) \
702 { \
703  PTDI_REQUEST_KERNEL_RECEIVEDG _Request; \
704  PIO_STACK_LOCATION _IrpSp; \
705  \
706  _IrpSp = IoGetNextIrpStackLocation(Irp); \
707  \
708  TdiBuildBaseIrp(Irp, DevObj, FileObj, CompRoutine, \
709  Contxt, _IrpSp, TDI_RECEIVE_DATAGRAM); \
710  \
711  _Request = (PTDI_REQUEST_KERNEL_RECEIVEDG)&_IrpSp->Parameters; \
712  _Request->ReceiveDatagramInformation = (ReceiveDatagramInfo); \
713  _Request->ReturnDatagramInformation = (ReturnInfo); \
714  _Request->ReceiveLength = (ReceiveLen); \
715  _Request->ReceiveFlags = (InFlags); \
716  (Irp)->MdlAddress = (MdlAddr); \
717 }
718 
719 /*
720  * VOID
721  * TdiBuildSend(
722  * IN PIRP Irp,
723  * IN PDEVICE_OBJECT DevObj,
724  * IN PFILE_OBJECT FileObj,
725  * IN PVOID CompRoutine,
726  * IN PVOID Contxt,
727  * IN PMDL MdlAddr,
728  * IN ULONG InFlags,
729  * IN ULONG SendLen);
730  */
731 #define TdiBuildSend( \
732  Irp, DevObj, FileObj, CompRoutine, Contxt, \
733  MdlAddr, InFlags, SendLen) \
734 { \
735  PTDI_REQUEST_KERNEL_SEND _Request; \
736  PIO_STACK_LOCATION _IrpSp; \
737  \
738  _IrpSp = IoGetNextIrpStackLocation(Irp); \
739  \
740  TdiBuildBaseIrp(Irp, DevObj, FileObj, CompRoutine, \
741  Contxt, _IrpSp, TDI_SEND); \
742  \
743  _Request = (PTDI_REQUEST_KERNEL_SEND)&_IrpSp->Parameters; \
744  _Request->SendFlags = (InFlags); \
745  _Request->SendLength = (SendLen); \
746  (Irp)->MdlAddress = (MdlAddr); \
747 }
748 
749 /*
750  * VOID
751  * TdiBuildSendDatagram(
752  * IN PIRP Irp,
753  * IN PDEVICE_OBJECT DevObj,
754  * IN PFILE_OBJECT FileObj,
755  * IN PVOID CompRoutine,
756  * IN PVOID Contxt,
757  * IN PMDL MdlAddr,
758  * IN ULONG SendLen,
759  * IN PTDI_CONNECTION_INFORMATION SendDatagramInfo);
760  */
761 #define TdiBuildSendDatagram( \
762  Irp, DevObj, FileObj, CompRoutine, Contxt, \
763  MdlAddr, SendLen, SendDatagramInfo) \
764 { \
765  PTDI_REQUEST_KERNEL_SENDDG _Request; \
766  PIO_STACK_LOCATION _IrpSp; \
767  \
768  _IrpSp = IoGetNextIrpStackLocation(Irp); \
769  \
770  TdiBuildBaseIrp(Irp, DevObj, FileObj, CompRoutine, \
771  Contxt, _IrpSp, TDI_SEND_DATAGRAM); \
772  \
773  _Request = (PTDI_REQUEST_KERNEL_SENDDG)&_IrpSp->Parameters; \
774  _Request->SendDatagramInformation = (SendDatagramInfo); \
775  _Request->SendLength = (SendLen); \
776  (Irp)->MdlAddress = (MdlAddr); \
777 }
778 
779 /*
780  * VOID
781  * TdiBuildSetEventHandler(
782  * IN PIRP Irp,
783  * IN PDEVICE_OBJECT DevObj,
784  * IN PFILE_OBJECT FileObj,
785  * IN PVOID CompRoutine,
786  * IN PVOID Contxt,
787  * IN INT InEventType,
788  * IN PVOID InEventHandler,
789  * IN PVOID InEventContext);
790  */
791 #define TdiBuildSetEventHandler( \
792  Irp, DevObj, FileObj, CompRoutine, Contxt, \
793  InEventType, InEventHandler, InEventContext) \
794 { \
795  PTDI_REQUEST_KERNEL_SET_EVENT _Request; \
796  PIO_STACK_LOCATION _IrpSp; \
797  \
798  _IrpSp = IoGetNextIrpStackLocation(Irp); \
799  \
800  TdiBuildBaseIrp(Irp, DevObj, FileObj, CompRoutine, \
801  Contxt, _IrpSp, TDI_SET_EVENT_HANDLER); \
802  \
803  _Request = (PTDI_REQUEST_KERNEL_SET_EVENT)&_IrpSp->Parameters; \
804  _Request->EventType = (InEventType); \
805  _Request->EventHandler = (PVOID)(InEventHandler); \
806  _Request->EventContext = (PVOID)(InEventContext); \
807 }
808 
809 /*
810  * VOID
811  * TdiBuildSetInformation(
812  * IN PIRP Irp,
813  * IN PDEVICE_OBJECT DevObj,
814  * IN PFILE_OBJECT FileObj,
815  * IN PVOID CompRoutine,
816  * IN PVOID Contxt,
817  * IN UINT SType,
818  * IN PMDL MdlAddr);
819  */
820 #define TdiBuildSetInformation( \
821  Irp, DevObj, FileObj, CompRoutine, Contxt, SType, MdlAddr) \
822 { \
823  PTDI_REQUEST_KERNEL_SET_INFORMATION _Request; \
824  PIO_STACK_LOCATION _IrpSp; \
825  \
826  _IrpSp = IoGetNextIrpStackLocation(Irp); \
827  \
828  TdiBuildBaseIrp(Irp, DevObj, FileObj, CompRoutine, \
829  Contxt, _IrpSp, TDI_SET_INFORMATION); \
830  \
831  _Request = (PTDI_REQUEST_KERNEL_SET_INFORMATION)&_IrpSp->Parameters; \
832  _Request->RequestConnectionInformation = NULL; \
833  _Request->SetType = (ULONG)(SType); \
834  (Irp)->MdlAddress = (MdlAddr); \
835 }
836 
837 /* TDI20_CLIENT_INTERFACE_INFO.TdiVersion constants */
838 #define TDI_CURRENT_MAJOR_VERSION 2
839 #define TDI_CURRENT_MINOR_VERSION 0
840 
841 #define TDI_CURRENT_VERSION ((TDI_CURRENT_MINOR_VERSION) << 8 \
842  | (TDI_CURRENT_MAJOR_VERSION))
843 
844 #define TDI_VERSION_ONE 0x0001
845 
846 typedef enum _TDI_PNP_OPCODE {
857 
858 /* TDI_PNP_CONTEXT.ContextType */
859 #define TDI_PNP_CONTEXT_TYPE_IF_NAME 0x1
860 #define TDI_PNP_CONTEXT_TYPE_IF_ADDR 0x2
861 #define TDI_PNP_CONTEXT_TYPE_PDO 0x3
862 #define TDI_PNP_CONTEXT_TYPE_FIRST_OR_LAST_IF 0x4
863 
864 typedef struct _TDI_PNP_CONTEXT {
869 
870 typedef VOID
873 
874 typedef VOID
879 
880 typedef VOID
882  _In_ TDI_PNP_OPCODE PnPOpcode,
884  _In_ PWSTR MultiSZBindList);
885 
886 typedef VOID
889 
890 typedef VOID
893 
894 typedef VOID
899 
900 typedef NTSTATUS
906 
907 typedef VOID
910 
911 typedef VOID
913  _In_ PNET_PNP_EVENT NetEvent,
914  _In_ NTSTATUS ProviderStatus);
915 
917  _ANONYMOUS_UNION union {
918  _ANONYMOUS_STRUCT struct {
921  } DUMMYSTRUCTNAME;
923  } DUMMYUNIONNAME;
927  _ANONYMOUS_UNION union {
929  _ANONYMOUS_STRUCT struct {
932  } DUMMYSTRUCTNAME;
934  _ANONYMOUS_UNION union {
935  _ANONYMOUS_STRUCT struct {
938  } DUMMYSTRUCTNAME;
939  _ANONYMOUS_STRUCT struct {
943  } DUMMYUNIONNAME3;
945 
948 
949 
950 /* TDI functions */
951 
952 /*
953  * VOID
954  * TdiCompleteRequest(
955  * IN PIRP Irp,
956  * IN NTSTATUS Status);
957  */
958 #define TdiCompleteRequest(Irp, Status) \
959 { \
960  (Irp)->IoStatus.Status = (Status); \
961  IoCompleteRequest((Irp), IO_NETWORK_INCREMENT); \
962 }
963 
966 NTSTATUS
967 NTAPI
969  _In_ PVOID SourceBuffer,
975 
976 /*
977  * VOID
978  * TdiCopyLookaheadData(
979  * IN PVOID Destination,
980  * IN PVOID Source,
981  * IN ULONG Length,
982  * IN ULONG ReceiveFlags);
983  */
984 #define TdiCopyLookaheadData(Destination, Source, Length, ReceiveFlags) \
985  RtlCopyMemory(Destination, Source, Length)
986 
989 NTSTATUS
990 NTAPI
991 TdiCopyMdlChainToMdlChain(
992  _In_ PMDL SourceMdlChain,
997 
1000 NTSTATUS
1001 NTAPI
1003  _In_ PMDL SourceMdlChain,
1005  _Out_writes_bytes_(DestinationBufferSize) PVOID DestinationBuffer,
1009 
1010 TDIKRNLAPI
1011 NTSTATUS
1012 NTAPI
1015 
1017 TDIKRNLAPI
1018 NTSTATUS
1019 NTAPI
1022 
1024 TDIKRNLAPI
1025 NTSTATUS
1026 NTAPI
1029 
1031 TDIKRNLAPI
1032 NTSTATUS
1033 NTAPI
1036 
1038 TDIKRNLAPI
1039 NTSTATUS
1040 NTAPI
1041 TdiDeregisterProvider(
1043 
1045 TDIKRNLAPI
1046 NTSTATUS
1047 NTAPI
1048 TdiEnumerateAddresses(
1050 
1052 TDIKRNLAPI
1053 VOID
1054 NTAPI
1056 
1057 TDIKRNLAPI
1058 VOID
1059 NTAPI
1060 TdiMapBuffer(
1061  _In_ PMDL MdlChain);
1062 
1064 TDIKRNLAPI
1065 NTSTATUS
1066 NTAPI
1071 
1072 TDIKRNLAPI
1073 BOOLEAN
1074 NTAPI
1076  _In_ PVOID TsduDescriptor,
1077  _In_ PVOID PDO);
1078 
1080 TDIKRNLAPI
1081 VOID
1082 NTAPI
1083 TdiPnPPowerComplete(
1086  _In_ NTSTATUS Status);
1087 
1089 TDIKRNLAPI
1090 NTSTATUS
1091 NTAPI
1092 TdiPnPPowerRequest(
1098 
1100 TDIKRNLAPI
1101 NTSTATUS
1102 NTAPI
1103 TdiProviderReady(
1105 
1106 TDIKRNLAPI
1107 NTSTATUS
1108 NTAPI
1110  _In_ TDI_ADD_ADDRESS_HANDLER AddHandler,
1111  _In_ TDI_DEL_ADDRESS_HANDLER DeleteHandler,
1113 
1115 TDIKRNLAPI
1116 NTSTATUS
1117 NTAPI
1121 
1123 TDIKRNLAPI
1124 NTSTATUS
1125 NTAPI
1131 
1132 TDIKRNLAPI
1133 NTSTATUS
1134 NTAPI
1136  _In_ TDI_BIND_HANDLER BindHandler,
1137  _In_ TDI_UNBIND_HANDLER UnbindHandler,
1139 
1141 TDIKRNLAPI
1142 NTSTATUS
1143 NTAPI
1148 
1150 TDIKRNLAPI
1151 NTSTATUS
1152 NTAPI
1153 TdiRegisterProvider(
1154  _In_ PUNICODE_STRING ProviderName,
1156 
1158 TDIKRNLAPI
1159 VOID
1160 NTAPI
1162  _In_ PVOID *TsduDescriptors,
1164 
1165 TDIKRNLAPI
1166 VOID
1167 NTAPI
1169  _In_ PMDL MdlChain);
1170 
1171 #ifdef __cplusplus
1172 }
1173 #endif
1174 
1175 #endif /* __TDIKRNL_H */
TDI_ADD_ADDRESS_HANDLER_V2 AddAddressHandlerV2
Definition: tdikrnl.h:936
PTDI_CONNECTION_INFORMATION ReturnConnectionInformation
Definition: tdikrnl.h:42
struct _TDI_REQUEST_KERNEL_RECEIVEDG * PTDI_REQUEST_KERNEL_RECEIVEDG
TDIKRNLAPI NTSTATUS NTAPI TdiDefaultDisconnectHandler(_In_opt_ PVOID TdiEventContext, _In_opt_ CONNECTION_CONTEXT ConnectionContext, _In_ LONG DisconnectDataLength, _In_reads_bytes_opt_(DisconnectDataLength) PVOID DisconnectData, _In_ LONG DisconnectInformationLength, _In_reads_bytes_opt_(DisconnectInformationLength) PVOID DisconnectInformation, _In_ ULONG DisconnectFlags)
TDIKRNLAPI NTSTATUS NTAPI TdiDefaultRcvExpeditedHandler(_In_opt_ PVOID TdiEventContext, _In_opt_ CONNECTION_CONTEXT ConnectionContext, _In_ ULONG ReceiveFlags, _In_ ULONG BytesIndicated, _In_ ULONG BytesAvailable, _Out_ ULONG *BytesTaken, _In_ PVOID Tsdu, _Out_opt_ PIRP *IoRequestPacket)
struct _TDI_REQUEST_KERNEL_ASSOCIATE * PTDI_REQUEST_KERNEL_ASSOCIATE
TDIKRNLAPI NTSTATUS NTAPI TdiRegisterNotificationHandler(_In_ TDI_BIND_HANDLER BindHandler, _In_ TDI_UNBIND_HANDLER UnbindHandler, _Out_ HANDLE *BindingHandle)
struct _TDI_REQUEST_KERNEL_SENDDG TDI_REQUEST_KERNEL_SENDDG
NTSTATUS(NTAPI * PTDI_IND_CHAINED_RECEIVE_EXPEDITED)(_In_opt_ PVOID TdiEventContext, _In_opt_ CONNECTION_CONTEXT ConnectionContext, _In_ ULONG ReceiveFlags, _In_ ULONG ReceiveLength, _In_ ULONG StartingOffset, _In_ PMDL Tsdu, _In_ PVOID TsduDescriptor)
Definition: tdikrnl.h:352
NTSTATUS(NTAPI * PTDI_IND_DISCONNECT)(_In_opt_ PVOID TdiEventContext, _In_opt_ CONNECTION_CONTEXT ConnectionContext, _In_ LONG DisconnectDataLength, _In_reads_bytes_opt_(DisconnectDataLength) PVOID DisconnectData, _In_ LONG DisconnectInformationLength, _In_reads_bytes_opt_(DisconnectInformationLength) PVOID DisconnectInformation, _In_ ULONG DisconnectFlags)
Definition: tdikrnl.h:185
TDIKRNLAPI NTSTATUS NTAPI TdiDefaultRcvDatagramHandler(_In_opt_ PVOID TdiEventContext, _In_ LONG SourceAddressLength, _In_reads_bytes_(SourceAddressLength) PVOID SourceAddress, _In_ LONG OptionsLength, _In_reads_bytes_opt_(OptionsLength) PVOID Options, _In_ ULONG ReceiveDatagramFlags, _In_ ULONG BytesIndicated, _In_ ULONG BytesAvailable, _Out_ ULONG *BytesTaken, _In_ PVOID Tsdu, _Out_opt_ PIRP *IoRequestPacket)
_In_ PFCB _In_ LONGLONG StartingOffset
Definition: cdprocs.h:282
VOID NTAPI TdiInitialize()
Definition: stubs.c:73
struct _TDI_REQUEST_KERNEL_SET_EVENT * PTDI_REQUEST_KERNEL_SET_EVENT
NTSTATUS NTAPI TdiRegisterPnPHandlers(_In_ PTDI_CLIENT_INTERFACE_INFO ClientInterfaceInfo, _In_ ULONG InterfaceInfoSize, _Out_ HANDLE *BindingHandle)
Definition: handler.c:233
struct _TDI_REQUEST_KERNEL_ACCEPT * PTDI_REQUEST_KERNEL_ACCEPT
_In_ ULONG _In_ ULONG _In_ PMDL DestinationMdlChain
Definition: tdikrnl.h:970
_In_ PIRP Irp
Definition: csq.h:116
#define TDIKRNLAPI
Definition: tdikrnl.h:35
struct _TDI_REQUEST_KERNEL_ACCEPT TDI_REQUEST_KERNEL_ACCEPT
_ANONYMOUS_UNION union _TDI20_CLIENT_INTERFACE_INFO::@2155 DUMMYUNIONNAME3
uint16_t * PWSTR
Definition: typedefs.h:54
#define _ANONYMOUS_UNION
Definition: ntbasedef.h:30
struct _TDI_REQUEST_KERNEL_QUERY_INFO * PTDI_REQUEST_KERNEL_QUERY_INFORMATION
unsigned char * PUCHAR
Definition: retypes.h:3
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ ULONG _In_ ULONG _Outptr_ PMDL * MdlChain
Definition: fsrtlfuncs.h:46
_ANONYMOUS_STRUCT struct _TDI20_CLIENT_INTERFACE_INFO::@2155::@2159 DUMMYSTRUCTNAME2
#define _In_reads_bytes_opt_(size)
Definition: no_sal2.h:230
_In_ ULONG _Out_writes_bytes_(DestinationBufferSize) PVOID DestinationBuffer
TDIKRNLAPI NTSTATUS NTAPI TdiDefaultReceiveHandler(_In_opt_ PVOID TdiEventContext, _In_opt_ CONNECTION_CONTEXT ConnectionContext, _In_ ULONG ReceiveFlags, _In_ ULONG BytesIndicated, _In_ ULONG BytesAvailable, _Out_ ULONG *BytesTaken, _In_ PVOID Tsdu, _Out_opt_ PIRP *IoRequestPacket)
LONG NTSTATUS
Definition: precomp.h:26
_IRQL_requires_max_(DISPATCH_LEVEL) TDIKRNLAPI NTSTATUS NTAPI TdiCopyBufferToMdl(_In_ PVOID SourceBuffer
Definition: rmap.c:30
_In_ PUNICODE_STRING DeviceName
Definition: tdikrnl.h:1128
VOID(NTAPI * TDI_DEL_ADDRESS_HANDLER_V2)(_In_ PTA_ADDRESS Address, _In_ PUNICODE_STRING DeviceName, _In_ PTDI_PNP_CONTEXT Context)
Definition: tdikrnl.h:895
TDIKRNLAPI NTSTATUS NTAPI TdiDeregisterAddressChangeHandler(_In_ HANDLE BindingHandle)
NTSTATUS NTAPI TdiCopyBufferToMdl(IN PVOID SourceBuffer, IN ULONG SourceOffset, IN ULONG SourceBytesToCopy, IN PMDL DestinationMdlChain, IN ULONG DestinationOffset, IN PULONG BytesCopied)
Definition: stubs.c:37
_In_ ULONG _Out_ HANDLE * BindingHandle
Definition: tdikrnl.h:1146
TDIKRNLAPI NTSTATUS NTAPI TdiRegisterAddressChangeHandler(_In_ TDI_ADD_ADDRESS_HANDLER AddHandler, _In_ TDI_DEL_ADDRESS_HANDLER DeleteHandler, _Out_ HANDLE *BindingHandle)
TDI_BINDING_HANDLER BindingHandler
Definition: tdikrnl.h:928
_In_ ULONG _In_ ULONG _In_ PMDL _In_ ULONG _Out_ PULONG BytesCopied
Definition: tdikrnl.h:970
struct _TDI_REQUEST_KERNEL_RECEIVEDG TDI_REQUEST_KERNEL_RECEIVEDG
NTSTATUS NTAPI TdiRegisterDeviceObject(IN PUNICODE_STRING DeviceName, OUT HANDLE *RegistrationHandle)
Definition: dereg.c:53
NTSTATUS NTAPI TdiDeregisterPnPHandlers(_In_ HANDLE BindingHandle)
Definition: handler.c:244
NTSTATUS(NTAPI * PTDI_IND_CHAINED_RECEIVE_DATAGRAM)(_In_opt_ PVOID TdiEventContext, _In_ LONG SourceAddressLength, _In_reads_bytes_(SourceAddressLength) PVOID SourceAddress, _In_ LONG OptionsLength, _In_reads_bytes_opt_(OptionsLength) PVOID Options, _In_ ULONG ReceiveDatagramFlags, _In_ ULONG ReceiveDatagramLength, _In_ ULONG StartingOffset, _In_ PMDL Tsdu, _In_ PVOID TsduDescriptor)
Definition: tdikrnl.h:324
enum OPTION_FLAGS Options
Definition: stats.c:44
TDI_PNP_POWER_HANDLER PnPPowerHandler
Definition: tdikrnl.h:926
_In_ PNET_PNP_EVENT _In_ PTDI_PNP_CONTEXT _In_ PTDI_PNP_CONTEXT _In_ ProviderPnPPowerComplete ProtocolCompletionHandler
Definition: tdikrnl.h:1094
#define _In_opt_
Definition: no_sal2.h:213
NTSTATUS(NTAPI * PTDI_IND_ERROR)(_In_opt_ PVOID TdiEventContext, _In_ NTSTATUS Status)
Definition: tdikrnl.h:207
TDI_UNBIND_HANDLER UnBindHandler
Definition: tdikrnl.h:931
TDIKRNLAPI VOID NTAPI TdiUnmapBuffer(_In_ PMDL MdlChain)
TDI_DEL_ADDRESS_HANDLER DelAddressHandler
Definition: tdikrnl.h:941
TDI_REQUEST_KERNEL TDI_REQUEST_KERNEL_DISCONNECT
Definition: tdikrnl.h:93
TDIKRNLAPI NTSTATUS NTAPI TdiDefaultSendPossibleHandler(_In_opt_ PVOID TdiEventContext, _In_opt_ PVOID ConnectionContext, _In_ ULONG BytesAvailable)
struct _TDI_REQUEST_KERNEL_SET_INFO * PTDI_REQUEST_KERNEL_SET_INFORMATION
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
long LONG
Definition: pedump.c:60
TDI_BIND_HANDLER BindHandler
Definition: tdikrnl.h:930
struct _TDI_REQUEST_KERNEL_SET_INFO TDI_REQUEST_KERNEL_SET_INFORMATION
struct _TDI_REQUEST_KERNEL_SEND * PTDI_REQUEST_KERNEL_SEND
TDIKRNLAPI NTSTATUS NTAPI TdiDefaultChainedReceiveHandler(_In_opt_ PVOID TdiEventContext, _In_opt_ CONNECTION_CONTEXT ConnectionContext, _In_ ULONG ReceiveFlags, _In_ ULONG ReceiveLength, _In_ ULONG StartingOffset, _In_ PMDL Tsdu, _In_ PVOID TsduDescriptor)
PUNICODE_STRING ClientName
Definition: tdikrnl.h:925
NTSTATUS NTAPI TdiRegisterNetAddress(IN PTA_ADDRESS Address, IN PUNICODE_STRING DeviceName, IN PTDI_PNP_CONTEXT Context, OUT HANDLE *RegistrationHandle)
Definition: dereg.c:78
_In_ PUNICODE_STRING _In_ PTDI_PNP_CONTEXT _Out_ HANDLE * AddrRegistrationHandle
Definition: tdikrnl.h:1128
TDI_REQUEST_KERNEL TDI_REQUEST_KERNEL_LISTEN
Definition: tdikrnl.h:97
TDI_REQUEST_KERNEL * PTDI_REQUEST_KERNEL_DISCONNECT
Definition: tdikrnl.h:93
PTDI_CONNECTION_INFORMATION RequestConnectionInformation
Definition: tdikrnl.h:136
PTDI_CONNECTION_INFORMATION RequestConnectionInformation
Definition: tdikrnl.h:142
NTSTATUS(NTAPI * TDI_PNP_POWER_HANDLER)(_In_ PUNICODE_STRING DeviceName, _In_ PNET_PNP_EVENT PowerEvent, _In_ PTDI_PNP_CONTEXT Context1, _In_ PTDI_PNP_CONTEXT Context2)
Definition: tdikrnl.h:901
unsigned char BOOLEAN
static WCHAR Address[46]
Definition: ping.c:68
struct _TDI_REQUEST_KERNEL_ASSOCIATE TDI_REQUEST_KERNEL_ASSOCIATE
#define _Out_
Definition: no_sal2.h:323
struct _TDI_REQUEST_KERNEL_SEND TDI_REQUEST_KERNEL_SEND
NTSTATUS NTAPI TdiDeregisterNetAddress(IN HANDLE RegistrationHandle)
Definition: dereg.c:92
Definition: bufpool.h:45
TDI_REQUEST_KERNEL * PTDI_REQUEST_KERNEL_LISTEN
Definition: tdikrnl.h:97
NTSTATUS NTAPI TdiCopyMdlToBuffer(IN PMDL SourceMdlChain, IN ULONG SourceOffset, IN PVOID DestinationBuffer, IN ULONG DestinationOffset, IN ULONG DestinationBufferSize, OUT PULONG BytesCopied)
Definition: stubs.c:55
TDI_REQUEST_KERNEL TDI_REQUEST_KERNEL_CONNECT
Definition: tdikrnl.h:89
_ANONYMOUS_UNION union _TDI20_CLIENT_INTERFACE_INFO::@2153 DUMMYUNIONNAME
USHORT ContextSize
Definition: tdikrnl.h:865
_In_ ULONG _In_ ULONG SourceBytesToCopy
Definition: tdikrnl.h:970
#define _Out_opt_
Definition: no_sal2.h:339
_Field_size_bytes_(SendLength) PTDI_CONNECTION_INFORMATION SendDatagramInformation
enum _TDI_PNP_OPCODE TDI_PNP_OPCODE
struct _TDI_PNP_CONTEXT * PTDI_PNP_CONTEXT
_In_ ULONG SourceOffset
Definition: tdikrnl.h:970
struct tagUserData UserData
VOID(NTAPI * ProviderPnPPowerComplete)(_In_ PNET_PNP_EVENT NetEvent, _In_ NTSTATUS ProviderStatus)
Definition: tdikrnl.h:912
_Out_ HANDLE * ProviderHandle
Definition: tdikrnl.h:1155
PVOID RequestSpecific
Definition: tdikrnl.h:43
#define _Inout_
Definition: no_sal2.h:244
_In_ ULONG _In_ ULONG _In_ PMDL _In_ ULONG DestinationOffset
Definition: tdikrnl.h:970
NTSTATUS(NTAPI * PTDI_IND_CHAINED_RECEIVE)(_In_opt_ PVOID TdiEventContext, _In_opt_ CONNECTION_CONTEXT ConnectionContext, _In_ ULONG ReceiveFlags, _In_ ULONG ReceiveLength, _In_ ULONG StartingOffset, _In_ PMDL Tsdu, _In_ PVOID TsduDescriptor)
Definition: tdikrnl.h:302
struct _TDI_REQUEST_KERNEL_SET_EVENT TDI_REQUEST_KERNEL_SET_EVENT
TDIKRNLAPI NTSTATUS NTAPI TdiBuildNetbiosAddressEa(_Out_ PUCHAR Buffer, _In_ BOOLEAN IsGroupName, _In_ PUCHAR NetbiosName)
NTSTATUS(NTAPI * PTDI_IND_RECEIVE_DATAGRAM)(_In_opt_ PVOID TdiEventContext, _In_ LONG SourceAddressLength, _In_reads_bytes_(SourceAddressLength) PVOID SourceAddress, _In_ LONG OptionsLength, _In_reads_bytes_opt_(OptionsLength) PVOID Options, _In_ ULONG ReceiveDatagramFlags, _In_ ULONG BytesIndicated, _In_ ULONG BytesAvailable, _Out_ ULONG *BytesTaken, _In_ PVOID Tsdu, _Out_opt_ PIRP *IoRequestPacket)
Definition: tdikrnl.h:249
TDIKRNLAPI NTSTATUS NTAPI TdiDefaultChainedRcvExpeditedHandler(_In_opt_ PVOID TdiEventContext, _In_opt_ CONNECTION_CONTEXT ConnectionContext, _In_ ULONG ReceiveFlags, _In_ ULONG ReceiveLength, _In_ ULONG StartingOffset, _In_ PMDL Tsdu, _In_ PVOID TsduDescriptor)
NTSTATUS(NTAPI * PTDI_IND_CONNECT)(_In_opt_ PVOID TdiEventContext, _In_ LONG RemoteAddressLength, _In_reads_bytes_(RemoteAddressLength) PVOID RemoteAddress, _In_ LONG UserDataLength, _In_reads_bytes_opt_(UserDataLength) PVOID UserData, _In_ LONG OptionsLength, _In_reads_bytes_opt_(OptionsLength) PVOID Options, _Out_ CONNECTION_CONTEXT *ConnectionContext, _Out_ PIRP *AcceptIrp)
Definition: tdikrnl.h:159
unsigned char UCHAR
Definition: xmlstorage.h:181
TDIKRNLAPI VOID NTAPI TdiMapBuffer(_In_ PMDL MdlChain)
struct _TDI_REQUEST_KERNEL_QUERY_INFO TDI_REQUEST_KERNEL_QUERY_INFORMATION
#define NTSTATUS
Definition: precomp.h:20
VOID(NTAPI * TDI_DEL_ADDRESS_HANDLER)(_In_ PTA_ADDRESS Address)
Definition: tdikrnl.h:891
#define VOID
Definition: acefi.h:82
NTSTATUS(NTAPI * PTDI_IND_SEND_POSSIBLE)(_In_opt_ PVOID TdiEventContext, _In_opt_ PVOID ConnectionContext, _In_ ULONG BytesAvailable)
Definition: tdikrnl.h:374
TDIKRNLAPI NTSTATUS NTAPI TdiDefaultChainedRcvDatagramHandler(_In_opt_ PVOID TdiEventContext, _In_ LONG SourceAddressLength, _In_reads_bytes_(SourceAddressLength) PVOID SourceAddress, _In_ LONG OptionsLength, _In_reads_bytes_opt_(OptionsLength) PVOID Options, _In_ ULONG ReceiveDatagramFlags, _In_ ULONG ReceiveDatagramLength, _In_ ULONG StartingOffset, _In_ PMDL Tsdu, _In_ PVOID TsduDescriptor)
VOID(NTAPI * TDI_ADD_ADDRESS_HANDLER)(_In_ PTA_ADDRESS Address)
Definition: tdikrnl.h:871
TDIKRNLAPI VOID NTAPI TdiBuildNetbiosAddress(_In_ PUCHAR NetbiosName, _In_ BOOLEAN IsGroupName, _Inout_ PTA_NETBIOS_ADDRESS NetworkName)
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
struct _TDI_REQUEST_KERNEL_SENDDG * PTDI_REQUEST_KERNEL_SENDDG
NTSTATUS NTAPI TdiMapUserRequest(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PIO_STACK_LOCATION IrpSp)
Definition: stubs.c:83
#define _In_reads_bytes_(size)
Definition: no_sal2.h:229
_In_ ULONG InterfaceInfoSize
Definition: tdikrnl.h:1146
#define _ANONYMOUS_STRUCT
Definition: ntbasedef.h:56
_In_ PNET_PNP_EVENT _In_ PTDI_PNP_CONTEXT _In_ PTDI_PNP_CONTEXT Context2
Definition: tdikrnl.h:1094
struct _TDI_PNP_CONTEXT TDI_PNP_CONTEXT
Status
Definition: gdiplustypes.h:24
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
#define _In_
Definition: no_sal2.h:204
PTDI_CONNECTION_INFORMATION RequestConnectionInformation
Definition: tdikrnl.h:41
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
PTDI_CONNECTION_INFORMATION RequestConnectionInformation
Definition: tdikrnl.h:84
USHORT ContextType
Definition: tdikrnl.h:866
NTSTATUS(NTAPI * PTDI_IND_RECEIVE_EXPEDITED)(_In_opt_ PVOID TdiEventContext, _In_opt_ CONNECTION_CONTEXT ConnectionContext, _In_ ULONG ReceiveFlags, _In_ ULONG BytesIndicated, _In_ ULONG BytesAvailable, _Out_ ULONG *BytesTaken, _In_ PVOID Tsdu, _Out_opt_ PIRP *IoRequestPacket)
Definition: tdikrnl.h:278
_In_ ULONG _In_ ULONG _In_ ULONG DestinationBufferSize
Definition: tdikrnl.h:1006
VOID(NTAPI * TDI_BIND_HANDLER)(_In_ PUNICODE_STRING DeviceName)
Definition: tdikrnl.h:887
PTDI_CONNECTION_INFORMATION ReceiveDatagramInformation
Definition: tdikrnl.h:109
struct _TDI20_CLIENT_INTERFACE_INFO * PTDI20_CLIENT_INTERFACE_INFO
unsigned short USHORT
Definition: pedump.c:61
_TDI_PNP_OPCODE
Definition: tdikrnl.h:846
TDI_CLIENT_INTERFACE_INFO * PTDI_CLIENT_INTERFACE_INFO
Definition: tdikrnl.h:947
_In_ PNET_PNP_EVENT _In_ PTDI_PNP_CONTEXT Context1
Definition: tdikrnl.h:1094
_In_ PIRP _In_ PIO_STACK_LOCATION IrpSp
Definition: tdikrnl.h:1069
_ANONYMOUS_STRUCT struct _TDI20_CLIENT_INTERFACE_INFO::@2153::@2156 DUMMYSTRUCTNAME
unsigned int * PULONG
Definition: retypes.h:1
PTDI_CONNECTION_INFORMATION ReturnConnectionInformation
Definition: tdikrnl.h:85
struct _TDI_REQUEST_KERNEL_RECEIVE * PTDI_REQUEST_KERNEL_RECEIVE
_Out_ HANDLE * DevRegistrationHandle
Definition: tdikrnl.h:1120
TDI_ADD_ADDRESS_HANDLER AddAddressHandler
Definition: tdikrnl.h:940
_In_ PUNICODE_STRING _In_ PTDI_PNP_CONTEXT Context
Definition: tdikrnl.h:1128
struct _TDI20_CLIENT_INTERFACE_INFO TDI20_CLIENT_INTERFACE_INFO
TDIKRNLAPI NTSTATUS NTAPI TdiDefaultConnectHandler(_In_opt_ PVOID TdiEventContext, _In_ LONG RemoteAddressLength, _In_reads_bytes_(RemoteAddressLength) PVOID RemoteAddress, _In_ LONG UserDataLength, _In_reads_bytes_opt_(UserDataLength) PVOID UserData, _In_ LONG OptionsLength, _In_reads_bytes_opt_(OptionsLength) PVOID Options, _Out_ CONNECTION_CONTEXT *ConnectionContext, _Out_ PIRP *AcceptIrp)
_In_ ULONG NumberOfTsdus
Definition: tdikrnl.h:1163
unsigned int ULONG
Definition: retypes.h:1
TDI_REQUEST_KERNEL TDI_REQUEST_KERNEL_DISASSOCIATE
Definition: tdikrnl.h:79
UCHAR ContextData[1]
Definition: tdikrnl.h:867
TDI_REQUEST_KERNEL * PTDI_REQUEST_KERNEL_CONNECT
Definition: tdikrnl.h:89
PTDI_CONNECTION_INFORMATION ReturnDatagramInformation
Definition: tdikrnl.h:110
NTSTATUS(NTAPI * PTDI_IND_ERROR_EX)(_In_opt_ PVOID TdiEventContext, _In_ NTSTATUS Status, _In_ PVOID Buffer)
Definition: tdikrnl.h:212
VOID(NTAPI * TDI_UNBIND_HANDLER)(_In_ PUNICODE_STRING DeviceName)
Definition: tdikrnl.h:908
_In_ PNET_PNP_EVENT PowerEvent
Definition: tdikrnl.h:1085
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
TDI20_CLIENT_INTERFACE_INFO TDI_CLIENT_INTERFACE_INFO
Definition: tdikrnl.h:946
TDIKRNLAPI BOOLEAN NTAPI TdiMatchPdoWithChainedReceiveContext(_In_ PVOID TsduDescriptor, _In_ PVOID PDO)
NTSTATUS(NTAPI * PTDI_IND_RECEIVE)(_In_opt_ PVOID TdiEventContext, _In_opt_ CONNECTION_CONTEXT ConnectionContext, _In_ ULONG ReceiveFlags, _In_ ULONG BytesIndicated, _In_ ULONG BytesAvailable, _Out_ ULONG *BytesTaken, _In_ PVOID Tsdu, _Out_opt_ PIRP *IoRequestPacket)
Definition: tdikrnl.h:225
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS SourceAddress
Definition: iotypes.h:1090
VOID(NTAPI * TDI_BINDING_HANDLER)(_In_ TDI_PNP_OPCODE PnPOpcode, _In_ PUNICODE_STRING DeviceName, _In_ PWSTR MultiSZBindList)
Definition: tdikrnl.h:881
struct _TDI_REQUEST_KERNEL * PTDI_REQUEST_KERNEL
#define APC_LEVEL
Definition: env_spec_w32.h:695
_ANONYMOUS_UNION union _TDI20_CLIENT_INTERFACE_INFO::@2154 DUMMYUNIONNAME2
VOID(NTAPI * TDI_ADD_ADDRESS_HANDLER_V2)(_In_ PTA_ADDRESS Address, _In_ PUNICODE_STRING DeviceName, _In_ PTDI_PNP_CONTEXT Context)
Definition: tdikrnl.h:875
struct _TDI_REQUEST_KERNEL TDI_REQUEST_KERNEL
TDI_DEL_ADDRESS_HANDLER_V2 DelAddressHandlerV2
Definition: tdikrnl.h:937
_In_ PNET_PNP_EVENT _In_ NTSTATUS Status
Definition: tdikrnl.h:1085
TDI_REQUEST_KERNEL * PTDI_REQUEST_KERNEL_DISASSOCIATE
Definition: tdikrnl.h:79
ULONG RequestFlags
Definition: tdikrnl.h:40
VOID NTAPI TdiReturnChainedReceives(IN PVOID *TsduDescriptors, IN ULONG NumberOfTsdus)
Definition: stubs.c:113
TDIKRNLAPI NTSTATUS NTAPI TdiDefaultErrorHandler(_In_opt_ PVOID TdiEventContext, _In_ NTSTATUS Status)
NTSTATUS NTAPI TdiDeregisterDeviceObject(IN HANDLE RegistrationHandle)
Definition: dereg.c:65
_Must_inspect_result_ _In_ ULONG _In_ PSOCKADDR _In_ PSOCKADDR RemoteAddress
Definition: wsk.h:170
struct _TDI_REQUEST_KERNEL_RECEIVE TDI_REQUEST_KERNEL_RECEIVE