情報
要求されたトピックは次のとおりです。しかし、このトピックはこのライブラリには含まれていません。

WdfIoTargetOpen メソッド

The WdfIoTargetOpen method opens a remote I/O target so the driver can send I/O requests to it.

構文

NTSTATUS WdfIoTargetOpen(
  [in]  WDFIOTARGET IoTarget,
  [in]  PWDF_IO_TARGET_OPEN_PARAMS OpenParams
);

パラメーター

IoTarget [in]

A handle to an I/O target object that was obtained from a previous call to WdfIoTargetCreate.

OpenParams [in]

A pointer to a caller-allocated WDF_IO_TARGET_OPEN_PARAMS structure.

戻り値

WdfIoTargetOpen returns STATUS_SUCCESS if the operation succeeds. Otherwise, this method might return one of the following values:

リターン コード説明
STATUS_INVALID_DEVICE_STATE

The specified I/O target is already open.

STATUS_INSUFFICIENT_RESOURCES

Available system resources were insufficient to complete the operation.

STATUS_INFO_LENGTH_MISMATCH

The size of the WDF_IO_TARGET_OPEN_PARAMS structure that OpenParams specified was incorrect.

STATUS_NO_SUCH_DEVICE

The TargetFileObject member of the caller's WDF_IO_TARGET_OPEN_PARAMS structure specified an invalid file object.

STATUS_INVALID_PARAMETER

An invalid parameter was detected.

 

This method also might return other NTSTATUS values.

A bug check occurs if the driver supplies an invalid object handle.

解説

Drivers can open remote I/O targets by supplying a Unicode string that represents an object name or by supplying a pointer to a Windows Driver Model (WDM) DEVICE_OBJECT structure. (Framework-based drivers typically do not have pointers to other drivers' DEVICE_OBJECT structures.)

If you want your driver to use its local I/O target, the driver must call WdfDeviceGetIoTarget instead of WdfIoTargetOpen.

If a call to WdfIoTargetOpen fails, the driver should call WdfObjectDelete to delete the I/O target object.

For more information about WdfIoTargetOpen, see Initializing a General I/O Target.

For more information about I/O targets, see Using I/O Targets.

The following example creates an I/O target object, initializes a WDF_IO_TARGET_OPEN_PARAMS structure, and opens a remote I/O target by specifying a device's symbolic link name.

WDF_OBJECT_ATTRIBUTES  ioTargetAttrib;
WDFIOTARGET  ioTarget;
WDF_IO_TARGET_OPEN_PARAMS  openParams;

WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(
                                        &ioTargetAttrib,
                                        TARGET_DEVICE_INFO
                                        );
status = WdfIoTargetCreate(
                           device,
                           &ioTargetAttrib,
                           &ioTarget
                           );
if (!NT_SUCCESS(status)) {
    return status;
}
WDF_IO_TARGET_OPEN_PARAMS_INIT_OPEN_BY_NAME(
                                            &openParams,
                                            SymbolicLink,
                                            STANDARD_RIGHTS_ALL
                                            );
status = WdfIoTargetOpen(
                         ioTarget,
                         &openParams
                         );
if (!NT_SUCCESS(status)) {
    WdfObjectDelete(ioTarget);
    return status;
}

要件

バージョン

Available in version 1.0 and later versions of KMDF.

ヘッダー

Wdfiotarget.h (includeWdf.h)

ライブラリ

Wdf<MajorVersionNumber>000.sys (see Framework Library Versions.)

IRQL

PASSIVE_LEVEL

参照

DEVICE_OBJECT
WDF_IO_TARGET_OPEN_PARAMS
WdfDeviceGetIoTarget
WdfIoTargetClose
WdfIoTargetCreate
WdfIoTargetOpen
WdfObjectDelete

 

 

コミュニティの追加

表示:
© 2014 Microsoft