Source code of Windows XP (NT5)
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.

72 lines
2.3 KiB

  1. /*++
  2. 1998 Seagate Software, Inc. All rights reserved.
  3. Module Name:
  4. wsbtrak.h
  5. Abstract:
  6. Utility functions to keep track of run-time information.
  7. Author:
  8. Ron White [ronw] 5-Dec-1997
  9. Revision History:
  10. --*/
  11. #ifndef _WSBTRAK_
  12. #define _WSBTRAK_
  13. // Flags for WsbObjectTracePointers
  14. #define WSB_OTP_STATISTICS 0x00000001
  15. #define WSB_OTP_SEQUENCE 0x00000002
  16. #define WSB_OTP_ALLOCATED 0x00000004
  17. #define WSB_OTP_ALL 0x0000000f
  18. // Define these as macros so we can get rid of them for release code
  19. #if defined(WSB_TRACK_MEMORY)
  20. #define WSB_OBJECT_ADD(guid, addr) WsbObjectAdd(guid, addr)
  21. #define WSB_OBJECT_SUB(guid, addr) WsbObjectSub(guid, addr)
  22. #define WSB_OBJECT_TRACE_POINTERS(flags) WsbObjectTracePointers(flags)
  23. #define WSB_OBJECT_TRACE_TYPES WsbObjectTraceTypes()
  24. #else
  25. #define WSB_OBJECT_ADD(guid, addr)
  26. #define WSB_OBJECT_SUB(guid, addr)
  27. #define WSB_OBJECT_TRACE_POINTERS(flags)
  28. #define WSB_OBJECT_TRACE_TYPES
  29. #endif
  30. // Tracker functions
  31. #if defined(WSB_TRACK_MEMORY)
  32. extern WSB_EXPORT HRESULT WsbObjectAdd(const GUID& guid, const void* addr);
  33. extern WSB_EXPORT HRESULT WsbObjectSub(const GUID& guid, const void* addr);
  34. extern WSB_EXPORT HRESULT WsbObjectTracePointers(ULONG flags);
  35. extern WSB_EXPORT HRESULT WsbObjectTraceTypes(void);
  36. #endif
  37. // Memory replacement functions
  38. #if defined(WSB_TRACK_MEMORY)
  39. extern WSB_EXPORT LPVOID WsbMemAlloc(ULONG cb, const char * filename, int linenum);
  40. extern WSB_EXPORT void WsbMemFree(LPVOID pv, const char * filename, int linenum);
  41. extern WSB_EXPORT LPVOID WsbMemRealloc(LPVOID pv, ULONG cb,
  42. const char * filename, int linenum);
  43. extern WSB_EXPORT BSTR WsbSysAllocString(const OLECHAR FAR * sz,
  44. const char * filename, int linenum);
  45. extern WSB_EXPORT BSTR WsbSysAllocStringLen(const OLECHAR FAR * sz,
  46. unsigned int cc, const char * filename, int linenum);
  47. extern WSB_EXPORT void WsbSysFreeString(BSTR bs, const char * filename, int linenum);
  48. extern WSB_EXPORT HRESULT WsbSysReallocString(BSTR FAR * pb, const OLECHAR FAR * sz,
  49. const char * filename, int linenum);
  50. extern WSB_EXPORT HRESULT WsbSysReallocStringLen(BSTR FAR * pb,
  51. const OLECHAR FAR * sz, unsigned int cc, const char * filename, int linenum);
  52. #endif
  53. #endif // _WSBTRAK_