Freigeben über


UfxDeviceNotifyHardwareReady-Funktion (ufxclient.h)

Benachrichtigt UFX, dass die Hardware bereit ist.

Syntax

void UfxDeviceNotifyHardwareReady(
  [in] UFXDEVICE UfxDevice
);

Parameter

[in] UfxDevice

Ein Handle für ein UFX-Geräteobjekt, das vom Treiber erstellt wurde, indem UfxDeviceCreateaufgerufen wird.

Rückgabewert

Nichts

Bemerkungen

Der Clienttreiber ruft in der Regel UfxDeviceNotifyHardwareReady- aus seinem EvtDeviceD0Entry Rückruffunktion auf, wie im folgenden Beispiel gezeigt.

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

Anforderungen

Anforderung Wert
mindestens unterstützte Client- Windows 10
Zielplattform- Fenster
Header- ufxclient.h
Library ufxstub.lib
IRQL- DISPATCH_LEVEL