BOOLEAN
SetupDiSetDeviceRegistryProperty(
IN HDEVINFO DeviceInfoSet,
IN OUT PSP_DEVINFO_DATA DeviceInfoData,
IN DWORD Property,
IN PBYTE PropertyBuffer,
IN DWORD PropertyBufferSize
);
SetupDiSetDeviceRegistryProperty sets the specified Plug and Play device registry property.
Code |
Property |
SPDRP_DEVICEDESC (0x00) |
DeviceDesc |
SPDRP_HARDWAREID (0x01) |
HardwareID |
SPDRP_COMPATIBLEIDS (0x02) |
CompatibleIDs |
SPDRP_SERVICE (0x04) |
Service |
SPDRP_CLASSGUID (0x08) |
ClassGUID |
SPDRP_DRIVER (0x09) |
Driver |
SPDRP_CONFIGFLAGS (0x0A) |
ConfigFlags |
SPDRP_MFG (0x0B) |
Mfg |
SPDRP_FRIENDLYNAME (0x0C) |
FriendlyName |
The function returns TRUE if it is successful. Otherwise it returns FALSE and the logged error can be retrieved with a call to GetLastError.
The class name property cannot be set because it is based on the corresponding class GUID and is automatically updated when that property is changed. When the ClassGUID property changes, SetupDiSetDeviceRegistryProperty automatically cleans up any software keys associated with the device.