The documentation for WdfPdoRequestEject seems to be a little light. I'm sending this for my network card and in some cases the eject is not completing. In the "Orderly Removal" help page I can see that there are some circumstances where my request may not be honoured, but none of those are true in this case.
The scenario I'm testing is a torture test for add/remove where 5 virtual network cards are removed in quick succession by the xen backend. The first thing that happens is that the "backend" (xen) component flags that it is changing to the "closing' state, and my driver receives this event and issues the WdfPdoRequestEject. The first one or two remove successfully, but then for the next card nothing progresses after the call to WdfPdoRequest
The full Eject procedure is supposed to work as follows:
. Backend state changes
. Frontend (my driver) notices it, and knows that it hasn't initiated the removal and so issues a WdfPdoRequestEject
. One of the following things happen:
1. The device shuts down and is removed
2. EvtDevicePnpStateChange is called where Type == StateNotificationEnterState && CurrentState == WdfDeviceStatePnpQueryRemovePending && NewState == WdfDevStatePnpQueryCanceled, and a surprise removal is initiated
Is there another possible thing that can happen and I'm losing the request?