2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS TCP/IP protocol driver
5 * PURPOSE: Driver entry point
6 * PROGRAMMERS: Casper S. Hornstrup (chorns@users.sourceforge.net)
8 * CSH 01/08-2000 Created
21 /* See debug.h for debug/trace constants */
22 DWORD DebugTraceLevel
= MIN_TRACE
;
25 PDEVICE_OBJECT TCPDeviceObject
= NULL
;
26 PDEVICE_OBJECT UDPDeviceObject
= NULL
;
27 PDEVICE_OBJECT IPDeviceObject
= NULL
;
28 PDEVICE_OBJECT RawIPDeviceObject
= NULL
;
29 NDIS_HANDLE GlobalPacketPool
= NULL
;
30 NDIS_HANDLE GlobalBufferPool
= NULL
;
31 TDIEntityID
*EntityList
= NULL
;
32 ULONG EntityCount
= 0;
33 UDP_STATISTICS UDPStats
;
37 PDRIVER_OBJECT DriverContext
,
39 ULONG UniqueErrorValue
,
45 * FUNCTION: Writes an error log entry
47 * DriverContext = Pointer to the driver or device object
48 * ErrorCode = An error code to put in the log entry
49 * UniqueErrorValue = UniqueErrorValue in the error log packet
50 * FinalStatus = FinalStatus in the error log packet
51 * String = If not NULL, a pointer to a string to put in log entry
52 * DumpDataCount = Number of ULONGs of dump data
53 * DumpData = Pointer to dump data for the log entry
57 PIO_ERROR_LOG_PACKET LogEntry
;
61 static WCHAR DriverName
[] = L
"TCP/IP";
63 EntrySize
= sizeof(IO_ERROR_LOG_PACKET
) +
64 (DumpDataCount
* sizeof(ULONG
)) + sizeof(DriverName
);
67 StringSize
= (wcslen(String
) * sizeof(WCHAR
)) + sizeof(UNICODE_NULL
);
68 EntrySize
+= (UCHAR
)StringSize
;
71 LogEntry
= (PIO_ERROR_LOG_PACKET
)IoAllocateErrorLogEntry(
72 DriverContext
, EntrySize
);
75 LogEntry
->MajorFunctionCode
= -1;
76 LogEntry
->RetryCount
= -1;
77 LogEntry
->DumpDataSize
= (USHORT
)(DumpDataCount
* sizeof(ULONG
));
78 LogEntry
->NumberOfStrings
= (String
== NULL
) ? 1 : 2;
79 LogEntry
->StringOffset
= sizeof(IO_ERROR_LOG_PACKET
) + (DumpDataCount
-1) * sizeof(ULONG
);
80 LogEntry
->EventCategory
= 0;
81 LogEntry
->ErrorCode
= ErrorCode
;
82 LogEntry
->UniqueErrorValue
= UniqueErrorValue
;
83 LogEntry
->FinalStatus
= FinalStatus
;
84 LogEntry
->SequenceNumber
= -1;
85 LogEntry
->IoControlCode
= 0;
88 RtlCopyMemory(LogEntry
->DumpData
, DumpData
, DumpDataCount
* sizeof(ULONG
));
90 pString
= ((PUCHAR
)LogEntry
) + LogEntry
->StringOffset
;
91 RtlCopyMemory(pString
, DriverName
, sizeof(DriverName
));
92 pString
+= sizeof(DriverName
);
95 RtlCopyMemory(pString
, String
, StringSize
);
97 IoWriteErrorLogEntry(LogEntry
);
104 * FUNCTION: Creates a file object
106 * DeviceObject = Pointer to a device object for this driver
107 * Irp = Pointer to a I/O request packet
109 * Status of the operation
111 NTSTATUS
TiCreateFileObject(
112 PDEVICE_OBJECT DeviceObject
,
115 PIO_STACK_LOCATION IrpSp
;
116 PFILE_FULL_EA_INFORMATION EaInfo
;
117 PTA_ADDRESS_IP Address
;
118 PTRANSPORT_CONTEXT Context
;
122 TI_DbgPrint(DEBUG_IRP
, ("Called. DeviceObject is at (0x%X), IRP is at (0x%X).\n", DeviceObject
, Irp
));
124 EaInfo
= Irp
->AssociatedIrp
.SystemBuffer
;
126 /* Parameter check */
128 TI_DbgPrint(MIN_TRACE
, ("No EA information in IRP.\n"));
129 return STATUS_INVALID_PARAMETER
;
132 /* Allocate resources here. We release them again if something failed */
133 Context
= ExAllocatePool(NonPagedPool
, sizeof(TRANSPORT_CONTEXT
));
135 TI_DbgPrint(MIN_TRACE
, ("Insufficient resources.\n"));
136 return STATUS_INSUFFICIENT_RESOURCES
;
139 Context
->RefCount
= 1;
140 Context
->CancelIrps
= FALSE
;
141 KeInitializeEvent(&Context
->CleanupEvent
, NotificationEvent
, FALSE
);
143 IrpSp
= IoGetCurrentIrpStackLocation(Irp
);
144 IrpSp
->FileObject
->FsContext
= Context
;
145 Request
.RequestContext
= Irp
;
147 /* Branch to the right handler */
148 if ((EaInfo
->EaNameLength
==TDI_TRANSPORT_ADDRESS_LENGTH
) &&
149 (RtlCompareMemory(&EaInfo
->EaName
, TdiTransportAddress
,
150 TDI_TRANSPORT_ADDRESS_LENGTH
) == TDI_TRANSPORT_ADDRESS_LENGTH
)) {
151 /* This is a request to open an address */
153 /* Parameter checks */
154 Address
= (PTA_ADDRESS_IP
)(EaInfo
->EaName
+ EaInfo
->EaNameLength
+ 1);
155 if ((EaInfo
->EaValueLength
< sizeof(TA_ADDRESS_IP
)) ||
156 (Address
->TAAddressCount
!= 1) ||
157 (Address
->Address
[0].AddressLength
< sizeof(TDI_ADDRESS_IP
)) ||
158 (Address
->Address
[0].AddressType
!= TDI_ADDRESS_TYPE_IP
)) {
159 TI_DbgPrint(MIN_TRACE
, ("Parameters are invalid.\n"));
161 return STATUS_INVALID_PARAMETER
;
164 /* Open address file object */
165 /* FIXME: Protocol depends on device object */
166 Status
= FileOpenAddress(&Request
, Address
, IPPROTO_UDP
, NULL
);
167 if (NT_SUCCESS(Status
)) {
168 IrpSp
->FileObject
->FsContext2
= (PVOID
)TDI_TRANSPORT_ADDRESS_FILE
;
169 Context
->Handle
.AddressHandle
= Request
.Handle
.AddressHandle
;
172 TI_DbgPrint(MIN_TRACE
, ("Connection point, and control connections are not supported.\n"));
173 /* FIXME: Open a connection endpoint, or control connection */
174 Status
= STATUS_NOT_IMPLEMENTED
;
177 if (!NT_SUCCESS(Status
))
180 TI_DbgPrint(DEBUG_IRP
, ("Leaving. Status = (0x%X).\n", Status
));
186 VOID
TiCleanupFileObjectComplete(
190 * FUNCTION: Completes an object cleanup IRP I/O request
192 * Context = Pointer to the IRP for this request
193 * Status = Final status of the operation
197 PIO_STACK_LOCATION IrpSp
;
198 PTRANSPORT_CONTEXT TranContext
;
202 IrpSp
= IoGetCurrentIrpStackLocation(Irp
);
203 TranContext
= (PTRANSPORT_CONTEXT
)IrpSp
->FileObject
->FsContext
;
205 Irp
->IoStatus
.Status
= Status
;
207 IoAcquireCancelSpinLock(&OldIrql
);
209 /* Remove the initial reference provided at object creation time */
210 TranContext
->RefCount
--;
213 if (TranContext
->RefCount
!= 0)
214 TI_DbgPrint(DEBUG_REFCOUNT
, ("TranContext->RefCount is %i, should be 0.\n", TranContext
->RefCount
));
217 KeSetEvent(&TranContext
->CleanupEvent
, 0, FALSE
);
219 IoReleaseCancelSpinLock(OldIrql
);
224 * FUNCTION: Releases resources used by a file object
226 * DeviceObject = Pointer to a device object for this driver
227 * Irp = Pointer to a I/O request packet
229 * Status of the operation
231 * This function does not pend
233 NTSTATUS
TiCleanupFileObject(
234 PDEVICE_OBJECT DeviceObject
,
237 PIO_STACK_LOCATION IrpSp
;
238 PTRANSPORT_CONTEXT Context
;
243 IrpSp
= IoGetCurrentIrpStackLocation(Irp
);
244 Context
= IrpSp
->FileObject
->FsContext
;
246 TI_DbgPrint(MIN_TRACE
, ("Parameters are invalid.\n"));
247 return STATUS_INVALID_PARAMETER
;
250 IoAcquireCancelSpinLock(&OldIrql
);
252 Context
->CancelIrps
= TRUE
;
253 KeResetEvent(&Context
->CleanupEvent
);
255 IoReleaseCancelSpinLock(OldIrql
);
257 Request
.RequestNotifyObject
= TiCleanupFileObjectComplete
;
258 Request
.RequestContext
= Irp
;
260 switch ((ULONG_PTR
)IrpSp
->FileObject
->FsContext2
) {
261 case TDI_TRANSPORT_ADDRESS_FILE
:
262 Request
.Handle
.AddressHandle
= Context
->Handle
.AddressHandle
;
263 Status
= FileCloseAddress(&Request
);
266 case TDI_CONNECTION_FILE
:
267 Request
.Handle
.ConnectionContext
= Context
->Handle
.ConnectionContext
;
268 Status
= FileCloseConnection(&Request
);
271 case TDI_CONTROL_CHANNEL_FILE
:
272 Request
.Handle
.ControlChannel
= Context
->Handle
.ControlChannel
;
273 Status
= FileCloseControlChannel(&Request
);
277 /* This should never happen */
279 TI_DbgPrint(MIN_TRACE
, ("Unknown transport context.\n"));
281 IoAcquireCancelSpinLock(&OldIrql
);
282 Context
->CancelIrps
= FALSE
;
283 IoReleaseCancelSpinLock(OldIrql
);
285 return STATUS_INVALID_PARAMETER
;
288 if (Status
!= STATUS_PENDING
)
289 TiCleanupFileObjectComplete(Irp
, Status
);
291 KeWaitForSingleObject(&Context
->CleanupEvent
,
292 UserRequest
, KernelMode
, FALSE
, NULL
);
294 return Irp
->IoStatus
.Status
;
298 NTSTATUS
TiDispatchOpenClose(
299 PDEVICE_OBJECT DeviceObject
,
302 * FUNCTION: Main dispath routine
304 * DeviceObject = Pointer to a device object for this driver
305 * Irp = Pointer to a I/O request packet
307 * Status of the operation
310 PIO_STACK_LOCATION IrpSp
;
312 PTRANSPORT_CONTEXT Context
;
314 TI_DbgPrint(DEBUG_IRP
, ("Called. DeviceObject is at (0x%X), IRP is at (0x%X).\n", DeviceObject
, Irp
));
316 IoMarkIrpPending(Irp
);
317 Irp
->IoStatus
.Status
= STATUS_PENDING
;
318 Irp
->IoStatus
.Information
= 0;
320 IrpSp
= IoGetCurrentIrpStackLocation(Irp
);
322 switch (IrpSp
->MajorFunction
) {
323 /* Open an address file, connection endpoint, or control connection */
325 Status
= TiCreateFileObject(DeviceObject
, Irp
);
328 /* Close an address file, connection endpoint, or control connection */
330 Context
= (PTRANSPORT_CONTEXT
)IrpSp
->FileObject
->FsContext
;
333 Status
= STATUS_SUCCESS
;
336 /* Release resources bound to an address file, connection endpoint,
337 or control connection */
339 Status
= TiCleanupFileObject(DeviceObject
, Irp
);
343 Status
= STATUS_INVALID_DEVICE_REQUEST
;
346 if (Status
!= STATUS_PENDING
) {
347 IrpSp
->Control
&= ~SL_PENDING_RETURNED
;
348 Irp
->IoStatus
.Status
= Status
;
350 TI_DbgPrint(DEBUG_IRP
, ("Completing IRP at (0x%X).\n", Irp
));
352 IoCompleteRequest(Irp
, IO_NETWORK_INCREMENT
);
355 TI_DbgPrint(DEBUG_IRP
, ("Leaving. Status is (0x%X)\n", Status
));
361 NTSTATUS
TiDispatchInternal(
362 PDEVICE_OBJECT DeviceObject
,
365 * FUNCTION: Internal IOCTL dispatch routine
367 * DeviceObject = Pointer to a device object for this driver
368 * Irp = Pointer to a I/O request packet
370 * Status of the operation
374 PIO_STACK_LOCATION IrpSp
;
376 TI_DbgPrint(DEBUG_IRP
, ("Called. DeviceObject is at (0x%X), IRP is at (0x%X).\n", DeviceObject
, Irp
));
378 IrpSp
= IoGetCurrentIrpStackLocation(Irp
);
380 Irp
->IoStatus
.Status
= STATUS_SUCCESS
;
381 Irp
->IoStatus
.Information
= 0;
383 switch (IrpSp
->MinorFunction
) {
385 Status
= DispTdiReceive(Irp
);
388 case TDI_RECEIVE_DATAGRAM
:
389 Status
= DispTdiReceiveDatagram(Irp
);
393 Status
= DispTdiSend(Irp
);
396 case TDI_SEND_DATAGRAM
:
397 Status
= DispTdiSendDatagram(Irp
);
401 Status
= DispTdiAccept(Irp
);
405 Status
= DispTdiListen(Irp
);
409 Status
= DispTdiConnect(Irp
);
413 Status
= DispTdiDisconnect(Irp
);
416 case TDI_ASSOCIATE_ADDRESS
:
417 Status
= DispTdiAssociateAddress(Irp
);
420 case TDI_DISASSOCIATE_ADDRESS
:
421 Status
= DispTdiDisassociateAddress(Irp
);
424 case TDI_QUERY_INFORMATION
:
425 Status
= DispTdiQueryInformation(DeviceObject
, Irp
);
428 case TDI_SET_INFORMATION
:
429 Status
= DispTdiSetInformation(Irp
);
432 case TDI_SET_EVENT_HANDLER
:
433 Status
= DispTdiSetEventHandler(Irp
);
437 Status
= STATUS_SUCCESS
;
440 /* An unsupported IOCTL code was submitted */
442 Status
= STATUS_INVALID_DEVICE_REQUEST
;
445 if (Status
!= STATUS_PENDING
) {
446 Irp
->IoStatus
.Status
= Status
;
448 TI_DbgPrint(DEBUG_IRP
, ("Completing IRP at (0x%X).\n", Irp
));
450 IoCompleteRequest(Irp
, IO_NETWORK_INCREMENT
);
453 TI_DbgPrint(DEBUG_IRP
, ("Leaving. Status = (0x%X).\n", Status
));
460 PDEVICE_OBJECT DeviceObject
,
463 * FUNCTION: Dispath routine for IRP_MJ_DEVICE_CONTROL requests
465 * DeviceObject = Pointer to a device object for this driver
466 * Irp = Pointer to a I/O request packet
468 * Status of the operation
472 PIO_STACK_LOCATION IrpSp
;
474 TI_DbgPrint(DEBUG_IRP
, ("Called. IRP is at (0x%X).\n", Irp
));
476 Irp
->IoStatus
.Information
= 0;
478 IrpSp
= IoGetCurrentIrpStackLocation(Irp
);
480 Status
= TdiMapUserRequest(DeviceObject
, Irp
, IrpSp
);
481 if (NT_SUCCESS(Status
)) {
482 TiDispatchInternal(DeviceObject
, Irp
);
483 Status
= STATUS_PENDING
;
488 /* See if this request is TCP/IP specific */
489 switch (IrpSp
->Parameters
.DeviceIoControl
.IoControlCode
) {
490 case IOCTL_TCP_QUERY_INFORMATION_EX
:
491 Status
= DispTdiQueryInformationEx(Irp
, IrpSp
);
494 case IOCTL_TCP_SET_INFORMATION_EX
:
495 Status
= DispTdiSetInformationEx(Irp
, IrpSp
);
499 TI_DbgPrint(MIN_TRACE
, ("Unknown IOCTL 0x%X\n",
500 IrpSp
->Parameters
.DeviceIoControl
.IoControlCode
));
501 Status
= STATUS_NOT_IMPLEMENTED
;
506 if (Status
!= STATUS_PENDING
) {
507 Irp
->IoStatus
.Status
= Status
;
509 TI_DbgPrint(DEBUG_IRP
, ("Completing IRP at (0x%X).\n", Irp
));
511 IoCompleteRequest(Irp
, IO_NETWORK_INCREMENT
);
514 TI_DbgPrint(DEBUG_IRP
, ("Leaving. Status = (0x%X).\n", Status
));
521 PDRIVER_OBJECT DriverObject
)
523 * FUNCTION: Unloads the driver
525 * DriverObject = Pointer to driver object created by the system
531 KeAcquireSpinLock(&AddressFileListLock
, &OldIrql
);
532 if (!IsListEmpty(AddressFileList
)) {
533 TI_DbgPrint(MIN_TRACE
, ("Open address file objects exists.\n"));
535 KeReleaseSpinLock(&AddressFileListLock
, OldIrql
);
538 /* Unregister loopback adapter */
539 LoopUnregisterAdapter(NULL
);
541 /* Unregister protocol with NDIS */
543 LANUnregisterProtocol();
546 /* Shutdown transport level protocol subsystems */
552 /* Shutdown network level protocol subsystem */
555 /* Free NDIS buffer descriptors */
556 if (GlobalBufferPool
)
557 NdisFreeBufferPool(GlobalBufferPool
);
559 /* Free NDIS packet descriptors */
560 if (GlobalPacketPool
)
561 NdisFreePacketPool(GlobalPacketPool
);
563 /* Release all device objects */
566 IoDeleteDevice(TCPDeviceObject
);
569 IoDeleteDevice(UDPDeviceObject
);
571 if (RawIPDeviceObject
)
572 IoDeleteDevice(RawIPDeviceObject
);
575 IoDeleteDevice(IPDeviceObject
);
578 ExFreePool(EntityList
);
580 TI_DbgPrint(MAX_TRACE
, ("Leaving.\n"));
589 PDRIVER_OBJECT DriverObject
,
590 PUNICODE_STRING RegistryPath
)
592 * FUNCTION: Main driver entry point
594 * DriverObject = Pointer to a driver object for this driver
595 * RegistryPath = Registry node for configuration parameters
597 * Status of driver initialization
601 UNICODE_STRING strDeviceName
;
602 STRING strNdisDeviceName
;
603 NDIS_STATUS NdisStatus
;
605 PLAN_ADAPTER Adapter
;
606 NDIS_STRING DeviceName
;
609 TI_DbgPrint(MAX_TRACE
, ("Called.\n"));
611 /* Create IP device object */
612 RtlInitUnicodeString(&strDeviceName
, DD_IP_DEVICE_NAME
);
613 Status
= IoCreateDevice(DriverObject
, 0, &strDeviceName
,
614 FILE_DEVICE_NETWORK
, 0, FALSE
, &IPDeviceObject
);
615 if (!NT_SUCCESS(Status
)) {
616 TI_DbgPrint(MIN_TRACE
, ("Failed to create IP device object. Status (0x%X).\n", Status
));
620 /* Create RawIP device object */
621 RtlInitUnicodeString(&strDeviceName
, DD_RAWIP_DEVICE_NAME
);
622 Status
= IoCreateDevice(DriverObject
, 0, &strDeviceName
,
623 FILE_DEVICE_NETWORK
, 0, FALSE
, &RawIPDeviceObject
);
624 if (!NT_SUCCESS(Status
)) {
625 TI_DbgPrint(MIN_TRACE
, ("Failed to create RawIP device object. Status (0x%X).\n", Status
));
626 TiUnload(DriverObject
);
630 /* Create UDP device object */
631 RtlInitUnicodeString(&strDeviceName
, DD_UDP_DEVICE_NAME
);
632 Status
= IoCreateDevice(DriverObject
, 0, &strDeviceName
,
633 FILE_DEVICE_NETWORK
, 0, FALSE
, &UDPDeviceObject
);
634 if (!NT_SUCCESS(Status
)) {
635 TI_DbgPrint(MIN_TRACE
, ("Failed to create UDP device object. Status (0x%X).\n", Status
));
636 TiUnload(DriverObject
);
640 /* Create TCP device object */
641 RtlInitUnicodeString(&strDeviceName
, DD_TCP_DEVICE_NAME
);
642 Status
= IoCreateDevice(DriverObject
, 0, &strDeviceName
,
643 FILE_DEVICE_NETWORK
, 0, FALSE
, &TCPDeviceObject
);
644 if (!NT_SUCCESS(Status
)) {
645 TI_DbgPrint(MIN_TRACE
, ("Failed to create TCP device object. Status (0x%X).\n", Status
));
646 TiUnload(DriverObject
);
650 /* Allocate NDIS packet descriptors */
651 NdisAllocatePacketPool(&NdisStatus
, &GlobalPacketPool
, 100, sizeof(PACKET_CONTEXT
));
652 if (NdisStatus
!= NDIS_STATUS_SUCCESS
) {
653 TiUnload(DriverObject
);
654 return STATUS_INSUFFICIENT_RESOURCES
;
657 /* Allocate NDIS buffer descriptors */
658 NdisAllocateBufferPool(&NdisStatus
, &GlobalBufferPool
, 100);
659 if (NdisStatus
!= NDIS_STATUS_SUCCESS
) {
660 TiUnload(DriverObject
);
661 return STATUS_INSUFFICIENT_RESOURCES
;
664 /* Initialize address file list and protecting spin lock */
665 InitializeListHead(&AddressFileListHead
);
666 KeInitializeSpinLock(&AddressFileListLock
);
668 /* Initialize interface list and protecting spin lock */
669 InitializeListHead(&InterfaceListHead
);
670 KeInitializeSpinLock(&InterfaceListLock
);
672 /* Initialize network level protocol subsystem */
673 IPStartup(DriverObject
, RegistryPath
);
675 /* Initialize transport level protocol subsystems */
681 /* Register protocol with NDIS */
682 RtlInitString(&strNdisDeviceName
, IP_DEVICE_NAME
);
683 Status
= LANRegisterProtocol(&strNdisDeviceName
);
684 if (!NT_SUCCESS(Status
)) {
687 EVENT_TRANSPORT_REGISTER_FAILED
,
688 TI_ERROR_DRIVERENTRY
,
693 TiUnload(DriverObject
);
697 /* Open loopback adapter */
698 if (!NT_SUCCESS(LoopRegisterAdapter(NULL
, NULL
))) {
699 TI_DbgPrint(MIN_TRACE
, ("Failed to create loopback adapter. Status (0x%X).\n", Status
));
700 TiUnload(DriverObject
);
701 return STATUS_INSUFFICIENT_RESOURCES
;
705 /* Open underlying adapter(s) we are bound to */
707 /* FIXME: Get binding information from registry */
709 /* Put your own NDIS adapter device name here */
713 NdisInitUnicodeString(&DeviceName
, L
"\\Device\\El90x1");
716 NdisInitUnicodeString(&DeviceName
,
717 L
"\\Device\\{56388B49-67BB-4419-A3F4-28DF190B9149}");
720 NdisStatus
= LANRegisterAdapter(&DeviceName
, &Adapter
);
721 if (!NT_SUCCESS(NdisStatus
)) {
722 TI_DbgPrint(MIN_TRACE
, ("Failed to intialize adapter. Status (0x%X).\n", Status
));
725 EVENT_TRANSPORT_ADAPTER_NOT_FOUND
,
726 TI_ERROR_DRIVERENTRY
,
731 TiUnload(DriverObject
);
732 return STATUS_DEVICE_DOES_NOT_EXIST
;
736 /* Setup network layer and transport layer entities */
737 EntityList
= ExAllocatePool(NonPagedPool
, sizeof(TDIEntityID
) * 2);
738 if (!NT_SUCCESS(Status
)) {
739 TiUnload(DriverObject
);
740 return STATUS_INSUFFICIENT_RESOURCES
;
743 EntityList
[0].tei_entity
= CL_NL_ENTITY
;
744 EntityList
[0].tei_instance
= 0;
745 EntityList
[1].tei_entity
= CL_TL_ENTITY
;
746 EntityList
[1].tei_instance
= 0;
750 IPDeviceObject
->Flags
|= DO_DIRECT_IO
;
751 RawIPDeviceObject
->Flags
|= DO_DIRECT_IO
;
752 UDPDeviceObject
->Flags
|= DO_DIRECT_IO
;
753 TCPDeviceObject
->Flags
|= DO_DIRECT_IO
;
755 /* Initialize the driver object with this driver's entry points */
756 DriverObject
->MajorFunction
[IRP_MJ_CREATE
] = TiDispatchOpenClose
;
757 DriverObject
->MajorFunction
[IRP_MJ_CLOSE
] = TiDispatchOpenClose
;
758 DriverObject
->MajorFunction
[IRP_MJ_CLEANUP
] = TiDispatchOpenClose
;
759 DriverObject
->MajorFunction
[IRP_MJ_INTERNAL_DEVICE_CONTROL
] = TiDispatchInternal
;
760 DriverObject
->MajorFunction
[IRP_MJ_DEVICE_CONTROL
] = TiDispatch
;
762 DriverObject
->DriverUnload
= (PDRIVER_UNLOAD
)TiUnload
;
764 return STATUS_SUCCESS
;