PreGetSize Method

IMallocSpy::PreGetSize method

Performs operations required before calling IMalloc::GetSize.

Syntax


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

Parameters

pRequest [in]

The pointer that the caller is passing to GetSize.

fSpyed [in]

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

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

ObjIdl.h

IDL

ObjIdl.idl

IID

IID_IMallocSpy is defined as 0000001d-0000-0000-C000-000000000046

See also

IMalloc::GetSize
IMallocSpy
IMallocSpy::PostGetSize

 

 

Show:
© 2016 Microsoft