Called just before invoking IMalloc::Free to ensure that the pointer passed to IMalloc::Free points to the beginning of the actual allocation.
void * PreFree(
void * pRequest, //Pointer is passing to IMalloc::Free
BOOL fSpyed //TRUE if this memory was allocated while the
//spy was active
);
The actual pointer to pass to IMalloc::Free.
If IMallocSpy::PreAlloc modified the original allocation request passed to IMalloc::Alloc (or IMalloc::Realloc), IMallocSpy::PreFree must supply a pointer to the actual allocation, which COM will pass to IMalloc::Free. For example, if the PreAlloc/PostAlloc pair attached a header used to store debug information to the beginning of the caller's allocation, PreFree must return a pointer to the beginning of this header, so all of the block that was allocated can be freed.
Windows NT: Use version 4.0 or later.
Windows: Use Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in objidl.h.
IMalloc::Free, IMallocSpy::PostFree, CoRegisterMallocSpy, CoRevokeMallocSpy