Bewerken

Delen via


Accessing device class properties

In Windows Vista and later versions of Windows, applications and installers can access device setup class properties and device interface class properties by calling the following functions.

Note

SetupApi is not supported on all editions of Windows. When possible, you should use lower layer APIs such as those available via CfgMgr32.dll. See Porting from SetupApi to CfgMgr32 for tips.

For information about how to access device class properties on Windows Server 2003, Windows XP, and Windows 2000, see Accessing device setup class properties and Accessing device interface class properties.

Retrieving properties

Property APIs such as CM_Get_Class_Property or SetupDiGetClassProperty can be used to retrieve a class property for a device setup class or a device interface class.

Setting properties

Property APIs such as CM_Set_Class_Property or SetupDiSetClassProperty can be used to set a class property for a device setup class or device interface class.

Getting a list of available properties

Property APIs such as CM_Get_Class_Property_Keys or SetupDiGetClassPropertyKeys can be used to retrieve an array of the property keys that identify the properties that are currently set for a device setup class or device interface class. This can be used to determine the full set of properties set on a class. However, use of these functions, especially to then subsequently retrieve the value of all properties that these functions indicate are set on the class, should be used sparingly since the retrieval of the list of all properties and their values can be an expensive operation.