WINUSB-2x Interfaces in use at same time

Rob V 0 Reputation points
2023-07-14T03:18:38.9866667+00:00

Hello,

I have some fundamental questions about WINUSB and applying it to a USB 2.0 full speed composite device via Microsoft OS 2.0 descriptors.

Question 1:

I have a composite device with two interfaces (if 0 = HID, if 1 = bulk) up and running with usbccgp.sys which creates separate devices for my interfaces. I want to associate WINUSB with the composite device instead of usbccgp.sys via Microsoft OS 2.0 Descriptors. In looking at the the Microsoft OS 2.0 Descriptor spec page 12 at the bottom in the "Microsoft OS 2.0 Feature Descriptors" section it says "The compatible ID can be applied to the entire device or a specific function within a composite device." I think I see how to apply it to an interface using bFirstInterface in table-12, but what part of these descriptors allows you to apply it (in my example the WINUSB driver) to the entire device (and in my case a composite device). I'm not seeing a field or any info on how to make that connection in this spec?

Question 2:

I was also wondering where you can find the information some of the descriptor fields refer to. For example, table-13 has a "SubCompatibleID" field. Where can someone fine a list of these IDs? Or is there not a list and they are user defined?

Question 3:

This is more of an applications/approach question. I am trying to develop an application that allows me to use the HID interface and the bulk interface in software (the same software application) at the same time (not literally but logically). For example, I'd like a thread to monitor the HID interface for data sent over from my device as well as allow the user to move data in and out of the bulk interface. In testing this it looks like you make a handle and then select the interface with WINUSB. Can you make two device handles with one selecting interface 0 and the other selecting interface 1 (or claiming the interface I think is the correct term)? What is the proper way to use each of these interfaces at "logically" the same time? I'm really getting at, do you have to keep switching between which interface is claimed every time you need to use the other one or can you just have two handles - one for each interface. I'm testing this out in libusb and Python but I think what I'm missing is the proper approach as I'm a hardware/firmware guy.

Any advice is greatly appreciated!

Thanks!

Windows for business | Windows Client for IT Pros | User experience | Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Limitless Technology 44,766 Reputation points
    2023-07-14T17:47:57.1766667+00:00

    Hello there,

    The WINUSB-2x interface refers to a specific USB device driver interface provided by Windows. If you have multiple devices using the WINUSB-2x interface and you want to use them simultaneously, you can follow these steps:

    Identify the devices: Connect all the devices that are using the WINUSB-2x interface to your computer.

    Determine the device instance IDs: Open the Device Manager on your Windows computer. To do this, right-click on the Start button and select "Device Manager" from the menu. In the Device Manager window, expand the "Universal Serial Bus controllers" or "Other devices" section, depending on where your devices are listed.

    Locate the devices: Look for the devices that are using the WINUSB-2x interface. They may have names like "WINUSB Device" or "USB Device (WINUSB-2x)".

    Obtain the device instance IDs: Right-click on each device, select "Properties," and navigate to the "Details" tab. In the drop-down menu, select "Device Instance Path" or "Device Instance ID." Note down the device instance IDs for all the devices you want to use simultaneously.

    Create multiple device instances: Windows treats devices with the same device instance ID as the same device. To create multiple device instances for the devices, you can modify their device instance IDs slightly.

    I used AI provided by ChatGPT to formulate part of this response. I have verified that the information is accurate before sharing it with you.

    Hope this resolves your Query !!

    --If the reply is helpful, please Upvote and Accept it as an answer–


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.