// wdfdevice.h
VOID WdfDeviceSetDeviceInterfaceStateEx(
WDFDEVICE Device,
const GUID *InterfaceClassGUID,
PCUNICODE_STRING ReferenceString,
BOOLEAN IsInterfaceEnabled
);
View the official Windows Driver Kit DDI referenceNo description available.
The WdfDeviceSetDeviceInterfaceStateEx method enables or disables a device interface for a specified device.
DeviceA handle to a framework device object.
InterfaceClassGUIDA pointer to a GUID that identifies the device interface class.
ReferenceStringA pointer to a UNICODE_STRING structure that describes a reference string for the device interface. This parameter is optional and can be NULL.
IsInterfaceEnabledA Boolean value that, if TRUE, enables the specified device interface instance or, if FALSE, disables it.
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.
WdfDeviceSetDeviceInterfaceState
Enabling and Disabling a Device Interface