Rediger

Del via


WdfObjectDereference macro

[Applies to KMDF and UMDF]

The WdfObjectDereference macro decrements the reference count for a specified framework object.

Syntax

VOID WdfObjectDereference(
  [in] WDFOBJECT Handle
);

Parameters

Handle [in]
A handle to a framework object.

Return value

None.

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

Remarks

If the object's reference count becomes zero, the object might be deleted before WdfObjectDereference returns.

A driver can call WdfObjectDereference only if it has previously called WdfObjectReference.

Instead of calling WdfObjectDereference, a driver can call WdfObjectDereferenceWithTag or WdfObjectDereferenceActual.

For more information about object reference counts, see Framework Object Life Cycle.

Examples

The following code example decrements an object's reference count.

WdfObjectDereference(Object); 

Requirements

Target platform

Universal

Minimum KMDF version

1.0

Minimum UMDF version

2.0

Header

Wdfobject.h (include Wdf.h)

Library

Wdf01000.sys (KMDF); WUDFx02000.dll (UMDF)

IRQL

<= DISPATCH_LEVEL

DDI compliance rules

DriverCreate, MemAfterReqCompletedIntIoctlA, MemAfterReqCompletedIoctlA, MemAfterReqCompletedReadA, MemAfterReqCompletedWriteA, wdfioqueuefindrequestfailed, wdfioqueueretrievefoundrequest

See also

WdfObjectDereferenceActual

WdfObjectDereferenceWithTag

WdfObjectReference