Index   Commented   Search   About

IMallocSpy::PreFree

Called just before invoking IMalloc::Free.

  • oid * PreFree(

void * pRequest,
//The pointer is passing to IMalloc::Free
BOOL fSpyed
//TRUE if this memory was allocated while the spy was active
);

Parameters

pRequest

The pointer to the block of memory that the caller is passing to IMalloc::Free.

fSpyed

The value is TRUE if the pRequest parameter of IMallocSpy::PreFree was allocated while the spy was installed. This value is also passed to IMallocSpy::PostFree.

Return Value

The actual pointer to pass to IMalloc::Free.

Comments

If the PreAlloc method modified the original allocation, PreFree needs to compute the actual pointer to be passed to IMalloc::Free. For example, if the PreAlloc/PostAlloc pair attached a header used to store debug information to the beginning of the user's allocation, then PreFree would return a pointer to this header so the true allocation block would be freed.

See Also

IMalloc::Free, IMallocSpy::PostFree, CoRegisterMallocSpy, CoRevokeMallocSpy

Related Links

Software 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

Free Tech Secrets ;) Copyright © 2008 Free Tect Secrets ;) greatis just4fun network just4fun