6.5 Device Interface

来源:互联网 发布:虚拟仿真软件 编辑:程序博客网 时间:2024/05/21 02:49

想device发送I/O请求的用户模式的应用程序和系统组件为了打开设备,必须能识别设备

Device Interface是一个设备支持的逻辑上的I/O操作集,每个device interface class有一个GUID,可以定义自己的GUID

driver通过创建一个device interface把设备注册为a member of a device interface class,填写上合适的GUID和可选的string,string唯一表示了实例,可以防止同时存在两个相同实例,也能引导I/O请求。

driver可以在创建device后的任何时刻创建interface,但通常在add-device callback中这么做。

driver通常在进入工作状态时激活interface,离开工作状态时禁用它们。

例子Osrusbfx2和Fx2_Driver表示了一个client app可以通过device interface找到设备。

-----device interface和symbolic links-------

client可以通过device interface和symbolic links识别和打开device。

symbolic link更易使用,但对driver不是:

    symbolic link会导致安全风险,而且不能在重启或重置硬件之后使用。

    device interface对driver来说更容易使用,是持久的,应用程序可以直接在它的配置程序中保存interface。

    系统会在device移除后自动清除device interface。


原创粉丝点击