好文档就是一把金锄头!
欢迎来到金锄头文库![会员中心]
电子文档交易市场
安卓APP | ios版本
电子文档交易市场
安卓APP | ios版本

setupdi系列函数进行设备通信.doc

6页
  • 卖家[上传人]:ss****gk
  • 文档编号:280460888
  • 上传时间:2022-04-21
  • 文档格式:DOC
  • 文档大小:41.50KB
  • / 6 举报 版权申诉 马上下载
  • 文本预览
  • 下载提示
  • 常见问题
    • BOOLEAN SetupDiEnumDeviceInfo( 〃枚举指定设备信息集合的成员,并将数据放在PSP_DEVINFO_DATA 中IN HDEVINFO DevicelnfoSet,IN DWORD Memberindex,OUT PSP_DEVINFO_DATA DevicelnfoData);参数说明:DevicelnfoSet 提供一个设备信息集合的句柄Memberindex 指定一个要取得的设备信息成员序号,从0开始DevicelnfoData指向SP_DEVINFO_DATA结构的指针,关于指定成员的返回信息就放在该结构中Return ValueThe成功返回True,否则返回False)如果要枚举全部设备信息成员,装载者首先应该将Memberindex设为0调用 SetupDiEnumDevicelnfo ,然后递增 Memberindex (使用一个 for 循环),调用 SetupDiEnumDevicelnfo,直至所有成员全部遍历(此时函数返回False,并且GetLasfEiror返 回 ERROR NO MORE ITEMS)枚举设备信息 SetupDiGetClassDevsHDEVINFO SetupDiGetClassDevs( 〃获取一个指定类别或全部类别的所有己安装设备的信息IN PGUID ClassGuid, /* optional */IN PCTSTR Enumerator, /* optional */IN HWND hwndParent, /* optional */IN DWORD Flags);参数说明:ClassGuid 一个特定类别GUID (需要查询注册表)的指针,如果设置了D1GCF_ALLCLASSES标记,该参数备忽略,将返冋所有类别的设备信息表Enumerator 过滤梅举的内容:如:PCI则只显示PCI设备, hwnclParent 用于关联到集合成员中的用户接口的顶层窗口句柄Flags 建立设备信息表的控制选项,可以是下列值DIGCF_PRESENT (只列出当前存在的设备信息)D1GCF_ALLCLASSES (列出所有类别的一安装的设备表,如果设置了此值,则指定的类 别将备忽略)DIGCF_PROFILE (只返回当前硬件概况部分)Return Value如成功,返回包含所有与指定参数匹配的已经安装设备信息句柄 如失败则返冋 1NVALID_HANDLE_ VALUEWINSETUPAPI BOOL WINAPISetupDiGetDe viceRegistry Property ( :〃获得单个装置的详细资料IN HDEVINFO DevicelnfoSet,IN PSP DEVINFO DATA DevicelnfoData,IN DWORD Property,OUT PDWORD PropertyRegDataType, OPTIONALOUT PBYTE PropertyBuffer,IN DWORD PropertyBufferSize,OUT PDWORD RequiredSize OPTIONALProperty取以下的值:SPDRP_ADDRESS SPDRP_BUSNUMBER SPDRP_BUSTYPEGUID SPDRP_CAPABILITIES查询设备的地址 查询设备的bus号 查询设备的GUID号SetupDiGetDeviceRegistryProperty 参数说明:DevicelnfoSetDevicelnfoData设备信息句柄SP_DEVINFO_DATA结构体,包含DevicelnfoSet中的设备信息LockSuppoiled EjectSupported Removable DockDeviceUniquelDSilentlnstallRawDeviceOKCM_DEVCAP_NONDYNAMICNon DynamicThe function retrieves a bitwise OR of the following CM_DEVCAP_Xxx flags in a DWORD. The device capabilities that are represented by these flags correspond to the device capabilities that are represented by the members of the DEVICE_CAPABILITIES structure. The CM_DEVCAP_Xxx constants are defined incfgmgr32.h.CM_DEVCAP_Xxx flagCorresponding DEVICE_CAPABILITIES structure memberCM_DEVCAP_LOCKSUPPORTED CM_DEVCAP_EJECTSUPPORTED CM_DEVCAP_REMOVABLE CM_DEVCAP_DOCKDEVICE CM_DEVCAP_UNIQUEID CM_DEVCAP_SILENTINSTALL CM_DEVCAP_RAWDEVICEOKCM_DEVCAP_SURPRISEREMOVALOK SurpriseRemovalOKCM_DEVCAP_HARDWAREDISABLED HardwareDisabledSPDRP_CHARACTERISTICSThe function retrieves a bitwise OR of a device^ characteristics flags in a DWORD. For a description of these flags, which are defined in wdm.h and ntddk.h, see the loCreateDevice function^DeviceCharacteristics parameter.SPDRP_CLASSThe function retrieves a REG_SZ string that contains the device setup class of a device・ SPDRP_CLASSGUIDThe function retrieves a REG_SZ string that contains the GUID that represents the device setup class of a device.SPDRP.COMPATIBLEIDSThe function retrieves a REG_MULTI_SZ string containing the list of compatible IDs for a device. For information about compatible IDs, see Device Identification Strings.SPDRP_CONFIGFLAGSThe function retrieves a bitwise OR of a device's configuration flags in a DWORD value・ The configuration flags are represented by the CONFIGFLAG_Xxx bitmasks that are defined in regstr.h.SPDRP_DEVICE_POWER_DATA(Windows XP and later) The function retrieves a CM_POWER_DATA structure containing the device's power management information.SPDRP_DEVICEDESCThe function retrieves a REG_SZ string containing the description of a device・ SPDRP_DEVTYPEThe function retrieves a DWORD value representing the device s type (see Specifying Device Types).SPDRP_DRIVERThe function retrieves a string identifying the device's software key (sometimes called the driver key)・ See Driver Information in the Registry.SPDRP_ENUMERATOR_NAMEThe function retrieves a REG_SZ string containing the name of the device's enumerato匚 SPDRP_EXCLUSIVEThe function retrieves a DWORD value that indicates whether a user can obtain exclusive use of the device. The returned value is one if exclusive use is allowed, or zero otherwise. For more information, see IoCreateDevice.SPDRP_FR1ENDLYNAMEThe function retrieves a REG_SZ string that contains the friendly name of a device・ SPDRP_HARDWAREIDThe function retrieves a REG_MULTI_SZ string containing the list of hardware IDs for a device. For information about hardware IDs, see Device Identification Strings.SPDRPJNSTALL.STATE(Windows XP and later) The function retrieves a DWORD value that indicates the installation state of a device. The in stallation state is represented by one of the CM」NSTALL_STATE_Xxx values that are defined in Cfgmgr32.h. TheCM INSTALL STATE Xxx values correspond to the DEVICE INSTALL STATE enumeration values.SPDRP_LEGACYBUSTYPEThe function retrieves the device's legacy bus type as an INTERFACE_TYPE value (defined in wdm.hand ntddk.h).SPDRP_LOCATIO N」NFORMATIONThe function retrieves a REG_SZ string that contains the hardw。

      点击阅读更多内容
      关于金锄头网 - 版权申诉 - 免责声明 - 诚邀英才 - 联系我们
      手机版 | 川公网安备 51140202000112号 | 经营许可证(蜀ICP备13022795号)
      ©2008-2016 by Sichuan Goldhoe Inc. All Rights Reserved.