SetupDiGetDeviceRegistryProperty-使用SetupDi系列函数进行设备信息的管理(三)
2012-04-05 00:07
1341 查看
WINSETUPAPI BOOL WINAPI
SetupDiGetDeviceRegistryProperty(
IN HDEVINFO DeviceInfoSet,
IN PSP_DEVINFO_DATA DeviceInfoData,
IN DWORD Property,
OUT PDWORD PropertyRegDataType, OPTIONAL
OUT PBYTE PropertyBuffer,
IN DWORD PropertyBufferSize,
OUT PDWORD RequiredSize OPTIONAL
);SetupDiGetDeviceRegistryProperty:获得单个装置的详细资料参数说明:DeviceInfoSet设备信息句柄DeviceInfoDataSP_DEVINFO_DATA结构体,包含DeviceInfoSet 中的设备信息Property 取以下的值:SPDRP_ADDRESS查询设备的地址SPDRP_BUSNUMBER查询设备的bus号SPDRP_BUSTYPEGUID查询设备的GUID号SPDRP_CAPABILITIESThe 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.
SPDRP_CHARACTERISTICSThe function retrieves a bitwise OR of a device's characteristics flags in a DWORD. For a description of these flags, which are defined in wdm.h and ntddk.h, see the IoCreateDevice function'sDeviceCharacteristics 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 enumerator.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_FRIENDLYNAMEThe 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.SPDRP_INSTALL_STATE(Windows XP and later) The function retrieves a DWORD value that indicates the installation state of a device. The installation state is represented by one of the CM_INSTALL_STATE_Xxx values that are defined in Cfgmgr32.h. The CM_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_LOCATION_INFORMATIONThe function retrieves a REG_SZ string that contains the hardware location of a device.SPDRP_LOCATION_PATHS(Windows Server 2003 and later) The function retrieves a REG_MULTI_SZ string that represents the location of the device in the device tree. SPDRP_LOWERFILTERSThe function retrieves a REG_MULTI_SZ string that contains the names of a device's lower-filter drivers.SPDRP_MFGThe function retrieves a REG_SZ string that contains the name of the device manufacturer.SPDRP_PHYSICAL_DEVICE_OBJECT_NAMEThe function retrieves a REG_SZ string that contains the name that is associated with the device's PDO. For more information, see IoCreateDevice.SPDRP_REMOVAL_POLICY(Windows XP and later) The function retrieves the device's current removal policy as a DWORD containing one of the CM_REMOVAL_POLICY_Xxx values defined in cfgmgr32.h.SPDRP_REMOVAL_POLICY_HW_DEFAULT(Windows XP and later) The function retrieves the device's hardware-specified default removal policy as a DWORD containing one of the CM_REMOVAL_POLICY_Xxx values defined in cfgmgr32.h.SPDRP_REMOVAL_POLICY_OVERRIDE(Windows XP and later) The function retrieves the device's override removal policy (if it exists) from the registry, as a DWORD containing one of the CM_REMOVAL_POLICY_Xxx values defined in cfgmgr32.h.SPDRP_SECURITYThe function retrieves a SECURITY_DESCRIPTOR structure for a device.SPDRP_SECURITY_SDSThe function retrieves a REG_SZ string that contains the device's security descriptor. The format of security descriptor strings is described in Microsoft Windows SDK documentation.SPDRP_SERVICEThe function retrieves a REG_SZ string containing the service name for a device.SPDRP_UI_NUMBERThe function retrieves a DWORD value set to the value of the UINumber member of the device's DEVICE_CAPABILITIES structure.SPDRP_UI_NUMBER_DESC_FORMATThe function retrieves a format string (REG_SZ) used to display the UINumber value.SPDRP_UPPERFILTERSThe function retrieves a REG_MULTI_SZ string that contains the names of a device's upper filter drivers.PropertyRegDataTypeA pointer to a variable that receives the data type of the property that is being retrieved. This is one of the standard registry data types. This parameter is optional and can be NULL.PropertyBufferA pointer to a buffer that receives the property that is being retrieved. If this parameter is set to NULL, and PropertyBufferSize is also set to zero, the function returns the required size for the buffer inRequiredSize.PropertyBufferSizeThe size, in bytes, of the PropertyBuffer buffer.RequiredSizeA pointer to a variable of type DWORD that receives the required size, in bytes, of the PropertyBufferbuffer that is required to hold the data for the requested property. This parameter is optional and can be NULL.
SetupDiGetDeviceRegistryProperty(
IN HDEVINFO DeviceInfoSet,
IN PSP_DEVINFO_DATA DeviceInfoData,
IN DWORD Property,
OUT PDWORD PropertyRegDataType, OPTIONAL
OUT PBYTE PropertyBuffer,
IN DWORD PropertyBufferSize,
OUT PDWORD RequiredSize OPTIONAL
);SetupDiGetDeviceRegistryProperty:获得单个装置的详细资料参数说明:DeviceInfoSet设备信息句柄DeviceInfoDataSP_DEVINFO_DATA结构体,包含DeviceInfoSet 中的设备信息Property 取以下的值:SPDRP_ADDRESS查询设备的地址SPDRP_BUSNUMBER查询设备的bus号SPDRP_BUSTYPEGUID查询设备的GUID号SPDRP_CAPABILITIESThe 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 flag | Corresponding DEVICE_CAPABILITIES structure member |
---|---|
CM_DEVCAP_LOCKSUPPORTED | LockSupported |
CM_DEVCAP_EJECTSUPPORTED | EjectSupported |
CM_DEVCAP_REMOVABLE | Removable |
CM_DEVCAP_DOCKDEVICE | DockDevice |
CM_DEVCAP_UNIQUEID | UniqueID |
CM_DEVCAP_SILENTINSTALL | SilentInstall |
CM_DEVCAP_RAWDEVICEOK | RawDeviceOK |
CM_DEVCAP_SURPRISEREMOVALOK | SurpriseRemovalOK |
CM_DEVCAP_HARDWAREDISABLED | HardwareDisabled |
CM_DEVCAP_NONDYNAMIC | NonDynamic |
Return Value
SetupDiGetDeviceRegistryProperty returns TRUE if the call was successful. Otherwise, it returns FALSE and the logged error can be retrieved with a call to GetLastError. SetupDiGetDeviceRegistryPropertyreturns the ERROR_INVALID_DATA error code if the requested property does not exist for a device or if the property data is not valid.相关文章推荐
- SetupDiGetClassDevs-使用SetupDi系列函数进行设备信息的管理(一)
- SetupDiGetClassDevs-使用SetupDi系列函数进行设备信息的管理
- SetupDiEnumDeviceInfo-使用SetupDi系列函数进行设备信息的管理(二)
- SetupDiDestroyDeviceInfoList-使用SetupDi系列函数进行设备信息的管理(四)
- 使用SetupDi系列函数进行设备信息的管理
- 使用SetupDi系列函数进行设备信息的管理
- Cordova各个插件使用介绍系列(六)—$cordovaDevice获取设备的相关信息
- SetUpDi系列函数获取系统设备信息
- Cordova各个插件使用介绍系列(六)—$cordovaDevice获取设备的相关信息
- windows下设备信息管理系列函数——用于设备枚举
- 基于Windows的设备管理开发(主要阐述SetupDi系列函数及其相关内容)
- Cordova各个插件使用介绍系列(六)—$cordovaDevice获取设备的相关信息
- SetupDiGetDeviceRegistryProperty(,,SPDRP_xxx,,,)的结果
- 用SetUpDi系列函数获得系统设备信息
- 用SetUpDi系列函数获得系统设备信息
- SetupDiGetDeviceRegistryProperty在Windows2000导致死机的解决办法
- C语言学习10:结构体,结构体应用,联合用法,枚举,fopen函数使用,fseek,ftell的作用和文件结束符EOF,数组和文件交换数据,个人信息管理。
- mini2440插入usb设备出现: unable to enumerate USB device on port问题的解决,以及使用super vivi对nand flash进行分区
- html5 设备管理信息 device
- platform_device_系列函数及其设备注册的作用