ReactOS 0.4.15-dev-7907-g95bf896
main.c File Reference
#include "precomp.h"
#include <ntifs.h>
#include <ndk/rtlfuncs.h>
#include <ndk/obfuncs.h>
#include <dispatch.h>
#include <fileobjs.h>
Include dependency graph for main.c:

Go to the source code of this file.

Functions

VOID TiWriteErrorLog (PDRIVER_OBJECT DriverContext, NTSTATUS ErrorCode, ULONG UniqueErrorValue, NTSTATUS FinalStatus, PWSTR String, ULONG DumpDataCount, PULONG DumpData)
 
NTSTATUS TiCreateFileObject (PDEVICE_OBJECT DeviceObject, PIRP Irp)
 
NTSTATUS TiCloseFileObject (PDEVICE_OBJECT DeviceObject, PIRP Irp)
 
NTSTATUS NTAPI TiDispatchOpenClose (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 
NTSTATUS NTAPI TiDispatchInternal (PDEVICE_OBJECT DeviceObject, PIRP Irp)
 
NTSTATUS NTAPI TiDispatch (PDEVICE_OBJECT DeviceObject, PIRP Irp)
 Dispatch routine for IRP_MJ_DEVICE_CONTROL requests.
 
static NTSTATUS TiCreateSecurityDescriptor (_Out_ PSECURITY_DESCRIPTOR *SecurityDescriptor)
 
static NTSTATUS TiSetupTcpDeviceSD (_In_ PDEVICE_OBJECT DeviceObject)
 
static NTSTATUS TiSecurityStartup (VOID)
 
VOID NTAPI TiUnload (PDRIVER_OBJECT DriverObject)
 
NTSTATUS NTAPI DriverEntry (PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
 
VOID NTAPI IPAddInterface (ULONG Unknown0, ULONG Unknown1, ULONG Unknown2, ULONG Unknown3, ULONG Unknown4)
 
VOID NTAPI IPDelInterface (ULONG Unknown0)
 
VOID NTAPI LookupRoute (ULONG Unknown0, ULONG Unknown1)
 

Variables

PDEVICE_OBJECT TCPDeviceObject = NULL
 
PDEVICE_OBJECT UDPDeviceObject = NULL
 
PDEVICE_OBJECT IPDeviceObject = NULL
 
PDEVICE_OBJECT RawIPDeviceObject = NULL
 
NDIS_HANDLE GlobalPacketPool = NULL
 
NDIS_HANDLE GlobalBufferPool = NULL
 
KSPIN_LOCK EntityListLock
 
TDIEntityInfoEntityList = NULL
 
ULONG EntityCount = 0
 
ULONG EntityMax = 0
 
UDP_STATISTICS UDPStats
 
KTIMER IPTimer
 
KDPC IPTimeoutDpc
 

Function Documentation

◆ DriverEntry()

NTSTATUS NTAPI DriverEntry ( PDRIVER_OBJECT  DriverObject,
PUNICODE_STRING  RegistryPath 
)

Definition at line 836 of file main.c.

847{
854 NDIS_STATUS NdisStatus;
856
857 TI_DbgPrint(MAX_TRACE, ("[TCPIP, DriverEntry] Called\n"));
858
859 /* TdiInitialize() ? */
860
861 /* FIXME: Create symbolic links in Win32 namespace */
862
863 /* Initialize our periodic timer and its associated DPC object. When the
864 timer expires, the IPTimeout deferred procedure call (DPC) is queued */
867
868 /* Create IP device object */
869 Status = IoCreateDevice(DriverObject, 0, &strIpDeviceName,
871 if (!NT_SUCCESS(Status)) {
872 TI_DbgPrint(MIN_TRACE, ("Failed to create IP device object. Status (0x%X).\n", Status));
874 return Status;
875 }
876
878
879 /* Create RawIP device object */
880 Status = IoCreateDevice(DriverObject, 0, &strRawDeviceName,
882 if (!NT_SUCCESS(Status)) {
883 TI_DbgPrint(MIN_TRACE, ("Failed to create RawIP device object. Status (0x%X).\n", Status));
885 return Status;
886 }
887
888 /* Create UDP device object */
889 Status = IoCreateDevice(DriverObject, 0, &strUdpDeviceName,
891 if (!NT_SUCCESS(Status)) {
892 TI_DbgPrint(MIN_TRACE, ("Failed to create UDP device object. Status (0x%X).\n", Status));
894 return Status;
895 }
896
897 /* Create TCP device object */
898 Status = IoCreateDevice(DriverObject, 0, &strTcpDeviceName,
900 if (!NT_SUCCESS(Status)) {
901 TI_DbgPrint(MIN_TRACE, ("Failed to create TCP device object. Status (0x%X).\n", Status));
903 return Status;
904 }
905
906 /* Setup network layer and transport layer entities */
911 if (!EntityList) {
912 TI_DbgPrint(MIN_TRACE, ("Insufficient resources.\n"));
915 }
916
917 EntityCount = 0;
919
920 /* Allocate NDIS packet descriptors */
921 NdisAllocatePacketPoolEx(&NdisStatus, &GlobalPacketPool, 500, 1500, sizeof(PACKET_CONTEXT));
922 if (NdisStatus != NDIS_STATUS_SUCCESS) {
925 }
926
927 /* Allocate NDIS buffer descriptors */
928 NdisAllocateBufferPool(&NdisStatus, &GlobalBufferPool, 2000);
929 if (NdisStatus != NDIS_STATUS_SUCCESS) {
932 }
933
934 /* Initialize address file list and protecting spin lock */
937
938 /* Initialize connection endpoint list and protecting spin lock */
941
942 /* Initialize interface list and protecting spin lock */
945
946 /* Initialize network level protocol subsystem */
948
949 /* Initialize transport level protocol subsystems */
951 if( !NT_SUCCESS(Status) ) {
953 return Status;
954 }
955
956 Status = UDPStartup();
957 if( !NT_SUCCESS(Status) ) {
959 return Status;
960 }
961
962 Status = TCPStartup();
963 if( !NT_SUCCESS(Status) ) {
965 return Status;
966 }
967
969 if( !NT_SUCCESS(Status) ) {
971 return Status;
972 }
973
974 /* Initialize security */
976 if (!NT_SUCCESS(Status))
977 {
979 return Status;
980 }
981
982 /* Use direct I/O */
987
988 /* Initialize the driver object with this driver's entry points */
993
994 DriverObject->DriverUnload = TiUnload;
995
996 /* Open loopback adapter */
998 if (!NT_SUCCESS(Status)) {
999 TI_DbgPrint(MIN_TRACE, ("Failed to create loopback adapter. Status (0x%X).\n", Status));
1001 return Status;
1002 }
1003
1004 /* Register protocol with NDIS */
1005 /* This used to be IP_DEVICE_NAME but the DDK says it has to match your entry in the SCM */
1006 Status = LANRegisterProtocol(&strNdisDeviceName);
1007 if (!NT_SUCCESS(Status)) {
1008 TI_DbgPrint(MIN_TRACE,("Failed to register protocol with NDIS; status 0x%x\n", Status));
1013 Status,
1014 NULL,
1015 0,
1016 NULL);
1018 return Status;
1019 }
1020
1021 /* Start the periodic timer with an initial and periodic
1022 relative expiration time of IP_TIMEOUT milliseconds */
1023 DueTime.QuadPart = -(LONGLONG)IP_TIMEOUT * 10000;
1025
1026 TI_DbgPrint(MAX_TRACE, ("[TCPIP, DriverEntry] Finished\n"));
1027
1028
1029 return STATUS_SUCCESS;
1030}
LONG NTSTATUS
Definition: precomp.h:26
#define MIN_TRACE
Definition: debug.h:14
#define MAX_TRACE
Definition: debug.h:16
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
VOID NTAPI KeInitializeDpc(IN PKDPC Dpc, IN PKDEFERRED_ROUTINE DeferredRoutine, IN PVOID DeferredContext)
Definition: dpc.c:712
VOID EXPORT NdisAllocateBufferPool(OUT PNDIS_STATUS Status, OUT PNDIS_HANDLE PoolHandle, IN UINT NumberOfDescriptors)
Definition: buffer.c:372
VOID EXPORT NdisAllocatePacketPoolEx(OUT PNDIS_STATUS Status, OUT PNDIS_HANDLE PoolHandle, IN UINT NumberOfDescriptors, IN UINT NumberOfOverflowDescriptors, IN UINT ProtocolReservedLength)
Definition: buffer.c:449
#define TI_DbgPrint(_t_, _x_)
Definition: debug.h:45
NTSTATUS IPStartup(PUNICODE_STRING RegistryPath)
Definition: ip.c:407
KSPIN_LOCK InterfaceListLock
Definition: ip.c:18
#define IP_TIMEOUT
Definition: ip.h:200
LIST_ENTRY InterfaceListHead
Definition: ip.c:17
VOID NTAPI IPTimeoutDpcFn(PKDPC Dpc, PVOID DeferredContext, PVOID SystemArgument1, PVOID SystemArgument2)
Definition: ip.c:112
#define TDI_ENTITY_TAG
Definition: tags.h:14
NTSTATUS ICMPStartup()
Definition: icmp.c:15
KDPC IPTimeoutDpc
Definition: main.c:34
NDIS_HANDLE GlobalBufferPool
Definition: main.c:25
NTSTATUS NTAPI TiDispatchInternal(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: main.c:378
NTSTATUS NTAPI TiDispatchOpenClose(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: main.c:337
PDEVICE_OBJECT UDPDeviceObject
Definition: main.c:21
VOID NTAPI TiUnload(PDRIVER_OBJECT DriverObject)
Definition: main.c:770
ULONG EntityMax
Definition: main.c:29
static NTSTATUS TiSecurityStartup(VOID)
Definition: main.c:746
NDIS_HANDLE GlobalPacketPool
Definition: main.c:24
PDEVICE_OBJECT TCPDeviceObject
Definition: main.c:20
NTSTATUS NTAPI TiDispatch(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Dispatch routine for IRP_MJ_DEVICE_CONTROL requests.
Definition: main.c:492
VOID TiWriteErrorLog(PDRIVER_OBJECT DriverContext, NTSTATUS ErrorCode, ULONG UniqueErrorValue, NTSTATUS FinalStatus, PWSTR String, ULONG DumpDataCount, PULONG DumpData)
Definition: main.c:36
ULONG EntityCount
Definition: main.c:28
KTIMER IPTimer
Definition: main.c:33
TDIEntityInfo * EntityList
Definition: main.c:27
KSPIN_LOCK EntityListLock
Definition: main.c:26
PDEVICE_OBJECT IPDeviceObject
Definition: main.c:22
PDEVICE_OBJECT RawIPDeviceObject
Definition: main.c:23
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define DO_DIRECT_IO
Definition: env_spec_w32.h:396
#define NonPagedPool
Definition: env_spec_w32.h:307
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
#define KeInitializeSpinLock(sl)
Definition: env_spec_w32.h:604
KSPIN_LOCK AddressFileListLock
Definition: fileobjs.c:22
LIST_ENTRY ConnectionEndpointListHead
Definition: fileobjs.c:25
LIST_ENTRY AddressFileListHead
Definition: fileobjs.c:21
KSPIN_LOCK ConnectionEndpointListLock
Definition: fileobjs.c:26
Status
Definition: gdiplustypes.h:25
NTSTATUS TCPStartup(VOID)
Definition: tcp.c:208
NTSTATUS UDPStartup(VOID)
Definition: udp.c:336
NTSTATUS LANRegisterProtocol(PNDIS_STRING Name)
Registers this protocol driver with NDIS.
Definition: lan.c:893
NDIS_STATUS LoopRegisterAdapter(PNDIS_STRING AdapterName, PLAN_ADAPTER *Adapter)
Definition: loopback.c:96
#define NDIS_STATUS_SUCCESS
Definition: ndis.h:346
#define EVENT_TRANSPORT_REGISTER_FAILED
Definition: netevent.h:531
int NDIS_STATUS
Definition: ntddndis.h:475
NTSTATUS NTAPI IoCreateDevice(IN PDRIVER_OBJECT DriverObject, IN ULONG DeviceExtensionSize, IN PUNICODE_STRING DeviceName, IN DEVICE_TYPE DeviceType, IN ULONG DeviceCharacteristics, IN BOOLEAN Exclusive, OUT PDEVICE_OBJECT *DeviceObject)
Definition: device.c:1031
#define FILE_DEVICE_NETWORK
Definition: winioctl.h:124
NTSTATUS RawIPStartup(VOID)
Definition: rawip.c:337
#define IRP_MJ_CLOSE
Definition: rdpdr.c:45
#define IRP_MJ_DEVICE_CONTROL
Definition: rdpdr.c:52
#define IRP_MJ_CREATE
Definition: rdpdr.c:44
#define STATUS_SUCCESS
Definition: shellext.h:65
#define MAX_TDI_ENTITIES
Definition: tdiinfo.h:35
#define TCPIP_PROTOCOL_NAME
Definition: ticonsts.h:32
#define TI_ERROR_DRIVERENTRY
Definition: ticonsts.h:36
#define DD_RAWIP_DEVICE_NAME
Definition: ticonsts.h:27
#define DD_IP_DEVICE_NAME
Definition: ticonsts.h:26
BOOLEAN NTAPI KeSetTimerEx(IN OUT PKTIMER Timer, IN LARGE_INTEGER DueTime, IN LONG Period, IN PKDPC Dpc OPTIONAL)
Definition: timerobj.c:294
VOID NTAPI KeInitializeTimer(OUT PKTIMER Timer)
Definition: timerobj.c:233
#define RTL_CONSTANT_STRING(s)
Definition: tunneltest.c:14
int64_t LONGLONG
Definition: typedefs.h:68
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
Definition: wdfdriver.h:215
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
_In_ WDFTIMER _In_ LONGLONG DueTime
Definition: wdftimer.h:190
VOID ChewInit(PDEVICE_OBJECT DeviceObject)
Definition: workqueue.c:28
#define DD_UDP_DEVICE_NAME
Definition: wshtcpip.h:28
#define DD_TCP_DEVICE_NAME
Definition: wshtcpip.h:27
#define IRP_MJ_INTERNAL_DEVICE_CONTROL

◆ IPAddInterface()

VOID NTAPI IPAddInterface ( ULONG  Unknown0,
ULONG  Unknown1,
ULONG  Unknown2,
ULONG  Unknown3,
ULONG  Unknown4 
)

Definition at line 1033 of file main.c.

1039{
1041}
#define UNIMPLEMENTED
Definition: debug.h:115

◆ IPDelInterface()

VOID NTAPI IPDelInterface ( ULONG  Unknown0)

Definition at line 1045 of file main.c.

1047{
1049}

◆ LookupRoute()

VOID NTAPI LookupRoute ( ULONG  Unknown0,
ULONG  Unknown1 
)

Definition at line 1053 of file main.c.

1056{
1058}

◆ TiCloseFileObject()

NTSTATUS TiCloseFileObject ( PDEVICE_OBJECT  DeviceObject,
PIRP  Irp 
)

Definition at line 288 of file main.c.

291{
296
298 Context = IrpSp->FileObject->FsContext;
299 if (!Context)
300 {
301 TI_DbgPrint(MIN_TRACE, ("Parameters are invalid.\n"));
303 }
304
305 switch ((ULONG_PTR)IrpSp->FileObject->FsContext2)
306 {
308 Request.Handle.AddressHandle = Context->Handle.AddressHandle;
310 break;
311
313 Request.Handle.ConnectionContext = Context->Handle.ConnectionContext;
315 break;
316
318 Request.Handle.ControlChannel = Context->Handle.ControlChannel;
320 break;
321
322 default:
324 break;
325 }
326
327 if (NT_SUCCESS(Status))
329
330 Irp->IoStatus.Status = Status;
331
332 return Irp->IoStatus.Status;
333}
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
_In_ PIRP Irp
Definition: csq.h:116
_In_ PIO_STACK_LOCATION IrpSp
Definition: create.c:4137
#define TRANS_CONTEXT_TAG
Definition: tags.h:13
NTSTATUS FileCloseConnection(PTDI_REQUEST Request)
Definition: fileobjs.c:667
NTSTATUS FileCloseAddress(PTDI_REQUEST Request)
Definition: fileobjs.c:591
NTSTATUS FileCloseControlChannel(PTDI_REQUEST Request)
Definition: fileobjs.c:738
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1109
PFILE_OBJECT FileObject
Definition: iotypes.h:3169
#define TDI_CONTROL_CHANNEL_FILE
Definition: tdikrnl.h:67
#define TDI_TRANSPORT_ADDRESS_FILE
Definition: tdikrnl.h:65
#define TDI_CONNECTION_FILE
Definition: tdikrnl.h:66
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
_In_ WDFREQUEST Request
Definition: wdfdevice.h:547

Referenced by TiDispatchOpenClose().

◆ TiCreateFileObject()

NTSTATUS TiCreateFileObject ( PDEVICE_OBJECT  DeviceObject,
PIRP  Irp 
)

Definition at line 113 of file main.c.

116{
125 BOOLEAN Shared;
126
127 TI_DbgPrint(DEBUG_IRP, ("Called. DeviceObject is at (0x%X), IRP is at (0x%X).\n", DeviceObject, Irp));
128
129 EaInfo = Irp->AssociatedIrp.SystemBuffer;
130
131 /* Parameter check */
132 /* No EA information means that we're opening for SET/QUERY_INFORMATION
133 * style calls. */
134
135 /* Allocate resources here. We release them again if something failed */
138 if (!Context)
139 {
140 TI_DbgPrint(MIN_TRACE, ("Insufficient resources.\n"));
142 }
143
144 Context->CancelIrps = FALSE;
145
147 IrpSp->FileObject->FsContext = Context;
148 Request.RequestContext = Irp;
149
150 /* Branch to the right handler */
151 if (EaInfo &&
155 {
156 /* This is a request to open an address */
157
158
159 /* XXX This should probably be done in IoCreateFile() */
160 /* Parameter checks */
161
162 Address = (PTA_IP_ADDRESS)(EaInfo->EaName + EaInfo->EaNameLength + 1); //0-term
163
164 if ((EaInfo->EaValueLength < sizeof(TA_IP_ADDRESS)) ||
165 (Address->TAAddressCount != 1) ||
166 (Address->Address[0].AddressLength < TDI_ADDRESS_LENGTH_IP) ||
167 (Address->Address[0].AddressType != TDI_ADDRESS_TYPE_IP))
168 {
169 TI_DbgPrint(MIN_TRACE, ("Parameters are invalid:\n"));
170 TI_DbgPrint(MIN_TRACE, ("AddressCount: %d\n", Address->TAAddressCount));
171 if( Address->TAAddressCount == 1 )
172 {
173 TI_DbgPrint(MIN_TRACE, ("AddressLength: %u\n",
174 Address->Address[0].AddressLength));
175 TI_DbgPrint(MIN_TRACE, ("AddressType: %u\n",
176 Address->Address[0].AddressType));
177 }
178
181 }
182
183 /* Open address file object */
184
185 /* Protocol depends on device object so find the protocol */
188 else if (DeviceObject == UDPDeviceObject)
190 else if (DeviceObject == IPDeviceObject)
193 {
195 if (!NT_SUCCESS(Status))
196 {
197 TI_DbgPrint(MIN_TRACE, ("Raw IP protocol number is invalid.\n"));
200 }
201 }
202 else
203 {
204 TI_DbgPrint(MIN_TRACE, ("Invalid device object at (0x%X).\n", DeviceObject));
207 }
208
209 Shared = (IrpSp->Parameters.Create.ShareAccess != 0);
210
212 if (NT_SUCCESS(Status))
213 {
215 Context->Handle.AddressHandle = Request.Handle.AddressHandle;
216 }
217
218 }
219 else if (EaInfo &&
222 (&EaInfo->EaName, TdiConnectionContext,
225 {
226 /* This is a request to open a connection endpoint */
227
228 /* Parameter checks */
229
230 if (EaInfo->EaValueLength < sizeof(PVOID))
231 {
232 TI_DbgPrint(MIN_TRACE, ("Parameters are invalid.\n"));
235 }
236
237 /* Can only do connection oriented communication using TCP */
238
240 {
241 TI_DbgPrint(MIN_TRACE, ("Bad device object.\n"));
244 }
245
246 ClientContext = *((PVOID*)(EaInfo->EaName + EaInfo->EaNameLength));
247
248 /* Open connection endpoint file object */
249
251 if (NT_SUCCESS(Status))
252 {
254 Context->Handle.ConnectionContext = Request.Handle.ConnectionContext;
255 }
256 }
257 else
258 {
259 /* This is a request to open a control connection */
261 if (NT_SUCCESS(Status))
262 {
264 Context->Handle.ControlChannel = Request.Handle.ControlChannel;
265 }
266 }
267
268 if (!NT_SUCCESS(Status))
270
271 TI_DbgPrint(DEBUG_IRP, ("Leaving. Status = (0x%X).\n", Status));
272
273 Irp->IoStatus.Status = Status;
274 return Status;
275}
unsigned char BOOLEAN
#define DEBUG_IRP
Definition: debug.h:19
#define IPPROTO_RAW
Definition: ip.h:192
#define IPPROTO_TCP
Definition: ip.h:196
#define IPPROTO_UDP
Definition: ip.h:197
NTSTATUS TiGetProtocolNumber(PUNICODE_STRING FileName, PULONG Protocol)
Definition: proto.c:3
#define RtlCompareMemory(s1, s2, l)
Definition: env_spec_w32.h:465
NTSTATUS FileOpenControlChannel(PTDI_REQUEST Request)
Definition: fileobjs.c:694
NTSTATUS FileOpenConnection(PTDI_REQUEST Request, PVOID ClientContext)
Definition: fileobjs.c:632
NTSTATUS FileOpenAddress(PTDI_REQUEST Request, PTA_IP_ADDRESS AddrList, USHORT Protocol, BOOLEAN Shared, PVOID Options)
Definition: fileobjs.c:399
_In_ PVOID ClientContext
Definition: netioddk.h:55
static WCHAR Address[46]
Definition: ping.c:68
union _IO_STACK_LOCATION::@1564 Parameters
struct _IO_STACK_LOCATION::@3978::@3979 Create
struct _TA_ADDRESS_IP * PTA_IP_ADDRESS
#define TDI_CONNECTION_CONTEXT_LENGTH
Definition: tdi.h:373
#define TDI_TRANSPORT_ADDRESS_LENGTH
Definition: tdi.h:372
#define TDI_ADDRESS_LENGTH_IP
Definition: tdi.h:413
#define TDI_ADDRESS_TYPE_IP
Definition: tdi.h:345
#define TdiConnectionContext
Definition: tdi.h:371
#define TdiTransportAddress
Definition: tdi.h:370
void * PVOID
Definition: typedefs.h:50
uint32_t ULONG
Definition: typedefs.h:59
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055

Referenced by TiDispatchOpenClose().

◆ TiCreateSecurityDescriptor()

static NTSTATUS TiCreateSecurityDescriptor ( _Out_ PSECURITY_DESCRIPTOR SecurityDescriptor)
static

Definition at line 564 of file main.c.

566{
569 ULONG DaclSize, RelSDSize = 0;
571 PACL Dacl = NULL;
572
573 /* Setup a SD */
576 if (!NT_SUCCESS(Status))
577 {
578 TI_DbgPrint(MIN_TRACE, ("Failed to create the absolute SD (0x%X)\n", Status));
579 goto Quit;
580 }
581
582 /* Setup a DACL */
583 DaclSize = sizeof(ACL) +
588 DaclSize,
590 if (Dacl == NULL)
591 {
592 TI_DbgPrint(MIN_TRACE, ("Failed to allocate buffer heap for a DACL\n"));
594 goto Quit;
595 }
596
598 DaclSize,
600 if (!NT_SUCCESS(Status))
601 {
602 TI_DbgPrint(MIN_TRACE, ("Failed to create a DACL (0x%X)\n", Status));
603 goto Quit;
604 }
605
606 /* Setup access */
611 if (!NT_SUCCESS(Status))
612 {
613 TI_DbgPrint(MIN_TRACE, ("Failed to add access allowed ACE for System SID (0x%X)\n", Status));
614 goto Quit;
615 }
616
621 if (!NT_SUCCESS(Status))
622 {
623 TI_DbgPrint(MIN_TRACE, ("Failed to add access allowed ACE for Admins SID (0x%X)\n", Status));
624 goto Quit;
625 }
626
631 if (!NT_SUCCESS(Status))
632 {
633 TI_DbgPrint(MIN_TRACE, ("Failed to add access allowed ACE for Network Service SID (0x%X)\n", Status));
634 goto Quit;
635 }
636
637 /* Assign security data to SD */
639 TRUE,
640 Dacl,
641 FALSE);
642 if (!NT_SUCCESS(Status))
643 {
644 TI_DbgPrint(MIN_TRACE, ("Failed to set DACL to security descriptor (0x%X)\n", Status));
645 goto Quit;
646 }
647
650 FALSE);
651 if (!NT_SUCCESS(Status))
652 {
653 TI_DbgPrint(MIN_TRACE, ("Failed to set group to security descriptor (0x%X)\n", Status));
654 goto Quit;
655 }
656
659 FALSE);
660 if (!NT_SUCCESS(Status))
661 {
662 TI_DbgPrint(MIN_TRACE, ("Failed to set owner to security descriptor (0x%X)\n", Status));
663 goto Quit;
664 }
665
666 /* Get the required buffer size for the self-relative SD */
668 NULL,
669 &RelSDSize);
671 {
672 TI_DbgPrint(MIN_TRACE, ("Expected STATUS_BUFFER_TOO_SMALL but got something else (0x%X)\n", Status));
673 goto Quit;
674 }
675
677 RelSDSize,
679 if (RelSD == NULL)
680 {
681 TI_DbgPrint(MIN_TRACE, ("Failed to allocate buffer heap for relative SD\n"));
683 goto Quit;
684 }
685
686 /* Convert it now */
688 RelSD,
689 &RelSDSize);
690 if (!NT_SUCCESS(Status))
691 {
692 TI_DbgPrint(MIN_TRACE, ("Failed to convert absolute SD into a relative SD (0x%X)\n", Status));
693 goto Quit;
694 }
695
696 /* Give the buffer to caller */
697 *SecurityDescriptor = RelSD;
698
699Quit:
700 if (!NT_SUCCESS(Status))
701 {
702 if (RelSD != NULL)
703 {
705 }
706 }
707
708 if (Dacl != NULL)
709 {
711 }
712
713 return Status;
714}
#define TRUE
Definition: types.h:120
#define DEVICE_OBJ_SECURITY_TAG
Definition: tags.h:47
#define PagedPool
Definition: env_spec_w32.h:308
NTSYSAPI NTSTATUS WINAPI RtlAddAccessAllowedAce(PACL, DWORD, DWORD, PSID)
NTSYSAPI NTSTATUS WINAPI RtlSetOwnerSecurityDescriptor(PSECURITY_DESCRIPTOR, PSID, BOOLEAN)
NTSYSAPI NTSTATUS WINAPI RtlSetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR, BOOLEAN, PACL, BOOLEAN)
struct _ACL ACL
struct _ACCESS_ALLOWED_ACE ACCESS_ALLOWED_ACE
_Out_writes_bytes_to_opt_ AbsoluteSecurityDescriptorSize PSECURITY_DESCRIPTOR _Inout_ PULONG _Out_writes_bytes_to_opt_ DaclSize PACL Dacl
Definition: rtlfuncs.h:1593
NTSYSAPI NTSTATUS NTAPI RtlCreateAcl(PACL Acl, ULONG AclSize, ULONG AclRevision)
NTSYSAPI ULONG NTAPI RtlLengthSid(IN PSID Sid)
Definition: sid.c:150
NTSYSAPI NTSTATUS NTAPI RtlCreateSecurityDescriptor(_Out_ PSECURITY_DESCRIPTOR SecurityDescriptor, _In_ ULONG Revision)
_Out_writes_bytes_to_opt_ AbsoluteSecurityDescriptorSize PSECURITY_DESCRIPTOR _Inout_ PULONG _Out_writes_bytes_to_opt_ DaclSize PACL _Inout_ PULONG DaclSize
Definition: rtlfuncs.h:1594
#define GENERIC_ALL
Definition: nt_native.h:92
NTSYSAPI NTSTATUS NTAPI RtlSetGroupSecurityDescriptor(IN OUT PSECURITY_DESCRIPTOR SecurityDescriptor, IN PSID Group, IN BOOLEAN GroupDefaulted)
Definition: sd.c:410
NTSYSAPI NTSTATUS NTAPI RtlAbsoluteToSelfRelativeSD(IN PSECURITY_DESCRIPTOR AbsoluteSecurityDescriptor, IN OUT PSECURITY_DESCRIPTOR SelfRelativeSecurityDescriptor, IN PULONG BufferLength)
Definition: sd.c:626
PSE_EXPORTS SeExports
Definition: semgr.c:21
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:69
PSID SeAliasAdminsSid
Definition: setypes.h:1229
PSID SeNetworkServiceSid
Definition: setypes.h:1244
PSID SeLocalSystemSid
Definition: setypes.h:1228
_In_ USHORT _In_ ULONG _In_ PSOCKADDR _In_ PSOCKADDR _Reserved_ ULONG _In_opt_ PVOID _In_opt_ const WSK_CLIENT_CONNECTION_DISPATCH _In_opt_ PEPROCESS _In_opt_ PETHREAD _In_opt_ PSECURITY_DESCRIPTOR SecurityDescriptor
Definition: wsk.h:191
#define SECURITY_DESCRIPTOR_REVISION
Definition: setypes.h:58
#define ACL_REVISION
Definition: setypes.h:39

Referenced by TiSetupTcpDeviceSD().

◆ TiDispatch()

NTSTATUS NTAPI TiDispatch ( PDEVICE_OBJECT  DeviceObject,
PIRP  Irp 
)

Dispatch routine for IRP_MJ_DEVICE_CONTROL requests.

Parameters
[in]DeviceObjectPointer to a device object for this driver
[in]IrpPointer to a I/O request packet
Returns
Status of the operation

Definition at line 492 of file main.c.

495{
498
500
501 TI_DbgPrint(DEBUG_IRP, ("[TCPIP, TiDispatch] Called. IRP is at (0x%X).\n", Irp));
502
503 Irp->IoStatus.Information = 0;
504
505#if 0
507 if (NT_SUCCESS(Status))
508 {
511 }
512 else
513 {
514#else
515 if (TRUE) {
516#endif
517 /* See if this request is TCP/IP specific */
518 switch (IrpSp->Parameters.DeviceIoControl.IoControlCode)
519 {
521 TI_DbgPrint(MIN_TRACE, ("TCP_QUERY_INFORMATION_EX\n"));
523 break;
524
526 TI_DbgPrint(MIN_TRACE, ("TCP_SET_INFORMATION_EX\n"));
528 break;
529
531 TI_DbgPrint(MIN_TRACE, ("SET_IP_ADDRESS\n"));
533 break;
534
536 TI_DbgPrint(MIN_TRACE, ("DELETE_IP_ADDRESS\n"));
538 break;
539
541 TI_DbgPrint(MIN_TRACE, ("QUERY_IP_HW_ADDRESS\n"));
543 break;
544
546 TI_DbgPrint(MIN_TRACE, ("ICMP_ECHO_REQUEST\n"));
548 break;
549
550 default:
551 TI_DbgPrint(MIN_TRACE, ("Unknown IOCTL 0x%X\n",
552 IrpSp->Parameters.DeviceIoControl.IoControlCode));
554 break;
555 }
556 }
557
558 TI_DbgPrint(DEBUG_IRP, ("[TCPIP, TiDispatch] Leaving. Status = (0x%X).\n", Status));
559
560 return IRPFinish(Irp, Status);
561}
NTSTATUS DispTdiQueryIpHwAddress(PDEVICE_OBJECT DeviceObject, PIRP Irp, PIO_STACK_LOCATION IrpSp)
Definition: dispatch.c:1681
NTSTATUS DispTdiQueryInformationEx(PIRP Irp, PIO_STACK_LOCATION IrpSp)
Definition: dispatch.c:1319
NTSTATUS DispTdiDeleteIPAddress(PIRP Irp, PIO_STACK_LOCATION IrpSp)
Definition: dispatch.c:1609
NTSTATUS DispTdiSetIPAddress(PIRP Irp, PIO_STACK_LOCATION IrpSp)
Definition: dispatch.c:1561
NTSTATUS DispTdiSetInformationEx(PIRP Irp, PIO_STACK_LOCATION IrpSp)
Definition: dispatch.c:1502
NTSTATUS IRPFinish(PIRP Irp, NTSTATUS Status)
Definition: dispatch.c:26
NTSTATUS NTAPI TdiMapUserRequest(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PIO_STACK_LOCATION IrpSp)
Definition: stubs.c:83
NTSTATUS DispEchoRequest(PDEVICE_OBJECT DeviceObject, PIRP Irp, PIO_STACK_LOCATION IrpSp)
#define STATUS_PENDING
Definition: ntstatus.h:82
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:239
struct _IO_STACK_LOCATION::@1564::@1565 DeviceIoControl
#define IOCTL_SET_IP_ADDRESS
Definition: tcpioctl.h:43
#define IOCTL_DELETE_IP_ADDRESS
Definition: tcpioctl.h:46
#define IOCTL_ICMP_ECHO_REQUEST
Definition: tcpioctl.h:49
#define IOCTL_QUERY_IP_HW_ADDRESS
Definition: tcpioctl.h:40
#define IOCTL_TCP_QUERY_INFORMATION_EX
Definition: tditest.h:110
#define IOCTL_TCP_SET_INFORMATION_EX
Definition: tditest.h:112

Referenced by DriverEntry().

◆ TiDispatchInternal()

NTSTATUS NTAPI TiDispatchInternal ( PDEVICE_OBJECT  DeviceObject,
PIRP  Irp 
)

Definition at line 378 of file main.c.

389{
393
395
396 TI_DbgPrint(DEBUG_IRP, ("[TCPIP, TiDispatchInternal] Called. DeviceObject is at (0x%X), IRP is at (0x%X) MN (%d).\n",
398
399 Irp->IoStatus.Status = STATUS_SUCCESS;
400 Irp->IoStatus.Information = 0;
401
402 switch (IrpSp->MinorFunction) {
403 case TDI_RECEIVE:
405 Complete = FALSE;
406 break;
407
410 Complete = FALSE;
411 break;
412
413 case TDI_SEND:
415 Complete = FALSE; /* Completed in DispTdiSend */
416 break;
417
420 Complete = FALSE;
421 break;
422
423 case TDI_ACCEPT:
425 break;
426
427 case TDI_LISTEN:
429 Complete = FALSE;
430 break;
431
432 case TDI_CONNECT:
434 Complete = FALSE; /* Completed by the TCP event handler */
435 break;
436
437 case TDI_DISCONNECT:
439 Complete = FALSE;
440 break;
441
444 break;
445
448 break;
449
452 break;
453
456 break;
457
460 break;
461
462 case TDI_ACTION:
464 break;
465
466 /* An unsupported IOCTL code was submitted */
467 default:
469 }
470
471 TI_DbgPrint(DEBUG_IRP, ("[TCPIP, TiDispatchInternal] Leaving. Status = (0x%X).\n", Status));
472
473 if( Complete )
474 IRPFinish( Irp, Status );
475
476 return Status;
477}
NTSTATUS DispTdiQueryInformation(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: dispatch.c:662
NTSTATUS DispTdiAssociateAddress(PIRP Irp)
Definition: dispatch.c:270
NTSTATUS DispTdiConnect(PIRP Irp)
Definition: dispatch.c:382
NTSTATUS DispTdiReceive(PIRP Irp)
Definition: dispatch.c:802
NTSTATUS DispTdiSend(PIRP Irp)
Definition: dispatch.c:945
NTSTATUS DispTdiDisconnect(PIRP Irp)
Definition: dispatch.c:484
NTSTATUS DispTdiSetInformation(PIRP Irp)
Definition: dispatch.c:1266
NTSTATUS DispTdiReceiveDatagram(PIRP Irp)
Definition: dispatch.c:870
NTSTATUS DispTdiSetEventHandler(PIRP Irp)
Definition: dispatch.c:1103
NTSTATUS DispTdiSendDatagram(PIRP Irp)
Definition: dispatch.c:1018
NTSTATUS DispTdiAccept(PIRP Irp)
Definition: dispatch.c:254
NTSTATUS DispTdiDisassociateAddress(PIRP Irp)
Definition: dispatch.c:446
NTSTATUS DispTdiListen(PIRP Irp)
Definition: dispatch.c:550
pRequest Complete(RequestStatus)
#define TDI_SEND_DATAGRAM
Definition: tdikrnl.h:55
#define TDI_RECEIVE_DATAGRAM
Definition: tdikrnl.h:56
#define TDI_ACCEPT
Definition: tdikrnl.h:51
#define TDI_SEND
Definition: tdikrnl.h:53
#define TDI_LISTEN
Definition: tdikrnl.h:50
#define TDI_CONNECT
Definition: tdikrnl.h:49
#define TDI_QUERY_INFORMATION
Definition: tdikrnl.h:58
#define TDI_ACTION
Definition: tdikrnl.h:60
#define TDI_SET_INFORMATION
Definition: tdikrnl.h:59
#define TDI_DISASSOCIATE_ADDRESS
Definition: tdikrnl.h:48
#define TDI_SET_EVENT_HANDLER
Definition: tdikrnl.h:57
#define TDI_RECEIVE
Definition: tdikrnl.h:54
#define TDI_ASSOCIATE_ADDRESS
Definition: tdikrnl.h:47
#define TDI_DISCONNECT
Definition: tdikrnl.h:52
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138

Referenced by DriverEntry(), and TiDispatch().

◆ TiDispatchOpenClose()

NTSTATUS NTAPI TiDispatchOpenClose ( IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp 
)

Definition at line 337 of file main.c.

348{
351
352// DbgPrint("Called. DeviceObject is at (0x%X), IRP is at (0x%X).\n", DeviceObject, Irp);
353
355
356 switch (IrpSp->MajorFunction) {
357 /* Open an address file, connection endpoint, or control connection */
358 case IRP_MJ_CREATE:
360 break;
361
362 /* Close an address file, connection endpoint, or control connection */
363 case IRP_MJ_CLOSE:
365 break;
366
367 default:
369 }
370
371 //DbgPrint("Leaving. Status is (0x%X)\n", Status);
372
373 return IRPFinish( Irp, Status );
374}
NTSTATUS TiCloseFileObject(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: main.c:288
NTSTATUS TiCreateFileObject(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: main.c:113

Referenced by DriverEntry().

◆ TiSecurityStartup()

static NTSTATUS TiSecurityStartup ( VOID  )
static

Definition at line 746 of file main.c.

748{
750
751 /* Set security data for the TCP and IP device objects */
753 if (!NT_SUCCESS(Status))
754 {
755 TI_DbgPrint(MIN_TRACE, ("Failed to set security data for TCP device object\n"));
756 return Status;
757 }
758
760 if (!NT_SUCCESS(Status))
761 {
762 TI_DbgPrint(MIN_TRACE, ("Failed to set security data for IP device object\n"));
763 return Status;
764 }
765
766 return STATUS_SUCCESS;
767}
static NTSTATUS TiSetupTcpDeviceSD(_In_ PDEVICE_OBJECT DeviceObject)
Definition: main.c:717

Referenced by DriverEntry().

◆ TiSetupTcpDeviceSD()

static NTSTATUS TiSetupTcpDeviceSD ( _In_ PDEVICE_OBJECT  DeviceObject)
static

Definition at line 717 of file main.c.

719{
723
724 /* Obtain a security descriptor */
726 if (!NT_SUCCESS(Status))
727 {
728 TI_DbgPrint(MIN_TRACE, ("Failed to create a security descriptor for the device object\n"));
729 return Status;
730 }
731
732 /* Whack the new descriptor into the TCP device object */
734 Info,
735 Sd);
736 if (!NT_SUCCESS(Status))
737 {
738 TI_DbgPrint(MIN_TRACE, ("Failed to set new security information to the device object\n"));
739 }
740
742 return Status;
743}
static NTSTATUS TiCreateSecurityDescriptor(_Out_ PSECURITY_DESCRIPTOR *SecurityDescriptor)
Definition: main.c:564
DWORD SECURITY_INFORMATION
Definition: ms-dtyp.idl:311
NTSTATUS NTAPI ObSetSecurityObjectByPointer(IN PVOID Object, IN SECURITY_INFORMATION SecurityInformation, IN PSECURITY_DESCRIPTOR SecurityDescriptor)
Definition: obsecure.c:749
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:690
#define DACL_SECURITY_INFORMATION
Definition: setypes.h:125
#define OWNER_SECURITY_INFORMATION
Definition: setypes.h:123
#define GROUP_SECURITY_INFORMATION
Definition: setypes.h:124

Referenced by TiSecurityStartup().

◆ TiUnload()

VOID NTAPI TiUnload ( PDRIVER_OBJECT  DriverObject)

Definition at line 770 of file main.c.

777{
778#if DBG
780
783 TI_DbgPrint(MIN_TRACE, ("[TCPIP, TiUnload] Called. Open address file objects exists.\n"));
784 }
786#endif
787 /* Cancel timer */
789
790 /* Unregister loopback adapter */
792
793 /* Unregister protocol with NDIS */
795
796 /* Shutdown transport level protocol subsystems */
797 TCPShutdown();
798 UDPShutdown();
800 ICMPShutdown();
801
802 /* Shutdown network level protocol subsystem */
803 IPShutdown();
804
805 /* Free NDIS buffer descriptors */
808
809 /* Free NDIS packet descriptors */
812
813 /* Release all device objects */
814
815 if (TCPDeviceObject)
817
818 if (UDPDeviceObject)
820
823
824 if (IPDeviceObject) {
825 ChewShutdown();
827 }
828
829 if (EntityList)
831
832 TI_DbgPrint(MAX_TRACE, ("[TCPIP, TiUnload] Leaving.\n"));
833}
VOID EXPORT NdisFreeBufferPool(IN NDIS_HANDLE PoolHandle)
Definition: buffer.c:777
VOID EXPORT NdisFreePacketPool(IN NDIS_HANDLE PoolHandle)
Definition: buffer.c:793
NTSTATUS IPShutdown(VOID)
Definition: ip.c:473
VOID TcpipReleaseSpinLock(PKSPIN_LOCK SpinLock, KIRQL Irql)
Definition: lock.c:26
VOID TcpipAcquireSpinLock(PKSPIN_LOCK SpinLock, PKIRQL Irql)
Definition: lock.c:18
NTSTATUS ICMPShutdown()
Definition: icmp.c:22
#define IsListEmpty(ListHead)
Definition: env_spec_w32.h:954
UCHAR KIRQL
Definition: env_spec_w32.h:591
NTSTATUS TCPShutdown(VOID)
Definition: tcp.c:243
NTSTATUS UDPShutdown(VOID)
Definition: udp.c:361
VOID LANUnregisterProtocol(VOID)
Unregisters this protocol driver with NDIS.
Definition: lan.c:943
NDIS_STATUS LoopUnregisterAdapter(PLAN_ADAPTER Adapter)
Definition: loopback.c:143
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
Definition: device.c:1251
NTSTATUS RawIPShutdown(VOID)
Definition: rawip.c:353
BOOLEAN NTAPI KeCancelTimer(IN OUT PKTIMER Timer)
Definition: timerobj.c:206
VOID ChewShutdown(VOID)
Definition: workqueue.c:36
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:778

Referenced by DriverEntry().

◆ TiWriteErrorLog()

VOID TiWriteErrorLog ( PDRIVER_OBJECT  DriverContext,
NTSTATUS  ErrorCode,
ULONG  UniqueErrorValue,
NTSTATUS  FinalStatus,
PWSTR  String,
ULONG  DumpDataCount,
PULONG  DumpData 
)

Definition at line 36 of file main.c.

56{
57 PIO_ERROR_LOG_PACKET LogEntry;
59 ULONG StringSize;
61 static WCHAR DriverName[] = L"TCP/IP";
62
64 (DumpDataCount * sizeof(ULONG)) + sizeof(DriverName);
65
66 if (String) {
67 StringSize = (wcslen(String) * sizeof(WCHAR)) + sizeof(UNICODE_NULL);
68 EntrySize += (UCHAR)StringSize;
69 }
70
71 /* Fail if the required error log entry is too large */
73 return;
74
76 if (!LogEntry)
77 return;
78
79 LogEntry->MajorFunctionCode = -1;
80 LogEntry->RetryCount = -1;
81 LogEntry->DumpDataSize = (USHORT)(DumpDataCount * sizeof(ULONG));
82 LogEntry->NumberOfStrings = (String == NULL) ? 1 : 2;
83 LogEntry->StringOffset = sizeof(IO_ERROR_LOG_PACKET) + (DumpDataCount * sizeof(ULONG));
84 LogEntry->EventCategory = 0;
85 LogEntry->ErrorCode = ErrorCode;
87 LogEntry->FinalStatus = FinalStatus;
88 LogEntry->SequenceNumber = -1;
89 LogEntry->IoControlCode = 0;
90
91 if (DumpDataCount)
92 RtlCopyMemory(LogEntry->DumpData, DumpData, DumpDataCount * sizeof(ULONG));
93
94 pString = ((PUCHAR)LogEntry) + LogEntry->StringOffset;
95 RtlCopyMemory(pString, DriverName, sizeof(DriverName));
96 pString += sizeof(DriverName);
97
98 if (String)
99 RtlCopyMemory(pString, String, StringSize);
100
101 IoWriteErrorLogEntry(LogEntry);
102}
_In_ ULONG _In_ BOOLEAN _In_ ULONG UniqueErrorValue
Definition: classpnp.h:1312
FxString * pString
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
_In_ NDIS_ERROR_CODE ErrorCode
Definition: ndis.h:4436
#define UNICODE_NULL
VOID NTAPI IoWriteErrorLogEntry(IN PVOID ElEntry)
Definition: error.c:628
PVOID NTAPI IoAllocateErrorLogEntry(IN PVOID IoObject, IN UCHAR EntrySize)
Definition: error.c:528
#define L(x)
Definition: ntvdm.h:50
unsigned short USHORT
Definition: pedump.c:61
NTSTATUS ErrorCode
Definition: iotypes.h:2007
USHORT NumberOfStrings
Definition: iotypes.h:2004
NTSTATUS FinalStatus
Definition: iotypes.h:2009
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
unsigned char * PUCHAR
Definition: typedefs.h:53
_In_ UCHAR _In_ UCHAR _In_ ULONG _In_ WDFCONTEXT DriverContext
Definition: wdfdevice.h:1703
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2433
_In_ UCHAR EntrySize
Definition: iofuncs.h:642
#define ERROR_LOG_MAXIMUM_SIZE
Definition: iotypes.h:2042
struct _IO_ERROR_LOG_PACKET * PIO_ERROR_LOG_PACKET
struct _IO_ERROR_LOG_PACKET IO_ERROR_LOG_PACKET
unsigned char UCHAR
Definition: xmlstorage.h:181
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by DriverEntry().

Variable Documentation

◆ EntityCount

◆ EntityList

◆ EntityListLock

◆ EntityMax

ULONG EntityMax = 0

Definition at line 29 of file main.c.

Referenced by DriverEntry().

◆ GlobalBufferPool

NDIS_HANDLE GlobalBufferPool = NULL

Definition at line 25 of file main.c.

Referenced by DriverEntry(), and TiUnload().

◆ GlobalPacketPool

NDIS_HANDLE GlobalPacketPool = NULL

Definition at line 24 of file main.c.

Referenced by DriverEntry(), and TiUnload().

◆ IPDeviceObject

PDEVICE_OBJECT IPDeviceObject = NULL

Definition at line 22 of file main.c.

Referenced by DriverEntry(), TiCreateFileObject(), TiSecurityStartup(), and TiUnload().

◆ IPTimeoutDpc

KDPC IPTimeoutDpc

Definition at line 34 of file main.c.

Referenced by DriverEntry().

◆ IPTimer

KTIMER IPTimer

Definition at line 33 of file main.c.

Referenced by DriverEntry(), and TiUnload().

◆ RawIPDeviceObject

PDEVICE_OBJECT RawIPDeviceObject = NULL

Definition at line 23 of file main.c.

Referenced by DriverEntry(), TiCreateFileObject(), and TiUnload().

◆ TCPDeviceObject

◆ UDPDeviceObject

PDEVICE_OBJECT UDPDeviceObject = NULL

Definition at line 21 of file main.c.

Referenced by DriverEntry(), TiCreateFileObject(), and TiUnload().

◆ UDPStats

UDP_STATISTICS UDPStats

Definition at line 30 of file main.c.

Referenced by RawIPStartup(), and UDPStartup().