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 構造体へのポインターを受け取ります。 次に、このポインター UfxFdoInit を呼び出してから、WdfDeviceCreate 呼び出して WDFDEVICE オブジェクトを作成します。
既定では、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 |
ターゲット プラットフォーム の | ウィンドウズ |
ヘッダー | ufxclient.h |
ライブラリ | ufxstub.lib |
IRQL | PASSIVE_LEVEL |