Using WDM in KMDF

Is there a good way to get the WDM pDO for the next lower driver using a KMDF call?
If not how can it be retrieved in a KMDF driver that also uses the WDM edge?

In a standard WDM driver it would be passed into AddDevice(IN PDRIVER_OBJECT Dobj, IN PDEVICE_OBJECT Pdo). But the KMDF AddDevice() gets frame-work objects, not WDM objects.

There are some WDM DDI’s such as IoAllocateWorkItem(PDEVICE_OBJECT), that requires a WDM device object.

Thanks
-decoder

xxxxx@gmail.com wrote:

Is there a good way to get the WDM pDO for the next lower driver using a KMDF call?
If not how can it be retrieved in a KMDF driver that also uses the WDM edge?

In a standard WDM driver it would be passed into AddDevice(IN PDRIVER_OBJECT Dobj, IN PDEVICE_OBJECT Pdo). But the KMDF AddDevice() gets frame-work objects, not WDM objects.

EVERY framework wrapper object has an API to return the WDM object that
it wraps. You want WdfDeviceWdmGetDeviceObject.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

In this case, you can also use a WDFWORKITEM :wink:

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Tim Roberts
Sent: Friday, December 05, 2008 10:23 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Using WDM in KMDF

xxxxx@gmail.com wrote:

Is there a good way to get the WDM pDO for the next lower driver using a KMDF call?
If not how can it be retrieved in a KMDF driver that also uses the WDM edge?

In a standard WDM driver it would be passed into AddDevice(IN PDRIVER_OBJECT Dobj, IN PDEVICE_OBJECT Pdo). But the KMDF AddDevice() gets frame-work objects, not WDM objects.

EVERY framework wrapper object has an API to return the WDM object that
it wraps. You want WdfDeviceWdmGetDeviceObject.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

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

>EVERY framework wrapper object has an API to return the WDM object that

it wraps. You want WdfDeviceWdmGetDeviceObject.

Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Tim,

Thanks for the pointer. Now I’m not crashing anymore when I call IoQueueWorkItem()!
Actually I used WdfDeviceWdmGetAttachedDevice(), since I needed the Device Object pointer
from the next-lower device in this case.

-decoder

First, sorry about the previous empty reply, I clicked the button too early…

In this case, you can also use a WDFWORKITEM :wink:

d

Doron,

Thanks for recommending the KMDF version. I actually had planned to try it later on.
But since I’m porting a USB driver to KMDF as an experiment to compare functionality and
performance, I wanted to try the existing WDM version first.

-decoder

Um, what kind of perf are you expecting from a work item? Also, your PDO (e.g. your physical device object) is not necessarily the attached device! There can be a filter in there. To get your PDO, use WdfDeviceWdmGetPhysicalDevice

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Friday, December 05, 2008 12:01 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Using WDM in KMDF

First, sorry about the previous empty reply, I clicked the button too early…

In this case, you can also use a WDFWORKITEM :wink:

d

Doron,

Thanks for recommending the KMDF version. I actually had planned to try it later on.
But since I’m porting a USB driver to KMDF as an experiment to compare functionality and
performance, I wanted to try the existing WDM version first.

-decoder


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

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