ReactOS 0.4.16-dev-106-g10b08aa
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
29extern "C" {
30#endif
31
32#if defined(_TDI_)
33#define TDIKRNLAPI
34#else
35#define TDIKRNLAPI DECLSPEC_IMPORT
36#endif
37
38
39typedef 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 */
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
158typedef 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
172NTAPI
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
184typedef 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
196NTAPI
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
206typedef NTSTATUS
208 _In_opt_ PVOID TdiEventContext,
210
211typedef NTSTATUS
213 _In_opt_ PVOID TdiEventContext,
216
219NTAPI
221 _In_opt_ PVOID TdiEventContext,
223
224typedef 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
237NTAPI
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
248typedef 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
277typedef 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
290NTAPI
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
301typedef 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
313NTAPI
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
323typedef 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
338NTAPI
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
351typedef 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
363NTAPI
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
373typedef NTSTATUS
375 _In_opt_ PVOID TdiEventContext,
376 _In_opt_ PVOID ConnectionContext,
377 _In_ ULONG BytesAvailable);
378
381NTAPI
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
612VOID
613NTAPI
615 _In_ PUCHAR NetbiosName,
616 _In_ BOOLEAN IsGroupName,
617 _Inout_ PTA_NETBIOS_ADDRESS NetworkName);
618
621NTAPI
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
846typedef 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
864typedef struct _TDI_PNP_CONTEXT {
869
870typedef VOID
873
874typedef VOID
879
880typedef VOID
882 _In_ TDI_PNP_OPCODE PnPOpcode,
884 _In_ PWSTR MultiSZBindList);
885
886typedef VOID
889
890typedef VOID
893
894typedef VOID
899
900typedef NTSTATUS
906
907typedef VOID
910
911typedef VOID
913 _In_ PNET_PNP_EVENT NetEvent,
914 _In_ NTSTATUS ProviderStatus);
915
917 _ANONYMOUS_UNION union {
918 _ANONYMOUS_STRUCT struct {
927 _ANONYMOUS_UNION union {
929 _ANONYMOUS_STRUCT struct {
934 _ANONYMOUS_UNION union {
935 _ANONYMOUS_STRUCT struct {
939 _ANONYMOUS_STRUCT struct {
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
967NTAPI
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
990NTAPI
991TdiCopyMdlChainToMdlChain(
992 _In_ PMDL SourceMdlChain,
997
1001NTAPI
1003 _In_ PMDL SourceMdlChain,
1009
1012NTAPI
1015
1019NTAPI
1022
1026NTAPI
1029
1033NTAPI
1036
1040NTAPI
1041TdiDeregisterProvider(
1043
1047NTAPI
1048TdiEnumerateAddresses(
1050
1053VOID
1054NTAPI
1056
1058VOID
1059NTAPI
1062
1066NTAPI
1071
1073BOOLEAN
1074NTAPI
1076 _In_ PVOID TsduDescriptor,
1077 _In_ PVOID PDO);
1078
1081VOID
1082NTAPI
1083TdiPnPPowerComplete(
1087
1091NTAPI
1092TdiPnPPowerRequest(
1098
1102NTAPI
1103TdiProviderReady(
1105
1108NTAPI
1110 _In_ TDI_ADD_ADDRESS_HANDLER AddHandler,
1111 _In_ TDI_DEL_ADDRESS_HANDLER DeleteHandler,
1113
1117NTAPI
1121
1125NTAPI
1131
1134NTAPI
1136 _In_ TDI_BIND_HANDLER BindHandler,
1137 _In_ TDI_UNBIND_HANDLER UnbindHandler,
1139
1143NTAPI
1148
1152NTAPI
1153TdiRegisterProvider(
1154 _In_ PUNICODE_STRING ProviderName,
1156
1159VOID
1160NTAPI
1162 _In_ PVOID *TsduDescriptors,
1164
1166VOID
1167NTAPI
1170
1171#ifdef __cplusplus
1172}
1173#endif
1174
1175#endif /* __TDIKRNL_H */
unsigned char BOOLEAN
#define VOID
Definition: acefi.h:82
LONG NTSTATUS
Definition: precomp.h:26
_In_ PFCB _In_ LONGLONG StartingOffset
Definition: cdprocs.h:291
Definition: bufpool.h:45
_In_ PIRP Irp
Definition: csq.h:116
NTSTATUS NTAPI TdiRegisterNetAddress(IN PTA_ADDRESS Address, IN PUNICODE_STRING DeviceName, IN PTDI_PNP_CONTEXT Context, OUT HANDLE *RegistrationHandle)
Definition: dereg.c:78
NTSTATUS NTAPI TdiDeregisterDeviceObject(IN HANDLE RegistrationHandle)
Definition: dereg.c:65
NTSTATUS NTAPI TdiDeregisterNetAddress(IN HANDLE RegistrationHandle)
Definition: dereg.c:92
NTSTATUS NTAPI TdiRegisterDeviceObject(IN PUNICODE_STRING DeviceName, OUT HANDLE *RegistrationHandle)
Definition: dereg.c:53
#define NTSTATUS
Definition: precomp.h:21
VOID NTAPI TdiInitialize()
Definition: stubs.c:73
VOID NTAPI TdiReturnChainedReceives(IN PVOID *TsduDescriptors, IN ULONG NumberOfTsdus)
Definition: stubs.c:113
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
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
NTSTATUS NTAPI TdiMapUserRequest(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PIO_STACK_LOCATION IrpSp)
Definition: stubs.c:83
#define _IRQL_requires_max_(irql)
Definition: driverspecs.h:230
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
#define APC_LEVEL
Definition: env_spec_w32.h:695
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ ULONG _In_ ULONG _Outptr_ PMDL * MdlChain
Definition: fsrtlfuncs.h:49
Status
Definition: gdiplustypes.h:25
NTSTATUS NTAPI TdiDeregisterPnPHandlers(_In_ HANDLE BindingHandle)
Definition: handler.c:244
NTSTATUS NTAPI TdiRegisterPnPHandlers(_In_ PTDI_CLIENT_INTERFACE_INFO ClientInterfaceInfo, _In_ ULONG InterfaceInfoSize, _Out_ HANDLE *BindingHandle)
Definition: handler.c:233
struct tagUserData UserData
#define _Out_opt_
Definition: ms_sal.h:346
#define _In_reads_bytes_(size)
Definition: ms_sal.h:321
#define _Inout_
Definition: ms_sal.h:378
#define _Out_writes_bytes_(size)
Definition: ms_sal.h:350
#define _Out_
Definition: ms_sal.h:345
#define _In_
Definition: ms_sal.h:308
#define _In_reads_bytes_opt_(size)
Definition: ms_sal.h:322
#define _In_opt_
Definition: ms_sal.h:309
#define _ANONYMOUS_UNION
Definition: ntbasedef.h:30
#define _ANONYMOUS_STRUCT
Definition: ntbasedef.h:56
long LONG
Definition: pedump.c:60
unsigned short USHORT
Definition: pedump.c:61
static WCHAR Address[46]
Definition: ping.c:68
TDI_BIND_HANDLER BindHandler
Definition: tdikrnl.h:930
TDI_PNP_POWER_HANDLER PnPPowerHandler
Definition: tdikrnl.h:926
_ANONYMOUS_STRUCT struct _TDI20_CLIENT_INTERFACE_INFO::@2251::@2254 DUMMYSTRUCTNAME
TDI_DEL_ADDRESS_HANDLER DelAddressHandler
Definition: tdikrnl.h:941
_ANONYMOUS_UNION union _TDI20_CLIENT_INTERFACE_INFO::@2251 DUMMYUNIONNAME
PUNICODE_STRING ClientName
Definition: tdikrnl.h:925
TDI_BINDING_HANDLER BindingHandler
Definition: tdikrnl.h:928
TDI_ADD_ADDRESS_HANDLER_V2 AddAddressHandlerV2
Definition: tdikrnl.h:936
TDI_ADD_ADDRESS_HANDLER AddAddressHandler
Definition: tdikrnl.h:940
TDI_DEL_ADDRESS_HANDLER_V2 DelAddressHandlerV2
Definition: tdikrnl.h:937
_ANONYMOUS_UNION union _TDI20_CLIENT_INTERFACE_INFO::@2253 DUMMYUNIONNAME3
_ANONYMOUS_STRUCT struct _TDI20_CLIENT_INTERFACE_INFO::@2253::@2257 DUMMYSTRUCTNAME2
_ANONYMOUS_UNION union _TDI20_CLIENT_INTERFACE_INFO::@2252 DUMMYUNIONNAME2
TDI_UNBIND_HANDLER UnBindHandler
Definition: tdikrnl.h:931
USHORT ContextSize
Definition: tdikrnl.h:865
UCHAR ContextData[1]
Definition: tdikrnl.h:867
USHORT ContextType
Definition: tdikrnl.h:866
PTDI_CONNECTION_INFORMATION RequestConnectionInformation
Definition: tdikrnl.h:84
PTDI_CONNECTION_INFORMATION ReturnConnectionInformation
Definition: tdikrnl.h:85
PTDI_CONNECTION_INFORMATION RequestConnectionInformation
Definition: tdikrnl.h:136
PTDI_CONNECTION_INFORMATION ReceiveDatagramInformation
Definition: tdikrnl.h:109
PTDI_CONNECTION_INFORMATION ReturnDatagramInformation
Definition: tdikrnl.h:110
_Field_size_bytes_(SendLength) PTDI_CONNECTION_INFORMATION SendDatagramInformation
PTDI_CONNECTION_INFORMATION RequestConnectionInformation
Definition: tdikrnl.h:142
PVOID RequestSpecific
Definition: tdikrnl.h:43
PTDI_CONNECTION_INFORMATION RequestConnectionInformation
Definition: tdikrnl.h:41
PTDI_CONNECTION_INFORMATION ReturnConnectionInformation
Definition: tdikrnl.h:42
ULONG RequestFlags
Definition: tdikrnl.h:40
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
struct _TDI_REQUEST_KERNEL_ACCEPT * PTDI_REQUEST_KERNEL_ACCEPT
TDI_REQUEST_KERNEL TDI_REQUEST_KERNEL_CONNECT
Definition: tdikrnl.h:89
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)
VOID(NTAPI * TDI_DEL_ADDRESS_HANDLER_V2)(_In_ PTA_ADDRESS Address, _In_ PUNICODE_STRING DeviceName, _In_ PTDI_PNP_CONTEXT Context)
Definition: tdikrnl.h:895
struct _TDI_REQUEST_KERNEL_ACCEPT TDI_REQUEST_KERNEL_ACCEPT
struct _TDI_REQUEST_KERNEL_SENDDG TDI_REQUEST_KERNEL_SENDDG
TDI_REQUEST_KERNEL * PTDI_REQUEST_KERNEL_DISASSOCIATE
Definition: tdikrnl.h:80
_In_ PNET_PNP_EVENT PowerEvent
Definition: tdikrnl.h:1085
struct _TDI_REQUEST_KERNEL_QUERY_INFO TDI_REQUEST_KERNEL_QUERY_INFORMATION
struct _TDI_REQUEST_KERNEL_SEND TDI_REQUEST_KERNEL_SEND
_Out_ HANDLE * ProviderHandle
Definition: tdikrnl.h:1155
_In_ PNET_PNP_EVENT _In_ NTSTATUS Status
Definition: tdikrnl.h:1086
TDIKRNLAPI NTSTATUS NTAPI TdiDefaultErrorHandler(_In_opt_ PVOID TdiEventContext, _In_ NTSTATUS Status)
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)
struct _TDI_PNP_CONTEXT TDI_PNP_CONTEXT
_In_ ULONG _In_ ULONG _In_ PMDL DestinationMdlChain
Definition: tdikrnl.h:972
VOID(NTAPI * ProviderPnPPowerComplete)(_In_ PNET_PNP_EVENT NetEvent, _In_ NTSTATUS ProviderStatus)
Definition: tdikrnl.h:912
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
_In_ PUNICODE_STRING _In_ PTDI_PNP_CONTEXT Context
Definition: tdikrnl.h:1129
struct _TDI_REQUEST_KERNEL_RECEIVEDG * PTDI_REQUEST_KERNEL_RECEIVEDG
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)
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
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_ PNET_PNP_EVENT _In_ PTDI_PNP_CONTEXT _In_ PTDI_PNP_CONTEXT _In_ ProviderPnPPowerComplete ProtocolCompletionHandler
Definition: tdikrnl.h:1097
TDI_CLIENT_INTERFACE_INFO * PTDI_CLIENT_INTERFACE_INFO
Definition: tdikrnl.h:947
_In_ PNET_PNP_EVENT _In_ PTDI_PNP_CONTEXT Context1
Definition: tdikrnl.h:1095
struct _TDI_REQUEST_KERNEL_SENDDG * PTDI_REQUEST_KERNEL_SENDDG
struct _TDI_REQUEST_KERNEL_ASSOCIATE TDI_REQUEST_KERNEL_ASSOCIATE
TDIKRNLAPI VOID NTAPI TdiMapBuffer(_In_ PMDL MdlChain)
TDIKRNLAPI NTSTATUS NTAPI TdiDeregisterAddressChangeHandler(_In_ HANDLE BindingHandle)
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)
TDIKRNLAPI NTSTATUS NTAPI TdiRegisterAddressChangeHandler(_In_ TDI_ADD_ADDRESS_HANDLER AddHandler, _In_ TDI_DEL_ADDRESS_HANDLER DeleteHandler, _Out_ HANDLE *BindingHandle)
_In_ ULONG _In_ ULONG SourceBytesToCopy
Definition: tdikrnl.h:971
TDI20_CLIENT_INTERFACE_INFO TDI_CLIENT_INTERFACE_INFO
Definition: tdikrnl.h:946
TDIKRNLAPI NTSTATUS NTAPI TdiRegisterNotificationHandler(_In_ TDI_BIND_HANDLER BindHandler, _In_ TDI_UNBIND_HANDLER UnbindHandler, _Out_ HANDLE *BindingHandle)
_TDI_PNP_OPCODE
Definition: tdikrnl.h:846
@ TDI_PNP_OP_ADD_IGNORE_BINDING
Definition: tdikrnl.h:853
@ TDI_PNP_OP_ADD
Definition: tdikrnl.h:848
@ TDI_PNP_OP_DELETE_IGNORE_BINDING
Definition: tdikrnl.h:854
@ TDI_PNP_OP_NETREADY
Definition: tdikrnl.h:852
@ TDI_PNP_OP_DEL
Definition: tdikrnl.h:849
@ TDI_PNP_OP_MAX
Definition: tdikrnl.h:855
@ TDI_PNP_OP_UPDATE
Definition: tdikrnl.h:850
@ TDI_PNP_OP_PROVIDERREADY
Definition: tdikrnl.h:851
@ TDI_PNP_OP_MIN
Definition: tdikrnl.h:847
struct _TDI_REQUEST_KERNEL_SET_INFO * PTDI_REQUEST_KERNEL_SET_INFORMATION
struct _TDI20_CLIENT_INTERFACE_INFO TDI20_CLIENT_INTERFACE_INFO
VOID(NTAPI * TDI_BINDING_HANDLER)(_In_ TDI_PNP_OPCODE PnPOpcode, _In_ PUNICODE_STRING DeviceName, _In_ PWSTR MultiSZBindList)
Definition: tdikrnl.h:881
VOID(NTAPI * TDI_DEL_ADDRESS_HANDLER)(_In_ PTA_ADDRESS Address)
Definition: tdikrnl.h:891
struct _TDI_REQUEST_KERNEL_RECEIVE TDI_REQUEST_KERNEL_RECEIVE
_In_ PIRP _In_ PIO_STACK_LOCATION IrpSp
Definition: tdikrnl.h:1070
_In_ ULONG NumberOfTsdus
Definition: tdikrnl.h:1163
TDI_REQUEST_KERNEL * PTDI_REQUEST_KERNEL_CONNECT
Definition: tdikrnl.h:90
VOID(NTAPI * TDI_ADD_ADDRESS_HANDLER_V2)(_In_ PTA_ADDRESS Address, _In_ PUNICODE_STRING DeviceName, _In_ PTDI_PNP_CONTEXT Context)
Definition: tdikrnl.h:875
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
_In_ ULONG _In_ ULONG _In_ PMDL _In_ ULONG _Out_ PULONG BytesCopied
Definition: tdikrnl.h:974
TDI_REQUEST_KERNEL TDI_REQUEST_KERNEL_DISCONNECT
Definition: tdikrnl.h:93
TDIKRNLAPI VOID NTAPI TdiUnmapBuffer(_In_ PMDL MdlChain)
NTSTATUS(NTAPI * PTDI_IND_ERROR)(_In_opt_ PVOID TdiEventContext, _In_ NTSTATUS Status)
Definition: tdikrnl.h:207
struct _TDI_REQUEST_KERNEL_SET_EVENT * PTDI_REQUEST_KERNEL_SET_EVENT
struct _TDI_PNP_CONTEXT * PTDI_PNP_CONTEXT
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
struct _TDI_REQUEST_KERNEL * PTDI_REQUEST_KERNEL
enum _TDI_PNP_OPCODE TDI_PNP_OPCODE
struct _TDI20_CLIENT_INTERFACE_INFO * PTDI20_CLIENT_INTERFACE_INFO
TDI_REQUEST_KERNEL TDI_REQUEST_KERNEL_DISASSOCIATE
Definition: tdikrnl.h:79
VOID(NTAPI * TDI_BIND_HANDLER)(_In_ PUNICODE_STRING DeviceName)
Definition: tdikrnl.h:887
struct _TDI_REQUEST_KERNEL TDI_REQUEST_KERNEL
struct _TDI_REQUEST_KERNEL_RECEIVE * PTDI_REQUEST_KERNEL_RECEIVE
_In_ ULONG _Out_ HANDLE * BindingHandle
Definition: tdikrnl.h:1147
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)
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
NTSTATUS(NTAPI * PTDI_IND_ERROR_EX)(_In_opt_ PVOID TdiEventContext, _In_ NTSTATUS Status, _In_ PVOID Buffer)
Definition: tdikrnl.h:212
_In_ ULONG InterfaceInfoSize
Definition: tdikrnl.h:1146
_In_ PUNICODE_STRING _In_ PTDI_PNP_CONTEXT _Out_ HANDLE * AddrRegistrationHandle
Definition: tdikrnl.h:1130
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)
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
struct _TDI_REQUEST_KERNEL_QUERY_INFO * PTDI_REQUEST_KERNEL_QUERY_INFORMATION
TDI_REQUEST_KERNEL * PTDI_REQUEST_KERNEL_LISTEN
Definition: tdikrnl.h:98
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
#define TDIKRNLAPI
Definition: tdikrnl.h:35
_In_ ULONG _In_ ULONG _In_ ULONG DestinationBufferSize
Definition: tdikrnl.h:1007
_Out_ HANDLE * DevRegistrationHandle
Definition: tdikrnl.h:1120
_In_ PNET_PNP_EVENT _In_ PTDI_PNP_CONTEXT _In_ PTDI_PNP_CONTEXT Context2
Definition: tdikrnl.h:1096
struct _TDI_REQUEST_KERNEL_RECEIVEDG TDI_REQUEST_KERNEL_RECEIVEDG
struct _TDI_REQUEST_KERNEL_ASSOCIATE * PTDI_REQUEST_KERNEL_ASSOCIATE
TDIKRNLAPI VOID NTAPI TdiBuildNetbiosAddress(_In_ PUCHAR NetbiosName, _In_ BOOLEAN IsGroupName, _Inout_ PTA_NETBIOS_ADDRESS NetworkName)
_In_ PUNICODE_STRING DeviceName
Definition: tdikrnl.h:1128
struct _TDI_REQUEST_KERNEL_SET_INFO TDI_REQUEST_KERNEL_SET_INFORMATION
TDI_REQUEST_KERNEL TDI_REQUEST_KERNEL_LISTEN
Definition: tdikrnl.h:97
VOID(NTAPI * TDI_ADD_ADDRESS_HANDLER)(_In_ PTA_ADDRESS Address)
Definition: tdikrnl.h:871
TDIKRNLAPI NTSTATUS NTAPI TdiDefaultSendPossibleHandler(_In_opt_ PVOID TdiEventContext, _In_opt_ PVOID ConnectionContext, _In_ ULONG BytesAvailable)
struct _TDI_REQUEST_KERNEL_SET_EVENT TDI_REQUEST_KERNEL_SET_EVENT
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)
TDIKRNLAPI BOOLEAN NTAPI TdiMatchPdoWithChainedReceiveContext(_In_ PVOID TsduDescriptor, _In_ PVOID PDO)
TDIKRNLAPI NTSTATUS NTAPI TdiBuildNetbiosAddressEa(_Out_ PUCHAR Buffer, _In_ BOOLEAN IsGroupName, _In_ PUCHAR NetbiosName)
VOID(NTAPI * TDI_UNBIND_HANDLER)(_In_ PUNICODE_STRING DeviceName)
Definition: tdikrnl.h:908
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
NTSTATUS(NTAPI * PTDI_IND_SEND_POSSIBLE)(_In_opt_ PVOID TdiEventContext, _In_opt_ PVOID ConnectionContext, _In_ ULONG BytesAvailable)
Definition: tdikrnl.h:374
TDI_REQUEST_KERNEL * PTDI_REQUEST_KERNEL_DISCONNECT
Definition: tdikrnl.h:94
uint16_t * PWSTR
Definition: typedefs.h:56
uint32_t * PULONG
Definition: typedefs.h:59
#define NTAPI
Definition: typedefs.h:36
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_In_ PWDFDEVICE_INIT _In_ PWDF_REMOVE_LOCK_OPTIONS Options
Definition: wdfdevice.h:3534
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
Definition: wdfdevice.h:3275
_Must_inspect_result_ _In_ WDFMEMORY _In_ size_t SourceOffset
Definition: wdfmemory.h:320
_Must_inspect_result_ _In_ WDFMEMORY _In_ size_t DestinationOffset
Definition: wdfmemory.h:361
_Must_inspect_result_ _In_ ULONG _In_ PSOCKADDR _In_ PSOCKADDR RemoteAddress
Definition: wsk.h:172
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS SourceAddress
Definition: iotypes.h:1127
unsigned char UCHAR
Definition: xmlstorage.h:181