UfxDeviceNotifyHardwareReady 函数 (ufxclient.h)

通知 UFX 硬件已准备就绪。

语法

void UfxDeviceNotifyHardwareReady(
  [in] UFXDEVICE UfxDevice
);

参数

[in] UfxDevice

驱动程序通过调用 UfxDeviceCreate 创建的 UFX 设备对象的句柄。

返回值

备注

客户端驱动程序通常从其 EvtDeviceD0Entry 回调函数调用 UfxDeviceNotifyHardwareReady,如以下示例所示。

NTSTATUS
OnEvtDeviceD0Entry (
  _In_ WDFDEVICE Device,
  _In_ WDF_POWER_DEVICE_STATE PreviousState
)
/*++

Routine Description:

    Called by the framework after entering D0 state.

Arguments:

    Device - WDFDEVICE framework handle to the bus FDO.

    PreviousState - The WDF_POWER_DEVICE_STATE from which the stack is
        making this transition.

Return Value:

    Returns STATUS_SUCCESS or an appropriate NTSTATUS code otherwise.

--*/
{
    PCONTROLLER_CONTEXT ControllerContext;

    TraceEntry();

    ControllerContext = DeviceGetControllerContext(Device);

    if (PreviousState > WdfPowerDeviceD1) { 
        DevicePerformSoftReset(Device);

        WdfWaitLockAcquire(ControllerContext->InitializeDefaultEndpointLock, NULL);
        ControllerContext->InitializeDefaultEndpoint = TRUE;
        WdfWaitLockRelease(ControllerContext->InitializeDefaultEndpointLock);
    }

    if (PreviousState == WdfPowerDeviceD3Final) {
        //
        // Notify UFX that HW is now ready
        //
        UfxDeviceNotifyHardwareReady(ControllerContext->UfxDevice);
    }

    TraceExit();
    return STATUS_SUCCESS;
}

要求

要求
最低受支持的客户端 Windows 10
目标平台 Windows
标头 ufxclient.h
Library ufxstub.lib
IRQL DISPATCH_LEVEL