1. The user inserts the USB device.
2. The USB bus (or PCI bus, it’s unclear, but it’s a bus) recognizes that a USB device has been inserted.
3. The bus communicates with the USB device to obtain the USB’s hardware ID, product ID, and bcdversion. Based on this information, the device hardware ID is formed: vid_xxxx&PID_xxxx&rev_xxxx.
4. The bus generates an instance ID based on the slot position of the USB device. This ID is only mapped to the slot; the same device in different slots will generate different instance IDs; the same device in the same slot will not change its instance ID (what happens with different devices in the same slot is unknown; if you know, please let me know).
5. As shown in the figure below, the device instance path contains three parts, separated by “\”.
The first part is the bus type, which here is USB, meaning it is a USB bus type.
The second part is the device ID: vid_1BCF&PID_0501; the rev_xxxx part is omitted in the figure, but this part can be seen in “Properties –> Hardware ID”.
The third part is the instance ID: 6&10354432&0&8.
6. Based on the information obtained from the bus, the system searches for the driver in the registry under “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum”. For the device above, the driver information is located at the registry path: “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_1BCF&PID_0501\6&10354432&0&8”. If this path cannot be found, then install the driver. The path content is as follows:
7. Based on the registry information above, find the values of the service key and class key.
Long press the QR code to follow