Header additions and modifications to bring our header versions closer to the latest mingw releases. Basically just reducing the diffs between the two versions.

Nothing should change with the resulting binaries (although various #pragma pack directives may have an effect )^:
Clean build tested without problem. Hopefully haven't broken anything with the runtime, ROS still boots ok for me under BOCHS.
Lots of laborious work all to be chucked out once we can finally switch over to the mingw headers full time.
Sorry if this causes anybody�s uncommitted work to be in conflict.
Heaps more coming to an directory near you soon (if nobody objects of course)
I noticed somewhere something like an 'include next' directive, however I can't find it now. In order to save me the research can anybody enlighten me as to its purpose. What I am hoping for is that it tells the pre-proc to go to the next header of the same name in the 'includes' search path. Such a directive would certainly be useful right now!
Regarding the mention on ros-kernel about wine-msvcrt v's ros-msvcrt I was hoping that the mingwacr project would addrs this however it seems to have lost all its steam. Anybody got an update concerning the project?
Somewhat off topic: finally the rains have come -> http://mirror.bom.gov.au/products/IDR032.loop.shtml#image

svn path=/trunk/; revision=6368
This commit is contained in:
Robert Dickenson 2003-10-19 10:36:41 +00:00
parent ed810e5f93
commit 81ef57a149
11 changed files with 2275 additions and 1513 deletions

View file

@ -15,16 +15,13 @@ NTSTATUS
(*PI8042_SYNCH_READ_PORT) (
IN PVOID Context,
PUCHAR Value,
BOOLEAN WaitForACK
);
BOOLEAN WaitForACK);
typedef
NTSTATUS
typedef NTSTATUS
(*PI8042_SYNCH_WRITE_PORT) (
IN PVOID Context,
UCHAR Value,
BOOLEAN WaitForACK
);
BOOLEAN WaitForACK);
typedef enum _TRANSMIT_STATE {
Idle = 0,
@ -38,18 +35,15 @@ typedef struct _OUTPUT_PACKET {
TRANSMIT_STATE State;
} OUTPUT_PACKET, *POUTPUT_PACKET;
typedef
NTSTATUS
typedef NTSTATUS
(*PI8042_KEYBOARD_INITIALIZATION_ROUTINE) (
IN PVOID InitializationContext,
IN PVOID SynchFuncContext,
IN PI8042_SYNCH_READ_PORT ReadPort,
IN PI8042_SYNCH_WRITE_PORT WritePort,
OUT PBOOLEAN TurnTranslationOn
);
OUT PBOOLEAN TurnTranslationOn);
typedef
BOOLEAN
typedef BOOLEAN
(*PI8042_KEYBOARD_ISR) (
PVOID IsrContext,
PKEYBOARD_INPUT_DATA CurrentInput,
@ -57,8 +51,7 @@ BOOLEAN
UCHAR StatusByte,
PUCHAR Byte,
PBOOLEAN ContinueProcessing,
PKEYBOARD_SCAN_STATE ScanState
);
PKEYBOARD_SCAN_STATE ScanState);
typedef struct _INTERNAL_I8042_HOOK_KEYBOARD {

View file

@ -1,4 +1,4 @@
/* $Id: srb.h,v 1.4 2003/09/18 13:45:07 ekohl Exp $
/* $Id: srb.h,v 1.5 2003/10/19 10:36:41 robd Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -10,6 +10,46 @@
#ifndef __STORAGE_INCLUDE_SRB_H
#define __STORAGE_INCLUDE_SRB_H
#if __GNUC__ >=3
#pragma GCC system_header
#endif
#ifdef __cplusplus
extern "C" {
#endif
#pragma pack(push,4)
#include "ntddk.h"
#if defined(_SCSIPORT_)
#define SCSIPORTAPI
#else
#define SCSIPORTAPI
#endif
#define DDKAPI STDCALL
/* Obsolete. For backward compatibility only. */
typedef PHYSICAL_ADDRESS SCSI_PHYSICAL_ADDRESS, *PSCSI_PHYSICAL_ADDRESS;
#define SP_UNINITIALIZED_VALUE ((ULONG) ~0)
#define SP_UNTAGGED ((ULONG) ~0)
#define SRB_SIMPLE_TAG_REQUEST 0x20
#define SRB_HEAD_OF_QUEUE_TAG_REQUEST 0x21
#define SRB_ORDERED_QUEUE_TAG_REQUEST 0x22
/* SRB Status Masks */
#define SRB_STATUS_QUEUE_FROZEN 0x40
#define SRB_STATUS_AUTOSENSE_VALID 0x80
#define SRB_STATUS(Status) \
(Status & ~(SRB_STATUS_AUTOSENSE_VALID | SRB_STATUS_QUEUE_FROZEN))
#define MAXIMUM_CDB_SIZE 12
/* Define SCSI maximum configuration parameters. */
@ -18,29 +58,119 @@
#define SCSI_MAXIMUM_BUSES 8
#define SCSI_MINIMUM_PHYSICAL_BREAKS 16
#define SCSI_MAXIMUM_PHYSICAL_BREAKS 255
/* Obsolete. For backward compatibility only. */
#define SCSI_MAXIMUM_TARGETS 8
#define MAXIMUM_CDB_SIZE 12
/* Port driver error codes */
typedef PHYSICAL_ADDRESS SCSI_PHYSICAL_ADDRESS, *PSCSI_PHYSICAL_ADDRESS;
#define SP_BUS_PARITY_ERROR 0x0001
#define SP_UNEXPECTED_DISCONNECT 0x0002
#define SP_INVALID_RESELECTION 0x0003
#define SP_BUS_TIME_OUT 0x0004
#define SP_PROTOCOL_ERROR 0x0005
#define SP_INTERNAL_ADAPTER_ERROR 0x0006
#define SP_REQUEST_TIMEOUT 0x0007
#define SP_IRQ_NOT_RESPONDING 0x0008
#define SP_BAD_FW_WARNING 0x0009
#define SP_BAD_FW_ERROR 0x000a
/* SCSI_REQUEST_BLOCK.Function constants */
#define SRB_FUNCTION_EXECUTE_SCSI 0x00
#define SRB_FUNCTION_CLAIM_DEVICE 0x01
#define SRB_FUNCTION_IO_CONTROL 0x02
#define SRB_FUNCTION_RECEIVE_EVENT 0x03
#define SRB_FUNCTION_RELEASE_QUEUE 0x04
#define SRB_FUNCTION_ATTACH_DEVICE 0x05
#define SRB_FUNCTION_RELEASE_DEVICE 0x06
#define SRB_FUNCTION_SHUTDOWN 0x07
#define SRB_FUNCTION_FLUSH 0x08
#define SRB_FUNCTION_ABORT_COMMAND 0x10
#define SRB_FUNCTION_RELEASE_RECOVERY 0x11
#define SRB_FUNCTION_RESET_BUS 0x12
#define SRB_FUNCTION_RESET_DEVICE 0x13
#define SRB_FUNCTION_TERMINATE_IO 0x14
#define SRB_FUNCTION_FLUSH_QUEUE 0x15
#define SRB_FUNCTION_REMOVE_DEVICE 0x16
typedef struct _ACCESS_RANGE
{
/* SCSI_REQUEST_BLOCK.SrbStatus constants */
#define SRB_STATUS_PENDING 0x00
#define SRB_STATUS_SUCCESS 0x01
#define SRB_STATUS_ABORTED 0x02
#define SRB_STATUS_ABORT_FAILED 0x03
#define SRB_STATUS_ERROR 0x04
#define SRB_STATUS_BUSY 0x05
#define SRB_STATUS_INVALID_REQUEST 0x06
#define SRB_STATUS_INVALID_PATH_ID 0x07
#define SRB_STATUS_NO_DEVICE 0x08
#define SRB_STATUS_TIMEOUT 0x09
#define SRB_STATUS_SELECTION_TIMEOUT 0x0A
#define SRB_STATUS_COMMAND_TIMEOUT 0x0B
#define SRB_STATUS_MESSAGE_REJECTED 0x0D
#define SRB_STATUS_BUS_RESET 0x0E
#define SRB_STATUS_PARITY_ERROR 0x0F
#define SRB_STATUS_REQUEST_SENSE_FAILED 0x10
#define SRB_STATUS_NO_HBA 0x11
#define SRB_STATUS_DATA_OVERRUN 0x12
#define SRB_STATUS_UNEXPECTED_BUS_FREE 0x13
#define SRB_STATUS_PHASE_SEQUENCE_FAILURE 0x14
#define SRB_STATUS_BAD_SRB_BLOCK_LENGTH 0x15
#define SRB_STATUS_REQUEST_FLUSHED 0x16
#define SRB_STATUS_INVALID_LUN 0x20
#define SRB_STATUS_INVALID_TARGET_ID 0x21
#define SRB_STATUS_BAD_FUNCTION 0x22
#define SRB_STATUS_ERROR_RECOVERY 0x23
/* SCSI_REQUEST_BLOCK.SrbFlags constants */
#define SRB_FLAGS_QUEUE_ACTION_ENABLE 0x00000002
#define SRB_FLAGS_DISABLE_DISCONNECT 0x00000004
#define SRB_FLAGS_DISABLE_SYNCH_TRANSFER 0x00000008
#define SRB_FLAGS_BYPASS_FROZEN_QUEUE 0x00000010
#define SRB_FLAGS_DISABLE_AUTOSENSE 0x00000020
#define SRB_FLAGS_DATA_IN 0x00000040
#define SRB_FLAGS_DATA_OUT 0x00000080
#define SRB_FLAGS_NO_DATA_TRANSFER 0x00000000
#define SRB_FLAGS_UNSPECIFIED_DIRECTION (SRB_FLAGS_DATA_IN | SRB_FLAGS_DATA_OUT)
#define SRB_FLAGS_NO_QUEUE_FREEZE 0x00000100
#define SRB_FLAGS_ADAPTER_CACHE_ENABLE 0x00000200
#define SRB_FLAGS_IS_ACTIVE 0x00010000
#define SRB_FLAGS_ALLOCATED_FROM_ZONE 0x00020000
#define SRB_FLAGS_SGLIST_FROM_POOL 0x00040000
typedef struct _SCSI_REQUEST_BLOCK {
USHORT Length; /* 0x00 */
UCHAR Function; /* 0x02 */
UCHAR SrbStatus; /* 0x03 */
UCHAR ScsiStatus; /* 0x04 */
UCHAR PathId; /* 0x05 */
UCHAR TargetId; /* 0x06 */
UCHAR Lun; /* 0x07 */
UCHAR QueueTag; /* 0x08 */
UCHAR QueueAction; /* 0x09 */
UCHAR CdbLength; /* 0x0A */
UCHAR SenseInfoBufferLength; /* 0x0B */
ULONG SrbFlags; /* 0x0C */
ULONG DataTransferLength; /* 0x10 */
ULONG TimeOutValue; /* 0x14 */
PVOID DataBuffer; /* 0x18 */
PVOID SenseInfoBuffer; /* 0x1C */
struct _SCSI_REQUEST_BLOCK *NextSrb; /* 0x20 */
PVOID OriginalRequest; /* 0x24 */
PVOID SrbExtension; /* 0x28 */
ULONG QueueSortKey; /* 0x2C */
UCHAR Cdb[16]; /* 0x30 */
} SCSI_REQUEST_BLOCK, *PSCSI_REQUEST_BLOCK;
#define SCSI_REQUEST_BLOCK_SIZE sizeof(SCSI_REQUEST_BLOCK)
typedef struct _ACCESS_RANGE {
SCSI_PHYSICAL_ADDRESS RangeStart;
ULONG RangeLength;
BOOLEAN RangeInMemory;
}ACCESS_RANGE, *PACCESS_RANGE;
typedef struct _PORT_CONFIGURATION_INFORMATION
{
typedef struct _PORT_CONFIGURATION_INFORMATION {
ULONG Length;
ULONG SystemIoBusNumber;
INTERFACE_TYPE AdapterInterfaceType;
@ -96,146 +226,7 @@ typedef struct _PORT_CONFIGURATION_INFORMATION
#define CONFIG_INFO_VERSION_2 sizeof(PORT_CONFIGURATION_INFORMATION)
/* uninitialized flag values */
#define SP_UNINITIALIZED_VALUE ((ULONG)~0)
#define SP_UNTAGGED ((ULONG)~0)
typedef struct _SCSI_REQUEST_BLOCK
{
USHORT Length; /* 0x00 */
UCHAR Function; /* 0x02 */
UCHAR SrbStatus; /* 0x03 */
UCHAR ScsiStatus; /* 0x04 */
UCHAR PathId; /* 0x05 */
UCHAR TargetId; /* 0x06 */
UCHAR Lun; /* 0x07 */
UCHAR QueueTag; /* 0x08 */
UCHAR QueueAction; /* 0x09 */
UCHAR CdbLength; /* 0x0A */
UCHAR SenseInfoBufferLength; /* 0x0B */
ULONG SrbFlags; /* 0x0C */
ULONG DataTransferLength; /* 0x10 */
ULONG TimeOutValue; /* 0x14 */
PVOID DataBuffer; /* 0x18 */
PVOID SenseInfoBuffer; /* 0x1C */
struct _SCSI_REQUEST_BLOCK *NextSrb; /* 0x20 */
PVOID OriginalRequest; /* 0x24 */
PVOID SrbExtension; /* 0x28 */
ULONG QueueSortKey; /* 0x2C */
UCHAR Cdb[16]; /* 0x30 */
} SCSI_REQUEST_BLOCK, *PSCSI_REQUEST_BLOCK;
#define SCSI_REQUEST_BLOCK_SIZE sizeof(SCSI_REQUEST_BLOCK)
/* SRB Functions */
#define SRB_FUNCTION_EXECUTE_SCSI 0x00
#define SRB_FUNCTION_CLAIM_DEVICE 0x01
#define SRB_FUNCTION_IO_CONTROL 0x02
#define SRB_FUNCTION_RECEIVE_EVENT 0x03
#define SRB_FUNCTION_RELEASE_QUEUE 0x04
#define SRB_FUNCTION_ATTACH_DEVICE 0x05
#define SRB_FUNCTION_RELEASE_DEVICE 0x06
#define SRB_FUNCTION_SHUTDOWN 0x07
#define SRB_FUNCTION_FLUSH 0x08
#define SRB_FUNCTION_ABORT_COMMAND 0x10
#define SRB_FUNCTION_RELEASE_RECOVERY 0x11
#define SRB_FUNCTION_RESET_BUS 0x12
#define SRB_FUNCTION_RESET_DEVICE 0x13
#define SRB_FUNCTION_TERMINATE_IO 0x14
#define SRB_FUNCTION_FLUSH_QUEUE 0x15
#define SRB_FUNCTION_REMOVE_DEVICE 0x16
/* SRB Status */
#define SRB_STATUS_PENDING 0x00
#define SRB_STATUS_SUCCESS 0x01
#define SRB_STATUS_ABORTED 0x02
#define SRB_STATUS_ABORT_FAILED 0x03
#define SRB_STATUS_ERROR 0x04
#define SRB_STATUS_BUSY 0x05
#define SRB_STATUS_INVALID_REQUEST 0x06
#define SRB_STATUS_INVALID_PATH_ID 0x07
#define SRB_STATUS_NO_DEVICE 0x08
#define SRB_STATUS_TIMEOUT 0x09
#define SRB_STATUS_SELECTION_TIMEOUT 0x0A
#define SRB_STATUS_COMMAND_TIMEOUT 0x0B
#define SRB_STATUS_MESSAGE_REJECTED 0x0D
#define SRB_STATUS_BUS_RESET 0x0E
#define SRB_STATUS_PARITY_ERROR 0x0F
#define SRB_STATUS_REQUEST_SENSE_FAILED 0x10
#define SRB_STATUS_NO_HBA 0x11
#define SRB_STATUS_DATA_OVERRUN 0x12
#define SRB_STATUS_UNEXPECTED_BUS_FREE 0x13
#define SRB_STATUS_PHASE_SEQUENCE_FAILURE 0x14
#define SRB_STATUS_BAD_SRB_BLOCK_LENGTH 0x15
#define SRB_STATUS_REQUEST_FLUSHED 0x16
#define SRB_STATUS_INVALID_LUN 0x20
#define SRB_STATUS_INVALID_TARGET_ID 0x21
#define SRB_STATUS_BAD_FUNCTION 0x22
#define SRB_STATUS_ERROR_RECOVERY 0x23
/* SRB Status Masks */
#define SRB_STATUS_QUEUE_FROZEN 0x40
#define SRB_STATUS_AUTOSENSE_VALID 0x80
#define SRB_STATUS(Status) (Status & ~(SRB_STATUS_AUTOSENSE_VALID | SRB_STATUS_QUEUE_FROZEN))
/* SRB Flag Bits */
#define SRB_FLAGS_QUEUE_ACTION_ENABLE 0x00000002
#define SRB_FLAGS_DISABLE_DISCONNECT 0x00000004
#define SRB_FLAGS_DISABLE_SYNCH_TRANSFER 0x00000008
#define SRB_FLAGS_BYPASS_FROZEN_QUEUE 0x00000010
#define SRB_FLAGS_DISABLE_AUTOSENSE 0x00000020
#define SRB_FLAGS_DATA_IN 0x00000040
#define SRB_FLAGS_DATA_OUT 0x00000080
#define SRB_FLAGS_NO_DATA_TRANSFER 0x00000000
#define SRB_FLAGS_UNSPECIFIED_DIRECTION (SRB_FLAGS_DATA_IN | SRB_FLAGS_DATA_OUT)
#define SRB_FLAGS_NO_QUEUE_FREEZE 0x00000100
#define SRB_FLAGS_ADAPTER_CACHE_ENABLE 0x00000200
#define SRB_FLAGS_IS_ACTIVE 0x00010000
#define SRB_FLAGS_ALLOCATED_FROM_ZONE 0x00020000
#define SRB_FLAGS_SGLIST_FROM_POOL 0x00040000
/* Queue Action */
#define SRB_SIMPLE_TAG_REQUEST 0x20
#define SRB_HEAD_OF_QUEUE_TAG_REQUEST 0x21
#define SRB_ORDERED_QUEUE_TAG_REQUEST 0x22
/* Port driver error codes */
#define SP_BUS_PARITY_ERROR 0x0001
#define SP_UNEXPECTED_DISCONNECT 0x0002
#define SP_INVALID_RESELECTION 0x0003
#define SP_BUS_TIME_OUT 0x0004
#define SP_PROTOCOL_ERROR 0x0005
#define SP_INTERNAL_ADAPTER_ERROR 0x0006
#define SP_REQUEST_TIMEOUT 0x0007
#define SP_IRQ_NOT_RESPONDING 0x0008
#define SP_BAD_FW_WARNING 0x0009
#define SP_BAD_FW_ERROR 0x000a
/* Return values for SCSI_HW_FIND_ADAPTER. */
#define SP_RETURN_NOT_FOUND 0
#define SP_RETURN_FOUND 1
#define SP_RETURN_ERROR 2
#define SP_RETURN_BAD_CONFIG 3
typedef enum _SCSI_NOTIFICATION_TYPE
{
typedef enum _SCSI_NOTIFICATION_TYPE {
RequestComplete,
NextRequest,
NextLuRequest,
@ -246,41 +237,55 @@ typedef enum _SCSI_NOTIFICATION_TYPE
} SCSI_NOTIFICATION_TYPE, *PSCSI_NOTIFICATION_TYPE;
typedef BOOLEAN STDCALL
(*PHW_INITIALIZE)(IN PVOID DeviceExtension);
typedef BOOLEAN DDKAPI
(*PHW_ADAPTER_STATE)(
IN PVOID DeviceExtension,
IN PVOID Context,
IN BOOLEAN SaveState);
typedef BOOLEAN STDCALL
(*PHW_STARTIO)(IN PVOID DeviceExtension,
IN PSCSI_REQUEST_BLOCK Srb);
/* Return values for SCSI_HW_FIND_ADAPTER. */
typedef BOOLEAN STDCALL
(*PHW_INTERRUPT)(IN PVOID DeviceExtension);
#define SP_RETURN_NOT_FOUND 0
#define SP_RETURN_FOUND 1
#define SP_RETURN_ERROR 2
#define SP_RETURN_BAD_CONFIG 3
typedef VOID STDCALL
(*PHW_TIMER)(IN PVOID DeviceExtension);
typedef ULONG DDKAPI
(*PHW_FIND_ADAPTER)(
IN PVOID DeviceExtension,
IN PVOID HwContext,
IN PVOID BusInformation,
IN PCHAR ArgumentString,
IN OUT PPORT_CONFIGURATION_INFORMATION ConfigInfo,
OUT PBOOLEAN Again);
typedef VOID STDCALL
(*PHW_DMA_STARTED)(IN PVOID DeviceExtension);
typedef BOOLEAN DDKAPI
(*PHW_INITIALIZE)(
IN PVOID DeviceExtension);
typedef ULONG STDCALL
(*PHW_FIND_ADAPTER)(IN PVOID DeviceExtension,
IN PVOID HwContext,
IN PVOID BusInformation,
IN PCHAR ArgumentString,
IN OUT PPORT_CONFIGURATION_INFORMATION ConfigInfo,
OUT PBOOLEAN Again);
typedef BOOLEAN DDKAPI
(*PHW_INTERRUPT)(
IN PVOID DeviceExtension);
typedef BOOLEAN STDCALL
(*PHW_RESET_BUS)(IN PVOID DeviceExtension,
IN ULONG PathId);
typedef BOOLEAN DDKAPI
(*PHW_RESET_BUS)(
IN PVOID DeviceExtension,
IN ULONG PathId);
typedef BOOLEAN STDCALL
(*PHW_ADAPTER_STATE)(IN PVOID DeviceExtension,
IN PVOID Context,
IN BOOLEAN SaveState);
typedef VOID DDKAPI
(*PHW_DMA_STARTED)(
IN PVOID DeviceExtension);
typedef struct _HW_INITIALIZATION_DATA
{
typedef BOOLEAN DDKAPI
(*PHW_STARTIO)(
IN PVOID DeviceExtension,
IN PSCSI_REQUEST_BLOCK Srb);
typedef VOID DDKAPI
(*PHW_TIMER)(
IN PVOID DeviceExtension);
typedef struct _HW_INITIALIZATION_DATA {
ULONG HwInitializationDataSize;
INTERFACE_TYPE AdapterInterfaceType;
PHW_INITIALIZE HwInitialize;
@ -297,7 +302,8 @@ typedef struct _HW_INITIALIZATION_DATA
PVOID Reserved;
BOOLEAN MapBuffers;
BOOLEAN NeedPhysicalAddresses;
BOOLEAN TaggedQueuing;
// BOOLEAN TaggedQueuing;
BOOLEAN TaggedQueueing;
BOOLEAN AutoRequestSense;
BOOLEAN MultipleRequestPerLu;
BOOLEAN ReceiveEvent;
@ -312,227 +318,362 @@ typedef struct _HW_INITIALIZATION_DATA
/* FUNCTIONS ****************************************************************/
VOID
ScsiDebugPrint(IN ULONG DebugPrintLevel,
IN PCHAR DebugMessage,
...);
DDKAPI
ScsiPortCompleteRequest(
IN PVOID HwDeviceExtension,
IN UCHAR PathId,
IN UCHAR TargetId,
IN UCHAR Lun,
IN UCHAR SrbStatus);
VOID STDCALL
ScsiPortCompleteRequest(IN PVOID HwDeviceExtension,
IN UCHAR PathId,
IN UCHAR TargetId,
IN UCHAR Lun,
IN UCHAR SrbStatus);
ULONG
DDKAPI
ScsiPortConvertPhysicalAddressToUlong(
IN SCSI_PHYSICAL_ADDRESS Address);
ULONG STDCALL
ScsiPortConvertPhysicalAddressToUlong(IN SCSI_PHYSICAL_ADDRESS Address);
SCSI_PHYSICAL_ADDRESS STDCALL
ScsiPortConvertUlongToPhysicalAddress(IN ULONG UlongAddress);
VOID STDCALL
ScsiPortFlushDma(IN PVOID HwDeviceExtension);
VOID STDCALL
ScsiPortFreeDeviceBase(IN PVOID HwDeviceExtension,
IN PVOID MappedAddress);
ULONG STDCALL
ScsiPortGetBusData(IN PVOID DeviceExtension,
IN ULONG BusDataType,
IN ULONG SystemIoBusNumber,
IN ULONG SlotNumber,
IN PVOID Buffer,
IN ULONG Length);
PVOID STDCALL
ScsiPortGetDeviceBase(IN PVOID HwDeviceExtension,
IN INTERFACE_TYPE BusType,
IN ULONG SystemIoBusNumber,
IN SCSI_PHYSICAL_ADDRESS IoAddress,
IN ULONG NumberOfBytes,
IN BOOLEAN InIoSpace);
PVOID STDCALL
ScsiPortGetLogicalUnit(IN PVOID HwDeviceExtension,
IN UCHAR PathId,
IN UCHAR TargetId,
IN UCHAR Lun);
SCSI_PHYSICAL_ADDRESS STDCALL
ScsiPortGetPhysicalAddress(IN PVOID HwDeviceExtension,
IN PSCSI_REQUEST_BLOCK Srb OPTIONAL,
IN PVOID VirtualAddress,
OUT PULONG Length);
PSCSI_REQUEST_BLOCK STDCALL
ScsiPortGetSrb(IN PVOID DeviceExtension,
IN UCHAR PathId,
IN UCHAR TargetId,
IN UCHAR Lun,
IN LONG QueueTag);
PVOID STDCALL
ScsiPortGetUncachedExtension(IN PVOID HwDeviceExtension,
IN PPORT_CONFIGURATION_INFORMATION ConfigInfo,
IN ULONG NumberOfBytes);
PVOID STDCALL
ScsiPortGetVirtualAddress(IN PVOID HwDeviceExtension,
IN SCSI_PHYSICAL_ADDRESS PhysicalAddress);
ULONG STDCALL
ScsiPortInitialize(IN PVOID Argument1,
IN PVOID Argument2,
IN struct _HW_INITIALIZATION_DATA *HwInitializationData,
IN PVOID HwContext);
VOID STDCALL
ScsiPortIoMapTransfer(IN PVOID HwDeviceExtension,
IN PSCSI_REQUEST_BLOCK Srb,
IN ULONG LogicalAddress,
IN ULONG Length);
VOID STDCALL
ScsiPortLogError(IN PVOID HwDeviceExtension,
IN PSCSI_REQUEST_BLOCK Srb OPTIONAL,
IN UCHAR PathId,
IN UCHAR TargetId,
IN UCHAR Lun,
IN ULONG ErrorCode,
IN ULONG UniqueId);
VOID STDCALL
ScsiPortMoveMemory(OUT PVOID Destination,
IN PVOID Source,
IN ULONG Length);
SCSIPORTAPI
SCSI_PHYSICAL_ADDRESS
DDKAPI
ScsiPortConvertUlongToPhysicalAddress(
IN ULONG UlongAddress);
SCSIPORTAPI
VOID
ScsiPortNotification(IN SCSI_NOTIFICATION_TYPE NotificationType,
IN PVOID HwDeviceExtension,
...);
DDKAPI
ScsiPortFlushDma(
IN PVOID HwDeviceExtension);
VOID STDCALL
ScsiPortReadPortBufferUchar(IN PUCHAR Port,
IN PUCHAR Value,
IN ULONG Count);
SCSIPORTAPI
VOID
DDKAPI
ScsiPortFreeDeviceBase(
IN PVOID HwDeviceExtension,
IN PVOID MappedAddress);
VOID STDCALL
ScsiPortReadPortBufferUlong(IN PULONG Port,
IN PULONG Value,
IN ULONG Count);
SCSIPORTAPI
ULONG
DDKAPI
ScsiPortGetBusData(
IN PVOID DeviceExtension,
IN ULONG BusDataType,
IN ULONG SystemIoBusNumber,
IN ULONG SlotNumber,
IN PVOID Buffer,
IN ULONG Length);
VOID STDCALL
ScsiPortReadPortBufferUshort(IN PUSHORT Port,
IN PUSHORT Value,
IN ULONG Count);
SCSIPORTAPI
PVOID
DDKAPI
ScsiPortGetDeviceBase(
IN PVOID HwDeviceExtension,
IN INTERFACE_TYPE BusType,
IN ULONG SystemIoBusNumber,
IN SCSI_PHYSICAL_ADDRESS IoAddress,
IN ULONG NumberOfBytes,
IN BOOLEAN InIoSpace);
UCHAR STDCALL
ScsiPortReadPortUchar(IN PUCHAR Port);
SCSIPORTAPI
PVOID
DDKAPI
ScsiPortGetLogicalUnit(
IN PVOID HwDeviceExtension,
IN UCHAR PathId,
IN UCHAR TargetId,
IN UCHAR Lun);
ULONG STDCALL
ScsiPortReadPortUlong(IN PULONG Port);
SCSIPORTAPI
SCSI_PHYSICAL_ADDRESS
DDKAPI
ScsiPortGetPhysicalAddress(
IN PVOID HwDeviceExtension,
IN PSCSI_REQUEST_BLOCK Srb OPTIONAL,
IN PVOID VirtualAddress,
OUT PULONG Length);
USHORT STDCALL
ScsiPortReadPortUshort(IN PUSHORT Port);
SCSIPORTAPI
PSCSI_REQUEST_BLOCK
DDKAPI
ScsiPortGetSrb(
IN PVOID DeviceExtension,
IN UCHAR PathId,
IN UCHAR TargetId,
IN UCHAR Lun,
IN LONG QueueTag);
VOID STDCALL
ScsiPortReadRegisterBufferUchar(IN PUCHAR Register,
IN PUCHAR Buffer,
IN ULONG Count);
SCSIPORTAPI
PVOID
DDKAPI
ScsiPortGetUncachedExtension(
IN PVOID HwDeviceExtension,
IN PPORT_CONFIGURATION_INFORMATION ConfigInfo,
IN ULONG NumberOfBytes);
VOID STDCALL
ScsiPortReadRegisterBufferUlong(IN PULONG Register,
IN PULONG Buffer,
IN ULONG Count);
SCSIPORTAPI
PVOID
DDKAPI
ScsiPortGetVirtualAddress(
IN PVOID HwDeviceExtension,
IN SCSI_PHYSICAL_ADDRESS PhysicalAddress);
VOID STDCALL
ScsiPortReadRegisterBufferUshort(IN PUSHORT Register,
IN PUSHORT Buffer,
IN ULONG Count);
SCSIPORTAPI
ULONG
DDKAPI
ScsiPortInitialize(
IN PVOID Argument1,
IN PVOID Argument2,
IN struct _HW_INITIALIZATION_DATA *HwInitializationData,
IN PVOID HwContext);
UCHAR STDCALL
ScsiPortReadRegisterUchar(IN PUCHAR Register);
SCSIPORTAPI
VOID
DDKAPI
ScsiPortIoMapTransfer(
IN PVOID HwDeviceExtension,
IN PSCSI_REQUEST_BLOCK Srb,
IN ULONG LogicalAddress,
IN ULONG Length);
ULONG STDCALL
ScsiPortReadRegisterUlong(IN PULONG Register);
SCSIPORTAPI
VOID
DDKAPI
ScsiPortLogError(
IN PVOID HwDeviceExtension,
IN PSCSI_REQUEST_BLOCK Srb OPTIONAL,
IN UCHAR PathId,
IN UCHAR TargetId,
IN UCHAR Lun,
IN ULONG ErrorCode,
IN ULONG UniqueId);
USHORT STDCALL
ScsiPortReadRegisterUshort(IN PUSHORT Register);
SCSIPORTAPI
VOID
DDKAPI
ScsiPortMoveMemory(
OUT PVOID Destination,
IN PVOID Source,
IN ULONG Length);
ULONG STDCALL
ScsiPortSetBusDataByOffset(IN PVOID DeviceExtension,
IN ULONG BusDataType,
IN ULONG SystemIoBusNumber,
IN ULONG SlotNumber,
IN PVOID Buffer,
IN ULONG Offset,
IN ULONG Length);
SCSIPORTAPI
VOID
ScsiPortNotification(
IN SCSI_NOTIFICATION_TYPE NotificationType,
IN PVOID HwDeviceExtension,
...);
VOID STDCALL
ScsiPortStallExecution(IN ULONG MicroSeconds);
SCSIPORTAPI
VOID
DDKAPI
ScsiPortReadPortBufferUchar(
IN PUCHAR Port,
IN PUCHAR Value,
IN ULONG Count);
BOOLEAN STDCALL
ScsiPortValidateRange(IN PVOID HwDeviceExtension,
IN INTERFACE_TYPE BusType,
IN ULONG SystemIoBusNumber,
IN SCSI_PHYSICAL_ADDRESS IoAddress,
IN ULONG NumberOfBytes,
IN BOOLEAN InIoSpace);
SCSIPORTAPI
VOID
DDKAPI
ScsiPortReadPortBufferUlong(
IN PULONG Port,
IN PULONG Value,
IN ULONG Count);
VOID STDCALL
ScsiPortWritePortBufferUchar(IN PUCHAR Port,
IN PUCHAR Buffer,
IN ULONG Count);
SCSIPORTAPI
VOID
DDKAPI
ScsiPortReadPortBufferUshort(
IN PUSHORT Port,
IN PUSHORT Value,
IN ULONG Count);
VOID STDCALL
ScsiPortWritePortBufferUlong(IN PULONG Port,
IN PULONG Buffer,
IN ULONG Count);
SCSIPORTAPI
UCHAR
DDKAPI
ScsiPortReadPortUchar(
IN PUCHAR Port);
VOID STDCALL
ScsiPortWritePortBufferUshort(IN PUSHORT Port,
IN PUSHORT Value,
IN ULONG Count);
SCSIPORTAPI
ULONG
DDKAPI
ScsiPortReadPortUlong(
IN PULONG Port);
VOID STDCALL
ScsiPortWritePortUchar(IN PUCHAR Port,
IN UCHAR Value);
SCSIPORTAPI
USHORT
DDKAPI
ScsiPortReadPortUshort(
IN PUSHORT Port);
VOID STDCALL
ScsiPortWritePortUlong(IN PULONG Port,
IN ULONG Value);
SCSIPORTAPI
VOID
DDKAPI
ScsiPortReadRegisterBufferUchar(
IN PUCHAR Register,
IN PUCHAR Buffer,
IN ULONG Count);
VOID STDCALL
ScsiPortWritePortUshort(IN PUSHORT Port,
SCSIPORTAPI
VOID
DDKAPI
ScsiPortReadRegisterBufferUlong(
IN PULONG Register,
IN PULONG Buffer,
IN ULONG Count);
SCSIPORTAPI
VOID
DDKAPI
ScsiPortReadRegisterBufferUshort(
IN PUSHORT Register,
IN PUSHORT Buffer,
IN ULONG Count);
SCSIPORTAPI
UCHAR
DDKAPI
ScsiPortReadRegisterUchar(
IN PUCHAR Register);
SCSIPORTAPI
ULONG
DDKAPI
ScsiPortReadRegisterUlong(
IN PULONG Register);
SCSIPORTAPI
USHORT
DDKAPI
ScsiPortReadRegisterUshort(
IN PUSHORT Register);
SCSIPORTAPI
ULONG
DDKAPI
ScsiPortSetBusDataByOffset(
IN PVOID DeviceExtension,
IN ULONG BusDataType,
IN ULONG SystemIoBusNumber,
IN ULONG SlotNumber,
IN PVOID Buffer,
IN ULONG Offset,
IN ULONG Length);
SCSIPORTAPI
VOID
DDKAPI
ScsiPortStallExecution(
IN ULONG MicroSeconds);
SCSIPORTAPI
BOOLEAN
DDKAPI
ScsiPortValidateRange(
IN PVOID HwDeviceExtension,
IN INTERFACE_TYPE BusType,
IN ULONG SystemIoBusNumber,
IN SCSI_PHYSICAL_ADDRESS IoAddress,
IN ULONG NumberOfBytes,
IN BOOLEAN InIoSpace);
SCSIPORTAPI
VOID
DDKAPI
ScsiPortWritePortBufferUchar(
IN PUCHAR Port,
IN PUCHAR Buffer,
IN ULONG Count);
SCSIPORTAPI
VOID
DDKAPI
ScsiPortWritePortBufferUlong(
IN PULONG Port,
IN PULONG Buffer,
IN ULONG Count);
SCSIPORTAPI
VOID
DDKAPI
ScsiPortWritePortBufferUshort(
IN PUSHORT Port,
IN PUSHORT Value,
IN ULONG Count);
SCSIPORTAPI
VOID
DDKAPI
ScsiPortWritePortUchar(
IN PUCHAR Port,
IN UCHAR Value);
SCSIPORTAPI
VOID
DDKAPI
ScsiPortWritePortUlong(
IN PULONG Port,
IN ULONG Value);
SCSIPORTAPI
VOID
DDKAPI
ScsiPortWritePortUshort(
IN PUSHORT Port,
IN USHORT Value);
VOID STDCALL
ScsiPortWriteRegisterBufferUchar(IN PUCHAR Register,
IN PUCHAR Buffer,
IN ULONG Count);
SCSIPORTAPI
VOID
DDKAPI
ScsiPortWriteRegisterBufferUchar(
IN PUCHAR Register,
IN PUCHAR Buffer,
IN ULONG Count);
VOID STDCALL
ScsiPortWriteRegisterBufferUlong(IN PULONG Register,
IN PULONG Buffer,
IN ULONG Count);
SCSIPORTAPI
VOID
DDKAPI
ScsiPortWriteRegisterBufferUlong(
IN PULONG Register,
IN PULONG Buffer,
IN ULONG Count);
VOID STDCALL
ScsiPortWriteRegisterBufferUshort(IN PUSHORT Register,
IN PUSHORT Buffer,
IN ULONG Count);
SCSIPORTAPI
VOID
DDKAPI
ScsiPortWriteRegisterBufferUshort(
IN PUSHORT Register,
IN PUSHORT Buffer,
IN ULONG Count);
VOID STDCALL
ScsiPortWriteRegisterUchar(IN PUCHAR Register,
IN ULONG Value);
SCSIPORTAPI
VOID
DDKAPI
ScsiPortWriteRegisterUchar(
IN PUCHAR Register,
IN ULONG Value);
VOID STDCALL
ScsiPortWriteRegisterUlong(IN PULONG Register,
IN ULONG Value);
SCSIPORTAPI
VOID
DDKAPI
ScsiPortWriteRegisterUlong(
IN PULONG Register,
IN ULONG Value);
VOID STDCALL
ScsiPortWriteRegisterUshort(IN PUSHORT Register,
IN USHORT Value);
SCSIPORTAPI
VOID
DDKAPI
ScsiPortWriteRegisterUshort(
IN PUSHORT Register,
IN USHORT Value);
SCSIPORTAPI
VOID
ScsiDebugPrint(
IN ULONG DebugPrintLevel,
IN PCHAR DebugMessage,
IN ...);
#pragma pack(pop)
#ifdef __cplusplus
}
#endif
#endif /* __STORAGE_INCLUDE_SRB_H */
/* EOF */

File diff suppressed because it is too large Load diff

View file

@ -37,96 +37,6 @@ typedef struct _NET_PNP_TRANSLATE_LIST
} NET_PNP_TRANSLATE_LIST, *PNET_PNP_TRANSLATE_LIST;
/* Generel objects */
/* General operational characteristics */
/* Mandatory */
#define OID_GEN_SUPPORTED_LIST 0x00010101
#define OID_GEN_HARDWARE_STATUS 0x00010102
#define OID_GEN_MEDIA_SUPPORTED 0x00010103
#define OID_GEN_MEDIA_IN_USE 0x00010104
#define OID_GEN_MAXIMUM_LOOKAHEAD 0x00010105
#define OID_GEN_MAXIMUM_FRAME_SIZE 0x00010106
#define OID_GEN_LINK_SPEED 0x00010107
#define OID_GEN_TRANSMIT_BUFFER_SPACE 0x00010108
#define OID_GEN_RECEIVE_BUFFER_SPACE 0x00010109
#define OID_GEN_TRANSMIT_BLOCK_SIZE 0x0001010A
#define OID_GEN_RECEIVE_BLOCK_SIZE 0x0001010B
#define OID_GEN_VENDOR_ID 0x0001010C
#define OID_GEN_VENDOR_DESCRIPTION 0x0001010D
#define OID_GEN_CURRENT_PACKET_FILTER 0x0001010E
#define OID_GEN_CURRENT_LOOKAHEAD 0x0001010F
#define OID_GEN_DRIVER_VERSION 0x00010110
#define OID_GEN_MAXIMUM_TOTAL_SIZE 0x00010111
#define OID_GEN_PROTOCOL_OPTIONS 0x00010112
#define OID_GEN_MAC_OPTIONS 0x00010113
#define OID_GEN_MEDIA_CONNECT_STATUS 0x00010114
#define OID_GEN_MAXIMUM_SEND_PACKETS 0x00010115
#define OID_GEN_VENDOR_DRIVER_VERSION 0x00010116
/* Optional */
#define OID_GEN_SUPPORTED_GUIDS 0x00010117
#define OID_GEN_NETWORK_LAYER_ADDRESSES 0x00010118
#define OID_GEN_TRANSPORT_HEADER_OFFSET 0x00010119
/* General statistics */
/* Mandatory */
#define OID_GEN_XMIT_OK 0x00020101
#define OID_GEN_RCV_OK 0x00020102
#define OID_GEN_XMIT_ERROR 0x00020103
#define OID_GEN_RCV_ERROR 0x00020104
#define OID_GEN_RCV_NO_BUFFER 0x00020105
/* Optional */
#define OID_GEN_DIRECTED_BYTES_XMIT 0x00020201
#define OID_GEN_DIRECTED_FRAMES_XMIT 0x00020202
#define OID_GEN_MULTICAST_BYTES_XMIT 0x00020203
#define OID_GEN_MULTICAST_FRAMES_XMIT 0x00020204
#define OID_GEN_BROADCAST_BYTES_XMIT 0x00020205
#define OID_GEN_BROADCAST_FRAMES_XMIT 0x00020206
#define OID_GEN_DIRECTED_BYTES_RCV 0x00020207
#define OID_GEN_DIRECTED_FRAMES_RCV 0x00020208
#define OID_GEN_MULTICAST_BYTES_RCV 0x00020209
#define OID_GEN_MULTICAST_FRAMES_RCV 0x0002020A
#define OID_GEN_BROADCAST_BYTES_RCV 0x0002020B
#define OID_GEN_BROADCAST_FRAMES_RCV 0x0002020C
#define OID_GEN_RCV_CRC_ERROR 0x0002020D
#define OID_GEN_TRANSMIT_QUEUE_LENGTH 0x0002020E
/* Ethernet objects */
/* Ethernet operational characteristics */
/* Mandatory */
#define OID_802_3_PERMANENT_ADDRESS 0x01010101
#define OID_802_3_CURRENT_ADDRESS 0x01010102
#define OID_802_3_MULTICAST_LIST 0x01010103
#define OID_802_3_MAXIMUM_LIST_SIZE 0x01010104
/* Optional */
#define OID_802_3_MAC_OPTIONS 0x01010105
/* Ethernet statistics */
/* Mandatory */
#define OID_802_3_RCV_ERROR_ALIGNMENT 0x01020101
#define OID_802_3_XMIT_ONE_COLLISION 0x01020102
#define OID_802_3_XMIT_MORE_COLLISIONS 0x01020103
/* Optional */
#define OID_802_3_XMIT_DEFERRED 0x01020201
#define OID_802_3_XMIT_MAX_COLLISIONS 0x01020202
#define OID_802_3_RCV_OVERRUN 0x01020203
#define OID_802_3_XMIT_UNDERRUN 0x01020204
#define OID_802_3_XMIT_HEARTBEAT_FAILURE 0x01020205
#define OID_802_3_XMIT_TIMES_CRS_LOST 0x01020206
#define OID_802_3_XMIT_LATE_COLLISIONS 0x01020207
/* Token Ring objects */
/* Token Ring operational characteristics */
@ -418,5 +328,3 @@ typedef struct _NET_PNP_TRANSLATE_LIST
/* EOF */

View file

@ -1,18 +1,42 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS NDIS library
* FILE: include/net/netevent.h
* PURPOSE: Network event constants
* netevent.h
*
* Network events
*
* 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 __NETEVENT_H
#define __NETEVENT_H
#if __GNUC__ >=3
#pragma GCC system_header
#endif
#define EVENT_TRANSPORT_REGISTER_FAILED 0xC000232CL
#define EVENT_TRANSPORT_ADAPTER_NOT_FOUND 0xC000232EL
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif /* __NETEVENT_H */
/* EOF */

View file

@ -0,0 +1,73 @@
/*
* netpnp.h
*
* Network Plug and Play event support
*
* 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 __NETPNP_H
#define __NETPNP_H
#if __GNUC__ >=3
#pragma GCC system_header
#endif
#ifdef __cplusplus
extern "C" {
#endif
#pragma pack(push,4)
typedef enum _NET_PNP_EVENT_CODE {
NetEventSetPower,
NetEventQueryPower,
NetEventQueryRemoveDevice,
NetEventCancelRemoveDevice,
NetEventReconfigure,
NetEventBindList,
NetEventBindsComplete,
NetEventPnPCapabilities,
NetEventMaximum
} NET_PNP_EVENT_CODE, *PNET_PNP_EVENT_CODE;
typedef struct _NET_PNP_EVENT {
NET_PNP_EVENT_CODE NetEvent;
PVOID Buffer;
ULONG BufferLength;
ULONG_PTR NdisReserved[4];
ULONG_PTR TransportReserved[4];
ULONG_PTR TdiReserved[4];
ULONG_PTR TdiClientReserved[4];
} NET_PNP_EVENT, *PNET_PNP_EVENT;
typedef enum _NET_DEVICE_POWER_STATE {
NetDeviceStateUnspecified,
NetDeviceStateD0,
NetDeviceStateD1,
NetDeviceStateD2,
NetDeviceStateD3,
NetDeviceStateMaximum
} NET_DEVICE_POWER_STATE, *PNET_DEVICE_POWER_STATE;
#pragma pack(pop)
#ifdef __cplusplus
}
#endif
#endif /* __NETPNP_H */

View file

@ -1,16 +1,49 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS NDIS library
* FILE: include/net/ntddndis.h
* PURPOSE: Structures for accessing NDIS devices
* ntddndis.h
*
* NDIS device driver interface
*
* 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 __NTDDNDIS_H
#define __NIDDNDIS_H
#define __NTDDNDIS_H
#include <net/ndisoid.h>
#if __GNUC__ >=3
#pragma GCC system_header
#endif
typedef enum _NDIS_DEVICE_POWER_STATE
{
#pragma pack(push,4)
#include "ntddk.h"
//#include <net/ndisoid.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef enum _NDIS_WAN_QUALITY {
NdisWanRaw,
NdisWanErrorControl,
NdisWanReliable
} NDIS_WAN_QUALITY, *PNDIS_WAN_QUALITY;
typedef enum _NDIS_DEVICE_POWER_STATE {
NdisDeviceStateUnspecified = 0,
NdisDeviceStateD0,
NdisDeviceStateD1,
@ -19,21 +52,139 @@ typedef enum _NDIS_DEVICE_POWER_STATE
NdisDeviceStateMaximum
} NDIS_DEVICE_POWER_STATE, *PNDIS_DEVICE_POWER_STATE;
typedef struct _NDIS_PM_WAKE_UP_CAPABILITIES
{
typedef struct _NDIS_PM_WAKE_UP_CAPABILITIES {
NDIS_DEVICE_POWER_STATE MinMagicPacketWakeUp;
NDIS_DEVICE_POWER_STATE MinPatternWakeUp;
NDIS_DEVICE_POWER_STATE MinLinkChangeWakeUp;
} NDIS_PM_WAKE_UP_CAPABILITIES, *PNDIS_PM_WAKE_UP_CAPABILITIES;
typedef struct _NDIS_PNP_CAPABILITIES
{
/* NDIS_PNP_CAPABILITIES.Flags constants */
#define NDIS_DEVICE_WAKE_UP_ENABLE 0x00000001
#define NDIS_DEVICE_WAKE_ON_PATTERN_MATCH_ENABLE 0x00000002
#define NDIS_DEVICE_WAKE_ON_MAGIC_PACKET_ENABLE 0x00000004
typedef struct _NDIS_PNP_CAPABILITIES {
ULONG Flags;
NDIS_PM_WAKE_UP_CAPABILITIES WakeUpCapabilities;
} NDIS_PNP_CAPABILITIES, *PNDIS_PNP_CAPABILITIES;
/* Required Object IDs (OIDs) */
#define OID_GEN_SUPPORTED_LIST 0x00010101
#define OID_GEN_HARDWARE_STATUS 0x00010102
#define OID_GEN_MEDIA_SUPPORTED 0x00010103
#define OID_GEN_MEDIA_IN_USE 0x00010104
#define OID_GEN_MAXIMUM_LOOKAHEAD 0x00010105
#define OID_GEN_MAXIMUM_FRAME_SIZE 0x00010106
#define OID_GEN_LINK_SPEED 0x00010107
#define OID_GEN_TRANSMIT_BUFFER_SPACE 0x00010108
#define OID_GEN_RECEIVE_BUFFER_SPACE 0x00010109
#define OID_GEN_TRANSMIT_BLOCK_SIZE 0x0001010A
#define OID_GEN_RECEIVE_BLOCK_SIZE 0x0001010B
#define OID_GEN_VENDOR_ID 0x0001010C
#define OID_GEN_VENDOR_DESCRIPTION 0x0001010D
#define OID_GEN_CURRENT_PACKET_FILTER 0x0001010E
#define OID_GEN_CURRENT_LOOKAHEAD 0x0001010F
#define OID_GEN_DRIVER_VERSION 0x00010110
#define OID_GEN_MAXIMUM_TOTAL_SIZE 0x00010111
#define OID_GEN_PROTOCOL_OPTIONS 0x00010112
#define OID_GEN_MAC_OPTIONS 0x00010113
#define OID_GEN_MEDIA_CONNECT_STATUS 0x00010114
#define OID_GEN_MAXIMUM_SEND_PACKETS 0x00010115
#define OID_GEN_VENDOR_DRIVER_VERSION 0x00010116
#define OID_GEN_SUPPORTED_GUIDS 0x00010117
#define OID_GEN_NETWORK_LAYER_ADDRESSES 0x00010118
#define OID_GEN_TRANSPORT_HEADER_OFFSET 0x00010119
#define OID_GEN_MACHINE_NAME 0x0001021A
#define OID_GEN_RNDIS_CONFIG_PARAMETER 0x0001021B
#define OID_GEN_VLAN_ID 0x0001021C
/* Optional OIDs */
#define OID_GEN_MEDIA_CAPABILITIES 0x00010201
#define OID_GEN_PHYSICAL_MEDIUM 0x00010202
/* Required statistics OIDs */
#define OID_GEN_XMIT_OK 0x00020101
#define OID_GEN_RCV_OK 0x00020102
#define OID_GEN_XMIT_ERROR 0x00020103
#define OID_GEN_RCV_ERROR 0x00020104
#define OID_GEN_RCV_NO_BUFFER 0x00020105
/* Optional statistics OIDs */
#define OID_GEN_DIRECTED_BYTES_XMIT 0x00020201
#define OID_GEN_DIRECTED_FRAMES_XMIT 0x00020202
#define OID_GEN_MULTICAST_BYTES_XMIT 0x00020203
#define OID_GEN_MULTICAST_FRAMES_XMIT 0x00020204
#define OID_GEN_BROADCAST_BYTES_XMIT 0x00020205
#define OID_GEN_BROADCAST_FRAMES_XMIT 0x00020206
#define OID_GEN_DIRECTED_BYTES_RCV 0x00020207
#define OID_GEN_DIRECTED_FRAMES_RCV 0x00020208
#define OID_GEN_MULTICAST_BYTES_RCV 0x00020209
#define OID_GEN_MULTICAST_FRAMES_RCV 0x0002020A
#define OID_GEN_BROADCAST_BYTES_RCV 0x0002020B
#define OID_GEN_BROADCAST_FRAMES_RCV 0x0002020C
#define OID_GEN_RCV_CRC_ERROR 0x0002020D
#define OID_GEN_TRANSMIT_QUEUE_LENGTH 0x0002020E
#define OID_GEN_GET_TIME_CAPS 0x0002020F
#define OID_GEN_GET_NETCARD_TIME 0x00020210
#define OID_GEN_NETCARD_LOAD 0x00020211
#define OID_GEN_DEVICE_PROFILE 0x00020212
#define OID_GEN_INIT_TIME_MS 0x00020213
#define OID_GEN_RESET_COUNTS 0x00020214
#define OID_GEN_MEDIA_SENSE_COUNTS 0x00020215
#define OID_GEN_FRIENDLY_NAME 0x00020216
#define OID_GEN_MINIPORT_INFO 0x00020217
#define OID_GEN_RESET_VERIFY_PARAMETERS 0x00020218
/* IEEE 802.3 (Ethernet) OIDs */
#define NDIS_802_3_MAC_OPTION_PRIORITY 0x00000001
#define OID_802_3_PERMANENT_ADDRESS 0x01010101
#define OID_802_3_CURRENT_ADDRESS 0x01010102
#define OID_802_3_MULTICAST_LIST 0x01010103
#define OID_802_3_MAXIMUM_LIST_SIZE 0x01010104
#define OID_802_3_MAC_OPTIONS 0x01010105
#define OID_802_3_RCV_ERROR_ALIGNMENT 0x01020101
#define OID_802_3_XMIT_ONE_COLLISION 0x01020102
#define OID_802_3_XMIT_MORE_COLLISIONS 0x01020103
#define OID_802_3_XMIT_DEFERRED 0x01020201
#define OID_802_3_XMIT_MAX_COLLISIONS 0x01020202
#define OID_802_3_RCV_OVERRUN 0x01020203
#define OID_802_3_XMIT_UNDERRUN 0x01020204
#define OID_802_3_XMIT_HEARTBEAT_FAILURE 0x01020205
#define OID_802_3_XMIT_TIMES_CRS_LOST 0x01020206
#define OID_802_3_XMIT_LATE_COLLISIONS 0x01020207
/* OID_GEN_MINIPORT_INFO constants */
#define NDIS_MINIPORT_BUS_MASTER 0x00000001
#define NDIS_MINIPORT_WDM_DRIVER 0x00000002
#define NDIS_MINIPORT_SG_LIST 0x00000004
#define NDIS_MINIPORT_SUPPORTS_MEDIA_QUERY 0x00000008
#define NDIS_MINIPORT_INDICATES_PACKETS 0x00000010
#define NDIS_MINIPORT_IGNORE_PACKET_QUEUE 0x00000020
#define NDIS_MINIPORT_IGNORE_REQUEST_QUEUE 0x00000040
#define NDIS_MINIPORT_IGNORE_TOKEN_RING_ERRORS 0x00000080
#define NDIS_MINIPORT_INTERMEDIATE_DRIVER 0x00000100
#define NDIS_MINIPORT_IS_NDIS_5 0x00000200
#define NDIS_MINIPORT_IS_CO 0x00000400
#define NDIS_MINIPORT_DESERIALIZE 0x00000800
#define NDIS_MINIPORT_REQUIRES_MEDIA_POLLING 0x00001000
#define NDIS_MINIPORT_SUPPORTS_MEDIA_SENSE 0x00002000
#define NDIS_MINIPORT_NETBOOT_CARD 0x00004000
#define NDIS_MINIPORT_PM_SUPPORTED 0x00008000
#define NDIS_MINIPORT_SUPPORTS_MAC_ADDRESS_OVERWRITE 0x00010000
#define NDIS_MINIPORT_USES_SAFE_BUFFER_APIS 0x00020000
#define NDIS_MINIPORT_HIDDEN 0x00040000
#define NDIS_MINIPORT_SWENUM 0x00080000
#define NDIS_MINIPORT_SURPRISE_REMOVE_OK 0x00100000
#define NDIS_MINIPORT_NO_HALT_ON_SUSPEND 0x00200000
#define NDIS_MINIPORT_HARDWARE_DEVICE 0x00400000
#define NDIS_MINIPORT_SUPPORTS_CANCEL_SEND_PACKETS 0x00800000
#define NDIS_MINIPORT_64BITS_DMA 0x01000000
#pragma pack(pop)
#ifdef __cplusplus
}
#endif
#endif /* __NTDDNDIS_H */
/* EOF */

View file

@ -0,0 +1,66 @@
/*
* ntddtdi.h
*
* TDI IOCTL interface
*
* 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 __NTDDTDI_H
#define __NTDDTDI_H
#if __GNUC__ >=3
#pragma GCC system_header
#endif
#ifdef __cplusplus
extern "C" {
#endif
#pragma pack(push,4)
#include "ntddk.h"
#define DD_TDI_DEVICE_NAME "\\Device\\UNKNOWN"
#define DD_TDI_DEVICE_NAME_U L"\\Device\\UNKNOWN"
#define _TDI_CONTROL_CODE(Request, Method) \
CTL_CODE(FILE_DEVICE_TRANSPORT, Request, Method, FILE_ANY_ACCESS)
#define IOCTL_TDI_ACCEPT _TDI_CONTROL_CODE(0, METHOD_BUFFERED)
#define IOCTL_TDI_CONNECT _TDI_CONTROL_CODE(1, METHOD_BUFFERED)
#define IOCTL_TDI_DISCONNECT _TDI_CONTROL_CODE(2, METHOD_BUFFERED)
#define IOCTL_TDI_LISTEN _TDI_CONTROL_CODE(3, METHOD_BUFFERED)
#define IOCTL_TDI_QUERY_INFORMATION _TDI_CONTROL_CODE(4, METHOD_OUT_DIRECT)
#define IOCTL_TDI_RECEIVE _TDI_CONTROL_CODE(5, METHOD_OUT_DIRECT)
#define IOCTL_TDI_RECEIVE_DATAGRAM _TDI_CONTROL_CODE(6, METHOD_OUT_DIRECT)
#define IOCTL_TDI_SEND _TDI_CONTROL_CODE(7, METHOD_IN_DIRECT)
#define IOCTL_TDI_SEND_DATAGRAM _TDI_CONTROL_CODE(8, METHOD_IN_DIRECT)
#define IOCTL_TDI_SET_EVENT_HANDLER _TDI_CONTROL_CODE(9, METHOD_BUFFERED)
#define IOCTL_TDI_SET_INFORMATION _TDI_CONTROL_CODE(10, METHOD_IN_DIRECT)
#define IOCTL_TDI_ASSOCIATE_ADDRESS _TDI_CONTROL_CODE(11, METHOD_BUFFERED)
#define IOCTL_TDI_DISASSOCIATE_ADDRESS _TDI_CONTROL_CODE(12, METHOD_BUFFERED)
#define IOCTL_TDI_ACTION _TDI_CONTROL_CODE(13, METHOD_OUT_DIRECT)
#pragma pack(pop)
#ifdef __cplusplus
}
#endif
#endif /* __NTDDTDI_H */

View file

@ -1,12 +1,43 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS TDI library
* FILE: include/net/tdi.h
* PURPOSE: TDI definitions for user mode clients
* tdi.h
*
* TDI user mode definitions
*
* 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 __TDI_H
#define __TDI_H
#if __GNUC__ >=3
#pragma GCC system_header
#endif
#ifdef __cplusplus
extern "C" {
#endif
#pragma pack(push,4)
#include "ntddk.h"
#include "ntddtdi.h"
#include "tdistat.h"
#include "netpnp.h"
/* FIXME: Missed some definitions in ntddk.h */
/* Could be defined elsewhere
@ -16,80 +47,6 @@
*/
/* Basic types */
typedef LONG TDI_STATUS;
typedef PVOID CONNECTION_CONTEXT;
/* TDI status codes */
#define TDI_SUCCESS STATUS_SUCCESS
#define TDI_NO_RESOURCES STATUS_INSUFFICIENT_RESOURCES
#define TDI_ADDR_IN_USE STATUS_ADDRESS_ALREADY_EXISTS
#define TDI_BAD_ADDR STATUS_INVALID_ADDRESS_COMPONENT
#define TDI_NO_FREE_ADDR STATUS_TOO_MANY_ADDRESSES
#define TDI_ADDR_INVALID STATUS_INVALID_ADDRESS
#define TDI_ADDR_DELETED STATUS_ADDRESS_CLOSED
#define TDI_BUFFER_OVERFLOW STATUS_BUFFER_OVERFLOW
#define TDI_BAD_EVENT_TYPE STATUS_INVALID_PARAMETER
#define TDI_BAD_OPTION STATUS_INVALID_PARAMETER
#define TDI_CONN_REFUSED STATUS_CONNECTION_REFUSED
#define TDI_INVALID_CONNECTION STATUS_CONNECTION_INVALID
#define TDI_ALREADY_ASSOCIATED STATUS_ADDRESS_ALREADY_ASSOCIATED
#define TDI_NOT_ASSOCIATED STATUS_ADDRESS_NOT_ASSOCIATED
#define TDI_CONNECTION_ACTIVE STATUS_CONNECTION_ACTIVE
#define TDI_CONNECTION_ABORTED STATUS_CONNECTION_ABORTED
#define TDI_CONNECTION_RESET STATUS_CONNECTION_RESET
#define TDI_TIMED_OUT STATUS_IO_TIMEOUT
#define TDI_GRACEFUL_DISC STATUS_GRACEFUL_DISCONNECT
#define TDI_NOT_ACCEPTED STATUS_DATA_NOT_ACCEPTED
#define TDI_MORE_PROCESSING STATUS_MORE_PROCESSING_REQUIRED
#define TDI_INVALID_STATE STATUS_INVALID_DEVICE_STATE
#define TDI_INVALID_PARAMETER STATUS_INVALID_PARAMETER
#define TDI_DEST_NET_UNREACH STATUS_NETWORK_UNREACHABLE
#define TDI_DEST_HOST_UNREACH STATUS_HOST_UNREACHABLE
#define TDI_DEST_UNREACHABLE TDI_DEST_HOST_UNREACH
#define TDI_DEST_PROT_UNREACH STATUS_PROTOCOL_UNREACHABLE
#define TDI_DEST_PORT_UNREACH STATUS_PORT_UNREACHABLE
#define TDI_INVALID_QUERY STATUS_INVALID_DEVICE_REQUEST
#define TDI_REQ_ABORTED STATUS_REQUEST_ABORTED
#define TDI_BUFFER_TOO_SMALL STATUS_BUFFER_TOO_SMALL
#define TDI_CANCELLED STATUS_CANCELLED
#define TDI_BUFFER_TOO_BIG STATUS_INVALID_BUFFER_SIZE
#define TDI_INVALID_REQUEST STATUS_INVALID_DEVICE_REQUEST
#define TDI_PENDING STATUS_PENDING
#define TDI_ITEM_NOT_FOUND STATUS_OBJECT_NAME_NOT_FOUND
#define TDI_OPTION_EOL 0
#define TDI_ADDRESS_OPTION_REUSE 1
#define TDI_ADDRESS_OPTION_DHCP 2
/* TDI IOCTL codes */
#define TDI_CONTROL_CODE(Request, Method) \
CTL_CODE(FILE_DEVICE_TRANSPORT, Request, Method, FILE_ANY_ACCESS)
#define IOCTL_TDI_ACCEPT TDI_CONTROL_CODE(0, METHOD_BUFFERED)
#define IOCTL_TDI_CONNECT TDI_CONTROL_CODE(1, METHOD_BUFFERED)
#define IOCTL_TDI_DISCONNECT TDI_CONTROL_CODE(2, METHOD_BUFFERED)
#define IOCTL_TDI_LISTEN TDI_CONTROL_CODE(3, METHOD_BUFFERED)
#define IOCTL_TDI_QUERY_INFORMATION TDI_CONTROL_CODE(4, METHOD_OUT_DIRECT)
#define IOCTL_TDI_RECEIVE TDI_CONTROL_CODE(5, METHOD_OUT_DIRECT)
#define IOCTL_TDI_RECEIVE_DATAGRAM TDI_CONTROL_CODE(6, METHOD_OUT_DIRECT)
#define IOCTL_TDI_SEND TDI_CONTROL_CODE(7, METHOD_IN_DIRECT)
#define IOCTL_TDI_SEND_DATAGRAM TDI_CONTROL_CODE(8, METHOD_IN_DIRECT)
#define IOCTL_TDI_SET_EVENT_HANDLER TDI_CONTROL_CODE(9, METHOD_BUFFERED)
#define IOCTL_TDI_SET_INFORMATION TDI_CONTROL_CODE(10, METHOD_IN_DIRECT)
#define IOCTL_TDI_ASSOCIATE_ADDRESS TDI_CONTROL_CODE(11, METHOD_BUFFERED)
#define IOCTL_TDI_DISASSOCIATE_ADDRESS TDI_CONTROL_CODE(12, METHOD_BUFFERED)
#define IOCTL_TDI_ACTION TDI_CONTROL_CODE(13, METHOD_OUT_DIRECT)
/* TDI transport driver dispatch routines */
NTSTATUS TdiDispatchCleanup(
@ -125,10 +82,12 @@ NTSTATUS TdiDispatchInternalDeviceControl(
/* TDI structures */
/* Basic types */
typedef struct _TDI_CONNECTION_INFORMATION
{
typedef LONG TDI_STATUS;
typedef PVOID CONNECTION_CONTEXT;
typedef struct _TDI_CONNECTION_INFORMATION {
LONG UserDataLength;
PVOID UserData;
LONG OptionsLength;
@ -137,8 +96,7 @@ typedef struct _TDI_CONNECTION_INFORMATION
PVOID RemoteAddress;
} TDI_CONNECTION_INFORMATION, *PTDI_CONNECTION_INFORMATION;
typedef struct _TDI_REQUEST
{
typedef struct _TDI_REQUEST {
union {
HANDLE AddressHandle;
CONNECTION_CONTEXT ConnectionContext;
@ -149,16 +107,13 @@ typedef struct _TDI_REQUEST
TDI_STATUS TdiStatus;
} TDI_REQUEST, *PTDI_REQUEST;
typedef struct _TDI_REQUEST_STATUS
{
typedef struct _TDI_REQUEST_STATUS {
TDI_STATUS Status;
PVOID RequestContext;
ULONG BytesTransferred;
} TDI_REQUEST_STATUS, *PTDI_REQUEST_STATUS;
typedef struct _TA_ADDRESS
{
typedef struct _TA_ADDRESS {
USHORT AddressLength;
USHORT AddressType;
UCHAR Address[1];
@ -188,40 +143,37 @@ typedef struct _TA_ADDRESS
#define TDI_ADDRESS_TYPE_NETONE 20
#define TDI_ADDRESS_TYPE_VNS 21
#define TDI_ADDRESS_TYPE_NETBIOS_EX 22
#define TDI_ADDRESS_TYPE_IP6 23
#define TDI_ADDRESS_TYPE_NETBIOS_UNICODE_EX 24
#define TdiTransportAddress "TransportAddress"
#define TdiConnectionContext "ConnectionContext"
#define TDI_TRANSPORT_ADDRESS_LENGTH (sizeof(TdiTransportAddress) - 1)
#define TDI_CONNECTION_CONTEXT_LENGTH (sizeof(TdiConnectionContext) - 1)
typedef struct _TRANSPORT_ADDRESS
{
typedef struct _TRANSPORT_ADDRESS {
LONG TAAddressCount;
TA_ADDRESS Address[1];
} TRANSPORT_ADDRESS, *PTRANSPORT_ADDRESS;
typedef struct _TDI_ADDRESS_INFO
{
typedef struct _TDI_ADDRESS_INFO {
ULONG ActivityCount;
TRANSPORT_ADDRESS Address;
} TDI_ADDRESS_INFO, *PTDI_ADDRESS_INFO;
typedef struct _TDI_ACTION_HEADER
{
typedef struct _TDI_ACTION_HEADER {
ULONG TransportId;
USHORT ActionCode;
USHORT Reserved;
} TDI_ACTION_HEADER, *PTDI_ACTION_HEADER;
typedef struct _TDI_ADDRESS_8022
{
typedef struct _TDI_ADDRESS_8022 {
UCHAR MACAddress[6];
} TDI_ADDRESS_8022, *PTDI_ADDRESS_8022;
typedef struct _TDI_ADDRESS_APPLETALK
{
#define TDI_ADDRESS_LENGTH_8022 sizeof(TDI_ADDRESS_8022);
typedef struct _TDI_ADDRESS_APPLETALK {
USHORT Network;
UCHAR Node;
UCHAR Socket;
@ -229,8 +181,7 @@ typedef struct _TDI_ADDRESS_APPLETALK
#define TDI_ADDRESS_LENGTH_APPLETALK sizeof(TDI_ADDRESS_APPLETALK)
typedef struct _TDI_ADDRESS_IP
{
typedef struct _TDI_ADDRESS_IP {
USHORT sin_port;
ULONG in_addr;
UCHAR sin_zero[8];
@ -238,8 +189,7 @@ typedef struct _TDI_ADDRESS_IP
#define TDI_ADDRESS_LENGTH_IP sizeof(TDI_ADDRESS_IP)
typedef struct _TDI_ADDRESS_IPX
{
typedef struct _TDI_ADDRESS_IPX {
ULONG NetworkAddress;
UCHAR NodeAddress[6];
USHORT Socket;
@ -247,36 +197,35 @@ typedef struct _TDI_ADDRESS_IPX
#define TDI_ADDRESS_LENGTH_IPX sizeof(TDI_ADDRESS_IPX)
typedef struct _TDI_ADDRESS_NETBIOS
{
USHORT NetbiosNameType;
UCHAR NetbiosName[16];
} TDI_ADDRESS_NETBIOS, *PTDI_ADDRESS_NETBIOS;
/* TDI_ADDRESS_NETBIOS.NetbiosNameType constants */
#define TDI_ADDRESS_NETBIOS_TYPE_UNIQUE 0x0000
#define TDI_ADDRESS_NETBIOS_TYPE_GROUP 0x0001
#define TDI_ADDRESS_NETBIOS_TYPE_QUICK_UNIQUE 0x0002
#define TDI_ADDRESS_NETBIOS_TYPE_QUICK_GROUP 0x0003
typedef struct _TDI_ADDRESS_NETBIOS {
USHORT NetbiosNameType;
UCHAR NetbiosName[16];
} TDI_ADDRESS_NETBIOS, *PTDI_ADDRESS_NETBIOS;
#define TDI_ADDRESS_LENGTH_NETBIOS sizeof(TDI_ADDRESS_NETBIOS)
typedef struct _TDI_ADDRESS_NETBIOS_EX
{
typedef struct _TDI_ADDRESS_NETBIOS_EX {
UCHAR EndpointName[16];
TDI_ADDRESS_NETBIOS NetbiosAddress;
} TDI_ADDRESS_NETBIOS_EX, *PTDI_ADDRESS_NETBIOS_EX;
#define TDI_ADDRESS_LENGTH_NETBIOS_EX sizeof(TDI_ADDRESS_NETBIOS_EX)
typedef struct _TDI_ADDRESS_NETONE
{
/* TDI_ADDRESS_NETONE.NetoneNameType constants */
#define TDI_ADDRESS_NETONE_TYPE_UNIQUE 0x0000
#define TDI_ADDRESS_NETONE_TYPE_ROTORED 0x0001
typedef struct _TDI_ADDRESS_NETONE {
USHORT NetoneNameType;
UCHAR NetoneName[20];
} TDI_ADDRESS_NETONE, *PTDI_ADDRESS_NETONE;
#define TDI_ADDRESS_NETONE_TYPE_UNIQUE 0x0000
#define TDI_ADDRESS_NETONE_TYPE_ROTORED 0x0001
#define TDI_ADDRESS_LENGTH_NETONE sizeof(TDI_ADDRESS_NETONE)
typedef struct _TDI_ADDRESS_NS
@ -290,11 +239,11 @@ typedef struct _TDI_ADDRESS_NS
#define ISO_MAX_ADDR_LENGTH 64
/* TDI_ADDRESS_OSI_TSAP.tp_addr_type constants */
#define ISO_HIERARCHICAL 0
#define ISO_NON_HIERARCHICAL 1
typedef struct _TDI_ADDRESS_OSI_TSAP
{
typedef struct _TDI_ADDRESS_OSI_TSAP {
USHORT tp_addr_type;
USHORT tp_taddr_len;
USHORT tp_tsel_len;
@ -303,8 +252,7 @@ typedef struct _TDI_ADDRESS_OSI_TSAP
#define TDI_ADDRESS_LENGTH_OSI_TSAP sizeof(TDI_ADDRESS_OSI_TSAP)
typedef struct _TDI_ADDRESS_VNS
{
typedef struct _TDI_ADDRESS_VNS {
UCHAR net_address[4];
UCHAR subnet_addr[2];
UCHAR port[2];
@ -314,66 +262,80 @@ typedef struct _TDI_ADDRESS_VNS
#define TDI_ADDRESS_LENGTH_VNS sizeof(TDI_ADDRESS_VNS)
typedef struct _TDI_ADDRESS_IP6 {
USHORT sin6_port;
ULONG sin6_flowinfo;
USHORT sin6_addr[8];
ULONG sin6_scope_id;
} TDI_ADDRESS_IP6, *PTDI_ADDRESS_IP6;
/* TDI request structures */
#define TDI_ADDRESS_LENGTH_IP6 sizeof(TDI_ADDRESS_IP6)
typedef struct _TDI_CONNECT_REQUEST
{
enum eNameBufferType {
NBT_READONLY = 0,
NBT_WRITEONLY,
NBT_READWRITE,
NBT_WRITTEN
};
typedef struct _TDI_ADDRESS_NETBIOS_UNICODE_EX {
USHORT NetbiosNameType;
enum eNameBufferType NameBufferType;
UNICODE_STRING EndpointName;
UNICODE_STRING RemoteName;
WCHAR EndpointBuffer[17];
WCHAR RemoteNameBuffer[1];
} TDI_ADDRESS_NETBIOS_UNICODE_EX, *PTDI_ADDRESS_NETBIOS_UNICODE_EX;
typedef struct _TDI_CONNECT_REQUEST {
TDI_REQUEST Request;
PTDI_CONNECTION_INFORMATION RequestConnectionInformation;
PTDI_CONNECTION_INFORMATION ReturnConnectionInformation;
LARGE_INTEGER Timeout;
} TDI_REQUEST_CONNECT, *PTDI_REQUEST_CONNECT;
typedef struct _TDI_REQUEST_ACCEPT
{
typedef struct _TDI_REQUEST_ACCEPT {
TDI_REQUEST Request;
PTDI_CONNECTION_INFORMATION RequestConnectionInformation;
PTDI_CONNECTION_INFORMATION ReturnConnectionInformation;
} TDI_REQUEST_ACCEPT, *PTDI_REQUEST_ACCEPT;
typedef struct _TDI_REQUEST_LISTEN
{
typedef struct _TDI_REQUEST_LISTEN {
TDI_REQUEST Request;
PTDI_CONNECTION_INFORMATION RequestConnectionInformation;
PTDI_CONNECTION_INFORMATION ReturnConnectionInformation;
USHORT ListenFlags;
} TDI_REQUEST_LISTEN, *PTDI_REQUEST_LISTEN;
typedef struct _TDI_DISCONNECT_REQUEST
{
typedef struct _TDI_DISCONNECT_REQUEST {
TDI_REQUEST Request;
LARGE_INTEGER Timeout;
} TDI_REQUEST_DISCONNECT, *PTDI_REQUEST_DISCONNECT;
typedef struct _TDI_REQUEST_SEND
{
typedef struct _TDI_REQUEST_SEND {
TDI_REQUEST Request;
USHORT SendFlags;
} TDI_REQUEST_SEND, *PTDI_REQUEST_SEND;
typedef struct _TDI_REQUEST_RECEIVE
{
typedef struct _TDI_REQUEST_RECEIVE {
TDI_REQUEST Request;
USHORT ReceiveFlags;
} TDI_REQUEST_RECEIVE, *PTDI_REQUEST_RECEIVE;
typedef struct _TDI_REQUEST_SEND_DATAGRAM
{
typedef struct _TDI_REQUEST_SEND_DATAGRAM {
TDI_REQUEST Request;
PTDI_CONNECTION_INFORMATION SendDatagramInformation;
} TDI_REQUEST_SEND_DATAGRAM, *PTDI_REQUEST_SEND_DATAGRAM;
typedef struct _TDI_REQUEST_RECEIVE_DATAGRAM
{
typedef struct _TDI_REQUEST_RECEIVE_DATAGRAM {
TDI_REQUEST Request;
PTDI_CONNECTION_INFORMATION ReceiveDatagramInformation;
PTDI_CONNECTION_INFORMATION ReturnInformation;
USHORT ReceiveFlags;
} TDI_REQUEST_RECEIVE_DATAGRAM, *PTDI_REQUEST_RECEIVE_DATAGRAM;
typedef struct _TDI_REQUEST_SET_EVENT
{
typedef struct _TDI_REQUEST_SET_EVENT {
TDI_REQUEST Request;
LONG EventType;
PVOID EventHandler;
@ -390,6 +352,7 @@ typedef struct _TDI_REQUEST_SET_EVENT
#define TDI_RECEIVE_COPY_LOOKAHEAD 0x00000200
#define TDI_RECEIVE_ENTIRE_MESSAGE 0x00000400
#define TDI_RECEIVE_AT_DISPATCH_LEVEL 0x00000800
#define TDI_RECEIVE_CONTROL_INFO 0x00001000
/* Listen flags */
#define TDI_QUERY_ACCEPT 0x00000001
@ -399,6 +362,7 @@ typedef struct _TDI_REQUEST_SET_EVENT
#define TDI_SEND_PARTIAL 0x0040
#define TDI_SEND_NO_RESPONSE_EXPECTED 0x0080
#define TDI_SEND_NON_BLOCKING 0x0100
#define TDI_SEND_AND_DISCONNECT 0x0200
/* Disconnect Flags */
#define TDI_DISCONNECT_WAIT 0x0001
@ -406,23 +370,22 @@ typedef struct _TDI_REQUEST_SET_EVENT
#define TDI_DISCONNECT_RELEASE 0x0004
/* TdiRequest structure for TdiQueryInformation request */
typedef struct _TDI_REQUEST_QUERY_INFORMATION
{
typedef struct _TDI_REQUEST_QUERY_INFORMATION {
TDI_REQUEST Request;
ULONG QueryType;
PTDI_CONNECTION_INFORMATION RequestConnectionInformation;
} TDI_REQUEST_QUERY_INFORMATION, *PTDI_REQUEST_QUERY_INFORMATION;
/* TdiRequest structure for TdiSetInformation request */
typedef struct _TDI_REQUEST_SET_INFORMATION
{
typedef struct _TDI_REQUEST_SET_INFORMATION {
TDI_REQUEST Request;
ULONG SetType;
PTDI_CONNECTION_INFORMATION RequestConnectionInformation;
} TDI_REQUEST_SET_INFORMATION, *PTDI_REQUEST_SET_INFORMATION;
typedef union _TDI_REQUEST_TYPE
{
typedef TDI_REQUEST_SET_INFORMATION TDI_REQ_SET_INFORMATION, *PTDI_REQ_SET_INFORMATION;
typedef union _TDI_REQUEST_TYPE {
TDI_REQUEST_ACCEPT TdiAccept;
TDI_REQUEST_CONNECT TdiConnect;
TDI_REQUEST_DISCONNECT TdiDisconnect;
@ -437,7 +400,6 @@ typedef union _TDI_REQUEST_TYPE
} TDI_REQUEST_TYPE, *PTDI_REQUEST_TYPE;
/* Query information types */
/* Generic query info types that must be supported by all transports */
@ -456,8 +418,7 @@ typedef union _TDI_REQUEST_TYPE
#define TDI_QUERY_SESSION_STATUS 0x00000200
#define TDI_QUERY_FIND_NAME 0x00000300
typedef struct _TA_APPLETALK_ADDR
{
typedef struct _TA_APPLETALK_ADDR {
LONG TAAddressCount;
struct _AddrAtalk {
USHORT AddressLength;
@ -466,8 +427,7 @@ typedef struct _TA_APPLETALK_ADDR
} Address[1];
} TA_APPLETALK_ADDRESS, *PTA_APPLETALK_ADDRESS;
typedef struct _TA_ADDRESS_IP
{
typedef struct _TA_ADDRESS_IP {
LONG TAAddressCount;
struct _AddrIp {
USHORT AddressLength;
@ -476,8 +436,7 @@ typedef struct _TA_ADDRESS_IP
} Address[1];
} TA_ADDRESS_IP, *PTA_ADDRESS_IP;
typedef struct _TA_ADDRESS_IPX
{
typedef struct _TA_ADDRESS_IPX {
LONG TAAddressCount;
struct _AddrIpx {
USHORT AddressLength;
@ -486,8 +445,7 @@ typedef struct _TA_ADDRESS_IPX
} Address[1];
} TA_IPX_ADDRESS, *PTA_IPX_ADDRESS;
typedef struct _TA_NETBIOS_ADDRESS
{
typedef struct _TA_NETBIOS_ADDRESS {
LONG TAAddressCount;
struct _Addr{
USHORT AddressLength;
@ -496,8 +454,7 @@ typedef struct _TA_NETBIOS_ADDRESS
} Address[1];
} TA_NETBIOS_ADDRESS, *PTA_NETBIOS_ADDRESS;
typedef struct _TA_ADDRESS_NS
{
typedef struct _TA_ADDRESS_NS {
LONG TAAddressCount;
struct _AddrNs {
USHORT AddressLength;
@ -506,8 +463,7 @@ typedef struct _TA_ADDRESS_NS
} Address[1];
} TA_NS_ADDRESS, *PTA_NS_ADDRESS;
typedef struct _TA_ADDRESS_VNS
{
typedef struct _TA_ADDRESS_VNS {
LONG TAAddressCount;
struct _AddrVns {
USHORT AddressLength;
@ -516,11 +472,28 @@ typedef struct _TA_ADDRESS_VNS
} Address[1];
} TA_VNS_ADDRESS, *PTA_VNS_ADDRESS;
typedef struct _TA_ADDRESS_IP6 {
LONG TAAddressCount;
struct _AddrIp6 {
USHORT AddressLength;
USHORT AddressType;
TDI_ADDRESS_IP6 Address[1];
} Address [1];
} TA_IP6_ADDRESS, *PTA_IP6_ADDRESS;
typedef struct _TA_ADDRESS_NETBIOS_UNICODE_EX {
LONG TAAddressCount;
struct _AddrNetbiosWCharEx {
USHORT AddressLength;
USHORT AddressType;
TDI_ADDRESS_NETBIOS_UNICODE_EX Address[1];
} Address [1];
} TA_NETBIOS_UNICODE_EX_ADDRESS, *PTA_NETBIOS_UNICODE_EX_ADDRESS;
/* Structures used for TdiQueryInformation and TdiSetInformation */
typedef struct _TDI_ENDPOINT_INFO
{
typedef struct _TDI_ENDPOINT_INFO {
ULONG State;
ULONG Event;
ULONG TransmittedTsdus;
@ -534,8 +507,7 @@ typedef struct _TDI_ENDPOINT_INFO
ULONG SecurityCompartment;
} TDI_ENDPOINT_INFO, *PTDI_ENDPOINT_INFO;
typedef struct _TDI_CONNECTION_INFO
{
typedef struct _TDI_CONNECTION_INFO {
ULONG State;
ULONG Event;
ULONG TransmittedTsdus;
@ -549,19 +521,16 @@ typedef struct _TDI_CONNECTION_INFO
BOOLEAN Unreliable;
} TDI_CONNECTION_INFO, *PTDI_CONNECTION_INFO;
typedef struct _TDI_DATAGRAM_INFO
{
typedef struct _TDI_DATAGRAM_INFO {
ULONG MaximumDatagramBytes;
ULONG MaximumDatagramCount;
} TDI_DATAGRAM_INFO, *PTDI_DATAGRAM_INFO;
typedef struct _TDI_MAX_DATAGRAM_INFO
{
typedef struct _TDI_MAX_DATAGRAM_INFO {
ULONG MaxDatagramSize;
} TDI_MAX_DATAGRAM_INFO, *PTDI_MAX_DATAGRAM_INFO;
typedef struct _TDI_PROVIDER_INFO
{
typedef struct _TDI_PROVIDER_INFO {
ULONG Version;
ULONG MaxSendSize;
ULONG MaxConnectionUserData;
@ -588,17 +557,20 @@ typedef struct _TDI_PROVIDER_INFO
#define TDI_SERVICE_POINT_TO_POINT 0x00001000
#define TDI_SERVICE_MESSAGE_MODE 0x00002000
#define TDI_SERVICE_HALF_DUPLEX 0x00004000
#define TDI_SERVICE_DGRAM_CONNECTION 0x00008000
#define TDI_SERVICE_FORCE_ACCESS_CHECK 0x00010000
#define TDI_SERVICE_SEND_AND_DISCONNECT 0x00020000
#define TDI_SERVICE_DIRECT_ACCEPT 0x00040000
#define TDI_SERVICE_ACCEPT_LOCAL_ADDR 0x00080000
typedef struct _TDI_PROVIDER_RESOURCE_STATS
{
typedef struct _TDI_PROVIDER_RESOURCE_STATS {
ULONG ResourceId;
ULONG MaximumResourceUsed;
ULONG AverageResourceUsed;
ULONG ResourceExhausted;
} TDI_PROVIDER_RESOURCE_STATS, *PTDI_PROVIDER_RESOURCE_STATS;
typedef struct _TDI_PROVIDER_STATISTICS
{
typedef struct _TDI_PROVIDER_STATISTICS {
ULONG Version;
ULONG OpenConnections;
ULONG ConnectionsAfterNoRetry;
@ -636,11 +608,33 @@ typedef struct _TDI_PROVIDER_STATISTICS
LARGE_INTEGER WastedPacketSpace;
ULONG WastedSpacePackets;
ULONG NumberOfResources;
TDI_PROVIDER_RESOURCE_STATS Resources[1];
TDI_PROVIDER_RESOURCE_STATS ResourceStats[1];
} TDI_PROVIDER_STATISTICS, *PTDI_PROVIDER_STATISTICS;
#define TDI_EVENT_CONNECT 0
#define TDI_EVENT_DISCONNECT 1
#define TDI_EVENT_ERROR 2
#define TDI_EVENT_RECEIVE 3
#define TDI_EVENT_RECEIVE_DATAGRAM 4
#define TDI_EVENT_RECEIVE_EXPEDITED 5
#define TDI_EVENT_SEND_POSSIBLE 6
typedef struct _TDI_REQUEST_ASSOCIATE {
TDI_REQUEST Request;
HANDLE AddressHandle;
} TDI_REQUEST_ASSOCIATE_ADDRESS, *PTDI_REQUEST_ASSOCIATE_ADDRESS;
#define NDIS_PACKET_POOL_TAG_FOR_NWLNKIPX 'iPDN'
#define NDIS_PACKET_POOL_TAG_FOR_NWLNKSPX 'sPDN'
#define NDIS_PACKET_POOL_TAG_FOR_NWLNKNB 'nPDN'
#define NDIS_PACKET_POOL_TAG_FOR_TCPIP 'tPDN'
#define NDIS_PACKET_POOL_TAG_FOR_NBF 'bPDN'
#define NDIS_PACKET_POOL_TAG_FOR_APPLETALK 'aPDN'
#pragma pack(pop)
#ifdef __cplusplus
}
#endif
#endif /* __TDI_H */
/* EOF */

View file

@ -1,20 +1,85 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS TDI library
* FILE: include/net/tdiinfo.h
* PURPOSE: TDI definitions for Tdi(Query/Set)InformationEx
* tdiinfo.h
*
* TDI set and query information interface
*
* 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 __TDIINFO_H
#define __TDIINFO_H
typedef struct TDIEntityID
{
#if __GNUC__ >=3
#pragma GCC system_header
#endif
#ifdef __cplusplus
extern "C" {
#endif
#pragma pack(push,4)
#include "ntddk.h"
typedef struct TDIEntityID {
ULONG tei_entity;
ULONG tei_instance;
} TDIEntityID;
typedef struct TDIObjectID
{
#define MAX_TDI_ENTITIES 512
#define INVALID_ENTITY_INSTANCE -1
#define GENERIC_ENTITY 0
#define ENTITY_LIST_ID 0
#define ENTITY_TYPE_ID 1
#define AT_ENTITY 0x280
#define CL_NL_ENTITY 0x301
#define CL_TL_ENTITY 0x401
#define CO_NL_ENTITY 0x300
#define CO_TL_ENTITY 0x400
#define ER_ENTITY 0x380
#define IF_ENTITY 0x200
#define AT_ARP 0x280
#define AT_NULL 0x282
#define CL_TL_NBF 0x401
#define CL_TL_UDP 0x403
#define CL_NL_IPX 0x301
#define CL_NL_IP 0x303
#define CO_TL_NBF 0x400
#define CO_TL_SPX 0x402
#define CO_TL_TCP 0x404
#define CO_TL_SPP 0x406
#define ER_ICMP 0x380
#define IF_GENERIC 0x200
#define IF_MIB 0x202
/* TDIObjectID.toi_class constants */
#define INFO_CLASS_GENERIC 0x100
#define INFO_CLASS_PROTOCOL 0x200
#define INFO_CLASS_IMPLEMENTATION 0x300
/* TDIObjectID.toi_type constants */
#define INFO_TYPE_PROVIDER 0x100
#define INFO_TYPE_ADDRESS_OBJECT 0x200
#define INFO_TYPE_CONNECTION 0x300
typedef struct _TDIObjectID {
TDIEntityID toi_entity;
ULONG toi_class;
ULONG toi_type;
@ -23,76 +88,28 @@ typedef struct TDIObjectID
#define CONTEXT_SIZE 16
#define MAX_TDI_ENTITIES 512
#define INFO_CLASS_GENERIC 0x100
#define INFO_CLASS_PROTOCOL 0x200
#define INFO_CLASS_IMPLEMENTATION 0x300
#define INFO_TYPE_PROVIDER 0x100
#define INFO_TYPE_ADDRESS_OBJECT 0x200
#define INFO_TYPE_CONNECTION 0x300
#define ENTITY_LIST_ID 0
#define GENERIC_ENTITY 0
#define IF_ENTITY 0x200
#define AT_ENTITY 0x280
#define CO_NL_ENTITY 0x300
#define CL_NL_ENTITY 0x301
#define ER_ENTITY 0x380
#define CO_TL_ENTITY 0x400
#define CL_TL_ENTITY 0x401
/* IDs supported by all entities */
#define ENTITY_TYPE_ID 1
#define IF_GENERIC 0x200
#define IF_MIB 0x202
#define AT_ARP 0x280
#define AT_NULL 0x282
#define CL_NL_IPX 0x301
#define CL_NL_IP 0x303
#define ER_ICMP 0x380
#define CO_TL_NBF 0x400
#define CO_TL_SPX 0x402
#define CO_TL_TCP 0x404
#define CO_TL_SPP 0x406
#define CL_TL_NBF 0x401
#define CL_TL_UDP 0x403
/* TCP specific structures */
typedef struct _TCP_REQUEST_QUERY_INFORMATION_EX
{
typedef struct _TCP_REQUEST_QUERY_INFORMATION_EX {
TDIObjectID ID;
UCHAR Context[CONTEXT_SIZE];
} TCP_REQUEST_QUERY_INFORMATION_EX, *PTCP_REQUEST_QUERY_INFORMATION_EX;
typedef struct _TCP_REQUEST_SET_INFORMATION_EX
{
#if defined(_WIN64)
typedef struct _TCP_REQUEST_QUERY_INFORMATION_EX32 {
TDIObjectID ID;
ULONG32 Context[CONTEXT_SIZE / sizeof(ULONG32)];
} TCP_REQUEST_QUERY_INFORMATION_EX32, *PTCP_REQUEST_QUERY_INFORMATION_EX32;
#endif /* _WIN64 */
typedef struct _TCP_REQUEST_SET_INFORMATION_EX {
TDIObjectID ID;
UINT BufferSize;
UCHAR Buffer[1];
} TCP_REQUEST_SET_INFORMATION_EX, *PTCP_REQUEST_SET_INFORMATION_EX;
#pragma pack(pop)
#ifdef __cplusplus
}
#endif
#endif /* __TDIINFO_H */
/* EOF */

View file

@ -1,20 +1,56 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS TDI library
* FILE: include/net/tdikrnl.h
* PURPOSE: TDI definitions for kernel mode drivers
* tdikrnl.h
*
* TDI kernel mode definitions
*
* 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
#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"
#ifndef STDCALL
#define STDCALL
#endif
#define DDKAPI STDCALL
typedef struct _TDI_REQUEST_KERNEL
{
#if defined(_TDI_)
// #define TDIKRNLAPI DECLSPEC_EXPORT
#define TDIKRNLAPI
#else
// #define TDIKRNLAPI DECLSPEC_IMPORT
#define TDIKRNLAPI
#endif
typedef struct _TDI_REQUEST_KERNEL {
ULONG RequestFlags;
PTDI_CONNECTION_INFORMATION RequestConnectionInformation;
PTDI_CONNECTION_INFORMATION ReturnConnectionInformation;
@ -40,18 +76,16 @@ typedef struct _TDI_REQUEST_KERNEL
#define TDI_DIRECT_SEND 0x27
#define TDI_DIRECT_SEND_DATAGRAM 0x29
#define TDI_TRANSPORT_ADDRESS_FILE 1
#define TDI_CONNECTION_FILE 2
#define TDI_CONTROL_CHANNEL_FILE 3
/* Internal TDI IOCTLS */
#define IOCTL_TDI_QUERY_DIRECT_SEND_HANDLER TDI_CONTROL_CODE(0x80, METHOD_NEITHER)
#define IOCTL_TDI_QUERY_DIRECT_SENDDG_HANDLER TDI_CONTROL_CODE(0x81, METHOD_NEITHER)
#define IOCTL_TDI_QUERY_DIRECT_SEND_HANDLER _TDI_CONTROL_CODE(0x80, METHOD_NEITHER)
#define IOCTL_TDI_QUERY_DIRECT_SENDDG_HANDLER _TDI_CONTROL_CODE(0x81, METHOD_NEITHER)
/* TdiAssociateAddress */
typedef struct _TDI_REQUEST_KERNEL_ASSOCIATE
{
typedef struct _TDI_REQUEST_KERNEL_ASSOCIATE {
HANDLE AddressHandle;
} TDI_REQUEST_KERNEL_ASSOCIATE, *PTDI_REQUEST_KERNEL_ASSOCIATE;
@ -60,22 +94,31 @@ typedef TDI_REQUEST_KERNEL TDI_REQUEST_KERNEL_DISASSOCIATE,
*PTDI_REQUEST_KERNEL_DISASSOCIATE;
/* TdiAccept */
typedef struct _TDI_REQUEST_KERNEL_ACCEPT
{
typedef struct _TDI_REQUEST_KERNEL_ACCEPT {
PTDI_CONNECTION_INFORMATION RequestConnectionInformation;
PTDI_CONNECTION_INFORMATION ReturnConnectionInformation;
} 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 */
typedef struct _TDI_REQUEST_KERNEL_RECEIVE
{
typedef struct _TDI_REQUEST_KERNEL_RECEIVE {
ULONG ReceiveLength;
ULONG ReceiveFlags;
} TDI_REQUEST_KERNEL_RECEIVE, *PTDI_REQUEST_KERNEL_RECEIVE;
/* TdiReceiveDatagram */
typedef struct _TDI_REQUEST_KERNEL_RECEIVEDG
{
typedef struct _TDI_REQUEST_KERNEL_RECEIVEDG {
ULONG ReceiveLength;
PTDI_CONNECTION_INFORMATION ReceiveDatagramInformation;
PTDI_CONNECTION_INFORMATION ReturnDatagramInformation;
@ -83,37 +126,32 @@ typedef struct _TDI_REQUEST_KERNEL_RECEIVEDG
} TDI_REQUEST_KERNEL_RECEIVEDG, *PTDI_REQUEST_KERNEL_RECEIVEDG;
/* TdiSend */
typedef struct _TDI_REQUEST_KERNEL_SEND
{
typedef struct _TDI_REQUEST_KERNEL_SEND {
ULONG SendLength;
ULONG SendFlags;
} TDI_REQUEST_KERNEL_SEND, *PTDI_REQUEST_KERNEL_SEND;
/* TdiSendDatagram */
typedef struct _TDI_REQUEST_KERNEL_SENDDG
{
typedef struct _TDI_REQUEST_KERNEL_SENDDG {
ULONG SendLength;
PTDI_CONNECTION_INFORMATION SendDatagramInformation;
} TDI_REQUEST_KERNEL_SENDDG, *PTDI_REQUEST_KERNEL_SENDDG;
/* TdiSetEventHandler */
typedef struct _TDI_REQUEST_KERNEL_SET_EVENT
{
typedef struct _TDI_REQUEST_KERNEL_SET_EVENT {
LONG EventType;
PVOID EventHandler;
PVOID EventContext;
} TDI_REQUEST_KERNEL_SET_EVENT, *PTDI_REQUEST_KERNEL_SET_EVENT;
/* TdiQueryInformation */
typedef struct _TDI_REQUEST_KERNEL_QUERY_INFO
{
typedef struct _TDI_REQUEST_KERNEL_QUERY_INFO {
LONG QueryType;
PTDI_CONNECTION_INFORMATION RequestConnectionInformation;
} TDI_REQUEST_KERNEL_QUERY_INFORMATION, *PTDI_REQUEST_KERNEL_QUERY_INFORMATION;
/* TdiSetInformation */
typedef struct _TDI_REQUEST_KERNEL_SET_INFO
{
typedef struct _TDI_REQUEST_KERNEL_SET_INFO {
LONG SetType;
PTDI_CONNECTION_INFORMATION RequestConnectionInformation;
} TDI_REQUEST_KERNEL_SET_INFORMATION, *PTDI_REQUEST_KERNEL_SET_INFORMATION;
@ -130,8 +168,10 @@ typedef struct _TDI_REQUEST_KERNEL_SET_INFO
#define TDI_EVENT_CHAINED_RECEIVE 7
#define TDI_EVENT_CHAINED_RECEIVE_DATAGRAM 8
#define TDI_EVENT_CHAINED_RECEIVE_EXPEDITED 9
#define TDI_EVENT_ERROR_EX 10
typedef NTSTATUS (*PTDI_IND_CONNECT)(
typedef NTSTATUS
(*PTDI_IND_CONNECT)(
IN PVOID TdiEventContext,
IN LONG RemoteAddressLength,
IN PVOID RemoteAddress,
@ -142,7 +182,10 @@ typedef NTSTATUS (*PTDI_IND_CONNECT)(
OUT CONNECTION_CONTEXT *ConnectionContext,
OUT PIRP *AcceptIrp);
NTSTATUS STDCALL TdiDefaultConnectHandler(
TDIKRNLAPI
NTSTATUS
DDKAPI
TdiDefaultConnectHandler(
IN PVOID TdiEventContext,
IN LONG RemoteAddressLength,
IN PVOID RemoteAddress,
@ -153,7 +196,8 @@ NTSTATUS STDCALL TdiDefaultConnectHandler(
OUT CONNECTION_CONTEXT *ConnectionContext,
OUT PIRP *AcceptIrp);
typedef NTSTATUS (*PTDI_IND_DISCONNECT)(
typedef NTSTATUS
(*PTDI_IND_DISCONNECT)(
IN PVOID TdiEventContext,
IN CONNECTION_CONTEXT ConnectionContext,
IN LONG DisconnectDataLength,
@ -162,7 +206,10 @@ typedef NTSTATUS (*PTDI_IND_DISCONNECT)(
IN PVOID DisconnectInformation,
IN ULONG DisconnectFlags);
NTSTATUS STDCALL TdiDefaultDisconnectHandler(
TDIKRNLAPI
NTSTATUS
DDKAPI
TdiDefaultDisconnectHandler(
IN PVOID TdiEventContext,
IN CONNECTION_CONTEXT ConnectionContext,
IN LONG DisconnectDataLength,
@ -171,15 +218,26 @@ NTSTATUS STDCALL TdiDefaultDisconnectHandler(
IN PVOID DisconnectInformation,
IN ULONG DisconnectFlags);
typedef NTSTATUS (*PTDI_IND_ERROR)(
typedef NTSTATUS
(*PTDI_IND_ERROR)(
IN PVOID TdiEventContext,
IN NTSTATUS Status);
NTSTATUS STDCALL TdiDefaultErrorHandler(
typedef NTSTATUS DDKAPI
(*PTDI_IND_ERROR_EX)(
IN PVOID TdiEventContext,
IN NTSTATUS Status,
IN PVOID Buffer);
TDIKRNLAPI
NTSTATUS
DDKAPI
TdiDefaultErrorHandler(
IN PVOID TdiEventContext,
IN NTSTATUS Status);
typedef NTSTATUS (*PTDI_IND_RECEIVE)(
typedef NTSTATUS
(*PTDI_IND_RECEIVE)(
IN PVOID TdiEventContext,
IN CONNECTION_CONTEXT ConnectionContext,
IN ULONG ReceiveFlags,
@ -189,7 +247,10 @@ typedef NTSTATUS (*PTDI_IND_RECEIVE)(
IN PVOID Tsdu,
OUT PIRP *IoRequestPacket);
NTSTATUS STDCALL TdiDefaultReceiveHandler(
TDIKRNLAPI
NTSTATUS
DDKAPI
TdiDefaultReceiveHandler(
IN PVOID TdiEventContext,
IN CONNECTION_CONTEXT ConnectionContext,
IN ULONG ReceiveFlags,
@ -199,7 +260,8 @@ NTSTATUS STDCALL TdiDefaultReceiveHandler(
IN PVOID Tsdu,
OUT PIRP *IoRequestPacket);
typedef NTSTATUS (*PTDI_IND_RECEIVE_DATAGRAM)(
typedef NTSTATUS
(*PTDI_IND_RECEIVE_DATAGRAM)(
IN PVOID TdiEventContext,
IN LONG SourceAddressLength,
IN PVOID SourceAddress,
@ -212,7 +274,9 @@ typedef NTSTATUS (*PTDI_IND_RECEIVE_DATAGRAM)(
IN PVOID Tsdu,
OUT PIRP *IoRequestPacket);
NTSTATUS STDCALL TdiDefaultRcvDatagramHandler(
TDIKRNLAPI
NTSTATUS DDKAPI
TdiDefaultRcvDatagramHandler(
IN PVOID TdiEventContext,
IN LONG SourceAddressLength,
IN PVOID SourceAddress,
@ -225,7 +289,8 @@ NTSTATUS STDCALL TdiDefaultRcvDatagramHandler(
IN PVOID Tsdu,
OUT PIRP *IoRequestPacket);
typedef NTSTATUS (*PTDI_IND_RECEIVE_EXPEDITED)(
typedef NTSTATUS
(*PTDI_IND_RECEIVE_EXPEDITED)(
IN PVOID TdiEventContext,
IN CONNECTION_CONTEXT ConnectionContext,
IN ULONG ReceiveFlags,
@ -235,7 +300,10 @@ typedef NTSTATUS (*PTDI_IND_RECEIVE_EXPEDITED)(
IN PVOID Tsdu,
OUT PIRP *IoRequestPacket);
NTSTATUS STDCALL TdiDefaultRcvExpeditedHandler(
TDIKRNLAPI
NTSTATUS
DDKAPI
TdiDefaultRcvExpeditedHandler(
IN PVOID TdiEventContext,
IN CONNECTION_CONTEXT ConnectionContext,
IN ULONG ReceiveFlags,
@ -245,7 +313,8 @@ NTSTATUS STDCALL TdiDefaultRcvExpeditedHandler(
IN PVOID Tsdu,
OUT PIRP *IoRequestPacket);
typedef NTSTATUS (*PTDI_IND_CHAINED_RECEIVE)(
typedef NTSTATUS
(*PTDI_IND_CHAINED_RECEIVE)(
IN PVOID TdiEventContext,
IN CONNECTION_CONTEXT ConnectionContext,
IN ULONG ReceiveFlags,
@ -254,7 +323,10 @@ typedef NTSTATUS (*PTDI_IND_CHAINED_RECEIVE)(
IN PMDL Tsdu,
IN PVOID TsduDescriptor);
NTSTATUS STDCALL TdiDefaultChainedReceiveHandler(
TDIKRNLAPI
NTSTATUS
DDKAPI
TdiDefaultChainedReceiveHandler(
IN PVOID TdiEventContext,
IN CONNECTION_CONTEXT ConnectionContext,
IN ULONG ReceiveFlags,
@ -263,7 +335,8 @@ NTSTATUS STDCALL TdiDefaultChainedReceiveHandler(
IN PMDL Tsdu,
IN PVOID TsduDescriptor);
typedef NTSTATUS (*PTDI_IND_CHAINED_RECEIVE_DATAGRAM)(
typedef NTSTATUS
(*PTDI_IND_CHAINED_RECEIVE_DATAGRAM)(
IN PVOID TdiEventContext,
IN LONG SourceAddressLength,
IN PVOID SourceAddress,
@ -275,7 +348,10 @@ typedef NTSTATUS (*PTDI_IND_CHAINED_RECEIVE_DATAGRAM)(
IN PMDL Tsdu,
IN PVOID TsduDescriptor);
NTSTATUS STDCALL TdiDefaultChainedRcvDatagramHandler(
TDIKRNLAPI
NTSTATUS
DDKAPI
TdiDefaultChainedRcvDatagramHandler(
IN PVOID TdiEventContext,
IN LONG SourceAddressLength,
IN PVOID SourceAddress,
@ -287,7 +363,8 @@ NTSTATUS STDCALL TdiDefaultChainedRcvDatagramHandler(
IN PMDL Tsdu,
IN PVOID TsduDescriptor);
typedef NTSTATUS (*PTDI_IND_CHAINED_RECEIVE_EXPEDITED)(
typedef NTSTATUS
(*PTDI_IND_CHAINED_RECEIVE_EXPEDITED)(
IN PVOID TdiEventContext,
IN CONNECTION_CONTEXT ConnectionContext,
IN ULONG ReceiveFlags,
@ -296,7 +373,10 @@ typedef NTSTATUS (*PTDI_IND_CHAINED_RECEIVE_EXPEDITED)(
IN PMDL Tsdu,
IN PVOID TsduDescriptor);
NTSTATUS STDCALL TdiDefaultChainedRcvExpeditedHandler(
TDIKRNLAPI
NTSTATUS
DDKAPI
TdiDefaultChainedRcvExpeditedHandler(
IN PVOID TdiEventContext,
IN CONNECTION_CONTEXT ConnectionContext,
IN ULONG ReceiveFlags,
@ -305,12 +385,16 @@ NTSTATUS STDCALL TdiDefaultChainedRcvExpeditedHandler(
IN PMDL Tsdu,
IN PVOID TsduDescriptor);
typedef NTSTATUS (*PTDI_IND_SEND_POSSIBLE)(
typedef NTSTATUS
(*PTDI_IND_SEND_POSSIBLE)(
IN PVOID TdiEventContext,
IN PVOID ConnectionContext,
IN ULONG BytesAvailable);
NTSTATUS STDCALL TdiDefaultSendPossibleHandler(
TDIKRNLAPI
NTSTATUS
DDKAPI
TdiDefaultSendPossibleHandler(
IN PVOID TdiEventContext,
IN PVOID ConnectionContext,
IN ULONG BytesAvailable);
@ -320,21 +404,21 @@ NTSTATUS STDCALL TdiDefaultSendPossibleHandler(
/* Macros and functions to build IRPs */
#define TdiBuildBaseIrp( \
Irp, DevObj, FileObj, CompRoutine, Contxt, IrpSp, Minor) \
bIrp, bDevObj, bFileObj, bCompRoutine, bContxt, bIrpSp, bMinor) \
{ \
IrpSp->MajorFunction = IRP_MJ_INTERNAL_DEVICE_CONTROL; \
IrpSp->MinorFunction = (Minor); \
IrpSp->DeviceObject = (DevObj); \
IrpSp->FileObject = (FileObj); \
\
if (CompRoutine) \
IoSetCompletionRoutine(Irp, CompRoutine, Contxt, TRUE, TRUE, TRUE) \
bIrpSp->MajorFunction = IRP_MJ_INTERNAL_DEVICE_CONTROL; \
bIrpSp->MinorFunction = (bMinor); \
bIrpSp->DeviceObject = (bDevObj); \
bIrpSp->FileObject = (bFileObj); \
if (bCompRoutine) \
IoSetCompletionRoutine(bIrp, bCompRoutine, bContxt, TRUE, TRUE, TRUE) \
else \
IoSetCompletionRoutine(Irp, NULL, NULL, FALSE, FALSE, FALSE); \
IoSetCompletionRoutine(bIrp, NULL, NULL, FALSE, FALSE, FALSE); \
}
/*
* VOID TdiBuildAccept(
* VOID
* TdiBuildAccept(
* IN PIRP Irp,
* IN PDEVICE_OBJECT DevObj,
* IN PFILE_OBJECT FileObj,
@ -361,7 +445,8 @@ NTSTATUS STDCALL TdiDefaultSendPossibleHandler(
}
/*
* VOID TdiBuildAction(
* VOID
* TdiBuildAction(
* IN PIRP Irp,
* IN PDEVICE_OBJECT DevObj,
* IN PFILE_OBJECT FileObj,
@ -383,7 +468,8 @@ NTSTATUS STDCALL TdiDefaultSendPossibleHandler(
}
/*
* VOID TdiBuildAssociateAddress(
* VOID
* TdiBuildAssociateAddress(
* IN PIRP Irp,
* IN PDEVICE_OBJECT DevObj,
* IN PFILE_OBJECT FileObj,
@ -407,7 +493,8 @@ NTSTATUS STDCALL TdiDefaultSendPossibleHandler(
}
/*
* VOID TdiBuildConnect(
* VOID
* TdiBuildConnect(
* IN PIRP Irp,
* IN PDEVICE_OBJECT DevObj,
* IN PFILE_OBJECT FileObj,
@ -436,7 +523,8 @@ NTSTATUS STDCALL TdiDefaultSendPossibleHandler(
}
/*
* VOID TdiBuildDisassociateAddress(
* VOID
* TdiBuildDisassociateAddress(
* IN PIRP Irp,
* IN PDEVICE_OBJECT DevObj,
* IN PFILE_OBJECT FileObj,
@ -455,7 +543,8 @@ NTSTATUS STDCALL TdiDefaultSendPossibleHandler(
}
/*
* VOID TdiBuildDisconnect(
* VOID
* TdiBuildDisconnect(
* IN PIRP Irp,
* IN PDEVICE_OBJECT DevObj,
* IN PFILE_OBJECT FileObj,
@ -486,7 +575,8 @@ NTSTATUS STDCALL TdiDefaultSendPossibleHandler(
}
/*
* PIRP TdiBuildInternalDeviceControlIrp(
* PIRP
* TdiBuildInternalDeviceControlIrp(
* IN CCHAR IrpSubFunction,
* IN PDEVICE_OBJECT DeviceObject,
* IN PFILE_OBJECT FileObject,
@ -502,7 +592,8 @@ NTSTATUS STDCALL TdiDefaultSendPossibleHandler(
TRUE, Event, IoStatusBlock)
/*
* VOID TdiBuildListen(
* VOID
* TdiBuildListen(
* IN PIRP Irp,
* IN PDEVICE_OBJECT DevObj,
* IN PFILE_OBJECT FileObj,
@ -530,18 +621,25 @@ NTSTATUS STDCALL TdiDefaultSendPossibleHandler(
_Request->RequestFlags = (Flags); \
}
VOID STDCALL TdiBuildNetbiosAddress(
TDIKRNLAPI
VOID
DDKAPI
TdiBuildNetbiosAddress(
IN PUCHAR NetbiosName,
IN BOOLEAN IsGroupName,
IN OUT PTA_NETBIOS_ADDRESS NetworkName);
NTSTATUS STDCALL TdiBuildNetbiosAddressEa(
TDIKRNLAPI
NTSTATUS
DDKAPI
TdiBuildNetbiosAddressEa(
IN PUCHAR Buffer,
IN BOOLEAN IsGroupName,
IN PUCHAR NetbiosName);
/*
* VOID TdiBuildQueryInformation(
* VOID
* TdiBuildQueryInformation(
* IN PIRP Irp,
* IN PDEVICE_OBJECT DevObj,
* IN PFILE_OBJECT FileObj,
@ -568,7 +666,8 @@ NTSTATUS STDCALL TdiBuildNetbiosAddressEa(
}
/*
* VOID TdiBuildReceive(
* VOID
* TdiBuildReceive(
* IN PIRP Irp,
* IN PDEVICE_OBJECT DevObj,
* IN PFILE_OBJECT FileObj,
@ -597,7 +696,8 @@ NTSTATUS STDCALL TdiBuildNetbiosAddressEa(
}
/*
* VOID TdiBuildReceiveDatagram(
* VOID
* TdiBuildReceiveDatagram(
* IN PIRP Irp,
* IN PDEVICE_OBJECT DevObj,
* IN PFILE_OBJECT FileObj,
@ -630,7 +730,8 @@ NTSTATUS STDCALL TdiBuildNetbiosAddressEa(
}
/*
* VOID TdiBuildSend(
* VOID
* TdiBuildSend(
* IN PIRP Irp,
* IN PDEVICE_OBJECT DevObj,
* IN PFILE_OBJECT FileObj,
@ -659,7 +760,8 @@ NTSTATUS STDCALL TdiBuildNetbiosAddressEa(
}
/*
* VOID TdiBuildSendDatagram(
* VOID
* TdiBuildSendDatagram(
* IN PIRP Irp,
* IN PDEVICE_OBJECT DevObj,
* IN PFILE_OBJECT FileObj,
@ -688,7 +790,8 @@ NTSTATUS STDCALL TdiBuildNetbiosAddressEa(
}
/*
* VOID TdiBuildSetEventHandler(
* VOID
* TdiBuildSetEventHandler(
* IN PIRP Irp,
* IN PDEVICE_OBJECT DevObj,
* IN PFILE_OBJECT FileObj,
@ -717,7 +820,8 @@ NTSTATUS STDCALL TdiBuildNetbiosAddressEa(
}
/*
* VOID TdiBuildSetInformation(
* VOID
* TdiBuildSetInformation(
* IN PIRP Irp,
* IN PDEVICE_OBJECT DevObj,
* IN PFILE_OBJECT FileObj,
@ -743,12 +847,124 @@ NTSTATUS STDCALL TdiBuildNetbiosAddressEa(
(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);
typedef struct _TDI20_CLIENT_INTERFACE_INFO {
_ANONYMOUS_UNION union {
_ANONYMOUS_STRUCT struct {
UCHAR MajorTdiVersion;
UCHAR MinorTdiVersion;
} DUMMYSTRUCTNAME;
USHORT TdiVersion;
} DUMMYUNIONNAME;
USHORT Unused;
PUNICODE_STRING ClientName;
TDI_PNP_POWER_HANDLER PnPPowerHandler;
_ANONYMOUS_UNION union {
TDI_BINDING_HANDLER BindingHandler;
_ANONYMOUS_STRUCT struct {
TDI_BIND_HANDLER BindHandler;
TDI_UNBIND_HANDLER UnBindHandler;
} DUMMYSTRUCTNAME;
}DUMMYUNIONNAME2;
_ANONYMOUS_UNION union {
_ANONYMOUS_STRUCT struct {
TDI_ADD_ADDRESS_HANDLER_V2 AddAddressHandlerV2;
TDI_DEL_ADDRESS_HANDLER_V2 DelAddressHandlerV2;
} DUMMYSTRUCTNAME;
_ANONYMOUS_STRUCT struct {
TDI_ADD_ADDRESS_HANDLER AddAddressHandler;
TDI_DEL_ADDRESS_HANDLER DelAddressHandler;
} DUMMYSTRUCTNAME2;
} DUMMYUNIONNAME3;
} TDI20_CLIENT_INTERFACE_INFO, *PTDI20_CLIENT_INTERFACE_INFO;
typedef TDI20_CLIENT_INTERFACE_INFO TDI_CLIENT_INTERFACE_INFO;
typedef TDI_CLIENT_INTERFACE_INFO *PTDI_CLIENT_INTERFACE_INFO;
/* TDI functions */
/*
* VOID TdiCompleteRequest(
* VOID
* TdiCompleteRequest(
* IN PIRP Irp,
* IN NTSTATUS Status);
*/
@ -758,7 +974,10 @@ NTSTATUS STDCALL TdiBuildNetbiosAddressEa(
IoCompleteRequest((Irp), IO_NETWORK_INCREMENT); \
}
NTSTATUS STDCALL TdiCopyBufferToMdl(
TDIKRNLAPI
NTSTATUS
DDKAPI
TdiCopyBufferToMdl(
IN PVOID SourceBuffer,
IN ULONG SourceOffset,
IN ULONG SourceBytesToCopy,
@ -767,7 +986,8 @@ NTSTATUS STDCALL TdiCopyBufferToMdl(
IN PULONG BytesCopied);
/*
* VOID TdiCopyLookaheadData(
* VOID
* TdiCopyLookaheadData(
* IN PVOID Destination,
* IN PVOID Source,
* IN ULONG Length,
@ -776,7 +996,20 @@ NTSTATUS STDCALL TdiCopyBufferToMdl(
#define TdiCopyLookaheadData(Destination, Source, Length, ReceiveFlags) \
RtlCopyMemory(Destination, Source, Length)
NTSTATUS STDCALL TdiCopyMdlToBuffer(
TDIKRNLAPI
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 ULONG SourceOffset,
IN PVOID DestinationBuffer,
@ -784,22 +1017,157 @@ NTSTATUS STDCALL TdiCopyMdlToBuffer(
IN ULONG DestinationBufferSize,
OUT PULONG BytesCopied);
VOID STDCALL TdiMapBuffer(
TDIKRNLAPI
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);
NTSTATUS STDCALL TdiMapUserRequest(
TDIKRNLAPI
NTSTATUS
DDKAPI
TdiMapUserRequest(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp,
IN PIO_STACK_LOCATION IrpSp);
VOID STDCALL TdiReturnChainedReceives(
TDIKRNLAPI
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 ULONG NumberOfTsdus);
VOID STDCALL TdiUnmapBuffer(
TDIKRNLAPI
VOID
DDKAPI
TdiUnmapBuffer(
IN PMDL MdlChain);
#pragma pack(pop)
#ifdef __cplusplus
}
#endif
#endif /* __TDIKRNL_H */
/* EOF */