How windows KMDF Driver select different configuration

Hi EveryOne:

As we know, windows KMDF driver seems that it only can select the default configure setting. But when I look for the related material, I find that if I use USBD_SelectConfigUrbAllocateAndBuild to construct URB and use WdfUsbTargetDeviceSelectConfig with this URB. it shows that I can obtain the right pipe handle. But now when I implement this method, I can't find any bulk data transfer by capturing usb sniffer. So I want to know which step is wrong. (PS: before setting new configure, I use WdfUsbTargetDeviceSelectConfig with WDF_USB_DEVICE_SELECT_CONFIG_PARAMS_INIT_DECONFIG to deselect configure setting).
Thank you for your appreciation.

PS: in this case, I hope the I had better not implement USB composite device to let upper level driver to determine configure setting.

You can certainly select another configuration. That’s done by many devices. However, after you do so, the existing device drops off of the wire and re-enumerates. The device object you had been holding goes dormant, so your driver needs to unload.

This is sensible, because the new configuration has an entirely new set of interfaces and probably needs a different set of drivers.

hi @Tim_Roberts
Thank you for your reply. Does it mean that the current driver needs to send vendor command to notify Firmware and let Firmware rerun enumeration. Please help confirm it.

Well, the firmware is going to get notified when it receives the SELECT_CONFIGURATION command, right? It drops off, and the host controller controls the re-enumeration. Vendor commands aren’t needed.