IMallocSpy::PreDidAlloc

Called by COM just prior to invoking IMalloc::DidAlloc.

void * PreDidAlloc(
  void * pRequest,
               //Pointer the caller is passing to IMalloc::DidAlloc
  BOOL fSpyed  //Whether pRequest was allocated while this spy was 
               //active
);
 

Parameters

pRequest
[in] Pointer the caller is passing to IMalloc::DidAlloc.
fSpyed
[in] TRUE if the allocation was done while this spy was active.

Return Value

The pointer for which allocation status is determined. This pointer is passed to PostDidAlloc as the fActual parameter.

Remarks

When a spy object implementing IMallocSpy is registered with CoRegisterMallocSpy, COM calls this method immediately before any call to IMalloc::DidAlloc. This method is included for completeness and consistency — it is not anticipated that developers will implement significant functionality in this method.

QuickInfo

  Windows NT: Use version 4.0 or later.
  Windows: Use Windows 95 or later.
  Windows CE: Unsupported.
  Header: Declared in objidl.h.

See Also

IMalloc::DidAlloc, IMallocSpy::PostDidAlloc, CoRegisterMallocSpy, CoRevokeMallocSpy