Can a filter driver be the remote destination of a WDFIOTARGET?

Hi,
I have a filter driver which creates an interface with WdfDeviceCreateDeviceInterface(ReferenceString != NULL). A 2nd driver which implements a regular FDO registers for PnP notifications EventCategory = EventCategoryDeviceInterfaceChange. In the 2nd driver context, the callback is executed when the 1st driver has its interface enabled. The problem is that WdfIoTargetOpen (&open_by_name) fails with STATUS_INVALID_DEVICE_REQUEST. !wdflogdump shows:
FxIoTargetRemote::OpenTargetHandle - ZwCreateFile for WDFIOTARGET 00001FFED9DF9398 returned status 0xc0000010(STATUS_INVALID_DEVICE_REQUEST), info 0xe4526ac8
WdfIoTargetOpen() is called after EvtDeviceD0Entry.
Reverting the direction works: WdfIoTargetOpen() in the context of the filter DO with a remote target being the interface created by the regular FDO.
I’d appreciate your input.
Regards,
Calin

It depends. Requests always go to the top of the stack, so if you are a lower filter, the open request will go to the function driver first. If the function driver doesn’t allow opens, then you can’t reach your lower filter. This is why people use control devices.

If you are an upper filter, then you should get the request first.

In the UpperFilter, I have registered an EvtDeviceFileCreate with WdfDeviceInitSetFileObjectConfig(). The EvtDFC function completes the Request with STATUS_SUCCESS. It works now.