80 Irp->IoStatus.Information = 0;
84 return Irp->IoStatus.Status;
108 Irp->IoStatus.Status));
110 Irp->IoStatus.Information));
147 Irp->IoStatus.Information = 0;
246 Irp->IoStatus.Information = 0;
368 while (LastConnection->
Next !=
NULL)
369 LastConnection = LastConnection->
Next;
370 LastConnection->
Next = Connection;
575 if (TranContext ==
NULL)
722 Address->Address[0].Address[0].sin_port = AddrFile->
Port;
725 &
Address->Address[0].Address[0].sin_zero,
726 sizeof(
Address->Address[0].Address[0].sin_zero));
745 &
Address->Address[0].Address[0].sin_zero,
746 sizeof(
Address->Address[0].Address[0].sin_zero));
816 ULONG BytesReceived = 0;
826 if (TranContext ==
NULL)
885 ULONG BytesReceived = 0;
895 if (TranContext ==
NULL)
969 if (TranContext ==
NULL)
1042 if (TranContext ==
NULL)
1072 (
"About to call send routine %x\n",
1080 DgramInfo->SendDatagramInformation,
1084 Irp->IoStatus.Information = DataUsed;
1388 if (InputMdl && OutputMdl) {
1393 InputMdlLocked =
TRUE;
1398 OutputMdlLocked =
TRUE;
1416 Request.RequestContext = QueryContext;
1436 if (OutputMdlLocked)
1465 InputMdlLocked =
TRUE;
1486 Request.RequestContext = QueryContext;
1539 Irp->IoStatus.Information = 0;
1543 return Irp->IoStatus.Status;
1573 if( IF->Unicast.Address.IPv4Address == IpAddrChange->
Address ) {
1577 if( IF->Index == IpAddrChange->
NteIndex ) {
1581 IF->Unicast.Address.IPv4Address = IpAddrChange->
Address;
1584 IF->Netmask.Address.IPv4Address = IpAddrChange->
Netmask;
1587 IF->Broadcast.Address.IPv4Address =
1588 IF->Unicast.Address.IPv4Address |
1589 ~IF->Netmask.Address.IPv4Address;
1592 IF->Unicast.Address.IPv4Address));
1594 IF->Netmask.Address.IPv4Address));
1598 IpAddrChange->
Address = IF->Index;
1600 Irp->IoStatus.Information = IF->Index;
1611 PUSHORT NteIndex =
Irp->AssociatedIrp.SystemBuffer;
1615 if( IF->Index == *NteIndex ) {
1618 IF->Unicast.Address.IPv4Address = 0;
1621 IF->Netmask.Address.IPv4Address = 0;
1624 IF->Broadcast.Address.IPv4Address = 0;
1648 while (
Now.QuadPart -
WorkItem->StartTime.QuadPart < 10000 * 1000 && !
Irp->Cancel) {
1655 Wait.QuadPart = -10000;
1689 Irp->IoStatus.Information = 0;
1697 IPs = (
PULONG)
Irp->AssociatedIrp.SystemBuffer;
1772 if (LinkAddress ==
NULL) {
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
#define AddrInitIPv4(IPAddress, RawAddress)
PIP_INTERFACE AddrLocateInterface(PIP_ADDRESS MatchAddress)
BOOLEAN AddrIsUnspecified(PIP_ADDRESS Address)
BOOLEAN ARPTransmit(PIP_ADDRESS Address, PVOID LinkAddress, PIP_INTERFACE Interface)
UINT CopyBufferToBufferChain(PNDIS_BUFFER DstBuffer, UINT DstOffset, PUCHAR SrcData, UINT Length)
BOOLEAN DGRemoveIRP(PADDRESS_FILE AddrFile, PIRP Irp)
NTSTATUS DGReceiveDatagram(PADDRESS_FILE AddrFile, PTDI_CONNECTION_INFORMATION ConnInfo, PCHAR Buffer, ULONG ReceiveLength, ULONG ReceiveFlags, PTDI_CONNECTION_INFORMATION ReturnInfo, PULONG BytesReceived, PDATAGRAM_COMPLETION_ROUTINE Complete, PVOID Context, PIRP Irp)
#define NT_SUCCESS(StatCode)
_In_ PIO_STACK_LOCATION IrpSp
#define TI_DbgPrint(_t_, _x_)
VOID IPAddInterfaceRoute(PIP_INTERFACE IF)
VOID IPRemoveInterfaceRoute(PIP_INTERFACE IF)
struct _IP_SET_ADDRESS * PIP_SET_ADDRESS
PNEIGHBOR_CACHE_ENTRY RouteGetRouteToDestination(PIP_ADDRESS Destination)
#define IO_NETWORK_INCREMENT
NTSTATUS DispTdiQueryIpHwAddress(PDEVICE_OBJECT DeviceObject, PIRP Irp, PIO_STACK_LOCATION IrpSp)
NTSTATUS DispTdiQueryInformationEx(PIRP Irp, PIO_STACK_LOCATION IrpSp)
NTSTATUS DispPrepareIrpForCancel(PTRANSPORT_CONTEXT Context, PIRP Irp, PDRIVER_CANCEL CancelRoutine)
NTSTATUS DispTdiQueryInformation(PDEVICE_OBJECT DeviceObject, PIRP Irp)
NTSTATUS DispTdiAssociateAddress(PIRP Irp)
NTSTATUS DispTdiConnect(PIRP Irp)
NTSTATUS DispTdiReceive(PIRP Irp)
NTSTATUS DispTdiDeleteIPAddress(PIRP Irp, PIO_STACK_LOCATION IrpSp)
NTSTATUS DispTdiSend(PIRP Irp)
NTSTATUS DispTdiSetIPAddress(PIRP Irp, PIO_STACK_LOCATION IrpSp)
VOID NTAPI DispCancelListenRequest(PDEVICE_OBJECT Device, PIRP Irp)
struct _QUERY_HW_WORK_ITEM * PQUERY_HW_WORK_ITEM
VOID NTAPI WaitForHwAddress(PDEVICE_OBJECT DeviceObject, PVOID Context)
NTSTATUS DispTdiDisconnect(PIRP Irp)
VOID DispTdiQueryInformationExComplete(PVOID Context, ULONG Status, UINT ByteCount)
NTSTATUS DispTdiSetInformation(PIRP Irp)
VOID NTAPI DispCancelRequest(PDEVICE_OBJECT Device, PIRP Irp)
struct _QUERY_HW_WORK_ITEM QUERY_HW_WORK_ITEM
NTSTATUS DispTdiReceiveDatagram(PIRP Irp)
NTSTATUS DispTdiSetInformationEx(PIRP Irp, PIO_STACK_LOCATION IrpSp)
NTSTATUS DispTdiSetEventHandler(PIRP Irp)
NTSTATUS DispTdiSendDatagram(PIRP Irp)
NTSTATUS DispTdiAccept(PIRP Irp)
NTSTATUS DispTdiDisassociateAddress(PIRP Irp)
NTSTATUS IRPFinish(PIRP Irp, NTSTATUS Status)
NTSTATUS DispTdiListen(PIRP Irp)
VOID DispDataRequestComplete(PVOID Context, NTSTATUS Status, ULONG Count)
#define ExAllocatePoolWithTag(hernya, size, tag)
#define KeQuerySystemTime(t)
#define KeDelayExecutionThread(mode, foo, t)
#define EXCEPTION_EXECUTE_HANDLER
BOOLEAN TCPRemoveIRP(PCONNECTION_ENDPOINT Connection, PIRP Irp)
NTSTATUS TCPSendData(PCONNECTION_ENDPOINT Connection, PCHAR Buffer, ULONG DataSize, PULONG DataUsed, ULONG Flags, PTCP_COMPLETION_ROUTINE Complete, PVOID Context)
BOOLEAN TCPAbortListenForSocket(PCONNECTION_ENDPOINT Listener, PCONNECTION_ENDPOINT Connection)
NTSTATUS TCPSocket(PCONNECTION_ENDPOINT Connection, UINT Family, UINT Type, UINT Proto)
NTSTATUS TCPListen(PCONNECTION_ENDPOINT Connection, UINT Backlog)
NTSTATUS TCPAccept(PTDI_REQUEST Request, PCONNECTION_ENDPOINT Listener, PCONNECTION_ENDPOINT Connection, PTCP_COMPLETION_ROUTINE Complete, PVOID Context)
NTSTATUS TCPDisconnect(PCONNECTION_ENDPOINT Connection, UINT Flags, PLARGE_INTEGER Timeout, PTDI_CONNECTION_INFORMATION ConnInfo, PTDI_CONNECTION_INFORMATION ReturnInfo, PTCP_COMPLETION_ROUTINE Complete, PVOID Context)
NTSTATUS TCPConnect(PCONNECTION_ENDPOINT Connection, PTDI_CONNECTION_INFORMATION ConnInfo, PTDI_CONNECTION_INFORMATION ReturnInfo, PTCP_COMPLETION_ROUTINE Complete, PVOID Context)
PCONNECTION_ENDPOINT TCPAllocateConnectionEndpoint(PVOID ClientContext)
NTSTATUS TCPReceiveData(PCONNECTION_ENDPOINT Connection, PNDIS_BUFFER Buffer, ULONG ReceiveLength, PULONG BytesReceived, ULONG ReceiveFlags, PTCP_COMPLETION_ROUTINE Complete, PVOID Context)
TDI_STATUS InfoTdiSetInformationEx(PTDI_REQUEST Request, TDIObjectID *ID, PVOID Buffer, UINT BufferSize)
TDI_STATUS InfoTdiQueryInformationEx(PTDI_REQUEST Request, TDIObjectID *ID, PNDIS_BUFFER Buffer, PUINT BufferSize, PVOID Context)
POBJECT_TYPE IoFileObjectType
VOID NTAPI IoQueueWorkItem(IN PIO_WORKITEM IoWorkItem, IN PIO_WORKITEM_ROUTINE WorkerRoutine, IN WORK_QUEUE_TYPE QueueType, IN PVOID Context)
VOID NTAPI IoFreeWorkItem(IN PIO_WORKITEM IoWorkItem)
PIO_WORKITEM NTAPI IoAllocateWorkItem(IN PDEVICE_OBJECT DeviceObject)
IoSetCancelRoutine(Irp, CancelRoutine)
VOID NTAPI MmProbeAndLockPages(IN PMDL Mdl, IN KPROCESSOR_MODE AccessMode, IN LOCK_OPERATION Operation)
VOID NTAPI MmUnlockPages(IN PMDL Mdl)
#define ExFreePoolWithTag(_P, _T)
#define NdisQueryBuffer(_Buffer, _VirtualAddress, _Length)
PNEIGHBOR_CACHE_ENTRY NBLocateNeighbor(PIP_ADDRESS Address, PIP_INTERFACE Interface)
VOID NBUpdateNeighbor(PNEIGHBOR_CACHE_ENTRY NCE, PVOID LinkAddress, UCHAR State)
PIP_INTERFACE GetDefaultInterface(VOID)
#define IoCompleteRequest
VOID NTAPI IoReleaseCancelSpinLock(IN KIRQL Irql)
VOID NTAPI IoAcquireCancelSpinLock(OUT PKIRQL Irql)
#define STATUS_NETWORK_UNREACHABLE
#define STATUS_INVALID_BUFFER_SIZE
#define STATUS_NOT_IMPLEMENTED
#define STATUS_DEVICE_DOES_NOT_EXIST
#define STATUS_DUPLICATE_OBJECTID
NTSTATUS NTAPI ObReferenceObjectByHandle(IN HANDLE Handle, IN ACCESS_MASK DesiredAccess, IN POBJECT_TYPE ObjectType, IN KPROCESSOR_MODE AccessMode, OUT PVOID *Object, OUT POBJECT_HANDLE_INFORMATION HandleInformation OPTIONAL)
#define _SEH2_GetExceptionCode()
#define _SEH2_EXCEPT(...)
#define STATUS_BUFFER_TOO_SMALL
union IP_ADDRESS::@1014 Address
IPv4_RAW_ADDRESS IPv4Address
BOOLEAN RegisteredReceiveDatagramHandler
struct _CONNECTION_ENDPOINT * Connection
BOOLEAN RegisteredConnectHandler
PTDI_IND_CHAINED_RECEIVE ChainedReceiveHandler
PVOID ChainedReceiveHandlerContext
BOOLEAN RegisteredChainedReceiveExpeditedHandler
PTDI_IND_DISCONNECT DisconnectHandler
PVOID ConnectHandlerContext
PTDI_IND_CHAINED_RECEIVE_DATAGRAM ChainedReceiveDatagramHandler
PVOID DisconnectHandlerContext
PTDI_IND_ERROR ErrorHandler
PVOID ReceiveHandlerContext
PVOID ExpeditedReceiveHandlerContext
BOOLEAN RegisteredErrorHandler
PTDI_IND_CONNECT ConnectHandler
BOOLEAN RegisteredChainedReceiveHandler
BOOLEAN RegisteredReceiveHandler
PVOID ChainedReceiveDatagramHandlerContext
PVOID ReceiveDatagramHandlerContext
BOOLEAN RegisteredDisconnectHandler
PTDI_IND_RECEIVE_DATAGRAM ReceiveDatagramHandler
PTDI_IND_RECEIVE ReceiveHandler
PVOID ErrorHandlerContext
BOOLEAN RegisteredExpeditedReceiveHandler
PTDI_IND_CHAINED_RECEIVE_EXPEDITED ChainedReceiveExpeditedHandler
struct _CONNECTION_ENDPOINT * Listener
BOOLEAN RegisteredChainedReceiveDatagramHandler
PTDI_IND_RECEIVE_EXPEDITED ExpeditedReceiveHandler
PVOID ChainedReceiveExpeditedHandlerContext
PADDRESS_FILE AddressFile
struct _CONNECTION_ENDPOINT * Next
struct _IO_STACK_LOCATION::@1575::@1576 DeviceIoControl
union _IO_STACK_LOCATION::@1575 Parameters
TRANSPORT_ADDRESS Address
PTDI_CONNECTION_INFORMATION ReceiveDatagramInformation
PTDI_CONNECTION_INFORMATION ReturnDatagramInformation
PTDI_CONNECTION_INFORMATION RequestConnectionInformation
PTDI_CONNECTION_INFORMATION ReturnConnectionInformation
TCP_REQUEST_QUERY_INFORMATION_EX QueryInfo
union _TRANSPORT_CONTEXT::@1032 Handle
CONNECTION_CONTEXT ConnectionContext
#define TDI_QUERY_MAX_DATAGRAM_INFO
#define TDI_QUERY_CONNECTION_INFO
struct _TA_ADDRESS_IP * PTA_IP_ADDRESS
struct _TDI_CONNECTION_INFO * PTDI_CONNECTION_INFO
#define TDI_ADDRESS_LENGTH_IP
struct _TDI_ADDRESS_INFO * PTDI_ADDRESS_INFO
#define TDI_ADDRESS_TYPE_IP
#define TDI_QUERY_ADDRESS_INFO
struct _TDI_MAX_DATAGRAM_INFO * PTDI_MAX_DATAGRAM_INFO
struct _TCP_REQUEST_QUERY_INFORMATION_EX * PTCP_REQUEST_QUERY_INFORMATION_EX
NTSTATUS(NTAPI * PTDI_IND_RECEIVE_EXPEDITED)(_In_opt_ PVOID TdiEventContext, _In_opt_ CONNECTION_CONTEXT ConnectionContext, _In_ ULONG ReceiveFlags, _In_ ULONG BytesIndicated, _In_ ULONG BytesAvailable, _Out_ ULONG *BytesTaken, _In_ PVOID Tsdu, _Out_opt_ PIRP *IoRequestPacket)
#define TDI_EVENT_CHAINED_RECEIVE_EXPEDITED
#define TDI_SEND_DATAGRAM
#define TDI_CONTROL_CHANNEL_FILE
#define TDI_RECEIVE_DATAGRAM
#define TDI_EVENT_RECEIVE_EXPEDITED
#define TDI_EVENT_CHAINED_RECEIVE
struct _TDI_REQUEST_KERNEL_RECEIVEDG * PTDI_REQUEST_KERNEL_RECEIVEDG
#define TDI_EVENT_CONNECT
NTSTATUS(NTAPI * PTDI_IND_CHAINED_RECEIVE_DATAGRAM)(_In_opt_ PVOID TdiEventContext, _In_ LONG SourceAddressLength, _In_reads_bytes_(SourceAddressLength) PVOID SourceAddress, _In_ LONG OptionsLength, _In_reads_bytes_opt_(OptionsLength) PVOID Options, _In_ ULONG ReceiveDatagramFlags, _In_ ULONG ReceiveDatagramLength, _In_ ULONG StartingOffset, _In_ PMDL Tsdu, _In_ PVOID TsduDescriptor)
struct _TDI_REQUEST_KERNEL_SENDDG * PTDI_REQUEST_KERNEL_SENDDG
NTSTATUS(NTAPI * PTDI_IND_CHAINED_RECEIVE)(_In_opt_ PVOID TdiEventContext, _In_opt_ CONNECTION_CONTEXT ConnectionContext, _In_ ULONG ReceiveFlags, _In_ ULONG ReceiveLength, _In_ ULONG StartingOffset, _In_ PMDL Tsdu, _In_ PVOID TsduDescriptor)
NTSTATUS(NTAPI * PTDI_IND_ERROR)(_In_opt_ PVOID TdiEventContext, _In_ NTSTATUS Status)
struct _TDI_REQUEST_KERNEL_SET_EVENT * PTDI_REQUEST_KERNEL_SET_EVENT
#define TDI_EVENT_CHAINED_RECEIVE_DATAGRAM
NTSTATUS(NTAPI * PTDI_IND_CHAINED_RECEIVE_EXPEDITED)(_In_opt_ PVOID TdiEventContext, _In_opt_ CONNECTION_CONTEXT ConnectionContext, _In_ ULONG ReceiveFlags, _In_ ULONG ReceiveLength, _In_ ULONG StartingOffset, _In_ PMDL Tsdu, _In_ PVOID TsduDescriptor)
struct _TDI_REQUEST_KERNEL * PTDI_REQUEST_KERNEL
#define TDI_EVENT_DISCONNECT
struct _TDI_REQUEST_KERNEL_RECEIVE * PTDI_REQUEST_KERNEL_RECEIVE
NTSTATUS(NTAPI * PTDI_IND_RECEIVE_DATAGRAM)(_In_opt_ PVOID TdiEventContext, _In_ LONG SourceAddressLength, _In_reads_bytes_(SourceAddressLength) PVOID SourceAddress, _In_ LONG OptionsLength, _In_reads_bytes_opt_(OptionsLength) PVOID Options, _In_ ULONG ReceiveDatagramFlags, _In_ ULONG BytesIndicated, _In_ ULONG BytesAvailable, _Out_ ULONG *BytesTaken, _In_ PVOID Tsdu, _Out_opt_ PIRP *IoRequestPacket)
#define TDI_TRANSPORT_ADDRESS_FILE
struct _TDI_REQUEST_KERNEL_SEND * PTDI_REQUEST_KERNEL_SEND
NTSTATUS(NTAPI * PTDI_IND_RECEIVE)(_In_opt_ PVOID TdiEventContext, _In_opt_ CONNECTION_CONTEXT ConnectionContext, _In_ ULONG ReceiveFlags, _In_ ULONG BytesIndicated, _In_ ULONG BytesAvailable, _Out_ ULONG *BytesTaken, _In_ PVOID Tsdu, _Out_opt_ PIRP *IoRequestPacket)
struct _TDI_REQUEST_KERNEL_QUERY_INFO * PTDI_REQUEST_KERNEL_QUERY_INFORMATION
NTSTATUS(NTAPI * PTDI_IND_CONNECT)(_In_opt_ PVOID TdiEventContext, _In_ LONG RemoteAddressLength, _In_reads_bytes_(RemoteAddressLength) PVOID RemoteAddress, _In_ LONG UserDataLength, _In_reads_bytes_opt_(UserDataLength) PVOID UserData, _In_ LONG OptionsLength, _In_reads_bytes_opt_(OptionsLength) PVOID Options, _Out_ CONNECTION_CONTEXT *ConnectionContext, _Out_ PIRP *AcceptIrp)
#define TDI_CONNECTION_FILE
struct _TDI_REQUEST_KERNEL_ASSOCIATE * PTDI_REQUEST_KERNEL_ASSOCIATE
#define TDI_EVENT_RECEIVE
#define TDI_EVENT_RECEIVE_DATAGRAM
NTSTATUS(NTAPI * PTDI_IND_DISCONNECT)(_In_opt_ PVOID TdiEventContext, _In_opt_ CONNECTION_CONTEXT ConnectionContext, _In_ LONG DisconnectDataLength, _In_reads_bytes_opt_(DisconnectDataLength) PVOID DisconnectData, _In_ LONG DisconnectInformationLength, _In_reads_bytes_opt_(DisconnectInformationLength) PVOID DisconnectInformation, _In_ ULONG DisconnectFlags)
TDI_REQUEST_KERNEL * PTDI_REQUEST_KERNEL_DISCONNECT
#define ForEachInterface(n)
BOOLEAN NTAPI KeCancelTimer(IN OUT PKTIMER Timer)
struct _TRANSPORT_CONTEXT * PTRANSPORT_CONTEXT
DATAGRAM_COMPLETION_ROUTINE PDATAGRAM_COMPLETION_ROUTINE
#define UnlockObject(Object)
#define ReferenceObject(Object)
#define LockObject(Object)
#define DereferenceObject(Object)
struct _CONNECTION_ENDPOINT * PCONNECTION_ENDPOINT
struct _ADDRESS_FILE * PADDRESS_FILE
struct _TI_QUERY_CONTEXT * PTI_QUERY_CONTEXT
#define FIELD_OFFSET(t, f)
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define STATUS_INVALID_PARAMETER
#define STATUS_UNSUCCESSFUL
#define STATUS_INSUFFICIENT_RESOURCES
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
_Must_inspect_result_ _In_ WDFDEVICE Device
_In_ PDEVICE_OBJECT DeviceObject
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
_In_ UCHAR _In_ UCHAR MinorFunction
_In_ WDFDPC _In_ BOOLEAN Wait
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE Interface
_Must_inspect_result_ _In_ WDFQUEUE _In_opt_ WDFREQUEST _In_opt_ WDFFILEOBJECT _Inout_opt_ PWDF_REQUEST_PARAMETERS Parameters
_In_ WDFREQUEST _In_ size_t OutputBufferLength
_In_ WDFREQUEST _In_ size_t _In_ size_t InputBufferLength
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR OutputBuffer
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR InputBuffer
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
_Must_inspect_result_ _In_ PWDF_WORKITEM_CONFIG _In_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWORKITEM * WorkItem
_In_opt_ PDRIVER_CANCEL CancelRoutine
#define IRP_SYNCHRONOUS_API
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS _In_ LARGE_INTEGER ByteCount
DRIVER_CANCEL * PDRIVER_CANCEL
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
#define MmGetMdlByteCount(_Mdl)
#define MmGetSystemAddressForMdl(Mdl)
#define ObDereferenceObject