CM_Set_Class_Property_ExW function (cfgmgr32.h)

[Beginning with Windows 8 and Windows Server 2012, this function has been deprecated. Please use CM_Set_Class_Property instead.]

The CM_Set_Class_Property_ExW function sets a class property for a device setup class or a device interface class.

Syntax

CMAPI CONFIGRET CM_Set_Class_Property_ExW(
  [in]           LPCGUID          ClassGUID,
  [in]           const DEVPROPKEY *PropertyKey,
  [in]           DEVPROPTYPE      PropertyType,
  [in]           const PBYTE      PropertyBuffer,
  [in]           ULONG            PropertyBufferSize,
  [in]           ULONG            ulFlags,
  [in, optional] HMACHINE         hMachine
);

Parameters

[in] ClassGUID

Pointer to the GUID that identifies the device interface class or device setup class for which to set a device property. For information about specifying the class type, see the ulFlags parameter.

[in] PropertyKey

Pointer to a DEVPROPKEY structure that represents the property key of the device class property to set.

[in] PropertyType

A DEVPROPTYPE-typed value that represents the property-data-type identifier for the device class property. To delete a property, set this to DEVPROP_TYPE_EMPTY.

[in] PropertyBuffer

Pointer to a buffer that contains the property value of the device class property. If either the property or the data is to be deleted, this pointer must be set to NULL, and PropertyBufferSize must be set to zero.

[in] PropertyBufferSize

The size, in bytes, of the PropertyBuffer buffer. If PropertyBuffer is set to NULL, PropertyBufferSize must be set to zero.

[in] ulFlags

Class property flags:

CM_CLASS_PROPERTY_INSTALLER

ClassGUID specifies a device setup class. Do not combine with CM_CLASS_PROPERTY_INTERFACE.

CM_CLASS_PROPERTY_INTERFACE

ClassGUID specifies a device interface class. Do not combine with CM_CLASS_PROPERTY_INSTALLER.

[in, optional] hMachine

Caller-supplied machine handle, obtained from a previous call to CM_Connect_Machine.

Note  Using this function to access remote machines is not supported beginning with Windows 8 and Windows Server 2012, as this functionality has been removed.
 

Return value

If the operation succeeds, the function returns CR_SUCCESS. Otherwise, it returns one of the CR_-prefixed error codes defined in Cfgmgr32.h.

Remarks

CM_Set_Class_Property_ExW is part of the Unified Device Property Model.

Requirements

Requirement Value
Minimum supported client Available in Microsoft Windows 10 and later versions of Windows.
Target Platform Desktop
Header cfgmgr32.h (include Cfgmgr32.h)
Library Cfgmgr32.lib

See also

CM_Connect_Machine

SetupDiSetClassProperty