Device Interfaces

Device Interfaces

Device drivers provide a uniform and extensible way for applications and the system to interact with them programmatically, known as a device interface. Drivers expose, register, and enable device interfaces. A driver can expose zero, one, or more than one interface for a particular device. A device interface is represented by a GUID.

Each device interface is a member of a device interface class. A device interface class is a group of device interfaces with the same functionality. For example, all the joysticks on a system could be members of the joystick device interface class. A device interface class is identified by a class GUID.

When an application must communicate with a device, it searches for a device that exports the required interface. To perform the search, use the following steps.

  1. Call the SetupDiGetClassDevs or SetupDiGetClassDevsEx function to obtain a list of all devices in a specified device class. This list is known as a device information set.
  2. Call the SetupDiEnumDeviceInterfaces function to enumerate all devices of the specified class that export the interface.

To communicate with the device, call the SetupDiGetDeviceInterfaceDetail function. This function returns device information in an SP_DEVICE_INTERFACE_DETAIL_DATA structure. The DevicePath member provides the symbolic link name, which can be used in the CreateFile function to access the device. 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值