EVT_WDF_DEVICE_FILE_CREATE callback function (wdfdevice.h)

[Applies to KMDF and UMDF]

A driver's EvtDeviceFileCreate callback function handles operations that must be performed when an application requests access to a device.

Syntax

EVT_WDF_DEVICE_FILE_CREATE EvtWdfDeviceFileCreate;

void EvtWdfDeviceFileCreate(
  [in] WDFDEVICE Device,
  [in] WDFREQUEST Request,
  [in] WDFFILEOBJECT FileObject
)
{...}

Parameters

[in] Device

A handle to a framework device object.

[in] Request

A handle to a framework request object that represents a file creation request.

[in] FileObject

A handle to a framework file object that describes a file that is being opened for the specified request. This parameter is NULL if the driver has specified WdfFileObjectNotRequired for the FileObjectClass member of the WDF_FILEOBJECT_CONFIG structure.

Return value

None

Remarks

The framework calls a driver's EvtDeviceFileCreate callback function when a user application or another driver opens the device to perform an I/O operation, such as reading or writing a file.

The driver can pass the Request handle to WdfRequestGetParameters to retrieve parameters that are associated with the file creation request. The parameters are stored in the Parameters.Create member of the WDF_REQUEST_PARAMETERS structure.

This callback function is called synchronously, in the context of the thread that opens the device.

To register an EvtDeviceFileCreate callback function, the driver must call the WdfDeviceInitSetFileObjectConfig method.

The driver must either complete the request or send it with WDF_REQUEST_SEND_OPTION_SEND_AND_FORGET.

Alternatively, the driver can receive create requests in a queue. For more info, see WdfDeviceConfigureRequestDispatching.

For more information about framework file objects and the EvtDeviceFileCreate callback function, see Framework File Objects.

Requirements

Requirement Value
Target Platform Universal
Minimum KMDF version 1.0
Minimum UMDF version 2.0
Header wdfdevice.h (include Wdf.h)
IRQL PASSIVE_LEVEL

See also

WDF_FILEOBJECT_CONFIG