Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

89 lines
2.3 KiB

  1. /*++
  2. Copyright (C) 1996-1999 Microsoft Corporation
  3. Module Name:
  4. LTIMALLOC.H
  5. History:
  6. --*/
  7. class LTIMallocSpy : public IMallocSpy
  8. {
  9. public:
  10. LTIMallocSpy();
  11. ~LTIMallocSpy();
  12. //
  13. // IUnknown interface
  14. virtual HRESULT STDMETHODCALLTYPE QueryInterface(
  15. /* [in] */ REFIID riid,
  16. /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject);
  17. virtual ULONG STDMETHODCALLTYPE AddRef( void);
  18. virtual ULONG STDMETHODCALLTYPE Release( void);
  19. private:
  20. //
  21. // IMallocSpy methods.
  22. virtual ULONG STDMETHODCALLTYPE PreAlloc(
  23. /* [in] */ ULONG cbRequest);
  24. virtual void __RPC_FAR *STDMETHODCALLTYPE PostAlloc(
  25. /* [in] */ void __RPC_FAR *pActual);
  26. virtual void __RPC_FAR *STDMETHODCALLTYPE PreFree(
  27. /* [in] */ void __RPC_FAR *pRequest,
  28. /* [in] */ BOOL fSpyed);
  29. virtual void STDMETHODCALLTYPE PostFree(
  30. /* [in] */ BOOL fSpyed);
  31. virtual ULONG STDMETHODCALLTYPE PreRealloc(
  32. /* [in] */ void __RPC_FAR *pRequest,
  33. /* [in] */ ULONG cbRequest,
  34. /* [out] */ void __RPC_FAR *__RPC_FAR *ppNewRequest,
  35. /* [in] */ BOOL fSpyed);
  36. virtual void __RPC_FAR *STDMETHODCALLTYPE PostRealloc(
  37. /* [in] */ void __RPC_FAR *pActual,
  38. /* [in] */ BOOL fSpyed);
  39. virtual void __RPC_FAR *STDMETHODCALLTYPE PreGetSize(
  40. /* [in] */ void __RPC_FAR *pRequest,
  41. /* [in] */ BOOL fSpyed);
  42. virtual ULONG STDMETHODCALLTYPE PostGetSize(
  43. /* [in] */ ULONG cbActual,
  44. /* [in] */ BOOL fSpyed);
  45. virtual void __RPC_FAR *STDMETHODCALLTYPE PreDidAlloc(
  46. /* [in] */ void __RPC_FAR *pRequest,
  47. /* [in] */ BOOL fSpyed);
  48. virtual int STDMETHODCALLTYPE PostDidAlloc(
  49. /* [in] */ void __RPC_FAR *pRequest,
  50. /* [in] */ BOOL fSpyed,
  51. /* [in] */ int fActual);
  52. virtual void STDMETHODCALLTYPE PreHeapMinimize( void);
  53. virtual void STDMETHODCALLTYPE PostHeapMinimize( void);
  54. UINT m_uiRefCount;
  55. CCounter m_IMallocCounter;
  56. CCounter m_IMallocUsage;
  57. ULONG m_ulSize;
  58. };
  59. void DumpOutstandingAllocs(void);
  60. void SetTrackingMode(BOOL);
  61. void LTAPIENTRY BreakOnIMalloc(DWORD);