Skip to content

Latest commit

 

History

History
88 lines (64 loc) · 3.58 KB

nf-objidl-imallocspy-pregetsize.md

File metadata and controls

88 lines (64 loc) · 3.58 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:objidl.IMallocSpy.PreGetSize
IMallocSpy::PreGetSize (objidl.h)
Performs operations required before calling IMalloc::GetSize.
IMallocSpy interface [COM]
PreGetSize method
IMallocSpy.PreGetSize
IMallocSpy::PreGetSize
PreGetSize
PreGetSize method [COM]
PreGetSize method [COM]
IMallocSpy interface
_com_imallocspy_pregetsize
com.imallocspy_pregetsize
objidl/IMallocSpy::PreGetSize
com\imallocspy_pregetsize.htm
com
7bebc327-490e-4a41-8043-5d7211e645f5
12/05/2018
IMallocSpy interface [COM],PreGetSize method, IMallocSpy.PreGetSize, IMallocSpy::PreGetSize, PreGetSize, PreGetSize method [COM], PreGetSize method [COM],IMallocSpy interface, _com_imallocspy_pregetsize, com.imallocspy_pregetsize, objidl/IMallocSpy::PreGetSize
objidl.h
Windows
Windows 2000 Professional [desktop apps only]
Windows 2000 Server [desktop apps only]
ObjIdl.idl
Windows
19H1
IMallocSpy::PreGetSize
objidl/IMallocSpy::PreGetSize
c++
APIRef
kbSyntax
COM
ObjIdl.h
IMallocSpy.PreGetSize

IMallocSpy::PreGetSize

-description

Performs operations required before calling IMalloc::GetSize.

-parameters

-param pRequest [in]

The pointer that the caller is passing to GetSize.

-param fSpyed [in]

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

-returns

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.

-see-also

IMalloc::GetSize

IMallocSpy

IMallocSpy::PostGetSize