Device Description from WdfPdoInitAddDeviceText not shown

Hi,

I have a WDF bus driver that statically enumerates a couple child devices. I’m trying to add a device description by calling WdfPdoInitAddDeviceText() and WdfPdoInitSetDefaultLocale(). For some reasons, it seems that the device manager is not picking up my description text and is still calling my child devices “Unknown device”. The DeviceLocation string that I passed to WdfPdoInitAddDeviceText does seem to be accepted, however, and it shows up in the device properties dialog. I’m testing on Vista x64.

Does anyone know what might cause this? Thanks.

Is the location information shown in the device’s property page if you
right click on it? What are you passing for the DeviceDescription
parameter to WdfPdoInitSetDefaultLocale?

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@stg.com
Sent: Tuesday, April 24, 2007 3:27 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Device Description from WdfPdoInitAddDeviceText not
shown

Hi,

I have a WDF bus driver that statically enumerates a couple child
devices. I’m trying to add a device description by calling
WdfPdoInitAddDeviceText() and WdfPdoInitSetDefaultLocale(). For some
reasons, it seems that the device manager is not picking up my
description text and is still calling my child devices “Unknown device”.
The DeviceLocation string that I passed to WdfPdoInitAddDeviceText does
seem to be accepted, however, and it shows up in the device properties
dialog. I’m testing on Vista x64.

Does anyone know what might cause this? Thanks.


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

I’ve got it working now. It looks like I have to uninstall my bus driver and then reinstall it. Once I’ve done that, device manager would pick up the new device description of my child nodes (I was only refreshing my bus driver image with windbg kd file association before). I believe the bus driver reinstall caused new child nodes with the updated information to be created under the ENUM tree of the registry. Not sure if this is working as intended or if I did something wrong.

The location information was correctly shown on the child’s device property page (even before I did the reinstall and got the device description to show up).

My code looks something like this:

DECLARE_CONST_UNICODE_STRING(MyPortDesc, L"My Description");
DECLARE_CONST_UNICODE_STRING(MyLocation, L"My Location");

PWDFDEVICE_INIT pdoInit = WdfPdoInitAllocate(parent);

/* set up the device, hw and instance ID here*/

WdfPdoInitAddDeviceText(pdoInit, &MyPortDesc, &MyLocation, 0x409);
WdfPdoInitSetDefaultLocale(pdoInit, 0x409);
WdfDeviceCreate(&pdoInit, WDF_NO_OBJECT_ATTRIBUTES, &child);
WdfFdoAddStaticChild(parent, child);

Thanks.

Didn’t realize that pnp cached the description and only used the first
reported one. Good to know. Glad you figured it out.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@stg.com
Sent: Wednesday, April 25, 2007 9:23 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Device Description from WdfPdoInitAddDeviceText not
shown

I’ve got it working now. It looks like I have to uninstall my bus
driver and then reinstall it. Once I’ve done that, device manager would
pick up the new device description of my child nodes (I was only
refreshing my bus driver image with windbg kd file association before).
I believe the bus driver reinstall caused new child nodes with the
updated information to be created under the ENUM tree of the registry.
Not sure if this is working as intended or if I did something wrong.

The location information was correctly shown on the child’s device
property page (even before I did the reinstall and got the device
description to show up).

My code looks something like this:

DECLARE_CONST_UNICODE_STRING(MyPortDesc, L"My Description");
DECLARE_CONST_UNICODE_STRING(MyLocation, L"My Location");

PWDFDEVICE_INIT pdoInit = WdfPdoInitAllocate(parent);

/* set up the device, hw and instance ID here*/

WdfPdoInitAddDeviceText(pdoInit, &MyPortDesc, &MyLocation, 0x409);
WdfPdoInitSetDefaultLocale(pdoInit, 0x409);
WdfDeviceCreate(&pdoInit, WDF_NO_OBJECT_ATTRIBUTES, &child);
WdfFdoAddStaticChild(parent, child);

Thanks.


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