EVT_UFX_DEVICE_HOST_CONNECT - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// ufxclient.h

EVT_UFX_DEVICE_HOST_CONNECT EvtUfxDeviceHostConnect;

VOID EvtUfxDeviceHostConnect(
  [in] UFXDEVICE unnamedParam1
)
{...}
View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nc-ufxclient-evt_ufx_device_host_connect)

EVT_UFX_DEVICE_HOST_CONNECT callback function

Description

The client driver's implementation to initiate connection with the host.

Parameters

unnamedParam1 [in]

The handle to a USB device object that the client driver received in a previous call to the UfxDeviceCreate method.

Remarks

The client driver for the function host controller registers its EVT_UFX_DEVICE_HOST_CONNECT implementation with the USB function class extension (UFX) by calling the UfxDeviceCreate method.

The client driver must not initiate connection with the host until UFX invokes this event callback. The client driver shall indicate completion of this event by calling the UfxDeviceEventComplete method.

Examples

EVT_UFX_DEVICE_HOST_CONNECT UfxDevice_EvtDeviceHostConnect;

VOID
UfxDevice_EvtDeviceHostConnect (
    _In_ UFXDEVICE UfxDevice
    )
/*++

Routine Description:

    EvtDeviceHostConnect callback handler for UFXDEVICE object.

Arguments:

    UfxDevice - UFXDEVICE object representing the device.

--*/
{
    PCONTROLLER_CONTEXT ControllerContext;
    PUFXDEVICE_CONTEXT DeviceContext;
    BOOLEAN EventComplete;

    TraceEntry();

    DeviceContext = UfxDeviceGetContext(UfxDevice);
    ControllerContext = DeviceGetControllerContext(DeviceContext->FdoWdfDevice);

    EventComplete = TRUE;

    WdfSpinLockAcquire(ControllerContext->DpcLock);

    //
    // #### TODO: Insert code to set the run state on the controller ####
    //

    WdfSpinLockRelease(ControllerContext->DpcLock);

    if (EventComplete) {
        UfxDeviceEventComplete(UfxDevice, STATUS_SUCCESS);
    }

    TraceExit();
}

See also