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.

156 lines
3.8 KiB

  1. /*++
  2. Copyright (c) 1994-1997 Microsoft Corporation
  3. Module Name:
  4. tshrutil.h
  5. Abstract:
  6. Contains proto type and constant definitions for tshare utility
  7. functions.
  8. Author:
  9. Madan Appiah (madana) 25-Aug-1997
  10. Environment:
  11. User Mode - Win32
  12. Revision History:
  13. --*/
  14. #ifndef _TSHRUTIL_H_
  15. #define _TSHRUTIL_H_
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. #include <winsta.h>
  20. #ifndef CHANNEL_FIRST
  21. #include <icadd.h>
  22. #endif
  23. #include <icaapi.h>
  24. //---------------------------------------------------------------------------------
  25. // Defines
  26. //---------------------------------------------------------------------------------
  27. #if DBG
  28. extern HANDLE g_hIcaTrace;
  29. extern HANDLE g_hTShareHeap;
  30. // Trace
  31. #undef TRACE
  32. #define TRACE(_arg) { if (g_hIcaTrace) IcaSystemTrace _arg; }
  33. #define TS_ASSERT(Predicate) ASSERT(Predicate)
  34. #ifndef TC_WX
  35. #define TC_WX 0x40000000 // winstation extension
  36. #endif
  37. #define DEBUG_GCC_DBERROR g_hIcaTrace, TC_WX, TT_ERROR
  38. #define DEBUG_GCC_DBWARN g_hIcaTrace, TC_WX, TT_API1
  39. #define DEBUG_GCC_DBNORMAL g_hIcaTrace, TC_WX, TT_API1
  40. #define DEBUG_GCC_DBDEBUG g_hIcaTrace, TC_WX, TT_API2
  41. #define DEBUG_GCC_DbDETAIL g_hIcaTrace, TC_WX, TT_API3
  42. #define DEBUG_GCC_DBFLOW g_hIcaTrace, TC_WX, TT_API4
  43. #define DEBUG_GCC_DBALL g_hIcaTrace, TC_WX, TT_API5
  44. #define DEBUG_TSHRSRV_ERROR g_hIcaTrace, TC_WX, TT_ERROR
  45. #define DEBUG_TSHRSRV_WARN g_hIcaTrace, TC_WX, TT_API1
  46. #define DEBUG_TSHRSRV_NORMAL g_hIcaTrace, TC_WX, TT_API1
  47. #define DEBUG_TSHRSRV_DEBUG g_hIcaTrace, TC_WX, TT_API2
  48. #define DEBUG_TSHRSRV_DETAIL g_hIcaTrace, TC_WX, TT_API3
  49. #define DEBUG_TSHRSRV_FLOW g_hIcaTrace, TC_WX, TT_API4
  50. // util flags.
  51. #define DEBUG_ERROR g_hIcaTrace, TC_WX, TT_ERROR
  52. #define DEBUG_MISC g_hIcaTrace, TC_WX, TT_API2
  53. #define DEBUG_REGISTRY g_hIcaTrace, TC_WX,TT_API2
  54. #define DEBUG_MEM_ALLOC g_hIcaTrace, TC_WX,TT_API4
  55. // Heap defines
  56. #define TSHeapAlloc(dwFlags, dwSize, nTag) \
  57. HeapAlloc(g_hTShareHeap, dwFlags, dwSize)
  58. #define TSHeapReAlloc(dwFlags, lpOldMemory, dwNewSize) \
  59. HeapReAlloc(g_hTShareHeap, dwFlags, lpOldMemory, dwNewSize)
  60. #define TSHeapFree(lpMemoryPtr) \
  61. HeapFree(g_hTShareHeap, 0, lpMemoryPtr)
  62. #define TSHeapValidate(dwFlags, lpMemoryPtr, nTag)
  63. #define TSHeapWalk(dwFlags, nTag, dwSize)
  64. #define TSHeapDump(dwFlags, lpMemoryPtr, dwSize)
  65. #define TSMemoryDump(lpMemoryPtr, dwSize)
  66. #else // DBG
  67. extern HANDLE g_hTShareHeap;
  68. // Trace
  69. #define TRACE(_arg)
  70. #define TS_ASSERT(Predicate)
  71. // Heap defines
  72. #define TSHeapAlloc(dwFlags, dwSize, nTag) \
  73. HeapAlloc(g_hTShareHeap, dwFlags, dwSize)
  74. #define TSHeapReAlloc(dwFlags, lpOldMemory, dwNewSize) \
  75. HeapReAlloc(g_hTShareHeap, dwFlags, lpOldMemory, dwNewSize)
  76. #define TSHeapFree(lpMemoryPtr) \
  77. HeapFree(g_hTShareHeap, 0, lpMemoryPtr)
  78. #define TSHeapValidate(dwFlags, lpMemoryPtr, nTag)
  79. #define TSHeapWalk(dwFlags, nTag, dwSize)
  80. #define TSHeapDump(dwFlags, lpMemoryPtr, dwSize)
  81. #define TSMemoryDump(lpMemoryPtr, dwSize)
  82. #endif // DBG
  83. #define TShareAlloc(dwSize) \
  84. TSHeapAlloc(0, dwSize, TS_HTAG_0)
  85. #define TShareAllocAndZero(dwSize) \
  86. TSHeapAlloc(HEAP_ZERO_MEMORY, dwSize, 0)
  87. #define TShareRealloc(lpOldMemory, dwNewSize) \
  88. TSHeapReAlloc(0, lpOldMemory, dwNewSize)
  89. #define TShareReallocAndZero(lpOldMemory, dwNewSize) \
  90. TSHeapReAlloc(HEAP_ZERO_MEMORY, lpOldMemory, dwNewSize)
  91. #define TShareFree(lpMemoryPtr) \
  92. TSHeapFree(lpMemoryPtr)
  93. DWORD TSUtilInit(VOID);
  94. VOID TSUtilCleanup(VOID);
  95. #ifdef __cplusplus
  96. } // extern "C"
  97. #endif
  98. #endif // _TSHRUTIL_H_