The SetupDiSetDeviceRegistryProperty function sets a Plug and Play device property for a device.
WINSETUPAPI BOOL SetupDiSetDeviceRegistryPropertyA( HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData, DWORD Property, CONST BYTE *PropertyBuffer, DWORD PropertyBufferSize );
A handle to the device information set that contains a device information element that represents the device for which to set a Plug and Play device property.
A pointer to an SP_DEVINFO_DATA structure that specifies the device information element in DeviceInfoSet. If the ClassGuid property is set, DeviceInfoData.ClassGuid is set upon return to the new class for the device.
One of the following values, which identifies the property to be set. For descriptions of these values, see SetupDiGetDeviceRegistryProperty.
A pointer to a buffer that contains the new data for the property. If the property is being cleared, then this pointer should be NULL and PropertyBufferSize must be zero.
The size, in bytes, of PropertyBuffer. If PropertyBuffer is NULL, then this field must be zero.
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 caller of this function must be a member of the Administrators group.
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.
|Windows version||Available in Microsoft Windows 2000 and later versions of Windows.|
|Header||setupapi.h (include Setupapi.h)|