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

Parameters

Params [out]

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

TargetDeviceName [in]

A value for the TargetDeviceName member of the WDF_IO_TARGET_OPEN_PARAMS structure.

DesiredAccess [in]

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_EXISTING_DEVICE
WDF_IO_TARGET_OPEN_PARAMS_INIT_CREATE_BY_NAME
WdfIoTargetOpen

 

 

Send comments about this topic to Microsoft

Show:
© 2015 Microsoft