GUID_DEVINTERFACE_USB_HUB interface will not enable

I have the following code:

status = WdfDeviceCreateDeviceInterface(hChild, &GUID_DEVINTERFACE_USB_HUB, &deviceAddress);

The status is STATUS_SUCCESS for this call.

However the interface is disabled and cannot be enabled, even though no errors are generated and there is no obvious reason why.

I looked through the wdf log for my device and it did not show any errors in the framework.

How can i trace the source of this problem?

You might want to include just a bit more context. Your code sample is
not particularly helpful. Obviously WdfDeviceCreateDeviceInterface
works. The only unusual part is your use of a reference string, but
that is known to work as well.

The log might also be helpful. A description of what your are doing would help.

Mark Roddy

On Sun, Jan 23, 2011 at 5:44 AM, wrote:
> WdfDeviceCreateDeviceInterface

I figured it out, it was related to a DeviceInitAssignName was clashing with something else in the system. The KMDF must automatically disable the interfaces of the device if there is a name clash.

Um, no. KMDF doesn’t automatically disable anything if the assigned name already exists (which i assume is what you mean by clashes). If the assigned name conflicts, you don’t create a WDFDEVICE at all. if your code doesn’t loop on the error condition and retry with a different name, your AddDevice will fail and return !NT_SUCCESS and the device interface will not be enabled b/c the device doesn’t start.

d

The reason I thought it is disabled i because if i issue

status = IoGetDeviceInterfaces(&GUID_DEVINTERFACE_USB_HUB, NULL, DEVICE_INTERFACE_INCLUDE_NONACTIVE, &symbolicLinkedList);

I can see the symbolic link of my device in the returned list.

Is that because its installed in the Driver Library but not actually instantiated by the Pnp subsystem?