Device Interface Class GUID和Device Setup Class GUID

本文澄清了Device Interface Class GUID和Device Setup Class GUID之间的区别。Device Interface Class GUID对应设备的功能合同,类似COM中的IID,而Device Setup Class GUID用于指定安装INF的安装程序。两者名称相似但概念不同。Windows Runtime设备相关类通常提供GetDeviceSelector()来避免直接使用GUID筛选设备。调用SetupDiGetClassDevs需要注意及时释放返回的设备信息集。
摘要由CSDN通过智能技术生成

Device Interface Class GUID和Device Setup Class GUID

20180516

两者是不一样的。

There seems to be confusion in this thread about two completely different classes so let me try to clear this up.

A Device Interface Class GUID is the “name” for a functional contract implemented by a device. It is very much the same concept as a IID in COM. A single instance of a device can implement many different functional contracts and therefore have many interfaces with different interface classes.

The Device Setup Class GUID (also referred to as the Installer Class GUID) is a “name” for the installer that should be selected to install a specific INF.

The two concepts are completely unrelated but often confused because they both have “Class GUID” as part of their name.

There is not definitive list of Interface Class GUIDs, and indeed, anyone can define a new one. There are of course some well-known interface classes defined by Windows. I do not know of a list of these either but they tend so to documented with the documentation that describes the functionality of the contract.

In the Windows Runtime device related classes, the class that expose the functionality that you want to use typically has a GetDeviceSelector() function. This selector returns a AQS string that can be used when enumerating devices with Windows.Devices.Enumeration.DeviceInforamtion. This avoids having to know the GUIDs or other details that are needed to filter devices that can be used to activate the functionality that is to be used.

SetupDiGetClassDevs function

注意!!

The caller of SetupDiGetClassDevs must delete the returned device information set when it is no longer needed by calling SetupDiDestroyDeviceI

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值