|
IMallocSpy::PreGetSize
Called just prior to invoking IMalloc::GetSize.
PreGetSize(
void * pRequest,
| //Pointer the caller is passing to IMalloc::GetSize
| BOOL fSpyed
| //TRUE if allocation done while this spy was active
| );
|
|
Parameters
pRequest
The pointer the caller is passing to IMalloc::GetSize
fSpyed
TRUE if the allocation was done while the spy was active.
Return Value
Pointer to the actual allocation for which the size is to be determined.
Comments
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 is then passed
to PostGetSize as the pRequest parameter.
The size determined by IMalloc::GetSize is then passed to IMallocSpy::PostGetSize as cbActual.
Note The size determined by IMalloc::GetSize is the value returned by the Win32 API HeapSize. On Windows NT, this is the size originally requested. On Windows95, memory
allocations are done on eight-byte boundaries. For example, a memory allocation
request of 27 bytes on Windows NT would return an allocation of 32 bytes and GetSize would return 27. On Windows95, the same request would return an allocation of
28 bytes and GetSize would return 28. Implementors of IMallocSpy::PostGetSize cannot assume, for example, that if cbActual is sizeof(debug_header), that the value is the actual size of the user's
allocation.
See Also
IMalloc::GetSize, IMallocSpy::PostGetSize, CoRegisterMallocSpy, CoRevokeMallocSpy
Related LinksSoftware for Delphi and C++ Builder developers Software for Visual Studio .NET developers Software for Visual Basic 6 developers Delphi Tips&Tricks
MegaDetailed.NET
TMS Scripter Studio Pro components for Delphi/C++Builder
More Online Helps Win32 Programmer's Reference (win32.hlp) Win32 Multimedia Programmer's Reference (mmedia.hlp) Microsoft Windows Pen API Programmer's Reference (penapi.hlp) Microsoft Windows Sockets 2 Reference (sock2.hlp) Microsoft Windows Telephony API (TAPI) Programmer's Reference (sock2.hlp) Unix Manual Pages
|