SwDeviceInterfaceRegister function (swdevice.h)

Registers a device interface for a software device and optionally sets properties on that interface.


HRESULT SwDeviceInterfaceRegister(
  HSWDEVICE         hSwDevice,
  const GUID        *pInterfaceClassGuid,
  PCWSTR            pszReferenceString,
  ULONG             cPropertyCount,
  const DEVPROPERTY *pProperties,
  BOOL              fEnabled,
  PWSTR             *ppszDeviceInterfaceId



The HSWDEVICE handle to the software device to register a device interface for.


A pointer to the interface class GUID that names the contract that this interface implements.


An optional reference string that differentiates multiple interfaces of the same class for this device. This pointer can be NULL.


The number of DEVPROPERTY structures in the pProperties array.


An optional array of DEVPROPERTY structures for the properties to set on the interface. This pointer can be NULL.

Set these properties on the interface after it is created but before a notification that the interface has been created are sent. For more info, see Remarks. This pointer can be NULL.


A Boolean value that indicates whether to either enable or disable the interface. TRUE to enable; FALSE to disable.


A pointer to a variable that receives a pointer to the device interface ID for the interface. The caller must free this value with SwMemFree. This value can be NULL if the client app doesn't need to retrieve the name.

Return value

S_OK is returned if SwDeviceInterfaceRegister successfully registered the interface; otherwise, an appropriate error value.


You can call SwDeviceInterfaceRegister 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.

You can't call SwDeviceInterfaceRegister for software devices that specify the SWDeviceCapabilitiesDriverRequired capability.


Minimum supported client Windows 8
Minimum supported server Windows Server 2012
Target Platform Universal
Header swdevice.h
Library Swdevice.lib; OneCoreUAP.lib on Windows 10
DLL Cfgmgr32.dll

See also