IMallocSpy::PreGetSize method (objidl.h)

Performs operations required before calling IMalloc::GetSize.

Syntax

void * PreGetSize(
  [in] void *pRequest,
  [in] BOOL fSpyed
);

Parameters

[in] pRequest

The pointer that the caller is passing to GetSize.

[in] fSpyed

Indicates whether the block of memory was allocated while the current spy was active.

Return value

A pointer to the actual allocation for which the size is to be determined.

Remarks

The 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 PreAlloc or the PreRealloc method of IMallocSpy. The pointer to the true allocation is then passed to GetSize as its pv parameter.

IMalloc::GetSize then returns the size determined, and COM passes this value to IMallocSpy::PostGetSize in cbActual.

The size determined by GetSize is the value returned by the HeapSize function. This is the size originally requested. For example, a memory allocation request of 27 bytes returns an allocation of 32 bytes and GetSize returns 27.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header objidl.h

See also

IMalloc::GetSize

IMallocSpy

IMallocSpy::PostGetSize