IoGetConfigurationInformation 接口使用--增加系统设备数量
来源:互联网 发布:mac激活时间查询 编辑:程序博客网 时间:2024/06/09 17:45
在编写USB转虚拟串口驱动程序过程中,PC上每插入一个USB设备,我们就需要生成一个串口设备。这样我们就需要增加系统的串口设备数量,这时就需要用到 IoGetConfigurationInformation 接口了。
这个接口使用的频率相对不高,因此整理下,方便后续查看以及消化理解。
接口定义如下:
PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void);
调用返回的数据结构如下:
typedef struct _CONFIGURATION_INFORMATION { // // This field indicates the total number of disks in the system. This // number should be used by the driver to determine the names of new // disks. This field should be updated by the driver as it finds new // disks. // ULONG DiskCount; // Count of hard disks thus far ULONG FloppyCount; // Count of floppy disks thus far ULONG CdRomCount; // Count of CD-ROM drives thus far ULONG TapeCount; // Count of tape drives thus far ULONG ScsiPortCount; // Count of SCSI port adapters thus far ULONG SerialCount; // Count of serial devices thus far ULONG ParallelCount; // Count of parallel devices thus far // // These next two fields indicate ownership of the two I/O address // spaces that are used by WD1003-compatible disk controllers. // BOOLEAN AtDiskPrimaryAddressClaimed; // 0x1F0 - 0x1FF BOOLEAN AtDiskSecondaryAddressClaimed; // 0x170 - 0x17F // // Indicates the structure version, as anything value beyond this will have been added. // Use the structure size as the version. // ULONG Version; // // Indicates the total number of medium changer devices in the system. // This field will be updated by the drivers as it determines that // new devices have been found and will be supported. // ULONG MediumChangerCount;} CONFIGURATION_INFORMATION, *PCONFIGURATION_INFORMATION;
通过返回的结构体我们可以知道系统中原本的设备的数量,同时我们可以增加或者减少设备数量,不仅仅是串口设备,可以是磁盘,并口等其它设备。
0 0
- IoGetConfigurationInformation 接口使用--增加系统设备数量
- Ubuntu下增加loop设备数量
- 系统消息数量的增加及减少!
- linux增加系统最大文件打开数量
- 增加多层标签数量
- 数据库超时--TIME_WAIT数量骤降,CLOSE_WAIT增加(四次握手)系统IO wait增加 --导致线上故障(274)
- 增加Windows远程桌面连接数量
- pandas 数量增加趋势图
- 购物车增加数量 总价
- 在DVR中增加系统模式CGI接口
- 获取当前显示设备数量
- 设备接口
- 设备接口
- 简单购物车(增加数量和减少数量)
- 使用ATL为COM组件增加多个双接口
- 服务器使用 ocx (ocx增加安全属性接口)
- 嵌入式系统设备驱动接口的C#编程
- 字符设备中添加系统休眠与唤醒接口
- 【第八周项目4-字符串加密】
- 玩具工厂
- (第八周项目2)建立链串的算法库
- 【PAT甲级】1030. Travel Plan (30)
- 在Linux环境下实现一个非常好的bash脚本框架
- IoGetConfigurationInformation 接口使用--增加系统设备数量
- 【第8周实践项目4-字符串加密】
- qemu QOM(qemu object model)和设备模拟
- Linux Thread编程
- NDK开发 从入门到放弃(一:基本流程入门了解)
- 第八周项目5-计数的模式匹配
- 【浅谈递归(二)】常见递归问题的分析与解答
- linux mint下配置jdk,tomcat
- 第8周 项目1-建立顺序串的算法库