IObjectCleanup::OnCleanup method (wudfddi.h)

[Warning: UMDF 2 is the latest version of UMDF and supersedes UMDF 1. All new UMDF drivers should be written using UMDF 2. No new features are being added to UMDF 1 and there is limited support for UMDF 1 on newer versions of Windows 10. Universal Windows drivers must use UMDF 2. For more info, see Getting Started with UMDF.]

The OnCleanup method releases any references to a WDF object to prevent interface leakage.

Syntax

void OnCleanup(
  [in] IWDFObject *pWdfObject
);

Parameters

[in] pWdfObject

A pointer to the IWDFObject interface of an object that is about to be released.

Return value

None

Remarks

The framework calls OnCleanup as part of a WDF object destruction sequence. The framework calls OnCleanup before the WDF object is destroyed.

A driver can register the IObjectCleanup interface when the driver calls any of the following methods that creates a WDF object or that assigns a context to the WDF object:

Requirements

Requirement Value
Target Platform Windows
Header wudfddi.h (include Wudfddi.h)

See also

IObjectCleanup

IWDFDevice::CreateIoQueue

IWDFDevice::CreateRequest

IWDFDriver::CreateDevice

IWDFDriver::CreatePreallocatedWdfMemory

IWDFDriver::CreateWdfMemory

IWDFDriver::CreateWdfObject

IWDFObject

IWDFObject::AssignContext