SetupDiSetClassRegistryProperty function
The SetupDiSetClassRegistryProperty function sets a specified device class property in the registry.
Syntax
BOOL SetupDiSetClassRegistryProperty( _In_ const GUID *ClassGuid, _In_ DWORD Property, _In_opt_ const BYTE *PropertyBuffer, _In_ DWORD PropertyBufferSize, _In_opt_ PCTSTR MachineName, _Reserved_ PVOID Reserved );
Parameters
- ClassGuid [in]
-
A pointer to the GUID that identifies the device class for which a property is to be set.
- Property [in]
-
A value that identifies the property to be set, which must be one of the following:
- SPCRP_CHARACTERISTICS
-
The caller supplies flags that specify the device characteristics for the class. For a list of characteristics flags, see the DeviceCharacteristics parameter of IoCreateDevice. Device characteristics should be set when the device class is installed and should not be changed after the device class is installed.
- SPCRP_DEVTYPE
-
The caller supplies the device type for the class. For more information, see Specifying Device Types. Device type should be set when a device class is installed and should not be changed after the device class is installed.
- SPCRP_EXCLUSIVE
-
The caller supplies a DWORD value that specifies whether users can obtain exclusive access to devices for this class. The supplied value is 1 if exclusive access is allowed, or zero otherwise. The exclusive setting for a device should be set when a device class is installed and should not be changed after the device class is installed.
- SPCRP_LOWERFILTERS
-
(Windows Vista and later) The caller supplies a REG_MULTI_SZ list of the service names of the lower filter drivers that are installed for the device setup class. For more information about how to install a class filter driver, see Installing a Filter Driver and INF ClassInstall32 Section.
- SPCRP_SECURITY
-
The caller supplies the device's security descriptor as a SECURITY_DESCRIPTOR structure in self-relative format (described in the Microsoft Windows SDK documentation).
- SPCRP_SECURITY_SDS
-
The caller supplies the device's security descriptor as a text string. For information about security descriptor strings, see Security Descriptor Definition Language (Windows). For information about the format of security descriptor strings, see Security Descriptor Definition Language (Windows).
- SPCRP_UPPERFILTERS
-
(Windows Vista and later) The caller supplies a REG_MULTI_SZ list of the service names of the upper filter drivers that are installed for the device setup class. For more information about how to install a class filter driver, see Installing a Filter Driver and INF ClassInstall32 Section.
- PropertyBuffer [in, optional]
-
A pointer to a buffer that supplies the specified property. This parameter is optional and can be NULL.
- PropertyBufferSize [in]
-
The size, in bytes, of the PropertyBuffer buffer.
- MachineName [in, optional]
-
A pointer to a NULL-terminated string that contains the name of a remote system on which to set the specified device class property. This parameter is optional and can be NULL. If this parameter is NULL, the property is set on the name of the local system.
- Reserved
-
Reserved, must be NULL.
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.
Remarks
The caller of this function must be a member of the Administrators group.
To determine the data type for a device class property, call SetupDiGetClassRegistryProperty.
Requirements
|
Target platform |
|
|---|---|
|
Version |
Available in Windows XP and later versions of Windows. |
|
Header |
|
|
Library |
|
See also