WdfFileObjectWdmGetFileObject method

WdfFileObjectWdmGetFileObject 方法

The WdfFileObjectWdmGetFileObject method returns the Windows Driver Model (WDM) file object that is associated with a specified framework file object.

语法

PFILE_OBJECT WdfFileObjectWdmGetFileObject(
  [in]  WDFFILEOBJECT FileObject
);

参数

FileObject [in]

A handle to a framework file object.

返回值

WdfFileObjectWdmGetFileObject returns a pointer to the FILE_OBJECT structure that is associated with the specified framework file object, or NULL if there is no WDM file object for the specified framework file object.

A bug check occurs if the driver supplies an invalid object handle.

评论

The pointer that the WdfFileObjectWdmGetFileObject method returns is valid until the framework file object is deleted. If the driver provides an EvtCleanupCallback function for the framework file object, the pointer is valid until the callback function returns.

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

示例

The following code example obtains a handle to the WDM file object that is associated with a specified framework file object.

PFILE_OBJECT  pReturnedFileObject;

pReturnedFileObject = WdfFileObjectWdmGetFileObject(fileObject);

要求

版本

Available in version 1.0 and later versions of KMDF.

标头

Wdffileobject.h (包括Wdf.h)

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

IRQL

<=DISPATCH_LEVEL

另请参见

FILE_OBJECT

 

 

社区附加资源

添加
显示:
© 2016 Microsoft