diff options
Diffstat (limited to 'private/ntos/nbt/inc/nbtnt.h')
-rw-r--r-- | private/ntos/nbt/inc/nbtnt.h | 272 |
1 files changed, 272 insertions, 0 deletions
diff --git a/private/ntos/nbt/inc/nbtnt.h b/private/ntos/nbt/inc/nbtnt.h new file mode 100644 index 000000000..e708aac52 --- /dev/null +++ b/private/ntos/nbt/inc/nbtnt.h @@ -0,0 +1,272 @@ +// +// NBTNT.H +// +// This file contains common header definitions for NBT in the NT +// environment +// +// + +#ifndef _NBT_H +#define _NBT_H + +#ifndef VXD +#include <ntos.h> +#include <status.h> +#include <ntstatus.h> +#include <tdikrnl.h> +#include <tdi.h> +#include <sockets/netinet/in.h> // htons, ntohs +#include <windef.h> +#include <stdio.h> +#include <nb30.h> +#include <zwapi.h> + +#else + +#include <oscfgnbt.h> +#include <cxport.h> +#define __int64 double +#include <windef.h> +#include <nb30.h> +#include <sockets/netinet/in.h> // htons, ntohs + +// +// These definitions work around NTisms found in various difficult to change +// places. +// +typedef ULONG NTSTATUS ; +typedef PNCB PIRP ; +typedef PVOID PDEVICE_OBJECT ; + +#include <ctemacro.h> +#include <tdi.h> + +// +// These are needed because we include windef.h rather then +// ntddk.h, which end up not being defined +// +#define STATUS_NETWORK_NAME_DELETED ((NTSTATUS)0xC00000CAL) +#define STATUS_INVALID_BUFFER_SIZE ((NTSTATUS)0xC0000206L) +#define STATUS_CONNECTION_DISCONNECTED ((NTSTATUS)0xC000020CL) +#define STATUS_CANCELLED ((NTSTATUS)0xC0000120L) +#define STATUS_UNSUCCESSFUL ((NTSTATUS)0xC0000001L) + +#define STATUS_TOO_MANY_COMMANDS ((NTSTATUS)0xC00000C1L) +#define STATUS_OBJECT_NAME_COLLISION ((NTSTATUS)0xC0000035L) +#define STATUS_SHARING_VIOLATION ((NTSTATUS)0xC0000043L) +#define STATUS_DUPLICATE_NAME ((NTSTATUS)0xC00000BDL) +#define STATUS_BAD_NETWORK_PATH ((NTSTATUS)0xC00000BEL) +#define STATUS_REMOTE_NOT_LISTENING ((NTSTATUS)0xC00000BCL) +#define STATUS_CONNECTION_REFUSED ((NTSTATUS)0xC0000236L) +#define STATUS_INVALID_PARAMETER ((NTSTATUS)0xC000000DL) +#define STATUS_UNEXPECTED_NETWORK_ERROR ((NTSTATUS)0xC00000C4L) +#define STATUS_NOT_SUPPORTED ((NTSTATUS)0xC00000BBL) + +#define STATUS_INVALID_HANDLE ((NTSTATUS)0xC0000008L) +#define STATUS_INVALID_DEVICE_REQUEST ((NTSTATUS)0xC0000010L) + +#define STATUS_INVALID_PARAMETER_6 ((NTSTATUS)0xC00000F4L) + +// +// The following functions are used by NBT. They are defined in the NT kernel +// TDI stuff which we are trying to avoid. +// + +typedef +NTSTATUS +(*PTDI_IND_CONNECT)( + IN PVOID TdiEventContext, + IN int RemoteAddressLength, + IN PVOID RemoteAddress, + IN int UserDataLength, + IN PVOID UserData, + IN int OptionsLength, + IN PVOID Options, + OUT CONNECTION_CONTEXT *ConnectionContext + ) + ; + +NTSTATUS +TdiDefaultConnectHandler ( + IN PVOID TdiEventContext, + IN int RemoteAddressLength, + IN PVOID RemoteAddress, + IN int UserDataLength, + IN PVOID UserData, + IN int OptionsLength, + IN PVOID Options, + OUT CONNECTION_CONTEXT *ConnectionContext + ); + +// +// Disconnection indication prototype. This is invoked when a connection is +// being disconnected for a reason other than the user requesting it. Note that +// this is a change from TDI V1, which indicated only when the remote caused +// a disconnection. Any non-directed disconnection will cause this indication. +// + +typedef +NTSTATUS +(*PTDI_IND_DISCONNECT)( + IN PVOID TdiEventContext, + IN CONNECTION_CONTEXT ConnectionContext, + IN int DisconnectDataLength, + IN PVOID DisconnectData, + IN int DisconnectInformationLength, + IN PVOID DisconnectInformation, + IN ULONG DisconnectFlags + ); + +NTSTATUS +TdiDefaultDisconnectHandler ( + IN PVOID TdiEventContext, + IN CONNECTION_CONTEXT ConnectionContext, + IN int DisconnectDataLength, + IN PVOID DisconnectData, + IN int DisconnectInformationLength, + IN PVOID DisconnectInformation, + IN ULONG DisconnectFlags + ); + +// +// A protocol error has occurred when this indication happens. This indication +// occurs only for errors of the worst type; the address this indication is +// delivered to is no longer usable for protocol-related operations, and +// should not be used for operations henceforth. All connections associated +// it are invalid. +// For NetBIOS-type providers, this indication is also delivered when a name +// in conflict or duplicate name occurs. +// + +typedef +NTSTATUS +(*PTDI_IND_ERROR)( + IN PVOID TdiEventContext, // the endpoint's file object. + IN NTSTATUS Status // status code indicating error type. + ); + +NTSTATUS +TdiDefaultErrorHandler ( + IN PVOID TdiEventContext, // the endpoint's file object. + IN NTSTATUS Status // status code indicating error type. + ); + +// +// TDI_IND_RECEIVE indication handler definition. This client routine is +// called by the transport provider when a connection-oriented TSDU is received +// that should be presented to the client. +// + +typedef +NTSTATUS +(*PTDI_IND_RECEIVE)( + IN PVOID TdiEventContext, + IN CONNECTION_CONTEXT ConnectionContext, + IN ULONG ReceiveFlags, + IN ULONG BytesIndicated, + IN ULONG BytesAvailable, + OUT ULONG *BytesTaken, + IN PVOID Tsdu, // pointer describing this TSDU, typically a lump of bytes + OUT PIRP *IoRequestPacket // TdiReceive IRP if MORE_PROCESSING_REQUIRED. + ); + +NTSTATUS +TdiDefaultReceiveHandler ( + IN PVOID TdiEventContext, + IN CONNECTION_CONTEXT ConnectionContext, + IN ULONG ReceiveFlags, + IN ULONG BytesIndicated, + IN ULONG BytesAvailable, + OUT ULONG *BytesTaken, + IN PVOID Tsdu, // pointer describing this TSDU, typically a lump of bytes + OUT PIRP *IoRequestPacket // TdiReceive IRP if MORE_PROCESSING_REQUIRED. + ); + +// +// TDI_IND_RECEIVE_DATAGRAM indication handler definition. This client routine +// is called by the transport provider when a connectionless TSDU is received +// that should be presented to the client. +// + +typedef +NTSTATUS +(*PTDI_IND_RECEIVE_DATAGRAM)( + IN PVOID TdiEventContext, // the event context + IN int SourceAddressLength, // length of the originator of the datagram + IN PVOID SourceAddress, // string describing the originator of the datagram + IN int OptionsLength, // options for the receive + IN PVOID Options, // + IN ULONG BytesIndicated, // number of bytes this indication + IN ULONG BytesAvailable, // number of bytes in complete Tsdu + OUT ULONG *BytesTaken, // number of bytes used + IN PVOID Tsdu, // pointer describing this TSDU, typically a lump of bytes + OUT PIRP *IoRequestPacket // TdiReceive IRP if MORE_PROCESSING_REQUIRED. + ); + +NTSTATUS +TdiDefaultRcvDatagramHandler ( + IN PVOID TdiEventContext, // the event context + IN int SourceAddressLength, // length of the originator of the datagram + IN PVOID SourceAddress, // string describing the originator of the datagram + IN int OptionsLength, // options for the receive + IN PVOID Options, // + IN ULONG BytesIndicated, // number of bytes this indication + IN ULONG BytesAvailable, // number of bytes in complete Tsdu + OUT ULONG *BytesTaken, // number of bytes used + IN PVOID Tsdu, // pointer describing this TSDU, typically a lump of bytes + OUT PIRP *IoRequestPacket // TdiReceive IRP if MORE_PROCESSING_REQUIRED. + ); + +// +// This indication is delivered if expedited data is received on the connection. +// This will only occur in providers that support expedited data. +// + +typedef +NTSTATUS +(*PTDI_IND_RECEIVE_EXPEDITED)( + IN PVOID TdiEventContext, + IN CONNECTION_CONTEXT ConnectionContext, + IN ULONG ReceiveFlags, // + IN ULONG BytesIndicated, // number of bytes in this indication + IN ULONG BytesAvailable, // number of bytes in complete Tsdu + OUT ULONG *BytesTaken, // number of bytes used by indication routine + IN PVOID Tsdu, // pointer describing this TSDU, typically a lump of bytes + OUT PIRP *IoRequestPacket // TdiReceive IRP if MORE_PROCESSING_REQUIRED. + ); + +NTSTATUS +TdiDefaultRcvExpeditedHandler ( + IN PVOID TdiEventContext, + IN CONNECTION_CONTEXT ConnectionContext, + IN ULONG ReceiveFlags, // + IN ULONG BytesIndicated, // number of bytes in this indication + IN ULONG BytesAvailable, // number of bytes in complete Tsdu + OUT ULONG *BytesTaken, // number of bytes used by indication routine + IN PVOID Tsdu, // pointer describing this TSDU, typically a lump of bytes + OUT PIRP *IoRequestPacket // TdiReceive IRP if MORE_PROCESSING_REQUIRED. + ); + +// +// This indication is delivered if there is room for a send in the buffer of +// a buffering protocol. +// + +typedef +NTSTATUS +(*PTDI_IND_SEND_POSSIBLE)( + IN PVOID TdiEventContext, + IN PVOID ConnectionContext, + IN ULONG BytesAvailable); + +NTSTATUS +TdiDefaultSendPossibleHandler ( + IN PVOID TdiEventContext, + IN PVOID ConnectionContext, + IN ULONG BytesAvailable); + +#endif //VXD + +#define FILE_DEVICE_NBT 0x32 +#endif + |