Author: cgutman
Date: Mon May 3 02:28:29 2010
New Revision: 47090
URL:
http://svn.reactos.org/svn/reactos?rev=47090&view=rev
Log:
[NDIS]
- Provide a IRP_MJ_CREATE and IRP_MJ_CLOSE handler for miniport drivers so
IoGetDeviceObjectPointer doesn't fail (and consequently, IoSetDeviceInterfaceState)
Modified:
trunk/reactos/drivers/network/ndis/ndis/miniport.c
Modified: trunk/reactos/drivers/network/ndis/ndis/miniport.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/ndis/…
==============================================================================
--- trunk/reactos/drivers/network/ndis/ndis/miniport.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/ndis/ndis/miniport.c [iso-8859-1] Mon May 3 02:28:29
2010
@@ -1722,6 +1722,22 @@
return Status;
}
+NTSTATUS
+NTAPI
+NdisICreateClose(
+ IN PDEVICE_OBJECT DeviceObject,
+ IN PIRP Irp)
+{
+ Irp->IoStatus.Status = STATUS_SUCCESS;
+ Irp->IoStatus.Information = 0;
+
+ DbgPrint("NdisICreateClose\n");
+
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
+
+ return STATUS_SUCCESS;
+}
+
NTSTATUS
NTAPI
@@ -2499,6 +2515,8 @@
*MiniportPtr = Miniport;
+ Miniport->DriverObject->MajorFunction[IRP_MJ_CREATE] = NdisICreateClose;
+ Miniport->DriverObject->MajorFunction[IRP_MJ_CLOSE] = NdisICreateClose;
Miniport->DriverObject->MajorFunction[IRP_MJ_PNP] = NdisIDispatchPnp;
Miniport->DriverObject->MajorFunction[IRP_MJ_SHUTDOWN] = NdisIShutdown;
Miniport->DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] =
NdisIDeviceIoControl;
@@ -2960,6 +2978,12 @@
DriverBlock->DriverObject->MajorFunction[IRP_MJ_PNP] = NdisIDispatchPnp;
+ if (!DriverBlock->DriverObject->MajorFunction[IRP_MJ_CREATE])
+ DriverBlock->DriverObject->MajorFunction[IRP_MJ_CREATE] =
NdisICreateClose;
+
+ if (!DriverBlock->DriverObject->MajorFunction[IRP_MJ_CLOSE])
+ DriverBlock->DriverObject->MajorFunction[IRP_MJ_CLOSE] = NdisICreateClose;
+
DeviceBlock->DeviceObject = DeviceObject;
DeviceBlock->SymbolicName = SymbolicName;