WdfObjectDelete 方法

The WdfObjectDelete method deletes a framework object and its child objects.

语法

VOID WdfObjectDelete(
  [in]  WDFOBJECT Object
);

参数

Object [in]

A handle to framework object.

返回值

None.

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

评论

After a driver calls WdfObjectDelete, the specified object is deleted after its reference count becomes zero.

Drivers cannot call WdfObjectDelete to delete the following framework objects, because the framework always handles deletion of these objects:

  • Framework child-list objects

  • Framework device objects (unless the driver has called WdfControlDeviceInitAllocate and created a control device object, which the driver must sometimes delete)

  • Framework driver objects

  • Framework file objects

  • Framework interrupt objects

  • Framework queue objects, if an object represents a default I/O queue or if the driver has called WdfDeviceConfigureRequestDispatching to set up the queue to receive all I/O requests of a particular type

  • Framework USB pipe objects

  • Framework USB interface objects

  • Framework WMI provider objects

The WdfObjectDelete method can return before the framework has deleted the object and its child objects. The order in which the framework deletes child objects is not predictable.

For more information about WdfObjectDelete, see Framework Object Life Cycle.

The WdfObjectDelete method must be called at IRQL <= DISPATCH_LEVEL. If your driver is deleting a control device object, WdfObjectDelete must be called at IRQL = PASSIVE_LEVEL. Similarly, if your driver is deleting a common buffer, WdfObjectDelete must be called at IRQL = PASSIVE_LEVEL.

示例

The following code example deletes a framework object and its child objects.

WdfObjectDelete(Object);

要求

版本

Available in version 1.0 and later versions of KMDF.

标头

Wdfobject.h (包括Wdf.h)

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

IRQL

See Remarks section.

另请参见

WdfControlDeviceInitAllocate
WdfObjectCreate

 

 

社区附加资源

添加
显示:
© 2015 Microsoft