SwDeviceInterfaceRegister function (swdevice.h)

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

Syntax

HRESULT SwDeviceInterfaceRegister(
  [in]            HSWDEVICE         hSwDevice,
  [in]            const GUID        *pInterfaceClassGuid,
  [in, optional]  PCWSTR            pszReferenceString,
  [in]            ULONG             cPropertyCount,
  [in, optional]  const DEVPROPERTY *pProperties,
  [in]            BOOL              fEnabled,
  [out, optional] PWSTR             *ppszDeviceInterfaceId
);

Parameters

[in] hSwDevice

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

[in] pInterfaceClassGuid

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

[in, optional] pszReferenceString

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

[in] cPropertyCount

The number of DEVPROPERTY structures in the pProperties array.

[in, optional] pProperties

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.

[in] fEnabled

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

[out, optional] ppszDeviceInterfaceId

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.

Remarks

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.

Requirements

Requirement Value
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

SwMemFree