Search code examples
windowswindows-servicesusbdevice-driverwinusb

How to implement multiple concurrent application access with WinUsb


We're porting our USB device dll's to use the generic WinUsb. However, WinUsb doesn't support multiple concurrent application accss to the same device (Same VID & PID). I wanted to know if there is a way to implement this concurrent access using WinUsb? I read about filter drivers & services. 1. I don't want to use a filter driver because, as I understand, this will have to pass WHQL, and I rather not go this path. 2. Regarding a windows service: How exactly should I implement it? should the service get all of the calls to WinUsb, and if a different application tries to access the same device, it will close the connection to the first application, open a new connection, and back again?

Is the service the right correct solution in this case? Is there another way to implement the solution other that what I wrote?

Thanks.


Solution

  • A filter driver does not need to pass WHQL. You only need to sign the catalog file, needed by the driver package. This only needs a code signing certigficate from verising/... . This should be a good starting place to get to know this.

    Nevertheless, a kernel driver can be hard to develop. So maybe a COM server would be a better approach. You implement this sharing from a service, by allowing COM-clients to create objects from your service and then implement some kind of sharing/mutual exclusion in your COM-server.

    A COM-exe servers can be written relativly fast.