// allocate a function class device data structure to receive the goods about this particular device.
SetupDiGetInterfaceDeviceDetail (HardwareDeviceInfo, DeviceInfoData, NULL, 0, &requiredLength, NULL);
// Retrieve the information from Plug and Play.
if (!SetupDiGetInterfaceDeviceDetail(
HardwareDeviceInfo,
DeviceInfoData,
functionClassDeviceData,
predictedLength,
&requiredLength,
NULL))
{
free(functionClassDeviceData);
return INVALID_HANDLE_VALUE;
}
strcpy(devName,functionClassDeviceData->DevicePath);
printf("Attempting to open %s\n", devName);