A WDF filter question

I am wondering how to do something I have done in some non-WDF filters. In
the AddDevice routine I want to call down the device stack to check a
condition, before attaching my device to the stack. In particular, if the
condition is not met, I want to fail the device add for that stack.

I appears I can do it by stepping into pure WDM after using
WdfFdoInitWdmGetPhysicalDevice to get the PDO, but I am wondering if there
is a way to call down the stack using WDF at this point, or a way after
attaching the device but before exiting AddDevice to detach and delete the
device.


Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Remove StopSpam from the email to reply

Before the WDFDEVICE is created, you need to go the WDM route, the in
stack WDFIOTARGET does not exist yet. Before returning failure, make
sure you call WdfFdoInitSetFilter so that KMDF can munge the error
status properly back to the pnp manager.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Don Burn
Sent: Wednesday, April 05, 2006 1:25 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] A WDF filter question

I am wondering how to do something I have done in some non-WDF filters.
In
the AddDevice routine I want to call down the device stack to check a
condition, before attaching my device to the stack. In particular, if
the
condition is not met, I want to fail the device add for that stack.

I appears I can do it by stepping into pure WDM after using
WdfFdoInitWdmGetPhysicalDevice to get the PDO, but I am wondering if
there
is a way to call down the stack using WDF at this point, or a way after
attaching the device but before exiting AddDevice to detach and delete
the
device.


Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Remove StopSpam from the email to reply


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

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