CoRegisterMallocSpy
Registers an
implementation of the IMallocSpy
HRESULT CoRegisterMallocSpy(
LPMALLOCSPY pMallocSpy |
//Pointer to the interface |
); |
|
Parameter
pMallocSpy
[in] Pointer
to an instance of the IMallocSpy
Return Values
This function
supports the standard return value E_INVALIDARG, as well as the following:
S_OK
The IMallocSpy
object is successfully registered.
CO_E_OBJISREG
There is
already a registered spy.
Remarks
The CoRegisterMallocSpy
function registers the IMallocSpy
When the IMallocSpy
object is registered, whenever there is a call to one of the IMalloc
methods, OLE first calls the corresponding IMallocSpy pre-method. Then,
after executing the IMalloc method, OLE calls the corresponding IMallocSpy
post-method. For example, whenever there is a call to IMalloc::Alloc,
from whatever source, OLE calls IMallocSpy::PreAlloc, calls IMalloc::Alloc,
and after that allocation is completed, calls IMallocSpy::PostAlloc.
See Also