private static DevInfoData CreateDevInfoData() { var devInfoData = new DevInfoData(); devInfoData.Size = Marshal.SizeOf(devInfoData); devInfoData.DevInst = 0; devInfoData.ClassGuid = Guid.Empty; devInfoData.Reserved = 0; return devInfoData; }
internal static extern bool SetupDiGetDeviceRegistryProperty(IntPtr deviceInfoSet, ref DevInfoData deviceInfoData, DeviceInfoRegistryProperty property, out uint propertyRegDataType, StringBuilder propertyBuffer, uint propertyBufferSize, out uint requiredSize);
internal static extern IntPtr SetupDiOpenDevRegKey(IntPtr deviceInfoSet, ref DevInfoData deviceInfoData, DeviceInfoPropertyScope scope, uint hwProfile, DeviceInfoRegistryKeyType keyType, RegistrySpecificAccessRights samDesired);
internal static extern bool SetupDiEnumDeviceInfo(IntPtr deviceInfoSet, uint memberIndex, ref DevInfoData deviceInfoData);
internal static extern bool SetupDiGetDeviceInstanceIdW(IntPtr deviceInfoSet, ref DevInfoData deviceInfoData, StringBuilder propertyBuffer, uint propertyBufferSize, out uint requiredSize);
private static extern bool SetupDiEnumDeviceInfo(IntPtr lpInfoSet, UInt32 dwIndex, DevInfoData devInfoData);