Reverting previous mods due to even more problems occurring with a clean build.

Sorry for all the noise...

svn path=/trunk/; revision=6345
This commit is contained in:
Robert Dickenson 2003-10-17 12:53:48 +00:00
parent a0c7411b79
commit c73c9212f8

View file

@ -1,56 +1,20 @@
/* /*
* tdikrnl.h * COPYRIGHT: See COPYING in the top level directory
* * PROJECT: ReactOS TDI library
* TDI kernel mode definitions * FILE: include/net/tdikrnl.h
* * PURPOSE: TDI definitions for kernel mode drivers
* This file is part of the w32api package.
*
* Contributors:
* Created by Casper S. Hornstrup <chorns@users.sourceforge.net>
*
* THIS SOFTWARE IS NOT COPYRIGHTED
*
* This source code is offered for use in the public domain. You may
* use, modify or distribute it freely.
*
* This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
*/ */
#ifndef __TDIKRNL_H #ifndef __TDIKRNL_H
#define __TDIKRNL_H #define __TDIKRNL_H
#if __GNUC__ >=3
#pragma GCC system_header
#endif
#ifdef __cplusplus
extern "C" {
#endif
#pragma pack(push,4)
#include "ntddk.h"
#include "tdi.h" #include "tdi.h"
#ifndef STDCALL #ifndef STDCALL
#define STDCALL #define STDCALL
#endif #endif
#define DDKAPI STDCALL
#if defined(_TDI_) typedef struct _TDI_REQUEST_KERNEL
// #define TDIKRNLAPI DECLSPEC_EXPORT {
#define TDIKRNLAPI
#else
// #define TDIKRNLAPI DECLSPEC_IMPORT
#define TDIKRNLAPI
#endif
typedef struct _TDI_REQUEST_KERNEL {
ULONG RequestFlags; ULONG RequestFlags;
PTDI_CONNECTION_INFORMATION RequestConnectionInformation; PTDI_CONNECTION_INFORMATION RequestConnectionInformation;
PTDI_CONNECTION_INFORMATION ReturnConnectionInformation; PTDI_CONNECTION_INFORMATION ReturnConnectionInformation;
@ -76,6 +40,7 @@ typedef struct _TDI_REQUEST_KERNEL {
#define TDI_DIRECT_SEND 0x27 #define TDI_DIRECT_SEND 0x27
#define TDI_DIRECT_SEND_DATAGRAM 0x29 #define TDI_DIRECT_SEND_DATAGRAM 0x29
#define TDI_TRANSPORT_ADDRESS_FILE 1 #define TDI_TRANSPORT_ADDRESS_FILE 1
#define TDI_CONNECTION_FILE 2 #define TDI_CONNECTION_FILE 2
#define TDI_CONTROL_CHANNEL_FILE 3 #define TDI_CONTROL_CHANNEL_FILE 3
@ -85,7 +50,8 @@ typedef struct _TDI_REQUEST_KERNEL {
#define IOCTL_TDI_QUERY_DIRECT_SENDDG_HANDLER TDI_CONTROL_CODE(0x81, METHOD_NEITHER) #define IOCTL_TDI_QUERY_DIRECT_SENDDG_HANDLER TDI_CONTROL_CODE(0x81, METHOD_NEITHER)
/* TdiAssociateAddress */ /* TdiAssociateAddress */
typedef struct _TDI_REQUEST_KERNEL_ASSOCIATE { typedef struct _TDI_REQUEST_KERNEL_ASSOCIATE
{
HANDLE AddressHandle; HANDLE AddressHandle;
} TDI_REQUEST_KERNEL_ASSOCIATE, *PTDI_REQUEST_KERNEL_ASSOCIATE; } TDI_REQUEST_KERNEL_ASSOCIATE, *PTDI_REQUEST_KERNEL_ASSOCIATE;
@ -94,31 +60,22 @@ typedef TDI_REQUEST_KERNEL TDI_REQUEST_KERNEL_DISASSOCIATE,
*PTDI_REQUEST_KERNEL_DISASSOCIATE; *PTDI_REQUEST_KERNEL_DISASSOCIATE;
/* TdiAccept */ /* TdiAccept */
typedef struct _TDI_REQUEST_KERNEL_ACCEPT { typedef struct _TDI_REQUEST_KERNEL_ACCEPT
{
PTDI_CONNECTION_INFORMATION RequestConnectionInformation; PTDI_CONNECTION_INFORMATION RequestConnectionInformation;
PTDI_CONNECTION_INFORMATION ReturnConnectionInformation; PTDI_CONNECTION_INFORMATION ReturnConnectionInformation;
} TDI_REQUEST_KERNEL_ACCEPT, *PTDI_REQUEST_KERNEL_ACCEPT; } TDI_REQUEST_KERNEL_ACCEPT, *PTDI_REQUEST_KERNEL_ACCEPT;
/* TdiConnect */
typedef TDI_REQUEST_KERNEL TDI_REQUEST_KERNEL_CONNECT,
*PTDI_REQUEST_KERNEL_CONNECT;
/* TdiDisconnect */
typedef TDI_REQUEST_KERNEL TDI_REQUEST_KERNEL_DISCONNECT,
*PTDI_REQUEST_KERNEL_DISCONNECT;
/* TdiListen */
typedef TDI_REQUEST_KERNEL TDI_REQUEST_KERNEL_LISTEN,
*PTDI_REQUEST_KERNEL_LISTEN;
/* TdiReceive */ /* TdiReceive */
typedef struct _TDI_REQUEST_KERNEL_RECEIVE { typedef struct _TDI_REQUEST_KERNEL_RECEIVE
{
ULONG ReceiveLength; ULONG ReceiveLength;
ULONG ReceiveFlags; ULONG ReceiveFlags;
} TDI_REQUEST_KERNEL_RECEIVE, *PTDI_REQUEST_KERNEL_RECEIVE; } TDI_REQUEST_KERNEL_RECEIVE, *PTDI_REQUEST_KERNEL_RECEIVE;
/* TdiReceiveDatagram */ /* TdiReceiveDatagram */
typedef struct _TDI_REQUEST_KERNEL_RECEIVEDG { typedef struct _TDI_REQUEST_KERNEL_RECEIVEDG
{
ULONG ReceiveLength; ULONG ReceiveLength;
PTDI_CONNECTION_INFORMATION ReceiveDatagramInformation; PTDI_CONNECTION_INFORMATION ReceiveDatagramInformation;
PTDI_CONNECTION_INFORMATION ReturnDatagramInformation; PTDI_CONNECTION_INFORMATION ReturnDatagramInformation;
@ -126,32 +83,37 @@ typedef struct _TDI_REQUEST_KERNEL_RECEIVEDG {
} TDI_REQUEST_KERNEL_RECEIVEDG, *PTDI_REQUEST_KERNEL_RECEIVEDG; } TDI_REQUEST_KERNEL_RECEIVEDG, *PTDI_REQUEST_KERNEL_RECEIVEDG;
/* TdiSend */ /* TdiSend */
typedef struct _TDI_REQUEST_KERNEL_SEND { typedef struct _TDI_REQUEST_KERNEL_SEND
{
ULONG SendLength; ULONG SendLength;
ULONG SendFlags; ULONG SendFlags;
} TDI_REQUEST_KERNEL_SEND, *PTDI_REQUEST_KERNEL_SEND; } TDI_REQUEST_KERNEL_SEND, *PTDI_REQUEST_KERNEL_SEND;
/* TdiSendDatagram */ /* TdiSendDatagram */
typedef struct _TDI_REQUEST_KERNEL_SENDDG { typedef struct _TDI_REQUEST_KERNEL_SENDDG
{
ULONG SendLength; ULONG SendLength;
PTDI_CONNECTION_INFORMATION SendDatagramInformation; PTDI_CONNECTION_INFORMATION SendDatagramInformation;
} TDI_REQUEST_KERNEL_SENDDG, *PTDI_REQUEST_KERNEL_SENDDG; } TDI_REQUEST_KERNEL_SENDDG, *PTDI_REQUEST_KERNEL_SENDDG;
/* TdiSetEventHandler */ /* TdiSetEventHandler */
typedef struct _TDI_REQUEST_KERNEL_SET_EVENT { typedef struct _TDI_REQUEST_KERNEL_SET_EVENT
{
LONG EventType; LONG EventType;
PVOID EventHandler; PVOID EventHandler;
PVOID EventContext; PVOID EventContext;
} TDI_REQUEST_KERNEL_SET_EVENT, *PTDI_REQUEST_KERNEL_SET_EVENT; } TDI_REQUEST_KERNEL_SET_EVENT, *PTDI_REQUEST_KERNEL_SET_EVENT;
/* TdiQueryInformation */ /* TdiQueryInformation */
typedef struct _TDI_REQUEST_KERNEL_QUERY_INFO { typedef struct _TDI_REQUEST_KERNEL_QUERY_INFO
{
LONG QueryType; LONG QueryType;
PTDI_CONNECTION_INFORMATION RequestConnectionInformation; PTDI_CONNECTION_INFORMATION RequestConnectionInformation;
} TDI_REQUEST_KERNEL_QUERY_INFORMATION, *PTDI_REQUEST_KERNEL_QUERY_INFORMATION; } TDI_REQUEST_KERNEL_QUERY_INFORMATION, *PTDI_REQUEST_KERNEL_QUERY_INFORMATION;
/* TdiSetInformation */ /* TdiSetInformation */
typedef struct _TDI_REQUEST_KERNEL_SET_INFO { typedef struct _TDI_REQUEST_KERNEL_SET_INFO
{
LONG SetType; LONG SetType;
PTDI_CONNECTION_INFORMATION RequestConnectionInformation; PTDI_CONNECTION_INFORMATION RequestConnectionInformation;
} TDI_REQUEST_KERNEL_SET_INFORMATION, *PTDI_REQUEST_KERNEL_SET_INFORMATION; } TDI_REQUEST_KERNEL_SET_INFORMATION, *PTDI_REQUEST_KERNEL_SET_INFORMATION;
@ -168,10 +130,8 @@ typedef struct _TDI_REQUEST_KERNEL_SET_INFO {
#define TDI_EVENT_CHAINED_RECEIVE 7 #define TDI_EVENT_CHAINED_RECEIVE 7
#define TDI_EVENT_CHAINED_RECEIVE_DATAGRAM 8 #define TDI_EVENT_CHAINED_RECEIVE_DATAGRAM 8
#define TDI_EVENT_CHAINED_RECEIVE_EXPEDITED 9 #define TDI_EVENT_CHAINED_RECEIVE_EXPEDITED 9
#define TDI_EVENT_ERROR_EX 10
typedef NTSTATUS typedef NTSTATUS (*PTDI_IND_CONNECT)(
(*PTDI_IND_CONNECT)(
IN PVOID TdiEventContext, IN PVOID TdiEventContext,
IN LONG RemoteAddressLength, IN LONG RemoteAddressLength,
IN PVOID RemoteAddress, IN PVOID RemoteAddress,
@ -182,10 +142,7 @@ typedef NTSTATUS
OUT CONNECTION_CONTEXT *ConnectionContext, OUT CONNECTION_CONTEXT *ConnectionContext,
OUT PIRP *AcceptIrp); OUT PIRP *AcceptIrp);
TDIKRNLAPI NTSTATUS STDCALL TdiDefaultConnectHandler(
NTSTATUS
DDKAPI
TdiDefaultConnectHandler(
IN PVOID TdiEventContext, IN PVOID TdiEventContext,
IN LONG RemoteAddressLength, IN LONG RemoteAddressLength,
IN PVOID RemoteAddress, IN PVOID RemoteAddress,
@ -196,8 +153,7 @@ TdiDefaultConnectHandler(
OUT CONNECTION_CONTEXT *ConnectionContext, OUT CONNECTION_CONTEXT *ConnectionContext,
OUT PIRP *AcceptIrp); OUT PIRP *AcceptIrp);
typedef NTSTATUS typedef NTSTATUS (*PTDI_IND_DISCONNECT)(
(*PTDI_IND_DISCONNECT)(
IN PVOID TdiEventContext, IN PVOID TdiEventContext,
IN CONNECTION_CONTEXT ConnectionContext, IN CONNECTION_CONTEXT ConnectionContext,
IN LONG DisconnectDataLength, IN LONG DisconnectDataLength,
@ -206,10 +162,7 @@ typedef NTSTATUS
IN PVOID DisconnectInformation, IN PVOID DisconnectInformation,
IN ULONG DisconnectFlags); IN ULONG DisconnectFlags);
TDIKRNLAPI NTSTATUS STDCALL TdiDefaultDisconnectHandler(
NTSTATUS
DDKAPI
TdiDefaultDisconnectHandler(
IN PVOID TdiEventContext, IN PVOID TdiEventContext,
IN CONNECTION_CONTEXT ConnectionContext, IN CONNECTION_CONTEXT ConnectionContext,
IN LONG DisconnectDataLength, IN LONG DisconnectDataLength,
@ -218,26 +171,15 @@ TdiDefaultDisconnectHandler(
IN PVOID DisconnectInformation, IN PVOID DisconnectInformation,
IN ULONG DisconnectFlags); IN ULONG DisconnectFlags);
typedef NTSTATUS typedef NTSTATUS (*PTDI_IND_ERROR)(
(*PTDI_IND_ERROR)(
IN PVOID TdiEventContext, IN PVOID TdiEventContext,
IN NTSTATUS Status); IN NTSTATUS Status);
typedef NTSTATUS DDKAPI NTSTATUS STDCALL TdiDefaultErrorHandler(
(*PTDI_IND_ERROR_EX)(
IN PVOID TdiEventContext,
IN NTSTATUS Status,
IN PVOID Buffer);
TDIKRNLAPI
NTSTATUS
DDKAPI
TdiDefaultErrorHandler(
IN PVOID TdiEventContext, IN PVOID TdiEventContext,
IN NTSTATUS Status); IN NTSTATUS Status);
typedef NTSTATUS typedef NTSTATUS (*PTDI_IND_RECEIVE)(
(*PTDI_IND_RECEIVE)(
IN PVOID TdiEventContext, IN PVOID TdiEventContext,
IN CONNECTION_CONTEXT ConnectionContext, IN CONNECTION_CONTEXT ConnectionContext,
IN ULONG ReceiveFlags, IN ULONG ReceiveFlags,
@ -247,10 +189,7 @@ typedef NTSTATUS
IN PVOID Tsdu, IN PVOID Tsdu,
OUT PIRP *IoRequestPacket); OUT PIRP *IoRequestPacket);
TDIKRNLAPI NTSTATUS STDCALL TdiDefaultReceiveHandler(
NTSTATUS
DDKAPI
TdiDefaultReceiveHandler(
IN PVOID TdiEventContext, IN PVOID TdiEventContext,
IN CONNECTION_CONTEXT ConnectionContext, IN CONNECTION_CONTEXT ConnectionContext,
IN ULONG ReceiveFlags, IN ULONG ReceiveFlags,
@ -260,8 +199,7 @@ TdiDefaultReceiveHandler(
IN PVOID Tsdu, IN PVOID Tsdu,
OUT PIRP *IoRequestPacket); OUT PIRP *IoRequestPacket);
typedef NTSTATUS typedef NTSTATUS (*PTDI_IND_RECEIVE_DATAGRAM)(
(*PTDI_IND_RECEIVE_DATAGRAM)(
IN PVOID TdiEventContext, IN PVOID TdiEventContext,
IN LONG SourceAddressLength, IN LONG SourceAddressLength,
IN PVOID SourceAddress, IN PVOID SourceAddress,
@ -274,9 +212,7 @@ typedef NTSTATUS
IN PVOID Tsdu, IN PVOID Tsdu,
OUT PIRP *IoRequestPacket); OUT PIRP *IoRequestPacket);
TDIKRNLAPI NTSTATUS STDCALL TdiDefaultRcvDatagramHandler(
NTSTATUS DDKAPI
TdiDefaultRcvDatagramHandler(
IN PVOID TdiEventContext, IN PVOID TdiEventContext,
IN LONG SourceAddressLength, IN LONG SourceAddressLength,
IN PVOID SourceAddress, IN PVOID SourceAddress,
@ -289,8 +225,7 @@ TdiDefaultRcvDatagramHandler(
IN PVOID Tsdu, IN PVOID Tsdu,
OUT PIRP *IoRequestPacket); OUT PIRP *IoRequestPacket);
typedef NTSTATUS typedef NTSTATUS (*PTDI_IND_RECEIVE_EXPEDITED)(
(*PTDI_IND_RECEIVE_EXPEDITED)(
IN PVOID TdiEventContext, IN PVOID TdiEventContext,
IN CONNECTION_CONTEXT ConnectionContext, IN CONNECTION_CONTEXT ConnectionContext,
IN ULONG ReceiveFlags, IN ULONG ReceiveFlags,
@ -300,10 +235,7 @@ typedef NTSTATUS
IN PVOID Tsdu, IN PVOID Tsdu,
OUT PIRP *IoRequestPacket); OUT PIRP *IoRequestPacket);
TDIKRNLAPI NTSTATUS STDCALL TdiDefaultRcvExpeditedHandler(
NTSTATUS
DDKAPI
TdiDefaultRcvExpeditedHandler(
IN PVOID TdiEventContext, IN PVOID TdiEventContext,
IN CONNECTION_CONTEXT ConnectionContext, IN CONNECTION_CONTEXT ConnectionContext,
IN ULONG ReceiveFlags, IN ULONG ReceiveFlags,
@ -313,8 +245,7 @@ TdiDefaultRcvExpeditedHandler(
IN PVOID Tsdu, IN PVOID Tsdu,
OUT PIRP *IoRequestPacket); OUT PIRP *IoRequestPacket);
typedef NTSTATUS typedef NTSTATUS (*PTDI_IND_CHAINED_RECEIVE)(
(*PTDI_IND_CHAINED_RECEIVE)(
IN PVOID TdiEventContext, IN PVOID TdiEventContext,
IN CONNECTION_CONTEXT ConnectionContext, IN CONNECTION_CONTEXT ConnectionContext,
IN ULONG ReceiveFlags, IN ULONG ReceiveFlags,
@ -323,10 +254,7 @@ typedef NTSTATUS
IN PMDL Tsdu, IN PMDL Tsdu,
IN PVOID TsduDescriptor); IN PVOID TsduDescriptor);
TDIKRNLAPI NTSTATUS STDCALL TdiDefaultChainedReceiveHandler(
NTSTATUS
DDKAPI
TdiDefaultChainedReceiveHandler(
IN PVOID TdiEventContext, IN PVOID TdiEventContext,
IN CONNECTION_CONTEXT ConnectionContext, IN CONNECTION_CONTEXT ConnectionContext,
IN ULONG ReceiveFlags, IN ULONG ReceiveFlags,
@ -335,8 +263,7 @@ TdiDefaultChainedReceiveHandler(
IN PMDL Tsdu, IN PMDL Tsdu,
IN PVOID TsduDescriptor); IN PVOID TsduDescriptor);
typedef NTSTATUS typedef NTSTATUS (*PTDI_IND_CHAINED_RECEIVE_DATAGRAM)(
(*PTDI_IND_CHAINED_RECEIVE_DATAGRAM)(
IN PVOID TdiEventContext, IN PVOID TdiEventContext,
IN LONG SourceAddressLength, IN LONG SourceAddressLength,
IN PVOID SourceAddress, IN PVOID SourceAddress,
@ -348,10 +275,7 @@ typedef NTSTATUS
IN PMDL Tsdu, IN PMDL Tsdu,
IN PVOID TsduDescriptor); IN PVOID TsduDescriptor);
TDIKRNLAPI NTSTATUS STDCALL TdiDefaultChainedRcvDatagramHandler(
NTSTATUS
DDKAPI
TdiDefaultChainedRcvDatagramHandler(
IN PVOID TdiEventContext, IN PVOID TdiEventContext,
IN LONG SourceAddressLength, IN LONG SourceAddressLength,
IN PVOID SourceAddress, IN PVOID SourceAddress,
@ -363,8 +287,7 @@ TdiDefaultChainedRcvDatagramHandler(
IN PMDL Tsdu, IN PMDL Tsdu,
IN PVOID TsduDescriptor); IN PVOID TsduDescriptor);
typedef NTSTATUS typedef NTSTATUS (*PTDI_IND_CHAINED_RECEIVE_EXPEDITED)(
(*PTDI_IND_CHAINED_RECEIVE_EXPEDITED)(
IN PVOID TdiEventContext, IN PVOID TdiEventContext,
IN CONNECTION_CONTEXT ConnectionContext, IN CONNECTION_CONTEXT ConnectionContext,
IN ULONG ReceiveFlags, IN ULONG ReceiveFlags,
@ -373,10 +296,7 @@ typedef NTSTATUS
IN PMDL Tsdu, IN PMDL Tsdu,
IN PVOID TsduDescriptor); IN PVOID TsduDescriptor);
TDIKRNLAPI NTSTATUS STDCALL TdiDefaultChainedRcvExpeditedHandler(
NTSTATUS
DDKAPI
TdiDefaultChainedRcvExpeditedHandler(
IN PVOID TdiEventContext, IN PVOID TdiEventContext,
IN CONNECTION_CONTEXT ConnectionContext, IN CONNECTION_CONTEXT ConnectionContext,
IN ULONG ReceiveFlags, IN ULONG ReceiveFlags,
@ -385,16 +305,12 @@ TdiDefaultChainedRcvExpeditedHandler(
IN PMDL Tsdu, IN PMDL Tsdu,
IN PVOID TsduDescriptor); IN PVOID TsduDescriptor);
typedef NTSTATUS typedef NTSTATUS (*PTDI_IND_SEND_POSSIBLE)(
(*PTDI_IND_SEND_POSSIBLE)(
IN PVOID TdiEventContext, IN PVOID TdiEventContext,
IN PVOID ConnectionContext, IN PVOID ConnectionContext,
IN ULONG BytesAvailable); IN ULONG BytesAvailable);
TDIKRNLAPI NTSTATUS STDCALL TdiDefaultSendPossibleHandler(
NTSTATUS
DDKAPI
TdiDefaultSendPossibleHandler(
IN PVOID TdiEventContext, IN PVOID TdiEventContext,
IN PVOID ConnectionContext, IN PVOID ConnectionContext,
IN ULONG BytesAvailable); IN ULONG BytesAvailable);
@ -404,21 +320,21 @@ TdiDefaultSendPossibleHandler(
/* Macros and functions to build IRPs */ /* Macros and functions to build IRPs */
#define TdiBuildBaseIrp( \ #define TdiBuildBaseIrp( \
bIrp, bDevObj, bFileObj, bCompRoutine, bContxt, bIrpSp, bMinor) \ Irp, DevObj, FileObj, CompRoutine, Contxt, IrpSp, Minor) \
{ \ { \
bIrpSp->MajorFunction = IRP_MJ_INTERNAL_DEVICE_CONTROL; \ IrpSp->MajorFunction = IRP_MJ_INTERNAL_DEVICE_CONTROL; \
bIrpSp->MinorFunction = (bMinor); \ IrpSp->MinorFunction = (Minor); \
bIrpSp->DeviceObject = (bDevObj); \ IrpSp->DeviceObject = (DevObj); \
bIrpSp->FileObject = (bFileObj); \ IrpSp->FileObject = (FileObj); \
if (bCompRoutine) \ \
IoSetCompletionRoutine(bIrp, bCompRoutine, bContxt, TRUE, TRUE, TRUE) \ if (CompRoutine) \
IoSetCompletionRoutine(Irp, CompRoutine, Contxt, TRUE, TRUE, TRUE) \
else \ else \
IoSetCompletionRoutine(bIrp, NULL, NULL, FALSE, FALSE, FALSE); \ IoSetCompletionRoutine(Irp, NULL, NULL, FALSE, FALSE, FALSE); \
} }
/* /*
* VOID * VOID TdiBuildAccept(
* TdiBuildAccept(
* IN PIRP Irp, * IN PIRP Irp,
* IN PDEVICE_OBJECT DevObj, * IN PDEVICE_OBJECT DevObj,
* IN PFILE_OBJECT FileObj, * IN PFILE_OBJECT FileObj,
@ -445,8 +361,7 @@ TdiDefaultSendPossibleHandler(
} }
/* /*
* VOID * VOID TdiBuildAction(
* TdiBuildAction(
* IN PIRP Irp, * IN PIRP Irp,
* IN PDEVICE_OBJECT DevObj, * IN PDEVICE_OBJECT DevObj,
* IN PFILE_OBJECT FileObj, * IN PFILE_OBJECT FileObj,
@ -468,8 +383,7 @@ TdiDefaultSendPossibleHandler(
} }
/* /*
* VOID * VOID TdiBuildAssociateAddress(
* TdiBuildAssociateAddress(
* IN PIRP Irp, * IN PIRP Irp,
* IN PDEVICE_OBJECT DevObj, * IN PDEVICE_OBJECT DevObj,
* IN PFILE_OBJECT FileObj, * IN PFILE_OBJECT FileObj,
@ -493,8 +407,7 @@ TdiDefaultSendPossibleHandler(
} }
/* /*
* VOID * VOID TdiBuildConnect(
* TdiBuildConnect(
* IN PIRP Irp, * IN PIRP Irp,
* IN PDEVICE_OBJECT DevObj, * IN PDEVICE_OBJECT DevObj,
* IN PFILE_OBJECT FileObj, * IN PFILE_OBJECT FileObj,
@ -523,8 +436,7 @@ TdiDefaultSendPossibleHandler(
} }
/* /*
* VOID * VOID TdiBuildDisassociateAddress(
* TdiBuildDisassociateAddress(
* IN PIRP Irp, * IN PIRP Irp,
* IN PDEVICE_OBJECT DevObj, * IN PDEVICE_OBJECT DevObj,
* IN PFILE_OBJECT FileObj, * IN PFILE_OBJECT FileObj,
@ -543,8 +455,7 @@ TdiDefaultSendPossibleHandler(
} }
/* /*
* VOID * VOID TdiBuildDisconnect(
* TdiBuildDisconnect(
* IN PIRP Irp, * IN PIRP Irp,
* IN PDEVICE_OBJECT DevObj, * IN PDEVICE_OBJECT DevObj,
* IN PFILE_OBJECT FileObj, * IN PFILE_OBJECT FileObj,
@ -575,8 +486,7 @@ TdiDefaultSendPossibleHandler(
} }
/* /*
* PIRP * PIRP TdiBuildInternalDeviceControlIrp(
* TdiBuildInternalDeviceControlIrp(
* IN CCHAR IrpSubFunction, * IN CCHAR IrpSubFunction,
* IN PDEVICE_OBJECT DeviceObject, * IN PDEVICE_OBJECT DeviceObject,
* IN PFILE_OBJECT FileObject, * IN PFILE_OBJECT FileObject,
@ -592,8 +502,7 @@ TdiDefaultSendPossibleHandler(
TRUE, Event, IoStatusBlock) TRUE, Event, IoStatusBlock)
/* /*
* VOID * VOID TdiBuildListen(
* TdiBuildListen(
* IN PIRP Irp, * IN PIRP Irp,
* IN PDEVICE_OBJECT DevObj, * IN PDEVICE_OBJECT DevObj,
* IN PFILE_OBJECT FileObj, * IN PFILE_OBJECT FileObj,
@ -621,25 +530,18 @@ TdiDefaultSendPossibleHandler(
_Request->RequestFlags = (Flags); \ _Request->RequestFlags = (Flags); \
} }
TDIKRNLAPI VOID STDCALL TdiBuildNetbiosAddress(
VOID
DDKAPI
TdiBuildNetbiosAddress(
IN PUCHAR NetbiosName, IN PUCHAR NetbiosName,
IN BOOLEAN IsGroupName, IN BOOLEAN IsGroupName,
IN OUT PTA_NETBIOS_ADDRESS NetworkName); IN OUT PTA_NETBIOS_ADDRESS NetworkName);
TDIKRNLAPI NTSTATUS STDCALL TdiBuildNetbiosAddressEa(
NTSTATUS
DDKAPI
TdiBuildNetbiosAddressEa(
IN PUCHAR Buffer, IN PUCHAR Buffer,
IN BOOLEAN IsGroupName, IN BOOLEAN IsGroupName,
IN PUCHAR NetbiosName); IN PUCHAR NetbiosName);
/* /*
* VOID * VOID TdiBuildQueryInformation(
* TdiBuildQueryInformation(
* IN PIRP Irp, * IN PIRP Irp,
* IN PDEVICE_OBJECT DevObj, * IN PDEVICE_OBJECT DevObj,
* IN PFILE_OBJECT FileObj, * IN PFILE_OBJECT FileObj,
@ -666,8 +568,7 @@ TdiBuildNetbiosAddressEa(
} }
/* /*
* VOID * VOID TdiBuildReceive(
* TdiBuildReceive(
* IN PIRP Irp, * IN PIRP Irp,
* IN PDEVICE_OBJECT DevObj, * IN PDEVICE_OBJECT DevObj,
* IN PFILE_OBJECT FileObj, * IN PFILE_OBJECT FileObj,
@ -696,8 +597,7 @@ TdiBuildNetbiosAddressEa(
} }
/* /*
* VOID * VOID TdiBuildReceiveDatagram(
* TdiBuildReceiveDatagram(
* IN PIRP Irp, * IN PIRP Irp,
* IN PDEVICE_OBJECT DevObj, * IN PDEVICE_OBJECT DevObj,
* IN PFILE_OBJECT FileObj, * IN PFILE_OBJECT FileObj,
@ -730,8 +630,7 @@ TdiBuildNetbiosAddressEa(
} }
/* /*
* VOID * VOID TdiBuildSend(
* TdiBuildSend(
* IN PIRP Irp, * IN PIRP Irp,
* IN PDEVICE_OBJECT DevObj, * IN PDEVICE_OBJECT DevObj,
* IN PFILE_OBJECT FileObj, * IN PFILE_OBJECT FileObj,
@ -760,8 +659,7 @@ TdiBuildNetbiosAddressEa(
} }
/* /*
* VOID * VOID TdiBuildSendDatagram(
* TdiBuildSendDatagram(
* IN PIRP Irp, * IN PIRP Irp,
* IN PDEVICE_OBJECT DevObj, * IN PDEVICE_OBJECT DevObj,
* IN PFILE_OBJECT FileObj, * IN PFILE_OBJECT FileObj,
@ -790,8 +688,7 @@ TdiBuildNetbiosAddressEa(
} }
/* /*
* VOID * VOID TdiBuildSetEventHandler(
* TdiBuildSetEventHandler(
* IN PIRP Irp, * IN PIRP Irp,
* IN PDEVICE_OBJECT DevObj, * IN PDEVICE_OBJECT DevObj,
* IN PFILE_OBJECT FileObj, * IN PFILE_OBJECT FileObj,
@ -820,8 +717,7 @@ TdiBuildNetbiosAddressEa(
} }
/* /*
* VOID * VOID TdiBuildSetInformation(
* TdiBuildSetInformation(
* IN PIRP Irp, * IN PIRP Irp,
* IN PDEVICE_OBJECT DevObj, * IN PDEVICE_OBJECT DevObj,
* IN PFILE_OBJECT FileObj, * IN PFILE_OBJECT FileObj,
@ -847,93 +743,12 @@ TdiBuildNetbiosAddressEa(
(Irp)->MdlAddress = (MdlAddr); \ (Irp)->MdlAddress = (MdlAddr); \
} }
/* TDI20_CLIENT_INTERFACE_INFO.TdiVersion constants */
#define TDI_CURRENT_MAJOR_VERSION 2
#define TDI_CURRENT_MINOR_VERSION 0
#define TDI_CURRENT_VERSION ((TDI_CURRENT_MINOR_VERSION) << 8 \
| (TDI_CURRENT_MAJOR_VERSION))
#define TDI_VERSION_ONE 0x0001
typedef enum _TDI_PNP_OPCODE {
TDI_PNP_OP_MIN,
TDI_PNP_OP_ADD,
TDI_PNP_OP_DEL,
TDI_PNP_OP_UPDATE,
TDI_PNP_OP_PROVIDERREADY,
TDI_PNP_OP_NETREADY,
TDI_PNP_OP_ADD_IGNORE_BINDING,
TDI_PNP_OP_DELETE_IGNORE_BINDING,
TDI_PNP_OP_MAX
} TDI_PNP_OPCODE;
/* TDI_PNP_CONTEXT.ContextType */
#define TDI_PNP_CONTEXT_TYPE_IF_NAME 0x1
#define TDI_PNP_CONTEXT_TYPE_IF_ADDR 0x2
#define TDI_PNP_CONTEXT_TYPE_PDO 0x3
#define TDI_PNP_CONTEXT_TYPE_FIRST_OR_LAST_IF 0x4
typedef struct _TDI_PNP_CONTEXT {
USHORT ContextSize;
USHORT ContextType;
UCHAR ContextData[1];
} TDI_PNP_CONTEXT, *PTDI_PNP_CONTEXT;
typedef VOID DDKAPI
(*TDI_ADD_ADDRESS_HANDLER)(
IN PTA_ADDRESS Address);
typedef VOID DDKAPI
(*TDI_ADD_ADDRESS_HANDLER_V2)(
IN PTA_ADDRESS Address,
IN PUNICODE_STRING DeviceName,
IN PTDI_PNP_CONTEXT Context);
typedef VOID DDKAPI
(*TDI_BINDING_HANDLER)(
IN TDI_PNP_OPCODE PnPOpcode,
IN PUNICODE_STRING DeviceName,
IN PWSTR MultiSZBindList);
typedef VOID DDKAPI
(*TDI_BIND_HANDLER)(
IN PUNICODE_STRING DeviceName);
typedef VOID DDKAPI
(*TDI_DEL_ADDRESS_HANDLER)(
IN PTA_ADDRESS Address);
typedef VOID DDKAPI
(*TDI_DEL_ADDRESS_HANDLER_V2)(
IN PTA_ADDRESS Address,
IN PUNICODE_STRING DeviceName,
IN PTDI_PNP_CONTEXT Context);
typedef NTSTATUS DDKAPI
(*TDI_PNP_POWER_HANDLER)(
IN PUNICODE_STRING DeviceName,
IN PNET_PNP_EVENT PowerEvent,
IN PTDI_PNP_CONTEXT Context1,
IN PTDI_PNP_CONTEXT Context2);
typedef VOID DDKAPI
(*TDI_UNBIND_HANDLER)(
IN PUNICODE_STRING DeviceName);
typedef VOID DDKAPI
(*ProviderPnPPowerComplete)(
IN PNET_PNP_EVENT NetEvent,
IN NTSTATUS ProviderStatus);
/* TDI functions */ /* TDI functions */
/* /*
* VOID * VOID TdiCompleteRequest(
* TdiCompleteRequest(
* IN PIRP Irp, * IN PIRP Irp,
* IN NTSTATUS Status); * IN NTSTATUS Status);
*/ */
@ -943,10 +758,7 @@ typedef VOID DDKAPI
IoCompleteRequest((Irp), IO_NETWORK_INCREMENT); \ IoCompleteRequest((Irp), IO_NETWORK_INCREMENT); \
} }
TDIKRNLAPI NTSTATUS STDCALL TdiCopyBufferToMdl(
NTSTATUS
DDKAPI
TdiCopyBufferToMdl(
IN PVOID SourceBuffer, IN PVOID SourceBuffer,
IN ULONG SourceOffset, IN ULONG SourceOffset,
IN ULONG SourceBytesToCopy, IN ULONG SourceBytesToCopy,
@ -955,8 +767,7 @@ TdiCopyBufferToMdl(
IN PULONG BytesCopied); IN PULONG BytesCopied);
/* /*
* VOID * VOID TdiCopyLookaheadData(
* TdiCopyLookaheadData(
* IN PVOID Destination, * IN PVOID Destination,
* IN PVOID Source, * IN PVOID Source,
* IN ULONG Length, * IN ULONG Length,
@ -965,20 +776,7 @@ TdiCopyBufferToMdl(
#define TdiCopyLookaheadData(Destination, Source, Length, ReceiveFlags) \ #define TdiCopyLookaheadData(Destination, Source, Length, ReceiveFlags) \
RtlCopyMemory(Destination, Source, Length) RtlCopyMemory(Destination, Source, Length)
TDIKRNLAPI NTSTATUS STDCALL TdiCopyMdlToBuffer(
NTSTATUS
DDKAPI
TdiCopyMdlChainToMdlChain (
IN PMDL SourceMdlChain,
IN ULONG SourceOffset,
IN PMDL DestinationMdlChain,
IN ULONG DestinationOffset,
OUT PULONG BytesCopied);
TDIKRNLAPI
NTSTATUS
DDKAPI
TdiCopyMdlToBuffer(
IN PMDL SourceMdlChain, IN PMDL SourceMdlChain,
IN ULONG SourceOffset, IN ULONG SourceOffset,
IN PVOID DestinationBuffer, IN PVOID DestinationBuffer,
@ -986,159 +784,22 @@ TdiCopyMdlToBuffer(
IN ULONG DestinationBufferSize, IN ULONG DestinationBufferSize,
OUT PULONG BytesCopied); OUT PULONG BytesCopied);
TDIKRNLAPI VOID STDCALL TdiMapBuffer(
NTSTATUS
DDKAPI
TdiDeregisterAddressChangeHandler(
IN HANDLE BindingHandle);
TDIKRNLAPI
NTSTATUS
DDKAPI
TdiDeregisterDeviceObject(
IN HANDLE DevRegistrationHandle);
TDIKRNLAPI
NTSTATUS
DDKAPI
TdiDeregisterNetAddress(
IN HANDLE AddrRegistrationHandle);
TDIKRNLAPI
NTSTATUS
DDKAPI
TdiDeregisterPnPHandlers(
IN HANDLE BindingHandle);
TDIKRNLAPI
NTSTATUS
DDKAPI
TdiDeregisterProvider(
IN HANDLE ProviderHandle);
TDIKRNLAPI
NTSTATUS
DDKAPI
TdiEnumerateAddresses(
IN HANDLE BindingHandle);
TDIKRNLAPI
VOID
DDKAPI
TdiInitialize(
VOID);
TDIKRNLAPI
VOID
DDKAPI
TdiMapBuffer(
IN PMDL MdlChain); IN PMDL MdlChain);
TDIKRNLAPI NTSTATUS STDCALL TdiMapUserRequest(
NTSTATUS
DDKAPI
TdiMapUserRequest(
IN PDEVICE_OBJECT DeviceObject, IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp, IN PIRP Irp,
IN PIO_STACK_LOCATION IrpSp); IN PIO_STACK_LOCATION IrpSp);
TDIKRNLAPI VOID STDCALL TdiReturnChainedReceives(
BOOLEAN
DDKAPI
TdiMatchPdoWithChainedReceiveContext(
IN PVOID TsduDescriptor,
IN PVOID PDO);
TDIKRNLAPI
VOID
DDKAPI
TdiPnPPowerComplete(
IN HANDLE BindingHandle,
IN PNET_PNP_EVENT PowerEvent,
IN NTSTATUS Status);
TDIKRNLAPI
NTSTATUS
DDKAPI
TdiPnPPowerRequest(
IN PUNICODE_STRING DeviceName,
IN PNET_PNP_EVENT PowerEvent,
IN PTDI_PNP_CONTEXT Context1,
IN PTDI_PNP_CONTEXT Context2,
IN ProviderPnPPowerComplete ProtocolCompletionHandler);
TDIKRNLAPI
NTSTATUS
DDKAPI
TdiProviderReady(
IN HANDLE ProviderHandle);
TDIKRNLAPI
NTSTATUS
DDKAPI
TdiRegisterAddressChangeHandler(
IN TDI_ADD_ADDRESS_HANDLER AddHandler,
IN TDI_DEL_ADDRESS_HANDLER DeleteHandler,
OUT HANDLE *BindingHandle);
TDIKRNLAPI
NTSTATUS
DDKAPI
TdiRegisterDeviceObject(
IN PUNICODE_STRING DeviceName,
OUT HANDLE *DevRegistrationHandle);
TDIKRNLAPI
NTSTATUS
DDKAPI
TdiRegisterNetAddress(
IN PTA_ADDRESS Address,
IN PUNICODE_STRING DeviceName,
IN PTDI_PNP_CONTEXT Context,
OUT HANDLE *AddrRegistrationHandle);
TDIKRNLAPI
NTSTATUS
DDKAPI
TdiRegisterNotificationHandler(
IN TDI_BIND_HANDLER BindHandler,
IN TDI_UNBIND_HANDLER UnbindHandler,
OUT HANDLE *BindingHandle);
TDIKRNLAPI
NTSTATUS
DDKAPI
TdiRegisterPnPHandlers(
IN PTDI_CLIENT_INTERFACE_INFO ClientInterfaceInfo,
IN ULONG InterfaceInfoSize,
OUT HANDLE *BindingHandle);
TDIKRNLAPI
NTSTATUS
DDKAPI
TdiRegisterProvider(
IN PUNICODE_STRING ProviderName,
OUT HANDLE *ProviderHandle);
TDIKRNLAPI
VOID
DDKAPI
TdiReturnChainedReceives(
IN PVOID *TsduDescriptors, IN PVOID *TsduDescriptors,
IN ULONG NumberOfTsdus); IN ULONG NumberOfTsdus);
TDIKRNLAPI VOID STDCALL TdiUnmapBuffer(
VOID
DDKAPI
TdiUnmapBuffer(
IN PMDL MdlChain); IN PMDL MdlChain);
#pragma pack(pop)
#ifdef __cplusplus
}
#endif
#endif /* __TDIKRNL_H */ #endif /* __TDIKRNL_H */
/* EOF */