Skip to content

Latest commit

 

History

History
118 lines (96 loc) · 3.8 KB

nf-objbase-corevokemallocspy.md

File metadata and controls

118 lines (96 loc) · 3.8 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:objbase.CoRevokeMallocSpy
CoRevokeMallocSpy function (objbase.h)
Revokes a registered IMallocSpy object.
CoRevokeMallocSpy
CoRevokeMallocSpy function [COM]
_com_CoRevokeMallocSpy
com.corevokemallocspy
objbase/CoRevokeMallocSpy
com\corevokemallocspy.htm
com
e1e984a2-2aee-452c-840c-42201ef5ee96
12/05/2018
CoRevokeMallocSpy, CoRevokeMallocSpy function [COM], _com_CoRevokeMallocSpy, com.corevokemallocspy, objbase/CoRevokeMallocSpy
objbase.h
Windows
Windows 2000 Professional [desktop apps only]
Windows 2000 Server [desktop apps only]
Ole32.lib
Ole32.dll
Windows
19H1
CoRevokeMallocSpy
objbase/CoRevokeMallocSpy
c++
APIRef
kbSyntax
DllExport
Ole32.dll
API-MS-Win-Core-Com-private-l1-1-0.dll
ComBase.dll
API-MS-Win-Core-COM-Private-l1-1-1.dll
CoRevokeMallocSpy

CoRevokeMallocSpy function

-description

Revokes a registered IMallocSpy object.

-returns

This function can return the following values.

Return code Description
S_OK
The object was revoked successfully.
CO_E_OBJNOTREG
No spy is currently registered.
E_ACCESSDENIED
A spy is registered but there are outstanding allocations (not yet freed) made while this spy was active.

-remarks

The IMallocSpy object is released when it is revoked. This release corresponds to the call to IUnknown::AddRef in the implementation of the QueryInterface function by the CoRegisterMallocSpy function. The implementation of the IMallocSpy interface should then do any appropriate cleanup.

If the return code is E_ACCESSDENIED, there are still outstanding allocations that were made while the spy was active. In this case, the registered spy cannot be revoked at this time because it may have attached arbitrary headers and/or trailers to these allocations that only the spy knows about. Only the spy's PreFree (or PreRealloc) method knows how to account for these headers and trailers. Before returning E_ACCESSDENIED, CoRevokeMallocSpy notes internally that a revoke is pending. When the outstanding allocations have been freed, the revoke proceeds automatically, releasing the IMallocSpy object. Thus, it is necessary to call CoRevokeMallocSpy only once for each call to CoRegisterMallocSpy, even if E_ACCESSDENIED is returned.

-see-also

CoRegisterMallocSpy

IMallocSpy