IMallocSpy::PreGetSize
A version of this page is also available for
4/8/2010
This method is called by COM just prior to any call to the IMalloc::GetSize method.
Syntax
void* PreGetSize(
void* pRequest,
BOOL fSpyed
);
Parameters
- pRequest
[in] Pointer the caller is passing to IMalloc::GetSize.
- fSpyed
[in] TRUE if the allocation was done while the spy was active, otherwise FALSE.
Return Value
Pointer to the actual allocation for which the size is to be determined.
Remarks
The IMallocSpy::PreGetSize method receives as its pRequest parameter the pointer the caller is passing to IMalloc::GetSize.
It must then return a pointer to the actual allocation, which may have altered pRequest in the implementation of either the IMallocSpy::PreAlloc method or the IMallocSpy::PreRealloc method.
The pointer to the true allocation is then passed to IMalloc::GetSize as its pv parameter.
IMalloc::GetSize then returns the size determined, and COM passes this value to the IMallocSpy::PostGetSize method in cbActual.
Note
The size determined by IMalloc::GetSize is the value returned by the Win32 function HeapSize. Implementers of IMallocSpy::PostGetSize cannot assume that if cbActual is sizeof(debug_header), the value is the actual size of the user's allocation.
To determine whether the platform supports this interface, see Determining Supported COM APIs.
Requirements
Header | objidl.h, objidl.idl |
Library | ole32.lib |
Windows Embedded CE | Windows CE 3.0 and later |
Windows Mobile | Windows Mobile Version 5.0 and later |
See Also
Reference
CoRegisterMallocSpy
CoRevokeMallocSpy
IMalloc::GetSize
IMallocSpy::PostGetSize
IMallocSpy::PreAlloc
IMallocSpy::PreRealloc