WDF_IO_TARGET_OPEN_PARAMS_INIT_OPEN_BY_NAME function (wdfiotarget.h)

[Applies to KMDF and UMDF]

The WDF_IO_TARGET_OPEN_PARAMS_INIT_OPEN_BY_NAME function initializes a driver's WDF_IO_TARGET_OPEN_PARAMS structure so the driver can open an I/O target by specifying the name of the device, file, or device interface. If the supplied name does not exist, the system will not try to create it.

Syntax

void WDF_IO_TARGET_OPEN_PARAMS_INIT_OPEN_BY_NAME(
  [out] PWDF_IO_TARGET_OPEN_PARAMS Params,
  [in]  PCUNICODE_STRING           TargetDeviceName,
  [in]  ACCESS_MASK                DesiredAccess
);

Parameters

[out] Params

A pointer to a driver-allocated WDF_IO_TARGET_OPEN_PARAMS structure, which the function initializes.

[in] TargetDeviceName

A value for the TargetDeviceName member of the WDF_IO_TARGET_OPEN_PARAMS structure.

[in] DesiredAccess

A value for the DesiredAccess member of the WDF_IO_TARGET_OPEN_PARAMS structure.

Return value

None

Remarks

If TargetDeviceName specifies the name of a file that already exists, the system opens the existing file. If the file does not exist, the open operation fails.

The WDF_IO_TARGET_OPEN_PARAMS structure is used as input to the WdfIoTargetOpen method.

The WDF_IO_TARGET_OPEN_PARAMS_INIT_OPEN_BY_NAME function initializes the Size, Type, TargetDeviceName, DesiredAccess, CreateOptions, and CreateDisposition members of the specified WDF_IO_TARGET_OPEN_PARAMS structure.

KMDF The WDF_IO_TARGET_OPEN_PARAMS_INIT_OPEN_BY_NAME function initializes the CreateDisposition member to FILE_OPEN.

UMDF The WDF_IO_TARGET_OPEN_PARAMS_INIT_OPEN_BY_NAME function initializes the CreateDisposition member to OPEN_EXISTING.

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

Examples

For a code example that uses WDF_IO_TARGET_OPEN_PARAMS_INIT_OPEN_BY_NAME, see WdfIoTargetOpen.

Requirements

Requirement Value
Target Platform Universal
Minimum KMDF version 1.0
Minimum UMDF version 2.0
Header wdfiotarget.h (include Wdf.h)
IRQL Any level

See also

WDF_IO_TARGET_OPEN_PARAMS

WDF_IO_TARGET_OPEN_PARAMS_INIT_CREATE_BY_NAME

WDF_IO_TARGET_OPEN_PARAMS_INIT_EXISTING_DEVICE

WdfIoTargetOpen