How can I check for the existence of another device from a WDF driver?

I want to check if a device exists from WDF driver. The device I want to check for is created by a software only driver. Is my best bet to use ZwOpenFile()and see if that succeeds?

You haven’t given us much information on what you’re trying to do.

If the device only has a device name, yes… something like ZwCreateFile would be a good approach.

OTOH, a better approach would be to use the target device’s Device Interface GUID, and IoRegisterPlugPlayNotification. If the device you’re lo9king for HAS a Device Interface GUID.

Peter

Thank you so much dear