Exclusive access to a USB Device

Question: How can I prevent other host applications from accessing my USB device when one host application is accessing the device?



There is a registry key in Windows which when set for that particular VID/PID will not allow other host applications to address the USB device. To set this registry key you will have to add the line HKR,,Exclusive,0x10001,1

to the AddReg section of the inf file. Here 0x10001 represents that the registry entry is of type REG_DWORD. 1 is used to enable exclusive access. Find attached with this article an demonstration inf file.

Note: Replace XXXX and YYYY with the device VID/PID respectively to get the inf file working and use the appropriate driver file for testing. This inf file was developed just for the purpose of demonstration.