SwDeviceInterfaceRegister function

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

Syntax

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

Parameters

hSwDevice

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

pInterfaceClassGuid

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

pszReferenceString

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

cPropertyCount

The number of DEVPROPERTY structures in the pProperties array.

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.

fEnabled

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

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

   
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