mirror of
https://github.com/reactos/reactos.git
synced 2025-05-22 02:25:18 +00:00
- Build AFD, TCPIP and TDI with w32api headers.
- Removed the old TDI headers from include/net. svn path=/trunk/; revision=8508
This commit is contained in:
parent
5eed2db5ae
commit
daaf2a72b8
32 changed files with 257 additions and 3234 deletions
|
@ -143,8 +143,13 @@ AfdCreate(
|
|||
FCB->HelperContext = SocketInfo->HelperContext;
|
||||
FCB->NotificationEvents = SocketInfo->NotificationEvents;
|
||||
|
||||
if (RtlCreateUnicodeString(&FCB->TdiDeviceName, SocketInfo->TdiDeviceName.Buffer)) {
|
||||
FCB->TdiDeviceName.Length = 0;
|
||||
FCB->TdiDeviceName.MaximumLength = SocketInfo->TdiDeviceName.MaximumLength;
|
||||
FCB->TdiDeviceName.Buffer = ExAllocatePool(
|
||||
NonPagedPool,
|
||||
FCB->TdiDeviceName.MaximumLength);
|
||||
|
||||
if (FCB->TdiDeviceName.Buffer) {
|
||||
RtlCopyUnicodeString(&FCB->TdiDeviceName, &SocketInfo->TdiDeviceName);
|
||||
|
||||
AFD_DbgPrint(MAX_TRACE, ("TDI device name is (%wZ).\n", &FCB->TdiDeviceName));
|
||||
|
|
|
@ -585,6 +585,54 @@ NTSTATUS TdiQueryDeviceControl(
|
|||
}
|
||||
|
||||
|
||||
NTSTATUS TdiQueryInformation(
|
||||
PFILE_OBJECT FileObject,
|
||||
LONG QueryType,
|
||||
PMDL MdlBuffer)
|
||||
/*
|
||||
* FUNCTION: Query for information
|
||||
* ARGUMENTS:
|
||||
* FileObject = Pointer to file object
|
||||
* QueryType = Query type
|
||||
* MdlBuffer = Pointer to MDL buffer specific for query type
|
||||
* RETURNS:
|
||||
* Status of operation
|
||||
*/
|
||||
{
|
||||
PDEVICE_OBJECT DeviceObject;
|
||||
IO_STATUS_BLOCK Iosb;
|
||||
NTSTATUS Status;
|
||||
KEVENT Event;
|
||||
PIRP Irp;
|
||||
|
||||
DeviceObject = IoGetRelatedDeviceObject(FileObject);
|
||||
|
||||
KeInitializeEvent(&Event, NotificationEvent, FALSE);
|
||||
|
||||
Irp = TdiBuildInternalDeviceControlIrp(IOCTL_TCP_QUERY_INFORMATION, /* Sub function */
|
||||
DeviceObject, /* Device object */
|
||||
ConnectionObject, /* File object */
|
||||
&Event, /* Event */
|
||||
&Iosb); /* Status */
|
||||
if (!Irp) {
|
||||
return STATUS_INSUFFICIENT_RESOURCES;
|
||||
}
|
||||
|
||||
TdiBuildQueryInformation(
|
||||
Irp,
|
||||
DeviceObject,
|
||||
FileObject,
|
||||
NULL,
|
||||
NULL,
|
||||
QueryType,
|
||||
MdlBuffer);
|
||||
|
||||
Status = TdiCall(Irp, DeviceObject, &Event, &Iosb);
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
NTSTATUS TdiQueryInformationEx(
|
||||
PFILE_OBJECT FileObject,
|
||||
ULONG Entity,
|
||||
|
|
|
@ -10,11 +10,14 @@
|
|||
#include <winsock2.h>
|
||||
#include <ddk/ntddk.h>
|
||||
#include <ddk/ntifs.h>
|
||||
#include <net/tdikrnl.h>
|
||||
#include <net/tdiinfo.h>
|
||||
#include <ddk/tdiinfo.h>
|
||||
#include <ddk/tdikrnl.h>
|
||||
#include <afd/shared.h>
|
||||
#include <debug.h>
|
||||
|
||||
#define IP_MIB_STATS_ID 1
|
||||
#define IP_MIB_ADDRTABLE_ENTRY_ID 0x102
|
||||
|
||||
/* Forward declarations */
|
||||
struct _AFDFCB;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $Id: makefile,v 1.9 2004/02/07 04:50:44 arty Exp $
|
||||
# $Id: makefile,v 1.10 2004/03/02 18:18:13 navaraf Exp $
|
||||
|
||||
PATH_TO_TOP = ../../..
|
||||
|
||||
|
@ -6,7 +6,7 @@ TARGET_TYPE = driver
|
|||
|
||||
TARGET_NAME = afd
|
||||
|
||||
TARGET_CFLAGS = -I./include -DDBG -Werror -Wall
|
||||
TARGET_CFLAGS = -I./include -DDBG -D__USE_W32API -Werror -Wall
|
||||
|
||||
TARGET_OBJECTS = \
|
||||
afd/afd.o \
|
||||
|
|
|
@ -19,25 +19,12 @@
|
|||
#include <ndis.h>
|
||||
#else /* _MSC_VER */
|
||||
#include <ddk/ntddk.h>
|
||||
#include <ddk/xfilter.h>
|
||||
#include <net/ndis.h>
|
||||
#endif /* _MSC_VER */
|
||||
|
||||
#include <debug.h>
|
||||
|
||||
|
||||
#ifndef _MSC_VER
|
||||
/* FIXME: The following should be moved to ntddk.h */
|
||||
|
||||
/*
|
||||
* ULONG MmGetMdlByteCount(
|
||||
* IN PMDL Mdl)
|
||||
*/
|
||||
#define MmGetMdlByteCount(Mdl) \
|
||||
((Mdl)->ByteCount)
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* Exported functions */
|
||||
#ifdef _MSC_VER
|
||||
#define EXPORT __declspec(dllexport)
|
||||
|
|
|
@ -451,6 +451,8 @@ NdisSetupDmaTransfer(
|
|||
}
|
||||
|
||||
|
||||
#undef NdisUpdateSharedMemory
|
||||
|
||||
/*
|
||||
* @unimplemented
|
||||
*/
|
||||
|
|
|
@ -89,10 +89,7 @@ NdisWriteErrorLogEntry(
|
|||
IN NDIS_HANDLE NdisAdapterHandle,
|
||||
IN NDIS_ERROR_CODE ErrorCode,
|
||||
IN ULONG NumberOfErrorValues,
|
||||
IN ULONG ERROR_LOG_MAXIMUM_SIZE)
|
||||
/* IN ULONG ...)
|
||||
* ERROR_LOG_MAXIMUM_SIZE = ... in MSDN
|
||||
*/
|
||||
...)
|
||||
/*
|
||||
* FUNCTION: Write a syslog error
|
||||
* ARGUMENTS:
|
||||
|
|
|
@ -1037,9 +1037,9 @@ NTSTATUS LANRegisterProtocol(
|
|||
ProtChars.CloseAdapterCompleteHandler = ProtocolCloseAdapterComplete;
|
||||
ProtChars.ResetCompleteHandler = ProtocolResetComplete;
|
||||
ProtChars.RequestCompleteHandler = ProtocolRequestComplete;
|
||||
ProtChars.u2.SendCompleteHandler = ProtocolSendComplete;
|
||||
ProtChars.u3.TransferDataCompleteHandler = ProtocolTransferDataComplete;
|
||||
ProtChars.u4.ReceiveHandler = ProtocolReceive;
|
||||
ProtChars.SendCompleteHandler = ProtocolSendComplete;
|
||||
ProtChars.TransferDataCompleteHandler = ProtocolTransferDataComplete;
|
||||
ProtChars.ReceiveHandler = ProtocolReceive;
|
||||
ProtChars.ReceiveCompleteHandler = ProtocolReceiveComplete;
|
||||
ProtChars.StatusHandler = ProtocolStatus;
|
||||
ProtChars.StatusCompleteHandler = ProtocolStatusComplete;
|
||||
|
|
|
@ -73,8 +73,7 @@ PADDRESS_FILE AddrSearchFirst(
|
|||
PADDRESS_FILE AddrSearchNext(
|
||||
PAF_SEARCH SearchContext);
|
||||
|
||||
ULONG inet_addr(
|
||||
PCSTR AddrString);
|
||||
unsigned long PASCAL inet_addr(const char*);
|
||||
|
||||
#endif /* __ADDRESS_H */
|
||||
|
||||
|
|
|
@ -45,9 +45,13 @@ typedef struct IPADDR_ENTRY {
|
|||
} IPADDR_ENTRY, *PIPADDR_ENTRY;
|
||||
|
||||
#define IP_MIB_STATS_ID 1
|
||||
#ifndef IP_MIB_ADDRTABLE_ENTRY_ID
|
||||
#define IP_MIB_ADDRTABLE_ENTRY_ID 0x102
|
||||
#endif
|
||||
|
||||
#ifndef MAX_PHYSADDR_SIZE
|
||||
#define MAX_PHYSADDR_SIZE 8
|
||||
#endif
|
||||
|
||||
|
||||
/* Only UDP is supported */
|
||||
|
|
|
@ -184,7 +184,9 @@ typedef VOID (*IP_PROTOCOL_HANDLER)(
|
|||
#define LOOPBACK_ADDRMASK_IPv4 ((IPv4_RAW_ADDRESS)DH2N(0xFFFFFF00))
|
||||
|
||||
/* Protocol definitions */
|
||||
#ifndef IPPROTO_RAW
|
||||
#define IPPROTO_RAW 0 /* Raw IP */
|
||||
#endif
|
||||
#define IPPROTO_ICMP 1 /* Internet Control Message Protocol */
|
||||
#define IPPROTO_IGMP 2 /* Internet Group Management Protocol */
|
||||
#define IPPROTO_TCP 6 /* Transmission Control Protocol */
|
||||
|
|
|
@ -23,9 +23,9 @@
|
|||
#include <tdiinfo.h>
|
||||
#else
|
||||
#include <ddk/ntddk.h>
|
||||
#include <net/ndis.h>
|
||||
#include <net/tdikrnl.h>
|
||||
#include <net/tdiinfo.h>
|
||||
#include <ddk/ndis.h>
|
||||
#include <ddk/tdikrnl.h>
|
||||
#include <ddk/tdiinfo.h>
|
||||
#endif
|
||||
|
||||
#include <debug.h>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $Id: makefile,v 1.14 2004/02/22 09:59:17 chorns Exp $
|
||||
# $Id: makefile,v 1.15 2004/03/02 18:18:14 navaraf Exp $
|
||||
|
||||
PATH_TO_TOP = ../../..
|
||||
|
||||
|
@ -8,7 +8,7 @@ TARGET_TYPE = export_driver
|
|||
|
||||
TARGET_NAME = tcpip
|
||||
|
||||
TARGET_CFLAGS = -I./include -DDBG=1 -DNDIS40
|
||||
TARGET_CFLAGS = -I./include -DDBG=1 -DNDIS40 -D__USE_W32API
|
||||
|
||||
TARGET_DDKLIBS = ndis.a
|
||||
|
||||
|
|
|
@ -414,7 +414,7 @@ PADDRESS_FILE AddrSearchNext(
|
|||
return NULL;
|
||||
}
|
||||
|
||||
ULONG inet_addr(PCSTR AddrString)
|
||||
unsigned long PASCAL inet_addr(const char *AddrString)
|
||||
/*
|
||||
* Convert an ansi string dotted-quad address to a ulong
|
||||
* NOTES:
|
||||
|
|
|
@ -444,9 +444,74 @@ NTSTATUS DispTdiDisconnect(
|
|||
* Status of operation
|
||||
*/
|
||||
{
|
||||
PTDI_REQUEST_KERNEL_QUERY_INFORMATION Parameters;
|
||||
PTRANSPORT_CONTEXT TranContext;
|
||||
PIO_STACK_LOCATION IrpSp;
|
||||
|
||||
TI_DbgPrint(DEBUG_IRP, ("Called.\n"));
|
||||
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
IrpSp = IoGetCurrentIrpStackLocation(Irp);
|
||||
Parameters = (PTDI_REQUEST_KERNEL_QUERY_INFORMATION)&IrpSp->Parameters;
|
||||
|
||||
TranContext = IrpSp->FileObject->FsContext;
|
||||
if (!TranContext) {
|
||||
TI_DbgPrint(MID_TRACE, ("Bad transport context.\n"));
|
||||
return STATUS_INVALID_CONNECTION;
|
||||
}
|
||||
|
||||
switch (Parameters->QueryType)
|
||||
{
|
||||
case TDI_QUERY_ADDRESS_INFO:
|
||||
{
|
||||
PTDI_ADDRESS_INFO AddressInfo;
|
||||
PADDRESS_FILE AddrFile;
|
||||
PTA_IP_ADDRESS Address;
|
||||
|
||||
AddressInfo = (PTDI_ADDRESS_INFO)MmGetSystemAddressForMdl(Irp->MdlAddress);
|
||||
|
||||
switch ((ULONG)IrpSp->FileObject->FsContext2) {
|
||||
case TDI_TRANSPORT_ADDRESS_FILE:
|
||||
AddrFile = (PADDRESS_FILE)TranContext->Handle.AddressHandle;
|
||||
break;
|
||||
|
||||
case TDI_CONNECTION_FILE:
|
||||
AddrFile = ((PCONNECTION_ENDPOINT)TranContext->Handle.ConnectionContext)->AddressFile;
|
||||
break;
|
||||
|
||||
default:
|
||||
TI_DbgPrint(MIN_TRACE, ("Invalid transport context\n"));
|
||||
return STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
if (!AddrFile) {
|
||||
TI_DbgPrint(MID_TRACE, ("No address file object.\n"));
|
||||
return STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
if (MmGetMdlByteCount(Irp->MdlAddress) <
|
||||
(sizeof(TDI_ADDRESS_INFO) + sizeof(TDI_ADDRESS_IP))) {
|
||||
TI_DbgPrint(MID_TRACE, ("MDL buffer too small.\n"));
|
||||
return STATUS_BUFFER_OVERFLOW;
|
||||
}
|
||||
|
||||
/* FIXME: Is this count really the one we should return? */
|
||||
AddressInfo->ActivityCount = AddrFile->RefCount;
|
||||
|
||||
Address = (PTA_IP_ADDRESS)&AddressInfo->Address;
|
||||
Address->TAAddressCount = 1;
|
||||
Address->Address[0].AddressLength = TDI_ADDRESS_LENGTH_IP;
|
||||
Address->Address[0].AddressType = TDI_ADDRESS_TYPE_IP;
|
||||
Address->Address[0].Address[0].sin_port = AddrFile->Port;
|
||||
Address->Address[0].Address[0].in_addr = AddrFile->ADE->Address->Address.IPv4Address;
|
||||
RtlZeroMemory(
|
||||
&Address->Address[0].Address[0].sin_zero,
|
||||
sizeof(Address->Address[0].Address[0].sin_zero));
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -341,7 +341,7 @@ UINT CopyPacketToBufferChain(
|
|||
return 0;
|
||||
|
||||
/* Skip SrcOffset bytes in the source packet */
|
||||
NdisGetFirstBufferFromPacket(SrcPacket, &SrcBuffer, (PVOID)&SrcData, &SrcSize, &Total);
|
||||
NdisGetFirstBufferFromPacket(SrcPacket, &SrcBuffer, &SrcData, &SrcSize, &Total);
|
||||
if (SkipToOffset(SrcBuffer, SrcOffset, &SrcData, &SrcSize) == -1)
|
||||
return 0;
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/* $Id: dereg.c,v 1.7 2004/01/28 20:55:50 ekohl Exp $
|
||||
/* $Id: dereg.c,v 1.8 2004/03/02 18:18:14 navaraf Exp $
|
||||
*
|
||||
*/
|
||||
#include <ddk/ntddk.h>
|
||||
#include <net/tdi.h>
|
||||
#include <ddk/tdi.h>
|
||||
|
||||
/* De-/Register Action IDs for TdiDeRegister */
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
/* $Id: handler.c,v 1.6 2004/01/28 20:55:50 ekohl Exp $
|
||||
/* $Id: handler.c,v 1.7 2004/03/02 18:18:14 navaraf Exp $
|
||||
*
|
||||
* DESCRIPTION: Default TDI event handlers.
|
||||
*/
|
||||
#include <ddk/ntddk.h>
|
||||
#include <net/tdi.h>
|
||||
#include <ddk/tdi.h>
|
||||
|
||||
|
||||
/*
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
|
||||
/* $Id: stubs.c,v 1.8 2004/01/28 20:55:50 ekohl Exp $
|
||||
/* $Id: stubs.c,v 1.9 2004/03/02 18:18:14 navaraf Exp $
|
||||
*
|
||||
*/
|
||||
#include <ddk/ntddk.h>
|
||||
#include <net/tdi.h>
|
||||
#include <ddk/tdi.h>
|
||||
|
||||
/*
|
||||
* @unimplemented
|
||||
|
|
|
@ -1,851 +0,0 @@
|
|||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS NDIS library
|
||||
* FILE: include/net/miniport.h
|
||||
* PURPOSE: Type definitions available only to NDIS miniport drivers
|
||||
*/
|
||||
#if 0
|
||||
#ifndef __MINIPORT_H
|
||||
#define __MINIPORT_H
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#include <ntstatus.h>
|
||||
#else /* _MSC_VER */
|
||||
#include <ddk/status.h>
|
||||
#endif /* _MSC_VER */
|
||||
|
||||
/* Base types */
|
||||
|
||||
#define IN
|
||||
#define OUT
|
||||
#define OPTIONAL
|
||||
|
||||
#define ANYSIZE_ARRAY 1
|
||||
|
||||
#define CONST const
|
||||
|
||||
#ifdef _MSC_VER
|
||||
|
||||
#ifdef i386
|
||||
#define STDCALL _stdcall
|
||||
#define CDECL _cdecl
|
||||
#else /* i386 */
|
||||
#define STDCALL
|
||||
#define CDECL
|
||||
#endif /* i386 */
|
||||
|
||||
#else /* _MSC_VER */
|
||||
|
||||
#ifdef i386
|
||||
#define STDCALL __attribute__ ((stdcall))
|
||||
#define CDECL __attribute__ ((cdecl))
|
||||
#else /* i386 */
|
||||
#define STDCALL
|
||||
#define CDECL
|
||||
#endif /* i386 */
|
||||
|
||||
#endif /* _MSC_VER */
|
||||
|
||||
typedef void VOID, *PVOID;
|
||||
typedef char CHAR, *PCHAR;
|
||||
typedef unsigned char UCHAR, *PUCHAR;
|
||||
typedef short SHORT, *PSHORT;
|
||||
typedef unsigned short USHORT, *PUSHORT;
|
||||
typedef long LONG,*PLONG;
|
||||
typedef unsigned long ULONG,*PULONG;
|
||||
typedef double DOUBLE, *PDOUBLE;
|
||||
typedef struct _QUAD {
|
||||
double DoNotUseThisField;
|
||||
} QUAD,*PQUAD;
|
||||
typedef QUAD UQUAD, *PUQUAD;
|
||||
typedef signed int INT, *PINT;
|
||||
typedef unsigned int UINT, *PUINT;
|
||||
typedef double LONGLONG, *PLONGLONG;
|
||||
typedef double ULONGLONG, *PULONGLONG;
|
||||
|
||||
typedef UCHAR BOOLEAN, *PBOOLEAN;
|
||||
typedef ULONG DWORD, *PDWORD;
|
||||
|
||||
/* Cardinal types */
|
||||
typedef CHAR CCHAR, *PCCHAR;
|
||||
typedef SHORT CSHORT, *PCSHORT;
|
||||
typedef ULONG CLONG, *PCLONG;
|
||||
|
||||
/* UNICODE (wide character) types */
|
||||
#ifndef __cplusplus
|
||||
typedef short unsigned int wchar_t;
|
||||
#endif /* __cplusplus */
|
||||
typedef wchar_t WCHAR;
|
||||
typedef WCHAR *PWCHAR;
|
||||
typedef WCHAR *LPWCH, *PWCH;
|
||||
typedef CONST WCHAR *LPCWCH, *PCWCH;
|
||||
typedef WCHAR *NWPSTR;
|
||||
typedef WCHAR *LPWSTR, *PWSTR;
|
||||
typedef CONST WCHAR *LPCWSTR, *PCWSTR;
|
||||
|
||||
/* ANSI (multi-byte character) types */
|
||||
typedef CHAR *LPCH, *PCH;
|
||||
typedef CONST CHAR *LPCCH, *PCCH;
|
||||
typedef CHAR *NPSTR;
|
||||
typedef CHAR *LPSTR, *PSTR;
|
||||
typedef CONST CHAR *LPCSTR, *PCSTR;
|
||||
|
||||
/* Neutral ANSI/UNICODE types */
|
||||
#ifdef UNICODE
|
||||
|
||||
typedef WCHAR TCHAR, *PTCHAR;
|
||||
typedef WCHAR TUCHAR, *PTUCHAR;
|
||||
|
||||
typedef LPWSTR LPTCH, PTCH;
|
||||
typedef LPWSTR PTSTR, LPTSTR;
|
||||
typedef LPCWSTR LPCTSTR;
|
||||
typedef LPWSTR LP;
|
||||
#define _TEXT(string) L##string
|
||||
#define _T(string) L##string
|
||||
|
||||
#else /* UNICODE */
|
||||
|
||||
typedef CHAR TCHAR, *PTCHAR;
|
||||
typedef UCHAR TUCHAR, *PTUCHAR;
|
||||
|
||||
typedef LPSTR LPTCH, PTCH;
|
||||
typedef LPSTR PTSTR, LPTSTR;
|
||||
typedef LPCSTR LPCTSTR;
|
||||
#define _TEXT(string) string
|
||||
#define _T(string) string
|
||||
|
||||
#endif /* UNICODE */
|
||||
|
||||
#define TEXT(string) __TEXT(string)
|
||||
|
||||
|
||||
typedef union _LARGE_INTEGER {
|
||||
struct {
|
||||
ULONG LowPart;
|
||||
LONG HighPart;
|
||||
};
|
||||
struct {
|
||||
ULONG LowPart;
|
||||
LONG HighPart;
|
||||
} u;
|
||||
LONGLONG QuadPart;
|
||||
} LARGE_INTEGER;
|
||||
|
||||
typedef LARGE_INTEGER *PLARGE_INTEGER;
|
||||
|
||||
typedef union _ULARGE_INTEGER {
|
||||
struct {
|
||||
ULONG LowPart;
|
||||
ULONG HighPart;
|
||||
};
|
||||
struct {
|
||||
ULONG LowPart;
|
||||
ULONG HighPart;
|
||||
} u;
|
||||
ULONGLONG QuadPart;
|
||||
} ULARGE_INTEGER;
|
||||
|
||||
typedef ULARGE_INTEGER *PULARGE_INTEGER;
|
||||
|
||||
|
||||
typedef LARGE_INTEGER PHYSICAL_ADDRESS, *PPHYSICAL_ADDRESS;
|
||||
|
||||
|
||||
|
||||
/* NT status type and macros for checking status */
|
||||
typedef LONG NTSTATUS;
|
||||
typedef NTSTATUS *PNTSTATUS;
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#define NT_SUCCESS(Status) ((ULONG)(Status) >= 0)
|
||||
#endif /* _MSC_VER */
|
||||
#define NT_INFORMATION(Status) ((ULONG)(Status) >> 30 == 1)
|
||||
#define NT_WARNING(Status) ((ULONG)(Status) >> 30 == 2)
|
||||
#define NT_ERROR(Status) ((ULONG)(Status) >> 30 == 3)
|
||||
|
||||
#define APPLICATION_ERROR_MASK 0x20000000
|
||||
#define ERROR_SEVERITY_SUCCESS 0x00000000
|
||||
#define ERROR_SEVERITY_INFORMATIONAL 0x40000000
|
||||
#define ERROR_SEVERITY_WARNING 0x80000000
|
||||
#define ERROR_SEVERITY_ERROR 0xC0000000
|
||||
|
||||
|
||||
|
||||
/* Basic constants */
|
||||
|
||||
#define FALSE 0
|
||||
#define TRUE 1
|
||||
|
||||
#define NULL ((PVOID)0)
|
||||
|
||||
|
||||
|
||||
/* Counted strings */
|
||||
|
||||
typedef struct _STRING
|
||||
{
|
||||
USHORT Length;
|
||||
USHORT MaximumLength;
|
||||
PCHAR Buffer;
|
||||
} STRING, *PSTRING;
|
||||
|
||||
typedef STRING ANSI_STRING, *PANSI_STRING;
|
||||
typedef STRING OEM_STRING, *POEM_STRING;
|
||||
|
||||
#define ANSI_NULL ((CHAR)0)
|
||||
|
||||
typedef struct _CSTRING
|
||||
{
|
||||
USHORT Length;
|
||||
USHORT MaximumLength;
|
||||
CONST CHAR *Buffer;
|
||||
} CSTRING, *PCSTRING;
|
||||
|
||||
typedef CSTRING CANSI_STRING, *PCANSI_STRING;
|
||||
|
||||
|
||||
typedef struct _UNICODE_STRING
|
||||
{
|
||||
USHORT Length;
|
||||
USHORT MaximumLength;
|
||||
PWSTR Buffer;
|
||||
} UNICODE_STRING, *PUNICODE_STRING;
|
||||
|
||||
typedef struct _CUNICODE_STRING
|
||||
{
|
||||
USHORT Length;
|
||||
USHORT MaximumLength;
|
||||
CONST PWSTR Buffer;
|
||||
} CUNICODE_STRING, *PCUNICODE_STRING;
|
||||
|
||||
#define UNICODE_NULL ((WCHAR)0)
|
||||
|
||||
|
||||
|
||||
/* Linked lists */
|
||||
|
||||
typedef struct _LIST_ENTRY
|
||||
{
|
||||
struct _LIST_ENTRY *Flink;
|
||||
struct _LIST_ENTRY *Blink;
|
||||
} LIST_ENTRY, *PLIST_ENTRY;
|
||||
|
||||
typedef struct _SINGLE_LIST_ENTRY
|
||||
{
|
||||
struct _SINGLE_LIST_ENTRY *Next;
|
||||
} SINGLE_LIST_ENTRY, *PSINGLE_LIST_ENTRY;
|
||||
|
||||
|
||||
/*
|
||||
* VOID InitializeListHead(
|
||||
* PLIST_ENTRY ListHead);
|
||||
*/
|
||||
#define InitializeListHead(ListHead) \
|
||||
{ \
|
||||
(ListHead)->Flink = (ListHead); \
|
||||
(ListHead)->Blink = (ListHead); \
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* VOID InsertHeadList(
|
||||
* LIST_ENTRY ListHead,
|
||||
* PLIST_ENTRY Entry);
|
||||
*/
|
||||
#define InsertHeadList(ListHead, ListEntry) \
|
||||
{ \
|
||||
PLIST_ENTRY OldFlink; \
|
||||
OldFlink = (ListHead)->Flink; \
|
||||
(ListEntry)->Flink = OldFlink; \
|
||||
(ListEntry)->Blink = (ListHead); \
|
||||
OldFlink->Blink = (ListEntry); \
|
||||
(ListHead)->Flink = (ListEntry); \
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* VOID InsertTailList(
|
||||
* PLIST_ENTRY ListHead,
|
||||
* PLIST_ENTRY Entry);
|
||||
*/
|
||||
#define InsertTailList(ListHead, ListEntry) \
|
||||
{ \
|
||||
PLIST_ENTRY OldBlink; \
|
||||
OldBlink = (ListHead)->Blink; \
|
||||
(ListEntry)->Flink = (ListHead); \
|
||||
(ListEntry)->Blink = OldBlink; \
|
||||
OldBlink->Flink = (ListEntry); \
|
||||
(ListHead)->Blink = (ListEntry); \
|
||||
}
|
||||
|
||||
/*
|
||||
* BOOLEAN IsListEmpty(
|
||||
* PLIST_ENTRY ListHead);
|
||||
*/
|
||||
#define IsListEmpty(ListHead) \
|
||||
((ListHead)->Flink == (ListHead))
|
||||
|
||||
|
||||
/*
|
||||
* PSINGLE_LIST_ENTRY PopEntryList(
|
||||
* PSINGLE_LIST_ENTRY ListHead);
|
||||
*/
|
||||
#define PopEntryList(ListHead) \
|
||||
(ListHead)->Next; \
|
||||
{ \
|
||||
PSINGLE_LIST_ENTRY FirstEntry; \
|
||||
\
|
||||
FirstEntry = (ListHead)->Next; \
|
||||
if (FirstEntry != NULL) \
|
||||
{ \
|
||||
(ListHead)->Next = FirstEntry->Next; \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* VOID PushEntryList(
|
||||
* PSINGLE_LIST_ENTRY ListHead,
|
||||
* PSINGLE_LIST_ENTRY Entry);
|
||||
*/
|
||||
#define PushEntryList(ListHead, Entry) \
|
||||
(Entry)->Next = (ListHead)->Next; \
|
||||
(ListHead)->Next = (Entry)
|
||||
|
||||
|
||||
/*
|
||||
* VOID RemoveEntryList(
|
||||
* PLIST_ENTRY Entry);
|
||||
*/
|
||||
#define RemoveEntryList(ListEntry) \
|
||||
{ \
|
||||
PLIST_ENTRY OldFlink; \
|
||||
PLIST_ENTRY OldBlink; \
|
||||
OldFlink = (ListEntry)->Flink; \
|
||||
OldBlink = (ListEntry)->Blink; \
|
||||
OldFlink->Blink = OldBlink; \
|
||||
OldBlink->Flink = OldFlink; \
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* PLIST_ENTRY RemoveHeadList(
|
||||
* PLIST_ENTRY ListHead);
|
||||
*/
|
||||
#define RemoveHeadList(ListHead) \
|
||||
(ListHead)->Flink; \
|
||||
{ \
|
||||
RemoveEntryList((ListHead)->Flink) \
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* PLIST_ENTRY RemoveTailList(
|
||||
* PLIST_ENTRY ListHead);
|
||||
*/
|
||||
#define RemoveTailList(ListHead) \
|
||||
(ListHead)->Blink; \
|
||||
{ \
|
||||
RemoveEntryList((ListHead)->Blink) \
|
||||
}
|
||||
|
||||
|
||||
/* Hardware */
|
||||
|
||||
typedef UCHAR KIRQL, *PKIRQL;
|
||||
|
||||
typedef struct _KSPIN_LOCK
|
||||
{
|
||||
ULONG Lock;
|
||||
} KSPIN_LOCK, *PKSPIN_LOCK;
|
||||
|
||||
|
||||
typedef struct _ADAPTER_OBJECT *PADAPTER_OBJECT;
|
||||
typedef struct _DEVICE_OBJECT *PDEVICE_OBJECT;
|
||||
typedef struct _DRIVER_OBJECT *PDRIVER_OBJECT;
|
||||
typedef struct _FILE_OBJECT *PFILE_OBJECT;
|
||||
|
||||
typedef struct _KINTERRUPT *PKINTERRUPT;
|
||||
|
||||
|
||||
/* Memory Descriptor List */
|
||||
typedef struct _MDL {
|
||||
struct _MDL *Next;
|
||||
CSHORT Size;
|
||||
CSHORT MdlFlags;
|
||||
struct _EPROCESS *Process;
|
||||
PVOID MappedSystemVa;
|
||||
PVOID StartVa;
|
||||
ULONG ByteCount;
|
||||
ULONG ByteOffset;
|
||||
} MDL, *PMDL;
|
||||
|
||||
#define MDL_MAPPED_TO_SYSTEM_VA 0x0001
|
||||
#define MDL_PAGES_LOCKED 0x0002
|
||||
#define MDL_SOURCE_IS_NONPAGED_POOL 0x0004
|
||||
#define MDL_ALLOCATED_FIXED_SIZE 0x0008
|
||||
#define MDL_PARTIAL 0x0010
|
||||
#define MDL_PARTIAL_HAS_BEEN_MAPPED 0x0020
|
||||
#define MDL_IO_PAGE_READ 0x0040
|
||||
#define MDL_WRITE_OPERATION 0x0080
|
||||
#define MDL_PARENT_MAPPED_SYSTEM_VA 0x0100
|
||||
#define MDL_LOCK_HELD 0x0200
|
||||
#define MDL_PHYSICAL_VIEW 0x0400
|
||||
#define MDL_IO_SPACE 0x0800
|
||||
#define MDL_NETWORK_HEADER 0x1000
|
||||
#define MDL_MAPPING_CAN_FAIL 0x2000
|
||||
#define MDL_ALLOCATED_MUST_SUCCEED 0x4000
|
||||
|
||||
|
||||
#define MDL_MAPPING_FLAGS (MDL_MAPPED_TO_SYSTEM_VA | \
|
||||
MDL_PAGES_LOCKED | \
|
||||
MDL_SOURCE_IS_NONPAGED_POOL | \
|
||||
MDL_PARTIAL_HAS_BEEN_MAPPED | \
|
||||
MDL_PARENT_MAPPED_SYSTEM_VA | \
|
||||
MDL_LOCK_HELD | \
|
||||
MDL_SYSTEM_VA | \
|
||||
MDL_IO_SPACE )
|
||||
|
||||
|
||||
typedef struct _DISPATCHER_HEADER
|
||||
{
|
||||
UCHAR Type;
|
||||
UCHAR Absolute;
|
||||
UCHAR Size;
|
||||
UCHAR Inserted;
|
||||
LONG SignalState;
|
||||
LIST_ENTRY WaitListHead;
|
||||
} DISPATCHER_HEADER;
|
||||
|
||||
typedef struct _KEVENT
|
||||
{
|
||||
DISPATCHER_HEADER Header;
|
||||
} KEVENT, *PKEVENT;
|
||||
|
||||
|
||||
typedef struct _KTIMER
|
||||
{
|
||||
DISPATCHER_HEADER Header;
|
||||
ULARGE_INTEGER DueTime;
|
||||
LIST_ENTRY TimerListEntry;
|
||||
struct _KDPC *Dpc;
|
||||
LONG Period;
|
||||
} KTIMER, *PKTIMER;
|
||||
|
||||
|
||||
typedef enum _KDPC_IMPORTANCE
|
||||
{
|
||||
LowImportance,
|
||||
MediumImportance,
|
||||
HighImportance
|
||||
} KDPC_IMPORTANCE;
|
||||
|
||||
/* Forward declaration */
|
||||
struct _KDPC;
|
||||
|
||||
typedef VOID (*PKDEFERRED_ROUTINE)(
|
||||
IN struct _KDPC *Dpc,
|
||||
IN PVOID DeferredContext,
|
||||
IN PVOID SystemArgument1,
|
||||
IN PVOID SystemArgument2);
|
||||
|
||||
/* Deferred Procedure Call */
|
||||
|
||||
typedef struct _KDPC {
|
||||
CSHORT Type;
|
||||
UCHAR Number;
|
||||
UCHAR Importance;
|
||||
LIST_ENTRY DpcListEntry;
|
||||
PKDEFERRED_ROUTINE DeferredRoutine;
|
||||
PVOID DeferredContext;
|
||||
PVOID SystemArgument1;
|
||||
PVOID SystemArgument2;
|
||||
PULONG Lock;
|
||||
} KDPC, *PKDPC;
|
||||
|
||||
|
||||
typedef enum _INTERFACE_TYPE
|
||||
{
|
||||
InterfaceTypeUndefined = -1,
|
||||
Internal,
|
||||
Isa,
|
||||
Eisa,
|
||||
MicroChannel,
|
||||
TurboChannel,
|
||||
PCIBus,
|
||||
VMEBus,
|
||||
NuBus,
|
||||
PCMCIABus,
|
||||
CBus,
|
||||
MPIBus,
|
||||
MPSABus,
|
||||
ProcessorInternal,
|
||||
InternalPowerBus,
|
||||
PNPISABus,
|
||||
MaximumInterfaceType
|
||||
} INTERFACE_TYPE, *PINTERFACE_TYPE;
|
||||
|
||||
|
||||
typedef enum _DMA_WIDTH
|
||||
{
|
||||
Width8Bits,
|
||||
Width16Bits,
|
||||
Width32Bits,
|
||||
MaximumDmaWidth
|
||||
} DMA_WIDTH, *PDMA_WIDTH;
|
||||
|
||||
typedef enum _DMA_SPEED
|
||||
{
|
||||
Compatible,
|
||||
TypeA,
|
||||
TypeB,
|
||||
TypeC,
|
||||
TypeF,
|
||||
MaximumDmaSpeed
|
||||
} DMA_SPEED, *PDMA_SPEED;
|
||||
|
||||
|
||||
typedef enum _KINTERRUPT_MODE
|
||||
{
|
||||
LevelSensitive,
|
||||
Latched
|
||||
} KINTERRUPT_MODE;
|
||||
|
||||
|
||||
typedef struct _DMA_CONFIGURATION_BYTE0
|
||||
{
|
||||
UCHAR Channel:3;
|
||||
UCHAR Reserved:3;
|
||||
UCHAR Shared:1;
|
||||
UCHAR MoreEntries:1;
|
||||
} DMA_CONFIGURATION_BYTE0;
|
||||
|
||||
typedef struct _DMA_CONFIGURATION_BYTE1
|
||||
{
|
||||
UCHAR Reserved0:2;
|
||||
UCHAR TransferSize:2;
|
||||
UCHAR Timing:2;
|
||||
UCHAR Reserved1:2;
|
||||
} DMA_CONFIGURATION_BYTE1;
|
||||
|
||||
|
||||
typedef struct _CM_MCA_POS_DATA
|
||||
{
|
||||
USHORT AdapterId;
|
||||
UCHAR PosData1;
|
||||
UCHAR PosData2;
|
||||
UCHAR PosData3;
|
||||
UCHAR PosData4;
|
||||
} CM_MCA_POS_DATA, *PCM_MCA_POS_DATA;
|
||||
|
||||
typedef struct _EISA_MEMORY_TYPE
|
||||
{
|
||||
UCHAR ReadWrite:1;
|
||||
UCHAR Cached:1;
|
||||
UCHAR Reserved0:1;
|
||||
UCHAR Type:2;
|
||||
UCHAR Shared:1;
|
||||
UCHAR Reserved1:1;
|
||||
UCHAR MoreEntries:1;
|
||||
} EISA_MEMORY_TYPE, *PEISA_MEMORY_TYPE;
|
||||
|
||||
typedef struct _EISA_MEMORY_CONFIGURATION
|
||||
{
|
||||
EISA_MEMORY_TYPE ConfigurationByte;
|
||||
UCHAR DataSize;
|
||||
USHORT AddressLowWord;
|
||||
UCHAR AddressHighByte;
|
||||
USHORT MemorySize;
|
||||
} EISA_MEMORY_CONFIGURATION, *PEISA_MEMORY_CONFIGURATION;
|
||||
|
||||
|
||||
typedef struct _EISA_IRQ_DESCRIPTOR
|
||||
{
|
||||
UCHAR Interrupt:4;
|
||||
UCHAR Reserved:1;
|
||||
UCHAR LevelTriggered:1;
|
||||
UCHAR Shared:1;
|
||||
UCHAR MoreEntries:1;
|
||||
} EISA_IRQ_DESCRIPTOR, *PEISA_IRQ_DESCRIPTOR;
|
||||
|
||||
typedef struct _EISA_IRQ_CONFIGURATION
|
||||
{
|
||||
EISA_IRQ_DESCRIPTOR ConfigurationByte;
|
||||
UCHAR Reserved;
|
||||
} EISA_IRQ_CONFIGURATION, *PEISA_IRQ_CONFIGURATION;
|
||||
|
||||
typedef struct _EISA_DMA_CONFIGURATION
|
||||
{
|
||||
DMA_CONFIGURATION_BYTE0 ConfigurationByte0;
|
||||
DMA_CONFIGURATION_BYTE1 ConfigurationByte1;
|
||||
} EISA_DMA_CONFIGURATION, *PEISA_DMA_CONFIGURATION;
|
||||
|
||||
|
||||
typedef struct _EISA_PORT_DESCRIPTOR
|
||||
{
|
||||
UCHAR NumberPorts:5;
|
||||
UCHAR Reserved:1;
|
||||
UCHAR Shared:1;
|
||||
UCHAR MoreEntries:1;
|
||||
} EISA_PORT_DESCRIPTOR, *PEISA_PORT_DESCRIPTOR;
|
||||
|
||||
typedef struct _EISA_PORT_CONFIGURATION
|
||||
{
|
||||
EISA_PORT_DESCRIPTOR Configuration;
|
||||
USHORT PortAddress;
|
||||
} EISA_PORT_CONFIGURATION, *PEISA_PORT_CONFIGURATION;
|
||||
|
||||
typedef struct _CM_EISA_SLOT_INFORMATION
|
||||
{
|
||||
UCHAR ReturnCode;
|
||||
UCHAR ReturnFlags;
|
||||
UCHAR MajorRevision;
|
||||
UCHAR MinorRevision;
|
||||
USHORT Checksum;
|
||||
UCHAR NumberFunctions;
|
||||
UCHAR FunctionInformation;
|
||||
ULONG CompressedId;
|
||||
} CM_EISA_SLOT_INFORMATION, *PCM_EISA_SLOT_INFORMATION;
|
||||
|
||||
typedef struct _CM_EISA_FUNCTION_INFORMATION
|
||||
{
|
||||
ULONG CompressedId;
|
||||
UCHAR IdSlotFlags1;
|
||||
UCHAR IdSlotFlags2;
|
||||
UCHAR MinorRevision;
|
||||
UCHAR MajorRevision;
|
||||
UCHAR Selections[26];
|
||||
UCHAR FunctionFlags;
|
||||
UCHAR TypeString[80];
|
||||
EISA_MEMORY_CONFIGURATION EisaMemory[9];
|
||||
EISA_IRQ_CONFIGURATION EisaIrq[7];
|
||||
EISA_DMA_CONFIGURATION EisaDma[4];
|
||||
EISA_PORT_CONFIGURATION EisaPort[20];
|
||||
UCHAR InitializationData[60];
|
||||
} CM_EISA_FUNCTION_INFORMATION, *PCM_EISA_FUNCTION_INFORMATION;
|
||||
|
||||
|
||||
typedef struct _CM_PARTIAL_RESOURCE_DESCRIPTOR
|
||||
{
|
||||
UCHAR Type;
|
||||
UCHAR ShareDisposition;
|
||||
USHORT Flags;
|
||||
union {
|
||||
struct {
|
||||
PHYSICAL_ADDRESS Start;
|
||||
ULONG Length;
|
||||
} Generic;
|
||||
|
||||
struct {
|
||||
PHYSICAL_ADDRESS Start;
|
||||
ULONG Length;
|
||||
} Port;
|
||||
|
||||
struct {
|
||||
ULONG Level;
|
||||
ULONG Vector;
|
||||
ULONG Affinity;
|
||||
} Interrupt;
|
||||
|
||||
struct {
|
||||
PHYSICAL_ADDRESS Start;
|
||||
ULONG Length;
|
||||
} Memory;
|
||||
|
||||
struct {
|
||||
ULONG Channel;
|
||||
ULONG Port;
|
||||
ULONG Reserved1;
|
||||
} Dma;
|
||||
|
||||
struct {
|
||||
ULONG Data[3];
|
||||
} DevicePrivate;
|
||||
|
||||
struct {
|
||||
ULONG Start;
|
||||
ULONG Length;
|
||||
ULONG Reserved;
|
||||
} BusNumber;
|
||||
|
||||
struct {
|
||||
ULONG DataSize;
|
||||
ULONG Reserved1;
|
||||
ULONG Reserved2;
|
||||
} DeviceSpecificData;
|
||||
} u;
|
||||
} CM_PARTIAL_RESOURCE_DESCRIPTOR, *PCM_PARTIAL_RESOURCE_DESCRIPTOR;
|
||||
|
||||
typedef struct _CM_PARTIAL_RESOURCE_LIST
|
||||
{
|
||||
USHORT Version;
|
||||
USHORT Revision;
|
||||
ULONG Count;
|
||||
CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1];
|
||||
} CM_PARTIAL_RESOURCE_LIST, *PCM_PARTIAL_RESOURCE_LIST;
|
||||
|
||||
typedef struct _CM_FULL_RESOURCE_DESCRIPTOR
|
||||
{
|
||||
INTERFACE_TYPE InterfaceType;
|
||||
ULONG BusNumber;
|
||||
CM_PARTIAL_RESOURCE_LIST PartialResourceList;
|
||||
} CM_FULL_RESOURCE_DESCRIPTOR, *PCM_FULL_RESOURCE_DESCRIPTOR;
|
||||
|
||||
typedef struct _CM_RESOURCE_LIST
|
||||
{
|
||||
ULONG Count;
|
||||
CM_FULL_RESOURCE_DESCRIPTOR List[1];
|
||||
} CM_RESOURCE_LIST, *PCM_RESOURCE_LIST;
|
||||
|
||||
|
||||
|
||||
/* Operating System services */
|
||||
|
||||
/* Debugging */
|
||||
|
||||
ULONG CDECL DbgPrint(
|
||||
PCH Format,
|
||||
...);
|
||||
|
||||
#ifdef DBG
|
||||
|
||||
VOID
|
||||
STDCALL
|
||||
RtlAssert(
|
||||
PVOID FailedAssertion,
|
||||
PVOID FileName,
|
||||
ULONG LineNumber,
|
||||
PCHAR Message);
|
||||
|
||||
#define ASSERT(exp) \
|
||||
if (!(exp)) \
|
||||
RtlAssert(#exp, __FILE__, __LINE__, NULL)
|
||||
|
||||
#define ASSERTMSG(msg, exp) \
|
||||
if (!(exp)) \
|
||||
RtlAssert(#exp, __FILE__, __LINE__, msg)
|
||||
|
||||
#else /* DBG */
|
||||
|
||||
#define ASSERT(exp)
|
||||
#define ASSERTMSG(msg, exp)
|
||||
|
||||
#endif /* DBG */
|
||||
|
||||
|
||||
/* Runtime library */
|
||||
|
||||
#define RtlEqualMemory(Destination,Source,Length) (!memcmp((Destination), (Source), (Length)))
|
||||
#define RtlMoveMemory(Destination,Source,Length) memmove((Destination), (Source), (Length))
|
||||
#define RtlCopyMemory(Destination,Source,Length) memcpy((Destination), (Source), (Length))
|
||||
#define RtlFillMemory(Destination,Length,Fill) memset((Destination), (Fill),(Length))
|
||||
#define RtlZeroMemory(Destination,Length) memset((Destination), 0, (Length))
|
||||
|
||||
|
||||
/* Core kernel functions */
|
||||
|
||||
VOID
|
||||
STDCALL
|
||||
KeStallExecutionProcessor(
|
||||
ULONG MicroSeconds);
|
||||
|
||||
|
||||
/* I/O functions */
|
||||
|
||||
VOID
|
||||
STDCALL
|
||||
READ_PORT_BUFFER_UCHAR(
|
||||
PUCHAR Port,
|
||||
PUCHAR Value,
|
||||
ULONG Count);
|
||||
|
||||
VOID
|
||||
STDCALL
|
||||
READ_PORT_BUFFER_ULONG(
|
||||
PULONG Port,
|
||||
PULONG Value,
|
||||
ULONG Count);
|
||||
|
||||
VOID
|
||||
STDCALL
|
||||
READ_PORT_BUFFER_USHORT(
|
||||
PUSHORT Port,
|
||||
PUSHORT Value,
|
||||
ULONG Count);
|
||||
|
||||
UCHAR
|
||||
STDCALL
|
||||
READ_PORT_UCHAR(
|
||||
PUCHAR Port);
|
||||
|
||||
ULONG
|
||||
STDCALL
|
||||
READ_PORT_ULONG(
|
||||
PULONG Port);
|
||||
|
||||
USHORT
|
||||
STDCALL
|
||||
READ_PORT_USHORT(
|
||||
PUSHORT Port);
|
||||
|
||||
VOID
|
||||
STDCALL
|
||||
WRITE_PORT_BUFFER_UCHAR(
|
||||
PUCHAR Port,
|
||||
PUCHAR Value,
|
||||
ULONG Count);
|
||||
|
||||
VOID
|
||||
STDCALL
|
||||
WRITE_PORT_BUFFER_ULONG(
|
||||
PULONG Port,
|
||||
PULONG Value,
|
||||
ULONG Count);
|
||||
|
||||
VOID
|
||||
STDCALL
|
||||
WRITE_PORT_BUFFER_USHORT(
|
||||
PUSHORT Port,
|
||||
PUSHORT Value,
|
||||
ULONG Count);
|
||||
|
||||
VOID
|
||||
STDCALL
|
||||
WRITE_PORT_UCHAR(
|
||||
PUCHAR Port,
|
||||
UCHAR Value);
|
||||
|
||||
VOID
|
||||
STDCALL
|
||||
WRITE_PORT_ULONG(
|
||||
PULONG Port,
|
||||
ULONG Value);
|
||||
|
||||
VOID
|
||||
STDCALL
|
||||
WRITE_PORT_USHORT(
|
||||
PUSHORT Port,
|
||||
USHORT Value);
|
||||
|
||||
VOID
|
||||
STDCALL
|
||||
WRITE_REGISTER_UCHAR(
|
||||
PUCHAR Register,
|
||||
UCHAR Value);
|
||||
|
||||
VOID
|
||||
STDCALL
|
||||
WRITE_REGISTER_ULONG(
|
||||
PULONG Register,
|
||||
ULONG Value);
|
||||
|
||||
VOID
|
||||
STDCALL
|
||||
WRITE_REGISTER_USHORT(
|
||||
PUSHORT Register,
|
||||
USHORT Value);
|
||||
|
||||
#endif /* __MINIPORT_H */
|
||||
|
||||
/* EOF */
|
||||
#endif
|
|
@ -52,7 +52,7 @@ extern "C" {
|
|||
|
||||
#include "ntddk.h"
|
||||
#include "ntddndis.h"
|
||||
#include "netpnp.h"
|
||||
#include <ddk/netpnp.h>
|
||||
|
||||
#ifdef NDIS50
|
||||
#undef NDIS40
|
||||
|
@ -2626,10 +2626,7 @@ NdisWriteErrorLogEntry(
|
|||
IN NDIS_HANDLE NdisAdapterHandle,
|
||||
IN NDIS_ERROR_CODE ErrorCode,
|
||||
IN ULONG NumberOfErrorValues,
|
||||
IN ULONG ERROR_LOG_MAXIMUM_SIZE);
|
||||
/* IN ULONG ...);
|
||||
* ERROR_LOG_MAXIMUM_SIZE = ... in MSDN
|
||||
*/
|
||||
...);
|
||||
|
||||
/*
|
||||
* VOID
|
||||
|
|
|
@ -1,42 +0,0 @@
|
|||
/*
|
||||
* 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 */
|
|
@ -1,73 +0,0 @@
|
|||
/*
|
||||
* 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 */
|
|
@ -1,66 +0,0 @@
|
|||
/*
|
||||
* 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 */
|
|
@ -1,641 +0,0 @@
|
|||
/*
|
||||
* 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
|
||||
* #ifndef INT
|
||||
* typedef signed int INT, *PINT;
|
||||
* #endif
|
||||
*/
|
||||
|
||||
|
||||
/* TDI transport driver dispatch routines */
|
||||
|
||||
NTSTATUS TdiDispatchCleanup(
|
||||
IN PDEVICE_OBJECT DeviceObject,
|
||||
IN PIRP Irp);
|
||||
|
||||
NTSTATUS TdiDispatchClose(
|
||||
IN PDEVICE_OBJECT DeviceObject,
|
||||
IN PIRP Irp);
|
||||
|
||||
NTSTATUS TdiDispatchCreate(
|
||||
IN PDEVICE_OBJECT DeviceObject,
|
||||
IN PIRP Irp);
|
||||
|
||||
NTSTATUS TdiDispatchDeviceControl(
|
||||
IN PDEVICE_OBJECT DeviceObject,
|
||||
IN PIRP Irp,
|
||||
IN PIO_STACK_LOCATION IrpSp);
|
||||
|
||||
BOOLEAN TdiDispatchFastDeviceControl(
|
||||
IN PFILE_OBJECT FileObject,
|
||||
IN BOOLEAN Wait,
|
||||
IN PVOID InputBuffer,
|
||||
IN ULONG InputBufferLength,
|
||||
IN OUT PVOID OutputBuffer,
|
||||
IN ULONG OutputBufferLength,
|
||||
IN ULONG IoControlCode,
|
||||
OUT PIO_STATUS_BLOCK IoStatus);
|
||||
|
||||
NTSTATUS TdiDispatchInternalDeviceControl(
|
||||
IN PDEVICE_OBJECT DeviceObject,
|
||||
IN PIRP Irp);
|
||||
|
||||
|
||||
|
||||
/* Basic types */
|
||||
|
||||
typedef LONG TDI_STATUS;
|
||||
typedef PVOID CONNECTION_CONTEXT;
|
||||
|
||||
typedef struct _TDI_CONNECTION_INFORMATION {
|
||||
LONG UserDataLength;
|
||||
PVOID UserData;
|
||||
LONG OptionsLength;
|
||||
PVOID Options;
|
||||
LONG RemoteAddressLength;
|
||||
PVOID RemoteAddress;
|
||||
} TDI_CONNECTION_INFORMATION, *PTDI_CONNECTION_INFORMATION;
|
||||
|
||||
typedef struct _TDI_REQUEST {
|
||||
union {
|
||||
HANDLE AddressHandle;
|
||||
CONNECTION_CONTEXT ConnectionContext;
|
||||
HANDLE ControlChannel;
|
||||
} Handle;
|
||||
PVOID RequestNotifyObject;
|
||||
PVOID RequestContext;
|
||||
TDI_STATUS TdiStatus;
|
||||
} TDI_REQUEST, *PTDI_REQUEST;
|
||||
|
||||
typedef struct _TDI_REQUEST_STATUS {
|
||||
TDI_STATUS Status;
|
||||
PVOID RequestContext;
|
||||
ULONG BytesTransferred;
|
||||
} TDI_REQUEST_STATUS, *PTDI_REQUEST_STATUS;
|
||||
|
||||
typedef struct _TA_ADDRESS {
|
||||
USHORT AddressLength;
|
||||
USHORT AddressType;
|
||||
UCHAR Address[1];
|
||||
} TA_ADDRESS, *PTA_ADDRESS;
|
||||
|
||||
#define TDI_ADDRESS_TYPE_UNSPEC 0
|
||||
#define TDI_ADDRESS_TYPE_UNIX 1
|
||||
#define TDI_ADDRESS_TYPE_IP 2
|
||||
#define TDI_ADDRESS_TYPE_IMPLINK 3
|
||||
#define TDI_ADDRESS_TYPE_PUP 4
|
||||
#define TDI_ADDRESS_TYPE_CHAOS 5
|
||||
#define TDI_ADDRESS_TYPE_NS 6
|
||||
#define TDI_ADDRESS_TYPE_IPX 6
|
||||
#define TDI_ADDRESS_TYPE_NBS 7
|
||||
#define TDI_ADDRESS_TYPE_ECMA 8
|
||||
#define TDI_ADDRESS_TYPE_DATAKIT 9
|
||||
#define TDI_ADDRESS_TYPE_CCITT 10
|
||||
#define TDI_ADDRESS_TYPE_SNA 11
|
||||
#define TDI_ADDRESS_TYPE_DECnet 12
|
||||
#define TDI_ADDRESS_TYPE_DLI 13
|
||||
#define TDI_ADDRESS_TYPE_LAT 14
|
||||
#define TDI_ADDRESS_TYPE_HYLINK 15
|
||||
#define TDI_ADDRESS_TYPE_APPLETALK 16
|
||||
#define TDI_ADDRESS_TYPE_NETBIOS 17
|
||||
#define TDI_ADDRESS_TYPE_8022 18
|
||||
#define TDI_ADDRESS_TYPE_OSI_TSAP 19
|
||||
#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)
|
||||
#define TDI_ADDRESS_HEADER_LEN (2 * sizeof(USHORT))
|
||||
|
||||
typedef struct _TRANSPORT_ADDRESS {
|
||||
LONG TAAddressCount;
|
||||
TA_ADDRESS Address[1];
|
||||
} TRANSPORT_ADDRESS, *PTRANSPORT_ADDRESS;
|
||||
|
||||
typedef struct _TDI_ADDRESS_INFO {
|
||||
ULONG ActivityCount;
|
||||
TRANSPORT_ADDRESS Address;
|
||||
} TDI_ADDRESS_INFO, *PTDI_ADDRESS_INFO;
|
||||
|
||||
typedef struct _TDI_ACTION_HEADER {
|
||||
ULONG TransportId;
|
||||
USHORT ActionCode;
|
||||
USHORT Reserved;
|
||||
} TDI_ACTION_HEADER, *PTDI_ACTION_HEADER;
|
||||
|
||||
typedef struct _TDI_ADDRESS_8022 {
|
||||
UCHAR MACAddress[6];
|
||||
} TDI_ADDRESS_8022, *PTDI_ADDRESS_8022;
|
||||
|
||||
#define TDI_ADDRESS_LENGTH_8022 sizeof(TDI_ADDRESS_8022);
|
||||
|
||||
typedef struct _TDI_ADDRESS_APPLETALK {
|
||||
USHORT Network;
|
||||
UCHAR Node;
|
||||
UCHAR Socket;
|
||||
} TDI_ADDRESS_APPLETALK, *PTDI_ADDRESS_APPLETALK;
|
||||
|
||||
#define TDI_ADDRESS_LENGTH_APPLETALK sizeof(TDI_ADDRESS_APPLETALK)
|
||||
|
||||
typedef struct _TDI_ADDRESS_IP {
|
||||
USHORT sin_port;
|
||||
ULONG in_addr;
|
||||
UCHAR sin_zero[8];
|
||||
} TDI_ADDRESS_IP, *PTDI_ADDRESS_IP;
|
||||
|
||||
#define TDI_ADDRESS_LENGTH_IP sizeof(TDI_ADDRESS_IP)
|
||||
|
||||
typedef struct _TDI_ADDRESS_IPX {
|
||||
ULONG NetworkAddress;
|
||||
UCHAR NodeAddress[6];
|
||||
USHORT Socket;
|
||||
} TDI_ADDRESS_IPX, *PTDI_ADDRESS_IPX;
|
||||
|
||||
#define TDI_ADDRESS_LENGTH_IPX sizeof(TDI_ADDRESS_IPX)
|
||||
|
||||
/* 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 {
|
||||
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)
|
||||
|
||||
/* 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_LENGTH_NETONE sizeof(TDI_ADDRESS_NETONE)
|
||||
|
||||
typedef struct _TDI_ADDRESS_NS
|
||||
{
|
||||
ULONG NetworkAddress;
|
||||
UCHAR NodeAddress[6];
|
||||
USHORT Socket;
|
||||
} TDI_ADDRESS_NS, *PTDI_ADDRESS_NS;
|
||||
|
||||
#define TDI_ADDRESS_LENGTH_NS sizeof(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 {
|
||||
USHORT tp_addr_type;
|
||||
USHORT tp_taddr_len;
|
||||
USHORT tp_tsel_len;
|
||||
UCHAR tp_addr[ISO_MAX_ADDR_LENGTH];
|
||||
} TDI_ADDRESS_OSI_TSAP, *PTDI_ADDRESS_OSI_TSAP;
|
||||
|
||||
#define TDI_ADDRESS_LENGTH_OSI_TSAP sizeof(TDI_ADDRESS_OSI_TSAP)
|
||||
|
||||
typedef struct _TDI_ADDRESS_VNS {
|
||||
UCHAR net_address[4];
|
||||
UCHAR subnet_addr[2];
|
||||
UCHAR port[2];
|
||||
UCHAR hops;
|
||||
UCHAR filler[5];
|
||||
} TDI_ADDRESS_VNS, *PTDI_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;
|
||||
|
||||
#define TDI_ADDRESS_LENGTH_IP6 sizeof(TDI_ADDRESS_IP6)
|
||||
|
||||
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 {
|
||||
TDI_REQUEST Request;
|
||||
PTDI_CONNECTION_INFORMATION RequestConnectionInformation;
|
||||
PTDI_CONNECTION_INFORMATION ReturnConnectionInformation;
|
||||
} TDI_REQUEST_ACCEPT, *PTDI_REQUEST_ACCEPT;
|
||||
|
||||
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 {
|
||||
TDI_REQUEST Request;
|
||||
LARGE_INTEGER Timeout;
|
||||
} TDI_REQUEST_DISCONNECT, *PTDI_REQUEST_DISCONNECT;
|
||||
|
||||
typedef struct _TDI_REQUEST_SEND {
|
||||
TDI_REQUEST Request;
|
||||
USHORT SendFlags;
|
||||
} TDI_REQUEST_SEND, *PTDI_REQUEST_SEND;
|
||||
|
||||
typedef struct _TDI_REQUEST_RECEIVE {
|
||||
TDI_REQUEST Request;
|
||||
USHORT ReceiveFlags;
|
||||
} TDI_REQUEST_RECEIVE, *PTDI_REQUEST_RECEIVE;
|
||||
|
||||
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 {
|
||||
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 {
|
||||
TDI_REQUEST Request;
|
||||
LONG EventType;
|
||||
PVOID EventHandler;
|
||||
PVOID EventContext;
|
||||
} TDI_REQUEST_SET_EVENT_HANDLER, *PTDI_REQUEST_SET_EVENT_HANDLER;
|
||||
|
||||
#define TDI_RECEIVE_BROADCAST 0x00000004
|
||||
#define TDI_RECEIVE_MULTICAST 0x00000008
|
||||
#define TDI_RECEIVE_PARTIAL 0x00000010
|
||||
#define TDI_RECEIVE_NORMAL 0x00000020
|
||||
#define TDI_RECEIVE_EXPEDITED 0x00000040
|
||||
#define TDI_RECEIVE_PEEK 0x00000080
|
||||
#define TDI_RECEIVE_NO_RESPONSE_EXP 0x00000100
|
||||
#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
|
||||
|
||||
/* Options used for both SendOptions and ReceiveIndicators */
|
||||
#define TDI_SEND_EXPEDITED 0x0020
|
||||
#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
|
||||
#define TDI_DISCONNECT_ABORT 0x0002
|
||||
#define TDI_DISCONNECT_RELEASE 0x0004
|
||||
|
||||
/* TdiRequest structure for TdiQueryInformation request */
|
||||
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 {
|
||||
TDI_REQUEST Request;
|
||||
ULONG SetType;
|
||||
PTDI_CONNECTION_INFORMATION RequestConnectionInformation;
|
||||
} TDI_REQUEST_SET_INFORMATION, *PTDI_REQUEST_SET_INFORMATION;
|
||||
|
||||
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;
|
||||
TDI_REQUEST_LISTEN TdiListen;
|
||||
TDI_REQUEST_QUERY_INFORMATION TdiQueryInformation;
|
||||
TDI_REQUEST_RECEIVE TdiReceive;
|
||||
TDI_REQUEST_RECEIVE_DATAGRAM TdiReceiveDatagram;
|
||||
TDI_REQUEST_SEND TdiSend;
|
||||
TDI_REQUEST_SEND_DATAGRAM TdiSendDatagram;
|
||||
TDI_REQUEST_SET_EVENT_HANDLER TdiSetEventHandler;
|
||||
TDI_REQUEST_SET_INFORMATION TdiSetInformation;
|
||||
} TDI_REQUEST_TYPE, *PTDI_REQUEST_TYPE;
|
||||
|
||||
|
||||
/* Query information types */
|
||||
|
||||
/* Generic query info types that must be supported by all transports */
|
||||
#define TDI_QUERY_BROADCAST_ADDRESS 0x00000001
|
||||
#define TDI_QUERY_PROVIDER_INFO 0x00000002
|
||||
#define TDI_QUERY_ADDRESS_INFO 0x00000003
|
||||
#define TDI_QUERY_CONNECTION_INFO 0x00000004
|
||||
#define TDI_QUERY_PROVIDER_STATISTICS 0x00000005
|
||||
#define TDI_QUERY_DATAGRAM_INFO 0x00000006
|
||||
#define TDI_QUERY_DATA_LINK_ADDRESS 0x00000007
|
||||
#define TDI_QUERY_NETWORK_ADDRESS 0x00000008
|
||||
#define TDI_QUERY_MAX_DATAGRAM_INFO 0x00000009
|
||||
|
||||
/* Netbios specific query information types */
|
||||
#define TDI_QUERY_ADAPTER_STATUS 0x00000100
|
||||
#define TDI_QUERY_SESSION_STATUS 0x00000200
|
||||
#define TDI_QUERY_FIND_NAME 0x00000300
|
||||
|
||||
typedef struct _TA_APPLETALK_ADDR {
|
||||
LONG TAAddressCount;
|
||||
struct _AddrAtalk {
|
||||
USHORT AddressLength;
|
||||
USHORT AddressType;
|
||||
TDI_ADDRESS_APPLETALK Address[1];
|
||||
} Address[1];
|
||||
} TA_APPLETALK_ADDRESS, *PTA_APPLETALK_ADDRESS;
|
||||
|
||||
typedef struct _TA_ADDRESS_IP {
|
||||
LONG TAAddressCount;
|
||||
struct _AddrIp {
|
||||
USHORT AddressLength;
|
||||
USHORT AddressType;
|
||||
TDI_ADDRESS_IP Address[1];
|
||||
} Address[1];
|
||||
} TA_IP_ADDRESS, *PTA_IP_ADDRESS;
|
||||
|
||||
typedef struct _TA_ADDRESS_IPX {
|
||||
LONG TAAddressCount;
|
||||
struct _AddrIpx {
|
||||
USHORT AddressLength;
|
||||
USHORT AddressType;
|
||||
TDI_ADDRESS_IPX Address[1];
|
||||
} Address[1];
|
||||
} TA_IPX_ADDRESS, *PTA_IPX_ADDRESS;
|
||||
|
||||
typedef struct _TA_NETBIOS_ADDRESS {
|
||||
LONG TAAddressCount;
|
||||
struct _Addr{
|
||||
USHORT AddressLength;
|
||||
USHORT AddressType;
|
||||
TDI_ADDRESS_NETBIOS Address[1];
|
||||
} Address[1];
|
||||
} TA_NETBIOS_ADDRESS, *PTA_NETBIOS_ADDRESS;
|
||||
|
||||
typedef struct _TA_ADDRESS_NS {
|
||||
LONG TAAddressCount;
|
||||
struct _AddrNs {
|
||||
USHORT AddressLength;
|
||||
USHORT AddressType;
|
||||
TDI_ADDRESS_NS Address[1];
|
||||
} Address[1];
|
||||
} TA_NS_ADDRESS, *PTA_NS_ADDRESS;
|
||||
|
||||
typedef struct _TA_ADDRESS_VNS {
|
||||
LONG TAAddressCount;
|
||||
struct _AddrVns {
|
||||
USHORT AddressLength;
|
||||
USHORT AddressType;
|
||||
TDI_ADDRESS_VNS Address[1];
|
||||
} 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 {
|
||||
ULONG State;
|
||||
ULONG Event;
|
||||
ULONG TransmittedTsdus;
|
||||
ULONG ReceivedTsdus;
|
||||
ULONG TransmissionErrors;
|
||||
ULONG ReceiveErrors;
|
||||
ULONG MinimumLookaheadData;
|
||||
ULONG MaximumLookaheadData;
|
||||
ULONG PriorityLevel;
|
||||
ULONG SecurityLevel;
|
||||
ULONG SecurityCompartment;
|
||||
} TDI_ENDPOINT_INFO, *PTDI_ENDPOINT_INFO;
|
||||
|
||||
typedef struct _TDI_CONNECTION_INFO {
|
||||
ULONG State;
|
||||
ULONG Event;
|
||||
ULONG TransmittedTsdus;
|
||||
ULONG ReceivedTsdus;
|
||||
ULONG TransmissionErrors;
|
||||
ULONG ReceiveErrors;
|
||||
LARGE_INTEGER Throughput;
|
||||
LARGE_INTEGER Delay;
|
||||
ULONG SendBufferSize;
|
||||
ULONG ReceiveBufferSize;
|
||||
BOOLEAN Unreliable;
|
||||
} TDI_CONNECTION_INFO, *PTDI_CONNECTION_INFO;
|
||||
|
||||
typedef struct _TDI_DATAGRAM_INFO {
|
||||
ULONG MaximumDatagramBytes;
|
||||
ULONG MaximumDatagramCount;
|
||||
} TDI_DATAGRAM_INFO, *PTDI_DATAGRAM_INFO;
|
||||
|
||||
typedef struct _TDI_MAX_DATAGRAM_INFO {
|
||||
ULONG MaxDatagramSize;
|
||||
} TDI_MAX_DATAGRAM_INFO, *PTDI_MAX_DATAGRAM_INFO;
|
||||
|
||||
typedef struct _TDI_PROVIDER_INFO {
|
||||
ULONG Version;
|
||||
ULONG MaxSendSize;
|
||||
ULONG MaxConnectionUserData;
|
||||
ULONG MaxDatagramSize;
|
||||
ULONG ServiceFlags;
|
||||
ULONG MinimumLookaheadData;
|
||||
ULONG MaximumLookaheadData;
|
||||
ULONG NumberOfResources;
|
||||
LARGE_INTEGER StartTime;
|
||||
} TDI_PROVIDER_INFO, *PTDI_PROVIDER_INFO;
|
||||
|
||||
#define TDI_SERVICE_CONNECTION_MODE 0x00000001
|
||||
#define TDI_SERVICE_ORDERLY_RELEASE 0x00000002
|
||||
#define TDI_SERVICE_CONNECTIONLESS_MODE 0x00000004
|
||||
#define TDI_SERVICE_ERROR_FREE_DELIVERY 0x00000008
|
||||
#define TDI_SERVICE_SECURITY_LEVEL 0x00000010
|
||||
#define TDI_SERVICE_BROADCAST_SUPPORTED 0x00000020
|
||||
#define TDI_SERVICE_MULTICAST_SUPPORTED 0x00000040
|
||||
#define TDI_SERVICE_DELAYED_ACCEPTANCE 0x00000080
|
||||
#define TDI_SERVICE_EXPEDITED_DATA 0x00000100
|
||||
#define TDI_SERVICE_INTERNAL_BUFFERING 0x00000200
|
||||
#define TDI_SERVICE_ROUTE_DIRECTED 0x00000400
|
||||
#define TDI_SERVICE_NO_ZERO_LENGTH 0x00000800
|
||||
#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 {
|
||||
ULONG ResourceId;
|
||||
ULONG MaximumResourceUsed;
|
||||
ULONG AverageResourceUsed;
|
||||
ULONG ResourceExhausted;
|
||||
} TDI_PROVIDER_RESOURCE_STATS, *PTDI_PROVIDER_RESOURCE_STATS;
|
||||
|
||||
typedef struct _TDI_PROVIDER_STATISTICS {
|
||||
ULONG Version;
|
||||
ULONG OpenConnections;
|
||||
ULONG ConnectionsAfterNoRetry;
|
||||
ULONG ConnectionsAfterRetry;
|
||||
ULONG LocalDisconnects;
|
||||
ULONG RemoteDisconnects;
|
||||
ULONG LinkFailures;
|
||||
ULONG AdapterFailures;
|
||||
ULONG SessionTimeouts;
|
||||
ULONG CancelledConnections;
|
||||
ULONG RemoteResourceFailures;
|
||||
ULONG LocalResourceFailures;
|
||||
ULONG NotFoundFailures;
|
||||
ULONG NoListenFailures;
|
||||
ULONG DatagramsSent;
|
||||
LARGE_INTEGER DatagramBytesSent;
|
||||
ULONG DatagramsReceived;
|
||||
LARGE_INTEGER DatagramBytesReceived;
|
||||
ULONG PacketsSent;
|
||||
ULONG PacketsReceived;
|
||||
ULONG DataFramesSent;
|
||||
LARGE_INTEGER DataFrameBytesSent;
|
||||
ULONG DataFramesReceived;
|
||||
LARGE_INTEGER DataFrameBytesReceived;
|
||||
ULONG DataFramesResent;
|
||||
LARGE_INTEGER DataFrameBytesResent;
|
||||
ULONG DataFramesRejected;
|
||||
LARGE_INTEGER DataFrameBytesRejected;
|
||||
ULONG ResponseTimerExpirations;
|
||||
ULONG AckTimerExpirations;
|
||||
ULONG MaximumSendWindow;
|
||||
ULONG AverageSendWindow;
|
||||
ULONG PiggybackAckQueued;
|
||||
ULONG PiggybackAckTimeouts;
|
||||
LARGE_INTEGER WastedPacketSpace;
|
||||
ULONG WastedSpacePackets;
|
||||
ULONG NumberOfResources;
|
||||
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 */
|
|
@ -1,253 +0,0 @@
|
|||
/*
|
||||
* 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
|
||||
|
||||
#if __GNUC__ >=3
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#pragma pack(push,4)
|
||||
|
||||
#include "ntddk.h"
|
||||
|
||||
#ifndef TDI_SUCCESS
|
||||
#define TDI_SUCCESS 0
|
||||
#endif/*TDI_SUCCESS*/
|
||||
|
||||
typedef struct TDIEntityID {
|
||||
ULONG tei_entity;
|
||||
ULONG tei_instance;
|
||||
} TDIEntityID;
|
||||
|
||||
#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
|
||||
|
||||
/* ID to use for requesting an IFEntry for an interface */
|
||||
#define IF_MIB_STATS_ID 1
|
||||
|
||||
/* ID to use for requesting an IPSNMPInfo for an interface */
|
||||
#define IP_MIB_STATS_ID 1 /* Hmm. I'm not sure I like this */
|
||||
|
||||
/* ID to use for requesting the route table */
|
||||
#define IP_MIB_ROUTETABLE_ENTRY_ID 0x101
|
||||
#define IP_MIB_ADDRTABLE_ENTRY_ID 102
|
||||
|
||||
/* 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;
|
||||
ULONG toi_id;
|
||||
} TDIObjectID;
|
||||
|
||||
#define MAX_PHYSADDR_SIZE 010
|
||||
|
||||
/* Basic interface information like from SIOCGIF* */
|
||||
/* 0x5c bytes without description tail */
|
||||
typedef struct _IFEntry {
|
||||
ULONG if_index;
|
||||
ULONG if_type;
|
||||
ULONG if_mtu;
|
||||
ULONG if_speed;
|
||||
ULONG if_physaddrlen;
|
||||
UCHAR if_physaddr[MAX_PHYSADDR_SIZE];
|
||||
ULONG if_adminstatus;
|
||||
ULONG if_operstatus;
|
||||
ULONG if_lastchange;
|
||||
ULONG if_inoctets;
|
||||
ULONG if_inucastpkts;
|
||||
ULONG if_innucastpkts;
|
||||
ULONG if_indiscards;
|
||||
ULONG if_inerrors;
|
||||
ULONG if_inunknownprotos;
|
||||
ULONG if_outoctets;
|
||||
ULONG if_outucastpkts;
|
||||
ULONG if_outnucastpkts;
|
||||
ULONG if_outdiscards;
|
||||
ULONG if_outerrors;
|
||||
ULONG if_outqlen;
|
||||
ULONG if_descrlen;
|
||||
UCHAR if_descr[1];
|
||||
} IFEntry;
|
||||
|
||||
/* Control information like from /proc/sys/net/ipv4/... */
|
||||
/* 0x58 bytes */
|
||||
#if 1
|
||||
typedef struct _IPSNMPInfo {
|
||||
ULONG ipsi_index;
|
||||
ULONG ipsi_forwarding;
|
||||
ULONG ipsi_defaultttl;
|
||||
ULONG ipsi_inreceives;
|
||||
ULONG ipsi_inhdrerrors;
|
||||
ULONG ipsi_inaddrerrors;
|
||||
ULONG ipsi_inunknownprotos;
|
||||
ULONG ipsi_indiscards;
|
||||
ULONG ipsi_indelivers;
|
||||
ULONG ipsi_outrequests;
|
||||
ULONG ipsi_routingdiscards;
|
||||
ULONG ipsi_outdiscards;
|
||||
ULONG ipsi_outnoroutes;
|
||||
ULONG ipsi_reasmtimeout;
|
||||
ULONG ipsi_reasmreqds;
|
||||
ULONG ipsi_reasmoks;
|
||||
ULONG ipsi_reasmfails;
|
||||
ULONG ipsi_fragoks;
|
||||
ULONG ipsi_fragfails;
|
||||
ULONG ipsi_fragcreates;
|
||||
ULONG ipsi_numif;
|
||||
ULONG ipsi_numaddr;
|
||||
ULONG ipsi_numroutes;
|
||||
} IPSNMPInfo;
|
||||
#else
|
||||
typedef struct _IPSNMPInfo {
|
||||
ULONG ipsi_forwarding;
|
||||
ULONG ipsi_defaultttl;
|
||||
ULONG ipsi_inreceives;
|
||||
ULONG ipsi_inhdrerrors;
|
||||
ULONG ipsi_inaddrerrors;
|
||||
ULONG ipsi_inunknownprotos;
|
||||
ULONG ipsi_indiscards;
|
||||
ULONG ipsi_indelivers;
|
||||
ULONG ipsi_outrequests;
|
||||
ULONG ipsi_routingdiscards;
|
||||
ULONG ipsi_outdiscards;
|
||||
ULONG ipsi_outnoroutes;
|
||||
ULONG ipsi_reasmtimeout;
|
||||
ULONG ipsi_reasmreqds;
|
||||
ULONG ipsi_reasmoks;
|
||||
ULONG ipsi_reasmfails;
|
||||
ULONG ipsi_fragoks;
|
||||
ULONG ipsi_fragfails;
|
||||
ULONG ipsi_fragcreates;
|
||||
ULONG ipsi_numif;
|
||||
ULONG ipsi_numaddr;
|
||||
ULONG ipsi_numroutes;
|
||||
} IPSNMPInfo;
|
||||
#endif
|
||||
|
||||
// BEGIN ORIGINAL SOURCE INFORMATION --
|
||||
// Gets ip info for the current interface list.
|
||||
|
||||
// Tom Sanfilippo
|
||||
// tsanfilippo@earthlink.net
|
||||
// December 12, 1999
|
||||
|
||||
// Thanks are due to Thomas F. Divine <tdivine@pcausa.com>
|
||||
// for pointing out the updated wshsmple in the NT4DDK.
|
||||
// The headers in that sample allowed the input parameters
|
||||
// to finally be discovered.
|
||||
// END ORIGINAL SOURCE INFORMATION --
|
||||
|
||||
typedef struct _IPRouteEntry {
|
||||
ULONG ire_dest;
|
||||
ULONG ire_index; //matches if_index in IFEntry and iae_index in IPAddrEntry
|
||||
ULONG ire_metric;
|
||||
ULONG ire_unk1; //??
|
||||
ULONG ire_unk2; //??
|
||||
ULONG ire_unk3; //??
|
||||
ULONG ire_gw;
|
||||
ULONG ire_unk4; //??
|
||||
ULONG ire_unk5; //??
|
||||
ULONG ire_unk6; //??
|
||||
ULONG ire_mask;
|
||||
ULONG ire_unk7; //??
|
||||
ULONG ire_unk8; //??
|
||||
} IPRouteEntry;
|
||||
|
||||
typedef struct _IPAddrEntry {
|
||||
ULONG iae_addr;
|
||||
ULONG iae_index;
|
||||
ULONG iae_mask;
|
||||
ULONG iae_bcastaddr;
|
||||
ULONG iae_reasmsize;
|
||||
ULONG iae_context;
|
||||
ULONG iae_pad;
|
||||
} IPAddrEntry;
|
||||
|
||||
#define CONTEXT_SIZE 16
|
||||
#define MAX_ADAPTER_DESCRIPTION_LENGTH 64 /* guess */
|
||||
|
||||
typedef struct _TCP_REQUEST_QUERY_INFORMATION_EX {
|
||||
TDIObjectID ID;
|
||||
UCHAR Context[CONTEXT_SIZE];
|
||||
} TCP_REQUEST_QUERY_INFORMATION_EX, *PTCP_REQUEST_QUERY_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 */
|
File diff suppressed because it is too large
Load diff
|
@ -1,83 +0,0 @@
|
|||
/*
|
||||
* tdistat.h
|
||||
*
|
||||
* TDI status codes
|
||||
*
|
||||
* 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 __TDISTAT_H
|
||||
#define __TDISTAT_H
|
||||
|
||||
#if __GNUC__ >=3
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#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_STATUS_BAD_VERSION 0xC0010004L
|
||||
#define TDI_STATUS_BAD_CHARACTERISTICS 0xC0010005L
|
||||
|
||||
#define TDI_OPTION_EOL 0
|
||||
|
||||
#define TDI_ADDRESS_OPTION_REUSE 1
|
||||
#define TDI_ADDRESS_OPTION_DHCP 2
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __TDISTAT_H */
|
96
reactos/include/tcpmisc.h
Normal file
96
reactos/include/tcpmisc.h
Normal file
|
@ -0,0 +1,96 @@
|
|||
#ifndef TCPMISC_H
|
||||
#define TCPMISC_H
|
||||
|
||||
#define IF_MIB_STATS_ID 1
|
||||
#define MAX_PHYSADDR_SIZE 8
|
||||
#define MAX_IFDESCR_LEN 256
|
||||
|
||||
/* ID to use for requesting an IFEntry for an interface */
|
||||
#define IF_MIB_STATS_ID 1
|
||||
|
||||
/* ID to use for requesting an IPSNMPInfo for an interface */
|
||||
#define IP_MIB_STATS_ID 1
|
||||
|
||||
/* ID to use for requesting the route table */
|
||||
#define IP_MIB_ROUTETABLE_ENTRY_ID 0x101
|
||||
#define IP_MIB_ADDRTABLE_ENTRY_ID 102
|
||||
|
||||
typedef struct IFEntry {
|
||||
ULONG if_index;
|
||||
ULONG if_type;
|
||||
ULONG if_mtu;
|
||||
ULONG if_speed;
|
||||
ULONG if_physaddrlen;
|
||||
UCHAR if_physaddr[MAX_PHYSADDR_SIZE];
|
||||
ULONG if_adminstatus;
|
||||
ULONG if_operstatus;
|
||||
ULONG if_lastchange;
|
||||
ULONG if_inoctets;
|
||||
ULONG if_inucastpkts;
|
||||
ULONG if_innucastpkts;
|
||||
ULONG if_indiscards;
|
||||
ULONG if_inerrors;
|
||||
ULONG if_inunknownprotos;
|
||||
ULONG if_outoctets;
|
||||
ULONG if_outucastpkts;
|
||||
ULONG if_outnucastpkts;
|
||||
ULONG if_outdiscards;
|
||||
ULONG if_outerrors;
|
||||
ULONG if_outqlen;
|
||||
ULONG if_descrlen;
|
||||
UCHAR if_descr[1];
|
||||
} IFEntry;
|
||||
|
||||
typedef struct _IPRouteEntry {
|
||||
ULONG ire_dest;
|
||||
ULONG ire_index; //matches if_index in IFEntry and iae_index in IPAddrEntry
|
||||
ULONG ire_metric;
|
||||
ULONG ire_unk1; //??
|
||||
ULONG ire_unk2; //??
|
||||
ULONG ire_unk3; //??
|
||||
ULONG ire_gw;
|
||||
ULONG ire_unk4; //??
|
||||
ULONG ire_unk5; //??
|
||||
ULONG ire_unk6; //??
|
||||
ULONG ire_mask;
|
||||
ULONG ire_unk7; //??
|
||||
ULONG ire_unk8; //??
|
||||
} IPRouteEntry;
|
||||
|
||||
typedef struct _IPAddrEntry {
|
||||
ULONG iae_addr;
|
||||
ULONG iae_index;
|
||||
ULONG iae_mask;
|
||||
ULONG iae_bcastaddr;
|
||||
ULONG iae_reasmsize;
|
||||
ULONG iae_context;
|
||||
ULONG iae_pad;
|
||||
} IPAddrEntry;
|
||||
|
||||
typedef struct _IPSNMPInfo {
|
||||
ULONG ipsi_index;
|
||||
ULONG ipsi_forwarding;
|
||||
ULONG ipsi_defaultttl;
|
||||
ULONG ipsi_inreceives;
|
||||
ULONG ipsi_inhdrerrors;
|
||||
ULONG ipsi_inaddrerrors;
|
||||
ULONG ipsi_inunknownprotos;
|
||||
ULONG ipsi_indiscards;
|
||||
ULONG ipsi_indelivers;
|
||||
ULONG ipsi_outrequests;
|
||||
ULONG ipsi_routingdiscards;
|
||||
ULONG ipsi_outdiscards;
|
||||
ULONG ipsi_outnoroutes;
|
||||
ULONG ipsi_reasmtimeout;
|
||||
ULONG ipsi_reasmreqds;
|
||||
ULONG ipsi_reasmoks;
|
||||
ULONG ipsi_reasmfails;
|
||||
ULONG ipsi_fragoks;
|
||||
ULONG ipsi_fragfails;
|
||||
ULONG ipsi_fragcreates;
|
||||
ULONG ipsi_numif;
|
||||
ULONG ipsi_numaddr;
|
||||
ULONG ipsi_numroutes;
|
||||
} IPSNMPInfo;
|
||||
|
||||
#endif /* TCPMISC_H */
|
|
@ -152,7 +152,7 @@ NTSTATUS tdiGetSetOfThings( HANDLE tcpFile,
|
|||
* stabilizes.
|
||||
*/
|
||||
do {
|
||||
assert( !entitySet ); /* We must not have an entity set allocated */
|
||||
ASSERT( !entitySet ); /* We must not have an entity set allocated */
|
||||
status = DeviceIoControl( tcpFile,
|
||||
IOCTL_TCP_QUERY_INFORMATION_EX,
|
||||
&req,
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
#define _WIN32_WINNT 0x500
|
||||
#include <ddk/ntddk.h>
|
||||
#include <rosrtl/string.h>
|
||||
#include <ntdll/rtl.h>
|
||||
#include <net/miniport.h>
|
||||
#include <ddk/miniport.h>
|
||||
#include <tcpmisc.h>
|
||||
#include <winsock2.h>
|
||||
#include <nspapi.h>
|
||||
#include <iptypes.h>
|
||||
|
@ -32,7 +32,7 @@
|
|||
#include "resinfo.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
#include "net/tdiinfo.h"
|
||||
#include "ddk/tdiinfo.h"
|
||||
#include "tcpioctl.h"
|
||||
|
||||
#ifndef ETH_ALEN
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
#include <wsahelp.h>
|
||||
#include <winsock2.h>
|
||||
#include <ws2spi.h>
|
||||
#include <net/tdi.h>
|
||||
#include <ddk/tdi.h>
|
||||
#include <afd/shared.h>
|
||||
#include <debug.h>
|
||||
|
||||
|
|
Loading…
Reference in a new issue