EVT_UFX_DEVICE_PORT_CHANGE 콜백 함수(ufxclient.h)

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 메서드를 호출하여 EVT_UFX_DEVICE_PORT_CHANGE 구현을 UFX(USB 함수 클래스 확장)에 등록합니다.

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();
}

요구 사항

요구 사항
대상 플랫폼 Windows
최소 KMDF 버전 1.0
최소 UMDF 버전 2.0
머리글 ufxclient.h
IRQL PASSIVE_LEVEL

추가 정보

UfxDeviceCreate

UfxDeviceEventComplete