WDF_IO_TARGET_OPEN_PARAMS_INIT_OPEN_BY_NAME function

[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(
  PWDF_IO_TARGET_OPEN_PARAMS Params,
  PCUNICODE_STRING           TargetDeviceName,
  ACCESS_MASK                DesiredAccess
);

Parameters

Params

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

TargetDeviceName

A value for the TargetDeviceName member of the WDF_IO_TARGET_OPEN_PARAMS structure.

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

   
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