Hardware Id missing on enumerating virtual NDIS device pdo

Hi,

I am enumerating a virtual Net class pdo from a kmdf bus driver. EvtChildListCreateDevice is getting called and I assign the device and hardware ids. No error comes on doing WdfDeviceCreate.

But Windows report “Hardware Id missing - windows can not determine the device connected to ” in the notification area with a network device icon. While adding this

I am unable to figure out what wrong I am doing. Also I could not find any threads related to this issue.

Any help will be much appreciated.

Cheers
Mohammad Azim

What device class is the pdo being installed under? Must it be the Networking class?

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Tuesday, August 20, 2013 10:09 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Hardware Id missing on enumerating virtual NDIS device pdo

Hi,

I am enumerating a virtual Net class pdo from a kmdf bus driver. EvtChildListCreateDevice is getting called and I assign the device and hardware ids. No error comes on doing WdfDeviceCreate.

But Windows report “Hardware Id missing - windows can not determine the device connected to ” in the notification area with a network device icon. While adding this

I am unable to figure out what wrong I am doing. Also I could not find any threads related to this issue.

Any help will be much appreciated.

Cheers
Mohammad Azim


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

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

It is not yet installed. I am waiting for it to appear under other devices
in the device manager. where I can install my miniport driver for it.
On 20 Aug 2013 18:27, “Doron Holan” wrote:

> What device class is the pdo being installed under? Must it be the
> Networking class?
>
> -----Original Message-----
> From: xxxxx@lists.osr.com [mailto:
> xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
> Sent: Tuesday, August 20, 2013 10:09 AM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] Hardware Id missing on enumerating virtual NDIS device pdo
>
> Hi,
>
> I am enumerating a virtual Net class pdo from a kmdf bus driver.
> EvtChildListCreateDevice is getting called and I assign the device and
> hardware ids. No error comes on doing WdfDeviceCreate.
>
> But Windows report “Hardware Id missing - windows can not determine the
> device connected to ” in the notification area with a network
> device icon. While adding this
>
> I am unable to figure out what wrong I am doing. Also I could not find any
> threads related to this issue.
>
> Any help will be much appreciated.
>
> Cheers
> Mohammad Azim
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
>
> OSR is HIRING!! See http://www.osr.com/careers
>
> 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
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
>
> OSR is HIRING!! See http://www.osr.com/careers
>
> 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
>

Post your code where you add all of the ids

d

Bent from my phone


From: Mohammad Azim Khanmailto:xxxxx
Sent: ?8/?20/?2013 11:32 AM
To: Windows System Software Devs Interest Listmailto:xxxxx
Subject: RE: [ntdev] Hardware Id missing on enumerating virtual NDIS device pdo

It is not yet installed. I am waiting for it to appear under other devices in the device manager. where I can install my miniport driver for it.

On 20 Aug 2013 18:27, “Doron Holan” > wrote:
What device class is the pdo being installed under? Must it be the Networking class?

-----Original Message-----
From: xxxxx@lists.osr.commailto:xxxxx [mailto:xxxxx@lists.osr.commailto:xxxxx] On Behalf Of xxxxx@gmail.commailto:xxxxx
Sent: Tuesday, August 20, 2013 10:09 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Hardware Id missing on enumerating virtual NDIS device pdo

Hi,

I am enumerating a virtual Net class pdo from a kmdf bus driver. EvtChildListCreateDevice is getting called and I assign the device and hardware ids. No error comes on doing WdfDeviceCreate.

But Windows report “Hardware Id missing - windows can not determine the device connected to ” in the notification area with a network device icon. While adding this

I am unable to figure out what wrong I am doing. Also I could not find any threads related to this issue.

Any help will be much appreciated.

Cheers
Mohammad Azim


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

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


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

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
— NTDEV is sponsored by OSR Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev OSR is HIRING!! See http://www.osr.com/careers 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</mailto:xxxxx></mailto:xxxxx></mailto:xxxxx></mailto:xxxxx></mailto:xxxxx>

Code below. However, just found a bug in my code. I was calling WdfDeviceInitSetDeviceType(DeviceInit, FILE_DEVICE_SERIAL_PORT); again from one of the help functions. Can this mismatch cause this issue?

////////////////// Defining Network class GUID

13
14 DEFINE_GUID(GUID_DEVCLASS_NET,
15 0x4d36e972, 0xe325, 0x11ce, 0xbf, 0xc1, 0x08, 0x00, 0x2b, 0xe1, 0x03, 0x18);
16

/////////////////// Defining child pdo device id

27 #define MY_NET_DEVICE_ID L"{31FCF443-3CE3-41a2-A754-86F223461EC9}\ABCD\XYZ\0"
28 #define ASMD_NET_DEVICE_ID_LEN sizeof(ASMD_NET_DEVICE_ID)
29

/////////////////// Defining child pdo hardware id

40 #define MY_NET_DEVICE_HW_ID L"{31FCF443-3CE3-41a2-A754-86F223461EC9}\ABCD\XYZ"
41 #define MY_NET_DEVICE_HW_ID_LEN sizeof (MY_NET_DEVICE_HW_ID)
42

////////////////// Function that enumerates the network child pdo

58 DECLARE_UNICODE_STRING_SIZE(netDeviceId, MY_NET_DEVICE_ID_LEN);
59

119 RtlInitUnicodeString(&netDeviceId, MY_NET_DEVICE_ID);
120
121 status = WdfPdoInitAssignDeviceID(ChildInit, &netDeviceId);
122 if (!NT_SUCCESS(status)) {
123 goto Cleanup;
124 }

203 DECLARE_UNICODE_STRING_SIZE(nethwid, MY_NET_DEVICE_HW_ID_LEN);
204
205 status = WdfPdoInitAssignRawDevice(ChildInit, &GUID_DEVCLASS_NET);
206 if (!NT_SUCCESS(status)) {
207 goto Cleanup;
208 }
209
210 WdfDeviceInitSetDeviceType(ChildInit, FILE_DEVICE_NETWORK);
211
212 RtlInitUnicodeString(&nethwid, MY_NET_DEVICE_HW_ID);
213 status = WdfPdoInitAddHardwareID(ChildInit, &nethwid);
214 if (!NT_SUCCESS(status)) {
215 goto Cleanup;
216 }
217
218 status = RtlUnicodeStringPrintf(&buffer,
219 L"My Company NET Device");
220 if (!NT_SUCCESS(status)) {
221 goto Cleanup;
222 }

240 status = WdfPdoInitAddDeviceText(ChildInit,
241 &buffer,
242 &deviceLocation,
243 0x409);
244 if (!NT_SUCCESS(status)) {
245 goto Cleanup;
246 }
247
248 WdfPdoInitSetDefaultLocale(ChildInit, 0x409);
249
250 WdfPdoInitAllowForwardingRequestToParent(ChildInit);
251
252 //
253 // Set child device properties
254 //

10 NTSTATUS status;
11 WDFDEVICE device;
12 WDF_OBJECT_ATTRIBUTES attributes;
13
14 TraceEvents(TRACE_LEVEL_INFORMATION, DBG_PNP,“MY_DEVICE_NET–> NetChildEvtDeviceAdd routine\n”);
15
16 WdfDeviceInitSetDeviceType(DeviceInit, FILE_DEVICE_SERIAL_PORT); <— Just found this bug. Do you think this can cause this problem
17
18 WDF_OBJECT_ATTRIBUTES_INIT(&attributes);
19 attributes.SynchronizationScope = WdfSynchronizationScopeNone;
20
21 status = WdfDeviceCreate(&DeviceInit, &attributes, &device);
22 if (!NT_SUCCESS(status)) {
23 TraceEvents(TRACE_LEVEL_ERROR, DBG_INIT,
24 “MY_DEVICE_NET WdfDeviceCreate failed with Status code %!STATUS!\n”, status);
25 return status;
26 }
27
28 return status;

259
260 return status;
261
262 Cleanup:
263
264 TraceEvents(TRACE_LEVEL_ERROR, DBG_INIT,“CreatePdo failed %x\n”, status);
265
266 //
267 // On error, framework will cleanup all the resources when it deletes
268 // the device. So there is nothing to do.
269 //
270
271 return status;

Hi Doron,

Fixing FILE_DEVICE_SERIAL_PORT to FILE_DEVICE_NETWORK above did not help.

I know I am missing some stuff in EvtChildListCreateDevice like: PNP capabilities, device context and any other initialization required for running the pdo. But I left that intentionally to fill in later. The error does not reflect reason of any missing initialization.

This network device pdo shares the bus fdo that also enumerates two virtual serial ports. If you remember I created following thread for help for creating virtual serial ports driver.
http://www.osronline.com/showThread.cfm?link=243881

The virtual serial ports functionality works great. Adding a network is an extension to the same solution.

Thanks
Mohammad Azim

Hi,

Any update on this please. This issue is critical for my development. Any pointers would be greatly appreciated.

Thanks
Mohammad Azim

Hi Doron,

Any update on this thread. I am eagerly waiting for your responce.

Thank
Mohammad Azim
On 22 Aug 2013 10:25, wrote:
>
> Hi,
>
>
> Any update on this please. This issue is critical for my development. Any
pointers would be greatly appreciated.
>
>
> Thanks
> Mohammad Azim
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
>
> OSR is HIRING!! See http://www.osr.com/careers
>
> 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