SetupDiGetDeviceRegistryProperty

BOOLEAN
    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 retrieves the specified property from the Plug and Play device storage location in the registry.

Parameters
DeviceInfoSet
Supplies a handle to the device information set containing information about the device instance for which to retrieve a Plug and Play registry property.
DeviceInfoData
Supplies a pointer to an SP_DEVINFO_DATA structure indicating the device instance for which to retrieve the Plug and Play property.
Property
Supplies an ordinal specifying the property to be retrieved. Can be one of the following values:

Code

Property

SPDRP_DEVICEDESC (0x00)

DeviceDesc

SPDRP_HARDWAREID (0x01)

HardwareID

SPDRP_COMPATIBLEIDS (0x02)

CompatibleIDs

SPDRP_NTDEVICEPATHS (0x03)

NtDevicePaths

SPDRP_SERVICE (0x04)

Service

SPDRP_CONFIGURATION (0x05)

Configuration

SPDRP_CONFIGURATIONVECTOR (0x06)

ConfigurationVector

SPDRP_CLASS (0x07)

Class

SPDRP_CLASSGUID (0x08)

ClassGUID

SPDRP_DRIVER (0x09)

Driver

SPDRP_CONFIGFLAGS (0x0A)

ConfigFlags

SPDRP_MFG (0x0B)

Mfg

SPDRP_FRIENDLYNAME (0x0C)

FriendlyName

PropertyRegDataType
Supplies a pointer to a variable to receive the data type of the property being retrieved. This is one of the standard registry data types.
PropertyBuffer
Supplies a pointer to a buffer to receive the property being retrieved.
PropertyBufferSize
Supplies the length, in bytes, of PropertyBuffer.
RequiredSize
Supplies a pointer to a variable to receive the number of bytes required to store the requested property in PropertyBuffer.
Return Value

The function returns TRUE if it is successful. Otherwise it returns FALSE and the logged error can be retrieved with a call to GetLastError.

See Also

SetupDiSetDeviceRegistryProperty