Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

IMallocSpy::PreFree method

Performs operations required before calling IMalloc::Free. This method ensures that the pointer passed to Free points to the beginning of the actual allocation.

Syntax


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

Parameters

pRequest [in]

A pointer to the block of memory that the caller is passing to Free.

fSpyed [in]

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

Return value

The value to be passed to IMalloc::Free.

Remarks

If IMallocSpy::PreAlloc modified the original allocation request passed to IMalloc::Alloc (or IMalloc::Realloc), 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 that all of the block that was allocated can be freed.

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::Free
IMallocSpy
IMallocSpy::PostFree

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.