Setting Device Object Registry Properties After Installation

A user-mode program can use the device installation functions to get or set the registry settings for the properties of a driver's device object. Normally these functions are used by installation software, but they can be used by any user-mode program. (The program must be executed by a user that has Administrator access.)

The SetupDiGetDeviceRegistryProperty and SetupDiSetDeviceRegistryProperty functions get and set the registry key for each specified property. The Property parameter specifies the property to get or set. The PropertyBuffer points to the destination buffer (when getting the property) or source buffer (when setting the property) for the property.

The correspondence between values for the Property parameter and actual properties is as follows.

Value for Property parameter Device object property


Device characteristics


Device type




Security descriptor as a SECURITY_DESCRIPTOR structure


Security descriptor as an SDDL string

Note that two different ways are provided to get or set the security descriptor. You can specify the SPDRP_SECURITY value to treat the security descriptor as a SECURITY_DESCRIPTOR structure, or SPDRP_SECURITY_SDS to treat the security descriptor as an SDDL string. For more information about SDDL strings, see SDDL for Device Objects.

For Windows XP and later operating systems, programs can also get and set the property values for a device setup class. Use the SetupDiGetClassRegistryProperty and SetupDiSetClassRegistryProperty functions to get and set the property values for a device setup class.

For more information about using the SetupDi*Xxx* functions, see Using Device Installation Functions.

Send comments about this topic to Microsoft