客户端驱动程序的实现,用于更新 USB 设备连接到的新端口的类型。
语法
EVT_UFX_DEVICE_PORT_CHANGE EvtUfxDevicePortChange;
void EvtUfxDevicePortChange(
[in] UFXDEVICE unnamedParam1,
[in] USBFN_PORT_TYPE unnamedParam2
)
{...}
参数
[in] unnamedParam1
客户端驱动程序在对 UfxDeviceCreate的上一次调用中收到的 USB 设备对象的句柄。
[in] unnamedParam2
指示新端口类型的USBFN_PORT_STATE类型标志。
返回值
没有
言论
函数主机控制器的客户端驱动程序通过调用 UfxDeviceCreate 方法向 USB 函数类扩展(UFX)注册其 EVT_UFX_DEVICE_PORT_CHANGE 实现。
UFX 调用此事件回调,以通知客户端驱动程序设备的新状态。
客户端驱动程序通过调用 UfxDeviceEventComplete 方法指示完成此事件。
例子
EVT_UFX_DEVICE_PORT_CHANGE UfxDevice_EvtDevicePortChange;
VOID
UfxDevice_EvtDevicePortChange (
_In_ UFXDEVICE UfxDevice,
_In_ USBFN_PORT_TYPE NewPort
)
/*++
Routine Description:
EvtDevicePortChange handler for the UFXDEVICE object.
Caches the new port type, and stops or resumes idle as needed.
Arguments:
UfxDevice - UFXDEVICE object representing the device.
NewPort - New port type
--*/
{
NTSTATUS Status;
PUFXDEVICE_CONTEXT Context;
PAGED_CODE();
TraceEntry();
Context = UfxDeviceGetContext(UfxDevice);
TraceInformation("New PORT: %d", NewPort);
//
// #### TODO: Insert code to examine the device USB state and port type
// and determine if it needs to stop or resume idle.
UfxDeviceEventComplete(UfxDevice, STATUS_SUCCESS);
TraceExit();
}
要求
要求 | 价值 |
---|---|
目标平台 | 窗户 |
最低 KMDF 版本 | 1.0 |
最低 UMDF 版本 | 2.0 |
标头 | ufxclient.h |
IRQL | PASSIVE_LEVEL |