UfxFdoInit 関数 (ufxclient.h)

クライアント ドライバーが WdfDeviceCreate を呼び出すときに後で提供するWDFDEVICE_INIT構造体を初期化します。

構文

NTSTATUS UfxFdoInit(
  [in]      WDFDRIVER              WdfDriver,
  [in, out] PWDFDEVICE_INIT        DeviceInit,
  [in, out] PWDF_OBJECT_ATTRIBUTES FdoAttributes
);

パラメーター

[in] WdfDriver

ドライバーが WdfDriverCreate または WdfGetDriver の以前の呼び出しから取得したドライバーの WDF ドライバー オブジェクトへのハンドル。

[in, out] DeviceInit

WDFDEVICE_INIT構造体へのポインター。

[in, out] FdoAttributes

のオブジェクト属性を記述する呼び出し元によって割り当てられた WDF_OBJECT_ATTRIBUTES 構造体へのポインター。

戻り値

操作が成功した場合、メソッドは STATUS_SUCCESS、または NT_SUCCESS(status) が TRUE である別の状態値を返します。 それ以外の場合は、NT_SUCCESS(status) が FALSE である状態値を返します。

注釈

クライアント ドライバーは、EvtDriverDeviceAdd コールバック関数でフレームワークによって割り当てられたWDFDEVICE_INIT構造体へのポインターを受け取ります。 次に、WdfDeviceCreate を呼び出して WDFDEVICE オブジェクトを作成する前に、このポインターで UfxFdoInit を呼び出します。

既定では、WDF ドライバーの場合、デバイスのファンクション ドライバーは電源ポリシー所有者です。

次のコード スニペットは、 UfxFdoInit を呼び出す方法を示しています。

NTSTATUS
UfxClientDeviceCreate(
    _In_ WDFDRIVER Driver,
    _In_ PWDFDEVICE_INIT DeviceInit
    )
/*++

Routine Description:

    Worker routine called to create a device and its software resources.

Arguments:

    Driver - WDF driver object

    DeviceInit - Pointer to an opaque init structure. Memory for this
                 structure will be freed by the framework when WdfDeviceCreate
                 succeeds. So don't access the structure after that point.

Return Value:

    Appropriate NTSTATUS value

--*/
{
    WDF_OBJECT_ATTRIBUTES DeviceAttributes;
    WDFDEVICE WdfDevice;

    PAGED_CODE();

    WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&DeviceAttributes, CONTROLLER_CONTEXT);

    //
    // Do UFX-specific initialization
    //
    Status = UfxFdoInit(Driver, DeviceInit, &DeviceAttributes);

    //
    // Proceed to WdfDeviceCreate
    //
    
    ...

}

要件

要件
サポートされている最小のクライアント Windows 10
対象プラットフォーム Windows
ヘッダー ufxclient.h
Library ufxstub.lib
IRQL PASSIVE_LEVEL