windows安装设备的过程(译自DDK doc)

来源:互联网 发布:norse实时网络攻击地图 编辑:程序博客网 时间:2024/05/20 13:14

以热插拔设备为例,不能热插拔的类似。

1. 用户插入设备。

2. 总线驱动接到一个新设备的notification。总线驱动调用IoInvalidateDeviceRelations通知内核PnP管理器。

    内核PnP管理器通过IRP_MJ_PNP, IRP_MN_QUERY_DEVICE_RELATIONS查询目前总线上有的设备。比较新的list和以前的list。

    内核PnP管理器发送IRP到到总线驱动收集新设备的信息,such as 设备的hardware ID等等。

3. 内核PnP管理器通知用户PnP管理器,有一个设备要安装。

4.The user-mode PnP manager creates a new process using rundll32.exe and launches newdev.dll to install the device

5. newdev.dll调用Setup API和 CfgMgr API。

    newdev.dll 调用SetupDiBuildDriverInfoList 为设备创建可能的驱动表。

6. The class installer and co-installers, if any, can participate in the installation by handling DIF requests.

7.Setup transfers control to kernel mode to load drivers and start the device.

8.The PnP manager loads the appropriate function driver and any optional filter drivers for the device.

9.Installers can supply wizard pages to change device settings.

原创粉丝点击