Skip to content

Latest commit

 

History

History
81 lines (64 loc) · 3.16 KB

nf-swdevice-swdevicepropertyset.md

File metadata and controls

81 lines (64 loc) · 3.16 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:swdevice.SwDevicePropertySet
SwDevicePropertySet function (swdevice.h)
Sets properties on a software device.
SwDevicePropertySet
SwDevicePropertySet function
swdevice.swdevicepropertyset
swdevice/SwDevicePropertySet
swdevice\swdevicepropertyset.htm
swdevice
6EA107FE-F1FD-4D19-82C8-00FE0D98A9EA
04/22/2024
SwDevicePropertySet, SwDevicePropertySet function, swdevice.swdevicepropertyset, swdevice/SwDevicePropertySet
swdevice.h
Universal
Windows 8
Windows Server 2012
Swdevice.lib; OneCoreUAP.lib on Windows 10
Cfgmgr32.dll
Windows
19H1
SwDevicePropertySet
swdevice/SwDevicePropertySet
c++
APIRef
kbSyntax
DllExport
Cfgmgr32.dll
API-MS-Win-devices-swdevice-l1-1-0.dll
API-MS-Win-devices-swdevice-l1-1-1.dll
SwDevicePropertySet

SwDevicePropertySet function

-description

Sets properties on a software device.

-parameters

-param hSwDevice [in]

The HSWDEVICE handle to the software device to set properties for.

-param cPropertyCount [in]

The number of DEVPROPERTY structures in the pProperties array.

-param pProperties [in]

An array of DEVPROPERTY structures containing the properties to set.

-returns

S_OK is returned if SwDevicePropertySet successfully set the properties; otherwise, an appropriate error value.

-remarks

You can call SwDevicePropertySet only after the operating system has called your client app's SW_DEVICE_CREATE_CALLBACK callback function to notify the client app that device enumeration completed.

There is a subtle difference between properties that are set as part of a SwDeviceCreate call and properties that are later set by calling SwDevicePropertySet. Properties that are set as part of SwDeviceCreate are stored in memory; if the device is uninstalled or a null driver wipes out the property stores, these properties are written out again by the Software Device API feature when PnP re-enumerates the devices. This is all transparent to the client. Properties that are set using SwDevicePropertySet after the enumeration don't persist in memory. But, if you set a property by using SwDeviceCreate, you can update the value with SwDevicePropertySet, and this update is applied to the in-memory value as well as the persisted store.

You can use SwDevicePropertySet only to set properties in the operating system store for the device.