ISensorDriver::OnSetProperties method

The ISensorDriver::OnSetProperties method specifies values for the specified list of properties.


HRESULT OnSetProperties(
  [in]  IWDFFile              *pClientFile,
  [in]  LPWSTR                pwszSensorID,
  [in]  IPortableDeviceValues *pPropertiesToSet,
  [out] IPortableDeviceValues **ppResults


pClientFile [in]

Pointer to an IWDFFile interface that represents the file object for the application specifying property values.

pwszSensorID [in]

LPWSTR that contains the ID for the sensor for which the client application is specifying property values.

pPropertiesToSet [in]

Pointer to an IPortableDeviceValues interface that contains the list of properties to set and their values.

ppResults [out]

Address of an IPortableDeviceValues pointer that receives the list of properties that have been set successfully and their new values. If a property was not set, the new value contains an HRESULT error code.

Return value

If the operation succeeds, this method returns S_OK. Otherwise, this method returns one of the error codes that are defined in Winerror.h.


Properties describe the sensor device, as opposed to data fields, which contain sensor-generated data. Platform-defined properties are defined in sensors.h.

The list of properties provided through pPropertiesToSet is typically a subset of the list you returned through ISensorDriver::OnGetSupportedProperties. However, the sensor class extension does not enforce this condition on client applications.

The sensor class extension is responsible for freeing any PROPVARIANT structures returned by this method.

IPortableDeviceValues is documented in Windows Portable Devices.

Note  This method will be called only if the user has enabled the sensor in the Location and Other Sensors control panel.


Minimum supported client

Windows 7

Minimum supported server

None supported

Target platform


Available in Windows 7.





See also




Send comments about this topic to Microsoft