Bewerken

Delen via


WdfDeviceSetDeviceInterfaceStateEx function (wdfdevice.h)

The WdfDeviceSetDeviceInterfaceStateEx method enables or disables a device interface for a specified device.

Syntax

void WdfDeviceSetDeviceInterfaceStateEx(
  WDFDEVICE        Device,
  const GUID       *InterfaceClassGUID,
  PCUNICODE_STRING ReferenceString,
  BOOLEAN          IsInterfaceEnabled
);

Parameters

Device

A handle to a framework device object.

InterfaceClassGUID

A pointer to a GUID that identifies the device interface class.

ReferenceString

A pointer to a UNICODE_STRING structure that describes a reference string for the device interface. This parameter is optional and can be NULL.

IsInterfaceEnabled

A Boolean value that, if TRUE, enables the specified device interface instance or, if FALSE, disables it.

Return value

None

Remarks

The driver can call this function either before or after the device has started.

When called before the device starts (for example from EvtDriverDeviceAdd, EvtChildListCreateDevice, or EvtDevicePrepareHardware), the driver should set IsInterfaceEnabled to FALSE to prevent the interface from being automatically enabled during PnP start. Setting the parameter to TRUE before the device starts is redundant and such a call should be removed.

When calling after the device has started, the behavior is the same as WdfDeviceSetDeviceInterfaceState.

Requirements

Requirement Value
Minimum supported client Windows 10, version 2004
Minimum KMDF version 1.31
Minimum UMDF version 1.31
Header wdfdevice.h (include Wdf.h)
Library Wdf01000.sys (KMDF); WUDFx02000.dll (UMDF)
IRQL PASSIVE_LEVEL

See also

WdfDeviceSetDeviceInterfaceState

Enabling and Disabling a Device Interface