信息
您所需的主题如下所示。但此主题未包含在此库中。

WdfDeviceInitSetFileObjectConfig 方法

The WdfDeviceInitSetFileObjectConfig method registers event callback functions and sets configuration information for the driver's framework file objects.

语法

VOID WdfDeviceInitSetFileObjectConfig(
  [in]            PWDFDEVICE_INIT DeviceInit,
  [in]            PWDF_FILEOBJECT_CONFIG FileObjectConfig,
  [in, optional]  PWDF_OBJECT_ATTRIBUTES FileObjectAttributes
);

参数

DeviceInit [in]

A pointer to a WDFDEVICE_INIT structure.

FileObjectConfig [in]

A pointer to a caller-allocated WDF_FILEOBJECT_CONFIG structure.

FileObjectAttributes [in, optional]

A pointer to a caller-allocated WDF_OBJECT_ATTRIBUTES structure that contains driver-supplied object attributes for the driver's framework file objects. This parameter is optional and can be WDF_NO_OBJECT_ATTRIBUTES.

返回值

None

评论

If a driver calls WdfDeviceInitSetFileObjectConfig, it must do so before it calls WdfDeviceCreate.

By default, each framework file object inherits its synchronization scope and execution level from its parent device object. If the parent device object's synchronization scope and execution level are not WdfSynchronizationScopeNone and WdfExecutionLevelPassive, the driver must set the WdfSynchronizationScopeNone and WdfExecutionLevelPassive values in the WDF_OBJECT_ATTRIBUTES structure that the FileObjectAttributes parameter specifies. Otherwise, WdfDeviceCreate will return an error status code. For more information about synchronization scope and execution level, see Using Automatic Synchronization.

For more information about calling WdfDeviceCreate, see Creating a Framework Device Object.

For more information about framework file objects, see Framework File Objects

示例

The following code example initializes a WDF_OBJECT_ATTRIBUTES structure and a WDF_FILEOBJECT_CONFIG structure and then calls WdfDeviceInitSetFileObjectConfig.

WDF_OBJECT_ATTRIBUTES  attributes;

WDF_OBJECT_ATTRIBUTES_INIT(&attributes);
attributes.SynchronizationScope = WdfSynchronizationScopeNone;
WDF_FILEOBJECT_CONFIG_INIT(
                           &deviceConfig,
                           MyEvtDeviceFileCreate,
                           MyEvtFileClose,
                           WDF_NO_EVENT_CALLBACK // No cleanup callback function
                           );
WdfDeviceInitSetFileObjectConfig(
                                 DeviceInit,
                                 &deviceConfig,
                                 &attributes
                                 );

要求

版本

Available in version 1.0 and later versions of KMDF.

标头

Wdfdevice.h (包括Wdf.h)

Wdf<MajorVersionNumber>000.sys (see Framework Library Versions.)

IRQL

<= DISPATCH_LEVEL

另请参见

WDF_OBJECT_ATTRIBUTES_INIT
WDF_FILEOBJECT_CONFIG_INIT
WdfFdoInitSetEventCallbacks
WdfPdoInitSetEventCallbacks

 

 

社区附加资源

显示:
© 2014 Microsoft