SetupDiGetDeviceRegistryProperty-使用SetupDi系列函数进行设备 str系列函数

SetupDiGetDeviceRegistryProperty-使用SetupDi系列函数进行设备信息的管理(三)

WINSETUPAPI BOOL WINAPI
SetupDiGetDeviceRegistryProperty(
IN HDEVINFO DeviceInfoSet,
IN PSP_DEVINFO_DATA DeviceInfoData,
IN DWORD Property,
OUT PDWORD PropertyRegDataType,OPTIONAL
OUT PBYTE PropertyBuffer,
SetupDiGetDeviceRegistryProperty-使用SetupDi系列函数进行设备 str系列函数
IN DWORD PropertyBufferSize,
OUT PDWORD RequiredSizeOPTIONAL
);

SetupDiGetDeviceRegistryProperty:获得单个装置的详细资料

参数说明:

DeviceInfoSet

设备信息句柄

DeviceInfoData

SP_DEVINFO_DATA结构体,包含DeviceInfoSet 中的设备信息

Property

取以下的值:

SPDRP_ADDRESS

查询设备的地址

SPDRP_BUSNUMBER

查询设备的bus号

SPDRP_BUSTYPEGUID

查询设备的GUID号

SPDRP_CAPABILITIES

The function retrieves a bitwise OR of the followingCM_DEVCAP_Xxx flags in a DWORD. The device capabilitiesthat are represented by these flags correspond to the devicecapabilities that are represented by the members of theDEVICE_CAPABILITIESstructure. The CM_DEVCAP_Xxx constants are defined incfgmgr32.h.

CM_DEVCAP_Xxx flagCorresponding DEVICE_CAPABILITIES structure member
CM_DEVCAP_LOCKSUPPORTEDLockSupported
CM_DEVCAP_EJECTSUPPORTEDEjectSupported
CM_DEVCAP_REMOVABLERemovable
CM_DEVCAP_DOCKDEVICEDockDevice
CM_DEVCAP_UNIQUEIDUniqueID
CM_DEVCAP_SILENTINSTALLSilentInstall
CM_DEVCAP_RAWDEVICEOKRawDeviceOK
CM_DEVCAP_SURPRISEREMOVALOKSurpriseRemovalOK
CM_DEVCAP_HARDWAREDISABLEDHardwareDisabled
CM_DEVCAP_NONDYNAMICNonDynamic
SPDRP_CHARACTERISTICS
The function retrieves a bitwise OR of a device'scharacteristics flags in a DWORD. For a description of these flags,which are defined in wdm.h and ntddk.h, see theIoCreateDevice function'sDeviceCharacteristics parameter.
SPDRP_CLASS
The function retrieves a REG_SZ string that contains the devicesetup class of a device.
SPDRP_CLASSGUID
The function retrieves a REG_SZ string that contains the GUIDthat represents the device setup class of a device.
SPDRP_COMPATIBLEIDS
The function retrieves a REG_MULTI_SZ string containing thelist of compatible IDs for a device. For information aboutcompatible IDs, see Device Identification Strings.
SPDRP_CONFIGFLAGS
The function retrieves a bitwise OR of a device's configurationflags in a DWORD value. The configuration flags are represented bythe CONFIGFLAG_Xxx bitmasks that are defined inregstr.h.
SPDRP_DEVICE_POWER_DATA
(Windows XP and later) The function retrieves a CM_POWER_DATAstructure containing the device's power managementinformation.
SPDRP_DEVICEDESC
The function retrieves a REG_SZ string containing thedescription of a device.
SPDRP_DEVTYPE
The function retrieves a DWORD value representing the device'stype (see Specifying Device Types).
SPDRP_DRIVER
The function retrieves a string identifying the device'ssoftware key (sometimes called the driver key). See DriverInformation in the Registry.
SPDRP_ENUMERATOR_NAME
The function retrieves a REG_SZ string containing the name ofthe device's enumerator.
SPDRP_EXCLUSIVE
The function retrieves a DWORD value that indicates whether auser can obtain exclusive use of the device. The returned value isone if exclusive use is allowed, or zero otherwise. For moreinformation, see IoCreateDevice.
SPDRP_FRIENDLYNAME
The function retrieves a REG_SZ string that contains thefriendly name of a device.
SPDRP_HARDWAREID
The function retrieves a REG_MULTI_SZ string containing thelist of hardware IDs for a device. For information about hardwareIDs, see Device Identification Strings.
SPDRP_INSTALL_STATE
(Windows XP and later) The function retrieves a DWORD valuethat indicates the installation state of a device. The installationstate is represented by one of the CM_INSTALL_STATE_Xxxvalues that are defined in Cfgmgr32.h. TheCM_INSTALL_STATE_Xxx values correspond to theDEVICE_INSTALL_STATE enumeration values.
SPDRP_LEGACYBUSTYPE
The function retrieves the device's legacy bus type as anINTERFACE_TYPE value (defined in wdm.h andntddk.h).
SPDRP_LOCATION_INFORMATION
The function retrieves a REG_SZ string that contains thehardware location of a device.
SPDRP_LOCATION_PATHS
(Windows Server 2003 and later) The function retrieves aREG_MULTI_SZ string that represents the location of the device inthe device tree.
SPDRP_LOWERFILTERS
The function retrieves a REG_MULTI_SZ string that contains thenames of a device's lower-filter drivers.
SPDRP_MFG
The function retrieves a REG_SZ string that contains the nameof the device manufacturer.
SPDRP_PHYSICAL_DEVICE_OBJECT_NAME
The function retrieves a REG_SZ string that contai ns the namethat is associated with the device's PDO. For more information, seeIoCreateDevice.
SPDRP_REMOVAL_POLICY
(Windows XP and later) The function retrieves the device'scurrent removal policy as a DWORD containing one of theCM_REMOVAL_POLICY_Xxx values defined incfgmgr32.h.
SPDRP_REMOVAL_POLICY_HW_DEFAULT
(Windows XP and later) The function retrieves the device'shardware-specified default removal policy as a DWORD containing oneof the CM_REMOVAL_POLICY_Xxx values defined incfgmgr32.h.
SPDRP_REMOVAL_POLICY_OVERRIDE
(Windows XP and later) The function retrieves the device'soverride removal policy (if it exists) from the registry, as aDWORD containing one of the CM_REMOVAL_POLICY_Xxx valuesdefined in cfgmgr32.h.
SPDRP_SECURITY
The function retrieves a SECURITY_DESCRIPTOR structure for adevice.
SPDRP_SECURITY_SDS
The function retrieves a REG_SZ string that contains thedevice's security descriptor. The format of security descriptorstrings is described in Microsoft Windows SDK documentation.
SPDRP_SERVICE
The function retrieves a REG_SZ string containing the servicename for a device.
SPDRP_UI_NUMBER
The function retrieves a DWORD value set to the value of theUINumber member of the device'sDEVICE_CAPABILITIES structure.
SPDRP_UI_NUMBER_DESC_FORMAT
The function retrieves a format string (REG_SZ) used to displaythe UINumber value.
SPDRP_UPPERFILTERS
The function retrieves a REG_MULTI_SZ string that contains thenames of a device's upper filter drivers.
PropertyRegDataType
A pointer to a variable that receives the data type of theproperty that is being retrieved. This is one of the standardregistry data types. This parameter is optional and can beNULL.
PropertyBuffer
A pointer to a buffer that receives the property that is beingretrieved. If this parameter is set to NULL, andPropertyBufferSize is also set to zero, the functionreturns the required size for the buffer inRequiredSize.
PropertyBufferSize
The size, in bytes, of the PropertyBuffer buffer.
RequiredSize
A pointer to a variable of type DWORD that receives therequired size, in bytes, of the PropertyBuffer buffer thatis required to hold the data for the requested property. Thisparameter is optional and can be NULL.

Return Value

SetupDiGetDeviceRegistryProperty returns TRUEif the call was successful. Otherwise, it returns FALSE and thelogged error can be retrieved with a call toGetLastError.SetupDiGetDeviceRegistryProperty returns theERROR_INVALID_DATA error code if the requested property does notexist for a device or if the property data is not valid.

  

爱华网本文地址 » http://www.aihuau.com/a/25101015/241977.html

更多阅读

excel中round函数的使用方法 isodd函数的使用方法

excel中round函数的使用方法——简介不少朋友都会问在excel中round函数怎么用,作为使用频率较高函数之一,本文就介绍一下round函数的使用方法。excel中round函数的使用方法——工具/原料office excelexcel中round函数的使用方法——

large函数的使用方法 max函数的使用方法

large函数的使用方法——简介excel中的large函数也是平时常用的统计函数之一,该函数语法简单,理解容易,再配上实例,基本可以让看到本文的朋友完全掌握。large函数的使用方法——工具/原料office excellarge函数的使用方法——函数解释

left函数的使用方法 sumif函数的使用方法

left函数的使用方法——简介在excel中left函数可以给我们提供很多方便,平时也经常用到。该函数相对而言比较简单,本文就介绍下left函数怎么用。left函数的使用方法——工具/原料office excelleft函数的使用方法——方法/步骤left函

声明:《SetupDiGetDeviceRegistryProperty-使用SetupDi系列函数进行设备 str系列函数》为网友少年如斯分享!如侵犯到您的合法权益请联系我们删除