Unload/Reload NDIS Miniport Driver

Is there way to trigger unload/reload [of driver] from Ndis miniport driver?
I see “WdfDeviceSetFailed” can not be used with miniport device handle.

You usually need to invoke this type of thing from user mode (essentially diasble/enable). WdfDeviceSetFailed results in IoInvalidateDeviceState and returning PNP_DEVICE_FAILED on the subsequent IRP_MN_QUERY_PNP_DEVICE_STATE. Also, KMDF queries the PDO for REENUMERATE_SELF_INTERFACE_STANDARD (http://msdn.microsoft.com/en-us/library/ff560839(VS.85).aspx) (which KMDF PDOs enumerated by a WDFCHILDLIST automatically support) to ask the bus driver to make the device go away and come back.

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@yahoo.com
Sent: Tuesday, April 05, 2011 9:05 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Unload/Reload NDIS Miniport Driver

Is there way to trigger unload/reload [of driver] from Ndis miniport driver?
I see “WdfDeviceSetFailed” can not be used with miniport device handle.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

NdisMRemoveMiniport removes a miniport (through a similar mechanism as KMDF) but it isn’t so fancy as to pull the bus’s REENUMERATE_SELF_INTERFACE_STANDARD.

Why do you want to do this? If it’s to apply a new configuration (like CurrentMacAddress), generally you’d want to have usermode drive this operation.

BTW, unloading the driver is not quite the same thing as removing a device.

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
Sent: Tuesday, April 05, 2011 9:13 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Unload/Reload NDIS Miniport Driver

You usually need to invoke this type of thing from user mode (essentially diasble/enable). WdfDeviceSetFailed results in IoInvalidateDeviceState and returning PNP_DEVICE_FAILED on the subsequent IRP_MN_QUERY_PNP_DEVICE_STATE. Also, KMDF queries the PDO for REENUMERATE_SELF_INTERFACE_STANDARD (http://msdn.microsoft.com/en-us/library/ff560839(VS.85).aspx) (which KMDF PDOs enumerated by a WDFCHILDLIST automatically support) to ask the bus driver to make the device go away and come back.

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@yahoo.com
Sent: Tuesday, April 05, 2011 9:05 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Unload/Reload NDIS Miniport Driver

Is there way to trigger unload/reload [of driver] from Ndis miniport driver?
I see “WdfDeviceSetFailed” can not be used with miniport device handle.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer