Author: cgutman
Date: Tue May 5 05:24:30 2009
New Revision: 40791
URL:
http://svn.reactos.org/svn/reactos?rev=40791&view=rev
Log:
- Implement handling for IRP_MN_CANCEL_STOP_DEVICE
Modified:
trunk/reactos/drivers/network/ndis/include/protocol.h
trunk/reactos/drivers/network/ndis/ndis/miniport.c
trunk/reactos/drivers/network/ndis/ndis/protocol.c
Modified: trunk/reactos/drivers/network/ndis/include/protocol.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/inclu…
==============================================================================
--- trunk/reactos/drivers/network/ndis/include/protocol.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/ndis/include/protocol.h [iso-8859-1] Tue May 5 05:24:30
2009
@@ -61,6 +61,12 @@
IN PDEVICE_OBJECT DeviceObject,
PIRP Irp);
+NTSTATUS
+NTAPI
+NdisIPnPCancelStopDevice(
+ IN PDEVICE_OBJECT DeviceObject,
+ PIRP Irp);
+
#endif /* __PROTOCOL_H */
/* EOF */
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] Tue May 5 05:24:30
2009
@@ -2050,6 +2050,12 @@
IoCompleteRequest(Irp, IO_NO_INCREMENT);
break;
+ case IRP_MN_CANCEL_STOP_DEVICE:
+ Status = NdisIPnPCancelStopDevice(DeviceObject, Irp);
+ Irp->IoStatus.Status = Status;
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
+ break;
+
default:
IoSkipCurrentIrpStackLocation(Irp);
Status = IoCallDriver(Adapter->NdisMiniportBlock.NextDeviceObject, Irp);
Modified: trunk/reactos/drivers/network/ndis/ndis/protocol.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/ndis/…
==============================================================================
--- trunk/reactos/drivers/network/ndis/ndis/protocol.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/ndis/ndis/protocol.c [iso-8859-1] Tue May 5 05:24:30
2009
@@ -77,11 +77,52 @@
else if (Status != NDIS_STATUS_SUCCESS)
{
/* One protocol failed so we can fail the query stop device IRP */
+ ExFreePool(PnPEvent);
return Status;
}
CurrentEntry = CurrentEntry->Flink;
}
+
+ ExFreePool(PnPEvent);
+
+ return NDIS_STATUS_SUCCESS;
+}
+
+NTSTATUS
+NTAPI
+NdisIPnPCancelStopDevice(
+ IN PDEVICE_OBJECT DeviceObject,
+ PIRP Irp)
+{
+ PLIST_ENTRY CurrentEntry;
+ PADAPTER_BINDING AdapterBinding;
+ PLOGICAL_ADAPTER Adapter = (PLOGICAL_ADAPTER)DeviceObject->DeviceExtension;
+ PNET_PNP_EVENT PnPEvent;
+ NDIS_STATUS Status;
+
+ PnPEvent = ProSetupPnPEvent(NetEventCancelRemoveDevice, NULL, 0);
+ if (!PnPEvent)
+ return NDIS_STATUS_RESOURCES;
+
+ CurrentEntry = Adapter->ProtocolListHead.Flink;
+
+ while (CurrentEntry != &Adapter->ProtocolListHead)
+ {
+ AdapterBinding = CONTAINING_RECORD(CurrentEntry, ADAPTER_BINDING,
AdapterListEntry);
+
+ Status = (*AdapterBinding->ProtocolBinding->Chars.PnPEventHandler)(
+ AdapterBinding->NdisOpenBlock.ProtocolBindingContext,
+ PnPEvent);
+
+ /* A protocol should always succeed NetEventCancelRemoveDevice */
+
+ ASSERT(Status == NDIS_STATUS_SUCCESS);
+
+ CurrentEntry = CurrentEntry->Flink;
+ }
+
+ ExFreePool(PnPEvent);
return NDIS_STATUS_SUCCESS;
}