WDF_FILEOBJECT_CONFIG - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// wdfdevice.h

typedef struct _WDF_FILEOBJECT_CONFIG {
  ULONG                      Size;
  PFN_WDF_DEVICE_FILE_CREATE EvtDeviceFileCreate;
  PFN_WDF_FILE_CLOSE         EvtFileClose;
  PFN_WDF_FILE_CLEANUP       EvtFileCleanup;
  WDF_TRI_STATE              AutoForwardCleanupClose;
  WDF_FILEOBJECT_CLASS       FileObjectClass;
} WDF_FILEOBJECT_CONFIG, *PWDF_FILEOBJECT_CONFIG;

View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (ns-wdfdevice-_wdf_fileobject_config)

_WDF_FILEOBJECT_CONFIG structure

Description

[Applies to KMDF and UMDF]

The WDF_FILEOBJECT_CONFIG structure contains configuration information of a driver's framework file objects.

Members

Size

The size, in bytes, of this structure.

EvtDeviceFileCreate

A pointer to the driver's EvtDeviceFileCreate callback function, or NULL.

EvtFileClose

A pointer to the driver's EvtFileClose callback function, or NULL.

EvtFileCleanup

A pointer to the driver's EvtFileCleanup callback function, or NULL.

AutoForwardCleanupClose

A WDF_TRI_STATE-typed value. For more information about this member, see the following Comments section.

FileObjectClass

A WDF_FILEOBJECT_CLASS-typed value that identifies whether the driver requires a framework file object to represent each file that an application or another driver creates or opens. Additionally, this value specifies where the framework can store the object's handle.

Remarks

The WDF_FILEOBJECT_CONFIG structure is used as input to the WdfDeviceInitSetFileObjectConfig method.

WDF_FILEOBJECT_CONFIG must be initialized by calling WDF_FILEOBJECT_CONFIG_INIT.

Framework Behavior for AutoForwardCleanupClose

If AutoForwardCleanupClose is set to WdfTrue, the framework does the following:

If AutoForwardCleanupClose is set to WdfFalse, the framework does not forward file creation, cleanup, or close requests. Instead, the framework completes the requests for the driver.

If AutoForwardCleanupClose is set to WdfUseDefault, the framework uses WdfTrue behavior for filter drivers and WdfFalse behavior for function drivers.

Driver Behavior for AutoForwardCleanupClose

Your driver's local I/O target must always receive an equal number of I/O requests with request types of WdfRequestTypeCreate, WdfRequestTypeCleanup, and WdfRequestTypeClose. Therefore, if the driver provides either an EvtDeviceFileCreate callback function or an I/O queue that receives file creation requests, you must use the following rules: