BOOLEAN
SetupDiOpenDeviceInfo(
IN HDEVINFO DeviceInfoSet,
IN PCTSTR DeviceInstanceId,
IN HWND hwndParent, /* optional */
IN DWORD OpenFlags
OUT PSP_DEVINFO_DATA DeviceInfoData /* optional */
);
SetupDiOpenDeviceInfo retrieves information about an existing device instance and adds it to the specified device information set. If a device information element already exists for this device instance, the function returns the existing element.
If the device information element was already present, its class driver list, if any, is replaced with the inherited list.
The function returns TRUE if it is successful. Otherwise it returns FALSE and the logged error can be retrieved with a call to GetLastError.
If this device instance is being added to a set that has an associated class, the device class must be the same or the call will fail. In this case, a call to GetLastError returns ERROR_CLASS_MISMATCH.
If the new device information element is successfully opened but the caller-supplied DeviceInfoData buffer is invalid, this function returns FALSE. In this case, a call to GetLastError returns ERROR_INVALID_USER_BUFFER. However, the device information element is added as a new member of the set anyway.
SetupDiCreateDeviceInfo, SetupDiDeleteDeviceInfo, SetupDiEnumDeviceInfo