A hardware ID is a vendor-defined identification string that Windows uses to match a device to an INF file. In most cases, a device has associated with it a list of hardware IDs. (However, there are exceptions − see Identifiers for 1394 Devices). When an enumerator reports a list of hardware IDs for a device, the hardware IDs should be listed in order of decreasing suitability.
A hardware ID has one of the following generic formats:
This is the most common format for individual PnP devices reported to the Plug and Play (PnP) manager by a single enumerator. New enumerators should use this format or the following format. For more information about enumerator-specific device IDs, see Device Identifier Formats.
The asterisk indicates that the device is supported by more than one enumerator, such as ISAPNP and the BIOS. For more information about this type of ID, see Generic Identifiers.
An existing device class that has established its own naming convention might use a custom format. For information about their hardware ID formats, see the hardware specification for such buses. New enumerators should not use this format.
The number of characters of a hardware ID, excluding a NULL terminator, must be less than MAX_DEVICE_ID_LEN. This constraint applies to the sum of the lengths of all the fields and any "\" field separators in a hardware ID. For more information about constraints on device IDs, see the Operations section of IRP_MN_QUERY_ID.
To obtain the list of hardware IDs for a device, call IoGetDeviceProperty with the DeviceProperty parameter set to DevicePropertyHardwareID. The list of hardware IDs that this routine retrieves is a REG_MULTI_SZ value. The maximum number of characters in a hardware list, including a NULL terminator after each hardware ID and a final NULL terminator, is REGSTR_VAL_MAX_HCID_LEN. The maximum possible number of IDs in a list of hardware IDs is 64.