// wdfobject.h
VOID WdfObjectDereferenceWithTag(
[in] WDFOBJECT Handle,
[in] PVOID Tag
);
View the official Windows hardware development documentationNo description available.
[Applies to KMDF and UMDF]
The WdfObjectDereferenceWithTag macro decrements the reference count for a specified framework object and assigns the driver's current file name and line number to the reference. This macro also assigns a tag value to the reference.
Handle [in] A handle to a framework object.
Tag [in] A driver-defined value that identifies an object reference. The tag value must match a tag value that the driver previously supplied to WdfObjectReferenceWithTag.
None.
A bug check occurs if the driver supplies an invalid object handle.
If the object's reference count becomes zero, the object might be deleted before WdfObjectDereferenceWithTag returns.
Calling WdfObjectDereferenceActual or WdfObjectDereferenceWithTag instead of WdfObjectDereference provides additional information (tag string, line number, and file name) to Microsoft debuggers. WdfObjectDereferenceActual allows your driver to specify the line number and file name, while WdfObjectDereferenceWithTag uses the driver's current line number and file name.
You can view the tag, line number, and file name values by using the !wdftagtracker debugger extension. The debugger extension displays the tag value as both a pointer and a series of characters. For more about debugger extensions, see Debugging a KMDF Driver.
For more information about object reference counts, see Framework Object Life Cycle.
The following code example decrements an object's reference count and assigns a tag value to the reference.
WdfObjectDereferenceWithTag(
object,
pTag
);
| 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 |