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.

387 lines
21 KiB

  1. /*
  2. * WABDBG.H
  3. *
  4. * Debugging support for WAB service providers.
  5. * Support functions are implemented in WABDBG.C.
  6. *
  7. * History:
  8. * 03/04/96 brucek Copied from MAPI's mapidbg.h
  9. *
  10. * Copyright 1993-1995 Microsoft Corporation. All Rights Reserved.
  11. */
  12. #ifndef __WABDBG_H_
  13. #define __WABDBG_H_
  14. /*
  15. * Debugging Macros -------------------------------------------------------
  16. *
  17. * IFDBG(x) Results in the expression x if DEBUG is defined, or
  18. * to nothing if DEBUG is not defined
  19. *
  20. * IFNDBG(x) Results in the expression x if DEBUG is not defined,
  21. * or to nothing if DEBUG is defined
  22. *
  23. * Unreferenced(a) Causes a to be referenced so that the compiler
  24. * doesn't issue warnings about unused local variables
  25. * which exist but are reserved for future use (eg
  26. * ulFlags in many cases)
  27. */
  28. #if defined(DEBUG)
  29. #define IFDBG(x) x
  30. #define IFNDBG(x)
  31. #define LEAK_TEST TRUE // allow memory leak dumps in debug build
  32. #else
  33. #define IFDBG(x)
  34. #define IFNDBG(x) x
  35. // #define LEAK_TEST TRUE // define to allow memory leak dumps in retail build
  36. #endif
  37. #ifdef __cplusplus
  38. #define EXTERN_C_BEGIN extern "C" {
  39. #define EXTERN_C_END }
  40. #else
  41. #define EXTERN_C_BEGIN
  42. #define EXTERN_C_END
  43. #endif
  44. #define dimensionof(a) (sizeof(a)/sizeof(*(a)))
  45. #define Unreferenced(a) ((void)(a))
  46. typedef long SCODE;
  47. typedef unsigned long ULONG;
  48. typedef unsigned long DWORD;
  49. /*
  50. * Assert Macros ---------------------------------------------------------
  51. *
  52. * Assert(a) Displays a message indicating the file and line number
  53. * of this Assert() if a == 0. OK'ing an assert traps
  54. * into the debugger.
  55. *
  56. * AssertSz(a,sz) Works like an Assert(), but displays the string sz
  57. * along with the file and line number.
  58. *
  59. * Side asserts A side assert works like an Assert(), but evaluates
  60. * 'a' even when asserts are not enabled.
  61. *
  62. * NF asserts A NF (Non-Fatal) assert works like an Assert(), but
  63. * continues instead of trapping into the debugger when
  64. * OK'ed.
  65. */
  66. #if defined(DEBUG) || defined(ASSERTS_ENABLED)
  67. #define IFTRAP(x) x
  68. #else
  69. #define IFTRAP(x) 0
  70. #endif
  71. #define Trap() IFTRAP(DebugTrapFn(1,TEXT(__FILE__),__LINE__,TEXT("Trap")))
  72. #define TrapSz(psz) IFTRAP(DebugTrapFn(1,TEXT(__FILE__),__LINE__,psz))
  73. #define TrapSz1(psz,a1) IFTRAP(DebugTrapFn(1,TEXT(__FILE__),__LINE__,psz,a1))
  74. #define TrapSz2(psz,a1,a2) IFTRAP(DebugTrapFn(1,TEXT(__FILE__),__LINE__,psz,a1,a2))
  75. #define TrapSz3(psz,a1,a2,a3) IFTRAP(DebugTrapFn(1,TEXT(__FILE__),__LINE__,psz,a1,a2,a3))
  76. #define TrapSz4(psz,a1,a2,a3,a4) IFTRAP(DebugTrapFn(1,TEXT(__FILE__),__LINE__,psz,a1,a2,a3,a4))
  77. #define TrapSz5(psz,a1,a2,a3,a4,a5) IFTRAP(DebugTrapFn(1,TEXT(__FILE__),__LINE__,psz,a1,a2,a3,a4,a5))
  78. #define TrapSz6(psz,a1,a2,a3,a4,a5,a6) IFTRAP(DebugTrapFn(1,TEXT(__FILE__),__LINE__,psz,a1,a2,a3,a4,a5,a6))
  79. #define TrapSz7(psz,a1,a2,a3,a4,a5,a6,a7) IFTRAP(DebugTrapFn(1,TEXT(__FILE__),__LINE__,psz,a1,a2,a3,a4,a5,a6,a7))
  80. #define TrapSz8(psz,a1,a2,a3,a4,a5,a6,a7,a8) IFTRAP(DebugTrapFn(1,TEXT(__FILE__),__LINE__,psz,a1,a2,a3,a4,a5,a6,a7,a8))
  81. #define TrapSz9(psz,a1,a2,a3,a4,a5,a6,a7,a8,a9) IFTRAP(DebugTrapFn(1,TEXT(__FILE__),__LINE__,psz,a1,a2,a3,a4,a5,a6,a7,a8,a9))
  82. #define Assert(t) IFTRAP(((t) ? 0 : DebugTrapFn(1,TEXT(__FILE__),__LINE__,TEXT("Assertion Failure: ") TEXT(#t)),0))
  83. #define AssertSz(t,psz) IFTRAP(((t) ? 0 : DebugTrapFn(1,TEXT(__FILE__),__LINE__,psz),0))
  84. #define AssertSz1(t,psz,a1) IFTRAP(((t) ? 0 : DebugTrapFn(1,TEXT(__FILE__),__LINE__,psz,a1),0))
  85. #define AssertSz2(t,psz,a1,a2) IFTRAP(((t) ? 0 : DebugTrapFn(1,TEXT(__FILE__),__LINE__,psz,a1,a2),0))
  86. #define AssertSz3(t,psz,a1,a2,a3) IFTRAP(((t) ? 0 : DebugTrapFn(1,TEXT(__FILE__),__LINE__,psz,a1,a2,a3),0))
  87. #define AssertSz4(t,psz,a1,a2,a3,a4) IFTRAP(((t) ? 0 : DebugTrapFn(1,TEXT(__FILE__),__LINE__,psz,a1,a2,a3,a4),0))
  88. #define AssertSz5(t,psz,a1,a2,a3,a4,a5) IFTRAP(((t) ? 0 : DebugTrapFn(1,TEXT(__FILE__),__LINE__,psz,a1,a2,a3,a4,a5),0))
  89. #define AssertSz6(t,psz,a1,a2,a3,a4,a5,a6) IFTRAP(((t) ? 0 : DebugTrapFn(1,TEXT(__FILE__),__LINE__,psz,a1,a2,a3,a4,a5,a6),0))
  90. #define AssertSz7(t,psz,a1,a2,a3,a4,a5,a6,a7) IFTRAP(((t) ? 0 : DebugTrapFn(1,TEXT(__FILE__),__LINE__,psz,a1,a2,a3,a4,a5,a6,a7),0))
  91. #define AssertSz8(t,psz,a1,a2,a3,a4,a5,a6,a7,a8) IFTRAP(((t) ? 0 : DebugTrapFn(1,TEXT(__FILE__),__LINE__,psz,a1,a2,a3,a4,a5,a6,a7,a8),0))
  92. #define AssertSz9(t,psz,a1,a2,a3,a4,a5,a6,a7,a8,a9) IFTRAP(((t) ? 0 : DebugTrapFn(1,TEXT(__FILE__),__LINE__,psz,a1,a2,a3,a4,a5,a6,a7,a8,a9),0))
  93. #define SideAssert(t) ((t) ? 0 : IFTRAP(DebugTrapFn(1,TEXT(__FILE__),__LINE__,TEXT("Assertion Failure: ") TEXT(#t))),0)
  94. #define SideAssertSz(t,psz) ((t) ? 0 : IFTRAP(DebugTrapFn(1,TEXT(__FILE__),__LINE__,psz)),0)
  95. #define SideAssertSz1(t,psz,a1) ((t) ? 0 : IFTRAP(DebugTrapFn(1,TEXT(__FILE__),__LINE__,psz,a1)),0)
  96. #define SideAssertSz2(t,psz,a1,a2) ((t) ? 0 : IFTRAP(DebugTrapFn(1,TEXT(__FILE__),__LINE__,psz,a1,a2)),0)
  97. #define SideAssertSz3(t,psz,a1,a2,a3) ((t) ? 0 : IFTRAP(DebugTrapFn(1,TEXT(__FILE__),__LINE__,psz,a1,a2,a3)),0)
  98. #define SideAssertSz4(t,psz,a1,a2,a3,a4) ((t) ? 0 : IFTRAP(DebugTrapFn(1,TEXT(__FILE__),__LINE__,psz,a1,a2,a3,a4)),0)
  99. #define SideAssertSz5(t,psz,a1,a2,a3,a4,a5) ((t) ? 0 : IFTRAP(DebugTrapFn(1,TEXT(__FILE__),__LINE__,psz,a1,a2,a3,a4,a5)),0)
  100. #define SideAssertSz6(t,psz,a1,a2,a3,a4,a5,a6) ((t) ? 0 : IFTRAP(DebugTrapFn(1,TEXT(__FILE__),__LINE__,psz,a1,a2,a3,a4,a5,a6)),0)
  101. #define SideAssertSz7(t,psz,a1,a2,a3,a4,a5,a6,a7) ((t) ? 0 : IFTRAP(DebugTrapFn(1,TEXT(__FILE__),__LINE__,psz,a1,a2,a3,a4,a5,a6,a7)),0)
  102. #define SideAssertSz8(t,psz,a1,a2,a3,a4,a5,a6,a7,a8) ((t) ? 0 : IFTRAP(DebugTrapFn(1,TEXT(__FILE__),__LINE__,psz,a1,a2,a3,a4,a5,a6,a7,a8)),0)
  103. #define SideAssertSz9(t,psz,a1,a2,a3,a4,a5,a6,a7,a8,a9) ((t) ? 0 : IFTRAP(DebugTrapFn(1,TEXT(__FILE__),__LINE__,psz,a1,a2,a3,a4,a5,a6,a7,a8,a9)),0)
  104. #define NFAssert(t) IFTRAP(((t) ? 0 : DebugTrapFn(0,TEXT(__FILE__),__LINE__,TEXT("Assertion Failure: ") TEXT(#t)),0))
  105. #define NFAssertSz(t,psz) IFTRAP(((t) ? 0 : DebugTrapFn(0,TEXT(__FILE__),__LINE__,psz),0))
  106. #define NFAssertSz1(t,psz,a1) IFTRAP(((t) ? 0 : DebugTrapFn(0,TEXT(__FILE__),__LINE__,psz,a1),0))
  107. #define NFAssertSz2(t,psz,a1,a2) IFTRAP(((t) ? 0 : DebugTrapFn(0,TEXT(__FILE__),__LINE__,psz,a1,a2),0))
  108. #define NFAssertSz3(t,psz,a1,a2,a3) IFTRAP(((t) ? 0 : DebugTrapFn(0,TEXT(__FILE__),__LINE__,psz,a1,a2,a3),0))
  109. #define NFAssertSz4(t,psz,a1,a2,a3,a4) IFTRAP(((t) ? 0 : DebugTrapFn(0,TEXT(__FILE__),__LINE__,psz,a1,a2,a3,a4),0))
  110. #define NFAssertSz5(t,psz,a1,a2,a3,a4,a5) IFTRAP(((t) ? 0 : DebugTrapFn(0,TEXT(__FILE__),__LINE__,psz,a1,a2,a3,a4,a5),0))
  111. #define NFAssertSz6(t,psz,a1,a2,a3,a4,a5,a6) IFTRAP(((t) ? 0 : DebugTrapFn(0,TEXT(__FILE__),__LINE__,psz,a1,a2,a3,a4,a5,a6),0))
  112. #define NFAssertSz7(t,psz,a1,a2,a3,a4,a5,a6,a7) IFTRAP(((t) ? 0 : DebugTrapFn(0,TEXT(__FILE__),__LINE__,psz,a1,a2,a3,a4,a5,a6,a7),0))
  113. #define NFAssertSz8(t,psz,a1,a2,a3,a4,a5,a6,a7,a8) IFTRAP(((t) ? 0 : DebugTrapFn(0,TEXT(__FILE__),__LINE__,psz,a1,a2,a3,a4,a5,a6,a7,a8),0))
  114. #define NFAssertSz9(t,psz,a1,a2,a3,a4,a5,a6,a7,a8,a9) IFTRAP(((t) ? 0 : DebugTrapFn(0,TEXT(__FILE__),__LINE__,psz,a1,a2,a3,a4,a5,a6,a7,a8,a9),0))
  115. #define NFSideAssert(t) ((t) ? 0 : IFTRAP(DebugTrapFn(0,TEXT(__FILE__),__LINE__,("Assertion Failure: ") TEXT(#t))),0)
  116. #define NFSideAssertSz(t,psz) ((t) ? 0 : IFTRAP(DebugTrapFn(0,TEXT(__FILE__),__LINE__,psz)),0)
  117. #define NFSideAssertSz1(t,psz,a1) ((t) ? 0 : IFTRAP(DebugTrapFn(0,TEXT(__FILE__),__LINE__,psz,a1)),0)
  118. #define NFSideAssertSz2(t,psz,a1,a2) ((t) ? 0 : IFTRAP(DebugTrapFn(0,TEXT(__FILE__),__LINE__,psz,a1,a2)),0)
  119. #define NFSideAssertSz3(t,psz,a1,a2,a3) ((t) ? 0 : IFTRAP(DebugTrapFn(0,TEXT(__FILE__),__LINE__,psz,a1,a2,a3)),0)
  120. #define NFSideAssertSz4(t,psz,a1,a2,a3,a4) ((t) ? 0 : IFTRAP(DebugTrapFn(0,TEXT(__FILE__),__LINE__,psz,a1,a2,a3,a4)),0)
  121. #define NFSideAssertSz5(t,psz,a1,a2,a3,a4,a5) ((t) ? 0 : IFTRAP(DebugTrapFn(0,TEXT(__FILE__),__LINE__,psz,a1,a2,a3,a4,a5)),0)
  122. #define NFSideAssertSz6(t,psz,a1,a2,a3,a4,a5,a6) ((t) ? 0 : IFTRAP(DebugTrapFn(0,TEXT(__FILE__),__LINE__,psz,a1,a2,a3,a4,a5,a6)),0)
  123. #define NFSideAssertSz7(t,psz,a1,a2,a3,a4,a5,a6,a7) ((t) ? 0 : IFTRAP(DebugTrapFn(0,TEXT(__FILE__),__LINE__,psz,a1,a2,a3,a4,a5,a6,a7)),0)
  124. #define NFSideAssertSz8(t,psz,a1,a2,a3,a4,a5,a6,a7,a8) ((t) ? 0 : IFTRAP(DebugTrapFn(0,TEXT(__FILE__),__LINE__,psz,a1,a2,a3,a4,a5,a6,a7,a8)),0)
  125. #define NFSideAssertSz9(t,psz,a1,a2,a3,a4,a5,a6,a7,a8,a9) ((t) ? 0 : IFTRAP(DebugTrapFn(0,TEXT(__FILE__),__LINE__,psz,a1,a2,a3,a4,a5,a6,a7,a8,a9)),0)
  126. /*
  127. * Trace Macros ------------------------------------------------------------
  128. *
  129. * DebugTrace Use for arbitrary formatted output. It
  130. * takes exactly the same arguments as the
  131. * Windows wsprintf() function.
  132. * DebugTraceResult Shorthand for error tracing with an
  133. * HRESULT. Arguments are the name of the
  134. * function (not quoted) and the HRESULT.
  135. * DebugTraceSc Shorthand for error tracing with an
  136. * SCODE. Arguments are the name of the
  137. * function (not quoted) and the SCODE.
  138. * DebugTraceArg Shorthand for invalid parameter
  139. * tracing. Arguments are the name of the
  140. * function (not quoted) and a quoted
  141. * string describing the bad parameter.
  142. */
  143. #if defined(DEBUG) || defined(TRACES_ENABLED)
  144. #define IFTRACE(x) x
  145. #define DebugTrace DebugTraceFn
  146. #else
  147. #define IFTRACE(x) 0
  148. #define DebugTrace 1?0:DebugTraceFn
  149. #endif
  150. #define DebugTraceResult(f,hr) IFTRACE(((hr) ? DebugTraceFn(TEXT(#f) TEXT(" returns 0x%08lX %s\n"), GetScode(hr), SzDecodeScode(GetScode(hr))) : 0))
  151. #define DebugTraceSc(f,sc) IFTRACE(((sc) ? DebugTraceFn(TEXT(#f) TEXT(" returns 0x%08lX %s\n"), sc, SzDecodeScode(sc)) : 0))
  152. #define DebugTraceArg(f,s) IFTRACE(DebugTraceFn(TEXT(#f) TEXT(": bad parameter: ") s TEXT("\n")))
  153. #define DebugTraceLine() IFTRACE(DebugTraceFn(TEXT("File %s, Line %i \n"),TEXT(__FILE__),__LINE__))
  154. #define DebugTraceProblems(sz, rgprob) IFTRACE(DebugTraceProblemsFn(sz, rgprob))
  155. #define TraceSz(psz) IFTRACE(DebugTraceFn(TEXT("~") psz))
  156. #define TraceSz1(psz,a1) IFTRACE(DebugTraceFn(TEXT("~") psz,a1))
  157. #define TraceSz2(psz,a1,a2) IFTRACE(DebugTraceFn(TEXT("~") psz,a1,a2))
  158. #define TraceSz3(psz,a1,a2,a3) IFTRACE(DebugTraceFn(TEXT("~") psz,a1,a2,a3))
  159. #define TraceSz4(psz,a1,a2,a3,a4) IFTRACE(DebugTraceFn(TEXT("~") psz,a1,a2,a3,a4))
  160. #define TraceSz5(psz,a1,a2,a3,a4,a5) IFTRACE(DebugTraceFn(TEXT("~") psz,a1,a2,a3,a4,a5))
  161. #define TraceSz6(psz,a1,a2,a3,a4,a5,a6) IFTRACE(DebugTraceFn(TEXT("~") psz,a1,a2,a3,a4,a5,a6))
  162. #define TraceSz7(psz,a1,a2,a3,a4,a5,a6,a7) IFTRACE(DebugTraceFn(TEXT("~") psz,a1,a2,a3,a4,a5,a6,a7))
  163. #define TraceSz8(psz,a1,a2,a3,a4,a5,a6,a7,a8) IFTRACE(DebugTraceFn(TEXT("~") psz,a1,a2,a3,a4,a5,a6,a7,a8))
  164. #define TraceSz9(psz,a1,a2,a3,a4,a5,a6,a7,a8,a9) IFTRACE(DebugTraceFn(TEXT("~") psz,a1,a2,a3,a4,a5,a6,a7,a8,a9))
  165. /* Debugging Functions ---------------------------------------------------- */
  166. EXTERN_C_BEGIN
  167. #ifdef WIN16
  168. #define EXPORTDBG __export
  169. #else
  170. #define EXPORTDBG
  171. #endif
  172. int EXPORTDBG __cdecl DebugTrapFn(int fFatal, TCHAR *pszFile, int iLine, TCHAR *pszFormat, ...);
  173. int EXPORTDBG __cdecl DebugTraceFn(TCHAR *pszFormat, ...);
  174. void EXPORTDBG __cdecl DebugTraceProblemsFn(TCHAR *sz, void *rgprob);
  175. TCHAR * EXPORTDBG __cdecl SzDecodeScodeFn(SCODE sc);
  176. TCHAR * EXPORTDBG __cdecl SzDecodeUlPropTypeFn(unsigned long ulPropType);
  177. TCHAR * EXPORTDBG __cdecl SzDecodeUlPropTagFn(unsigned long ulPropTag);
  178. unsigned long EXPORTDBG __cdecl UlPropTagFromSzFn(TCHAR *psz);
  179. SCODE EXPORTDBG __cdecl ScodeFromSzFn(TCHAR *psz);
  180. void * EXPORTDBG __cdecl DBGMEM_EncapsulateFn(void * pmalloc, TCHAR *pszSubsys, int fCheckOften);
  181. void EXPORTDBG __cdecl DBGMEM_ShutdownFn(void * pmalloc);
  182. void EXPORTDBG __cdecl DBGMEM_CheckMemFn(void * pmalloc, int fReportOrphans);
  183. #if defined(WIN32) && defined(_X86_) && defined(LEAK_TEST)
  184. void EXPORTDBG __cdecl DBGMEM_LeakHook(FARPROC pfn);
  185. void EXPORTDBG __cdecl GetCallStack(DWORD *, int, int);
  186. #endif
  187. void EXPORTDBG __cdecl DBGMEM_NoLeakDetectFn(void * pmalloc, void *pv);
  188. void EXPORTDBG __cdecl DBGMEM_SetFailureAtFn(void * pmalloc, ULONG ulFailureAt);
  189. SCODE EXPORTDBG __cdecl ScCheckScFn(SCODE, SCODE *, TCHAR *, TCHAR *, int);
  190. void * EXPORTDBG __cdecl VMAlloc(ULONG);
  191. void * EXPORTDBG __cdecl VMAllocEx(ULONG, ULONG);
  192. void * EXPORTDBG __cdecl VMRealloc(void *, ULONG);
  193. void * EXPORTDBG __cdecl VMReallocEx(void *, ULONG, ULONG);
  194. ULONG EXPORTDBG __cdecl VMGetSize(void *);
  195. ULONG EXPORTDBG __cdecl VMGetSizeEx(void *, ULONG);
  196. void EXPORTDBG __cdecl VMFree(void *);
  197. void EXPORTDBG __cdecl VMFreeEx(void *, ULONG);
  198. EXTERN_C_END
  199. /*
  200. * Debugging Macros -------------------------------------------------------
  201. *
  202. * SzDecodeScode Returns the string name of an SCODE
  203. * SzDecodeUlPropTag Returns the string name of a property
  204. * tag
  205. * UlPropTagFromSz Given a property tag's name, returns
  206. * its value
  207. * ScodeFromSz Given an SCODE's name, returns its
  208. * value
  209. *
  210. * DBGMEM_Encapsulate Given an IMalloc interface, adds heap-
  211. * checking functionality and returns a
  212. * wrapped interface
  213. * DBGMEM_Shutdown Undoes DBGMEM_Encapsulate, and prints
  214. * out information on any allocations made
  215. * since the interface was encapsulated
  216. * that have not yet been released.
  217. * DBGMEM_CheckMem Checks all memory allocated on the heap,
  218. * and optionally reports leaked blocks.
  219. * DBGMEM_NoLeakDetect Prevents a block from appearing on the leak
  220. * report. Pass NULL for pv to inhibit leak
  221. * reports at all from this heap.
  222. */
  223. #ifdef DEBUG
  224. #define SzDecodeScode(_sc) SzDecodeScodeFn(_sc)
  225. #define SzDecodeUlPropType(_ulPropType) SzDecodeUlPropTypeFn(_ulPropType)
  226. #define SzDecodeUlPropTag(_ulPropTag) SzDecodeUlPropTagFn(_ulPropTag)
  227. #define UlPropTagFromSz(_sz) UlPropTagFromSzFn(_sz)
  228. #define ScodeFromSz(_sz) ScodeFromSzFn(_sz)
  229. #define DBGMEM_Encapsulate(pm, psz, f) DBGMEM_EncapsulateFn(pm, psz, f)
  230. #define DBGMEM_Shutdown(pm) DBGMEM_ShutdownFn(pm)
  231. #define DBGMEM_CheckMem(pm, f) DBGMEM_CheckMemFn(pm, f)
  232. #define DBGMEM_NoLeakDetect(pm, pv) DBGMEM_NoLeakDetectFn(pm, pv)
  233. #define DBGMEM_SetFailureAt(pm, ul) DBGMEM_SetFailureAtFn(pm, ul)
  234. #else
  235. #define SzDecodeScode(_sc) (0)
  236. #define SzDecodeUlPropType(_ulPropType) (0)
  237. #define SzDecodeUlPropTag(_ulPropTag) (0)
  238. #define UlPropTagFromSz(_sz) (0)
  239. #define ScodeFromSz(_sz) (0)
  240. #if defined(__cplusplus) && !defined(CINTERFACE)
  241. #define DBGMEM_Encapsulate(pmalloc, pszSubsys, fCheckOften) \
  242. ((pmalloc)->AddRef(), (pmalloc))
  243. #define DBGMEM_Shutdown(pmalloc) \
  244. ((pmalloc)->Release())
  245. #else
  246. #define DBGMEM_Encapsulate(pmalloc, pszSubsys, fCheckOften) \
  247. ((pmalloc)->lpVtbl->AddRef(pmalloc), (pmalloc))
  248. #define DBGMEM_Shutdown(pmalloc) \
  249. ((pmalloc)->lpVtbl->Release(pmalloc))
  250. #endif
  251. #define DBGMEM_CheckMem(pm, f)
  252. #define DBGMEM_NoLeakDetect(pm, pv)
  253. #define DBGMEM_SetFailureAt(pm, ul)
  254. #endif
  255. /*
  256. * SCODE maps -------------------------------------------------------------
  257. *
  258. * ScCheckSc Given an SCODE and method name, verifies
  259. * that the SCODE can legally be returned from
  260. * thet method. Prints out a debug string if
  261. * it cannot.
  262. * HrCheckHr As ScCheckSc, for functions that return
  263. * HRESULT.
  264. */
  265. #if defined(DEBUG) && !defined(DOS)
  266. #define ScCheckSc(sc,fn) ScCheckScFn(sc,fn##_Scodes,#fn,TEXT(__FILE__), __LINE__)
  267. #define HrCheckHr(hr,fn) HrCheckSc(GetScode(hr),fn)
  268. #else
  269. #define ScCheckSc(sc,fn) (sc)
  270. #define HrCheckHr(hr,fn) (hr)
  271. #endif
  272. #define HrCheckSc(sc,fn) ResultFromScode(ScCheckSc(sc,fn))
  273. #if defined(DEBUG) && !defined(DOS)
  274. extern SCODE Common_Scodes[];
  275. extern SCODE WABAllocateBuffer_Scodes[];
  276. extern SCODE WABAllocateMore_Scodes[];
  277. extern SCODE WABFreeBuffer_Scodes[];
  278. extern SCODE IUnknown_QueryInterface_Scodes[];
  279. extern SCODE IUnknown_AddRef_Scodes[];
  280. extern SCODE IUnknown_Release_Scodes[];
  281. extern SCODE IUnknown_GetLastError_Scodes[];
  282. extern SCODE IWABProp_CopyTo_Scodes[];
  283. extern SCODE IWABProp_CopyProps_Scodes[];
  284. extern SCODE IWABProp_DeleteProps_Scodes[];
  285. extern SCODE IWABProp_GetIDsFromNames_Scodes[];
  286. extern SCODE IWABProp_GetLastError_Scodes[];
  287. extern SCODE IWABProp_GetNamesFromIDs_Scodes[];
  288. extern SCODE IWABProp_GetPropList_Scodes[];
  289. extern SCODE IWABProp_GetProps_Scodes[];
  290. extern SCODE IWABProp_OpenProperty_Scodes[];
  291. extern SCODE IWABProp_SetProps_Scodes[];
  292. extern SCODE IWABProp_SaveChanges_Scodes[];
  293. extern SCODE IStream_Read_Scodes[];
  294. extern SCODE IStream_Write_Scodes[];
  295. extern SCODE IStream_Seek_Scodes[];
  296. extern SCODE IStream_SetSize_Scodes[];
  297. extern SCODE IStream_Tell_Scodes[];
  298. extern SCODE IStream_LockRegion_Scodes[];
  299. extern SCODE IStream_UnlockRegion_Scodes[];
  300. extern SCODE IStream_Clone_Scodes[];
  301. extern SCODE IStream_CopyTo_Scodes[];
  302. extern SCODE IStream_Revert_Scodes[];
  303. extern SCODE IStream_Stat_Scodes[];
  304. extern SCODE IStream_Commit_Scodes[];
  305. extern SCODE IWABTable_GetLastError_Scodes[];
  306. extern SCODE IWABTable_Advise_Scodes[];
  307. extern SCODE IWABTable_Unadvise_Scodes[];
  308. extern SCODE IWABTable_GetStatus_Scodes[];
  309. extern SCODE IWABTable_SetColumns_Scodes[];
  310. extern SCODE IWABTable_QueryColumns_Scodes[];
  311. extern SCODE IWABTable_GetRowCount_Scodes[];
  312. extern SCODE IWABTable_SeekRow_Scodes[];
  313. extern SCODE IWABTable_SeekRowApprox_Scodes[];
  314. extern SCODE IWABTable_QueryPosition_Scodes[];
  315. extern SCODE IWABTable_FindRow_Scodes[];
  316. extern SCODE IWABTable_Restrict_Scodes[];
  317. extern SCODE IWABTable_CreateBookmark_Scodes[];
  318. extern SCODE IWABTable_FreeBookmark_Scodes[];
  319. extern SCODE IWABTable_SortTable_Scodes[];
  320. extern SCODE IWABTable_QuerySortOrder_Scodes[];
  321. extern SCODE IWABTable_QueryRows_Scodes[];
  322. extern SCODE IWABTable_Abort_Scodes[];
  323. extern SCODE IWABTable_ExpandRow_Scodes[];
  324. extern SCODE IWABTable_CollapseRow_Scodes[];
  325. extern SCODE IWABTable_WaitForCompletion_Scodes[];
  326. extern SCODE IWABTable_GetCollapseState_Scodes[];
  327. extern SCODE IWABTable_SetCollapseState_Scodes[];
  328. extern SCODE IAddrBook_OpenEntry_Scodes[];
  329. extern SCODE IAddrBook_CompareEntryIDs_Scodes[];
  330. extern SCODE IAddrBook_CreateOneOff_Scodes[];
  331. extern SCODE IAddrBook_ResolveName_Scodes[];
  332. extern SCODE IAddrBook_Address_Scodes[];
  333. extern SCODE IAddrBook_Details_Scodes[];
  334. extern SCODE IAddrBook_RecipOptions_Scodes[];
  335. extern SCODE IAddrBook_QueryDefaultRecipOpt_Scodes[];
  336. extern SCODE IAddrBook_Address_Scodes[];
  337. extern SCODE IAddrBook_ButtonPress_Scodes[];
  338. extern SCODE IABContainer_GetContentsTable_Scodes[];
  339. extern SCODE IABContainer_GetHierarchyTable_Scodes[];
  340. extern SCODE INotifObj_ChangeEvMask_Scodes[];
  341. #endif
  342. /* ------------------------------------------------------------------------ */
  343. #endif