IMallocSpy::PreGetSize (Compact 2013)

3/26/2014

This method is called by COM just prior to any call to the IMalloc::GetSize method.


void* PreGetSize(
  void* pRequest, 
  BOOL fSpyed 
);

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.

Pointer to the actual allocation for which the size is to be determined.

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.

Ee488530.note(en-us,WinEmbedded.80).gifNote:
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.

Header

objidl.h,
objidl.idl

Library

ole32.lib

Show: