Hi folks,
Simple query about WdfChildListUpdateChildDescriptionAsMissing. In some
cases it returns STATUS_WDF_DEVICE_NOT_CREATED.
Looks to me that this is in order to handle set-up/tear-down races,
which is exactly what I’m currently trying to do, however I need to
check my assumptions are right:
Is it correct that in the case of the return code
STATUS_WDF_DEVICE_NOT_CREATED, then I’ll *never* get the EvtDeviceAdd
for the PDO? i.e. I’ve managed to “catch” the enumeration process early
enough that that device will not be enumerated?
Conversely is it correct that if I *don’t* get
STATUS_WDF_DEVICE_NOT_CREATED, but some other NT_SUCCESS() code, then I
*will* get the EvtDeviceAdd, even if I have *not yet* had it.
So if I have some “management code” that wants to do a blocking teardown
of some PDO:
- If EvtDeviceAdd has been called, then I can wait on an Event that I
set either in EvtCleanupCallback or EvtDestroyCallback. - If EvtDeviceAdd has not been called but the status is
STATUS_WDF_DEVICE_NOT_CREATED, then I don’t need to wait. - If EvtDeviceAdd has not been called, but the status is not
STATUS_WDF_DEVICE_NOT_CREATED, then I need to either:
a) Fail EvtDeviceAdd, which is not my preferred option.
b) Wait for EvtDeviceAdd to be called, and then subsequently Wait
for the EvtCleanupCallback or EvtDestroyCallback to be called on that
PDO - it’ll be created and then destroyed.
MH.