IWDFDevice::AssignDeviceInterfaceState method

[Warning: UMDF 2 is the latest version of UMDF and supersedes UMDF 1. All new UMDF drivers should be written using UMDF 2. No new features are being added to UMDF 1 and there is limited support for UMDF 1 on newer versions of Windows 10. Universal Windows drivers must use UMDF 2. For more info, see Getting Started with UMDF.]

The AssignDeviceInterfaceState method enables or disables the specified device interface instance for a device.

Syntax


HRESULT AssignDeviceInterfaceState(
  [in]           LPCGUID pDeviceInterfaceGuid,
  [in, optional] PCWSTR  pReferenceString,
  [in]           BOOL    Enable
);

Parameters

pDeviceInterfaceGuid [in]

A pointer to the GUID for a device interface class.

pReferenceString [in, optional]

A pointer to a NULL-terminated string that contains the name of the instance of the device interface. This parameter is optional. The driver can pass NULL if the driver does not have to supply a name. If the driver must supply a name, the string that the driver passes must not contain any path separator characters ("/" or "\").

Enable [in]

A BOOL value that specifies whether the device interface instance should be enabled or disabled. TRUE indicates to enable; FALSE indicates to disable.

Return value

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

Remarks

If IWDFDevice::CreateDeviceInterface succeeds, the framework automatically enables and disables the interface based on the device's PnP state. Use the AssignDeviceInterfaceState method to disable and re-enable a device interface manually.

For more information about device interfaces, see Using Device Interfaces in UMDF Drivers.

Examples

For a code example of how to use the AssignDeviceInterfaceState method, see IWDFDevice::CreateDeviceInterface.

Requirements

Target platform

Desktop

End of support

Unavailable in UMDF 2.0 and later.

Minimum UMDF version

1.5

Header

Wudfddi.h (include Wudfddi.h)

DLL

WUDFx.dll

See also

IWDFDevice
IWDFDevice::CreateDeviceInterface

 

 

Send comments about this topic to Microsoft

Show: