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.

87 lines
2.5 KiB

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