home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Internet 2000 May / MICD_2000_05.iso / CBuilder5 / INSTALL / DATA1.CAB / Program_Built_Files / Include / mapidbg.h < prev    next >
C/C++ Source or Header  |  2000-02-01  |  25KB  |  482 lines

  1. /*
  2.  *  M A P I D B G . H
  3.  *
  4.  *  Debugging support for MAPI service providers.
  5.  *  Support functions are implemented in MAPIDBG.C.
  6.  *
  7.  *  Copyright 1986-1996 Microsoft Corporation. All Rights Reserved.
  8.  */
  9.  
  10. #ifndef __MAPIDBG_H_
  11. #pragma option push -b -a8 -pc -A- /*P_O_Push*/
  12. #define __MAPIDBG_H_
  13.  
  14. #if defined (WIN32) && !defined (_WIN32)
  15. #define _WIN32
  16. #endif
  17.  
  18. /*
  19.  * Debugging Macros -------------------------------------------------------
  20.  *
  21.  *      IFDBG(x)        Results in the expression x if DEBUG is defined, or
  22.  *                      to nothing if DEBUG is not defined
  23.  *  
  24.  *      IFNDBG(x)       Results in the expression x if DEBUG is not defined,
  25.  *                      or to nothing if DEBUG is defined
  26.  *  
  27.  *      Unreferenced(a) Causes a to be referenced so that the compiler
  28.  *                      doesn't issue warnings about unused local variables
  29.  *                      which exist but are reserved for future use (eg
  30.  *                      ulFlags in many cases)
  31.  */
  32.  
  33. #if defined(DEBUG)
  34. #define IFDBG(x)            x
  35. #define IFNDBG(x)
  36. #else
  37. #define IFDBG(x)
  38. #define IFNDBG(x)           x
  39. #endif
  40.  
  41. #ifdef __cplusplus
  42. #define EXTERN_C_BEGIN      extern "C" {
  43. #define EXTERN_C_END        }
  44. #else
  45. #define EXTERN_C_BEGIN
  46. #define EXTERN_C_END
  47. #endif
  48.  
  49. #define dimensionof(a)      (sizeof(a)/sizeof(*(a)))
  50.  
  51. #define Unreferenced(a)     ((void)(a))
  52.  
  53. typedef long SCODE;
  54. typedef unsigned long ULONG;
  55. typedef unsigned long DWORD;
  56.  
  57. /*
  58.  *   Assert Macros ---------------------------------------------------------
  59.  *  
  60.  *      Assert(a)       Displays a message indicating the file and line number
  61.  *                      of this Assert() if a == 0.  OK'ing an assert traps
  62.  *                      into the debugger.
  63.  *  
  64.  *      AssertSz(a,sz)  Works like an Assert(), but displays the string sz
  65.  *                      along with the file and line number.
  66.  *  
  67.  *      Side asserts    A side assert works like an Assert(), but evaluates
  68.  *                      'a' even when asserts are not enabled.
  69.  *  
  70.  *      NF asserts      A NF (Non-Fatal) assert works like an Assert(), but
  71.  *                      continues instead of trapping into the debugger when
  72.  *                      OK'ed.
  73.  */
  74.  
  75. #if defined(DEBUG) || defined(ASSERTS_ENABLED)
  76. #define IFTRAP(x)           x
  77. #else
  78. #define IFTRAP(x)           0
  79. #endif
  80.  
  81. #define Trap()                                          IFTRAP(DebugTrapFn(1,__FILE__,__LINE__,"Trap"))
  82. #define TrapSz(psz)                                     IFTRAP(DebugTrapFn(1,__FILE__,__LINE__,psz))
  83. #define TrapSz1(psz,a1)                                 IFTRAP(DebugTrapFn(1,__FILE__,__LINE__,psz,a1))
  84. #define TrapSz2(psz,a1,a2)                              IFTRAP(DebugTrapFn(1,__FILE__,__LINE__,psz,a1,a2))
  85. #define TrapSz3(psz,a1,a2,a3)                           IFTRAP(DebugTrapFn(1,__FILE__,__LINE__,psz,a1,a2,a3))
  86. #define TrapSz4(psz,a1,a2,a3,a4)                        IFTRAP(DebugTrapFn(1,__FILE__,__LINE__,psz,a1,a2,a3,a4))
  87. #define TrapSz5(psz,a1,a2,a3,a4,a5)                     IFTRAP(DebugTrapFn(1,__FILE__,__LINE__,psz,a1,a2,a3,a4,a5))
  88. #define TrapSz6(psz,a1,a2,a3,a4,a5,a6)                  IFTRAP(DebugTrapFn(1,__FILE__,__LINE__,psz,a1,a2,a3,a4,a5,a6))
  89. #define TrapSz7(psz,a1,a2,a3,a4,a5,a6,a7)               IFTRAP(DebugTrapFn(1,__FILE__,__LINE__,psz,a1,a2,a3,a4,a5,a6,a7))
  90. #define TrapSz8(psz,a1,a2,a3,a4,a5,a6,a7,a8)            IFTRAP(DebugTrapFn(1,__FILE__,__LINE__,psz,a1,a2,a3,a4,a5,a6,a7,a8))
  91. #define TrapSz9(psz,a1,a2,a3,a4,a5,a6,a7,a8,a9)         IFTRAP(DebugTrapFn(1,__FILE__,__LINE__,psz,a1,a2,a3,a4,a5,a6,a7,a8,a9))
  92.  
  93. #define Assert(t)                                       IFTRAP(((t) ? 0 : DebugTrapFn(1,__FILE__,__LINE__,"Assertion Failure: " #t),0))
  94. #define AssertSz(t,psz)                                 IFTRAP(((t) ? 0 : DebugTrapFn(1,__FILE__,__LINE__,psz),0))
  95. #define AssertSz1(t,psz,a1)                             IFTRAP(((t) ? 0 : DebugTrapFn(1,__FILE__,__LINE__,psz,a1),0))
  96. #define AssertSz2(t,psz,a1,a2)                          IFTRAP(((t) ? 0 : DebugTrapFn(1,__FILE__,__LINE__,psz,a1,a2),0))
  97. #define AssertSz3(t,psz,a1,a2,a3)                       IFTRAP(((t) ? 0 : DebugTrapFn(1,__FILE__,__LINE__,psz,a1,a2,a3),0))
  98. #define AssertSz4(t,psz,a1,a2,a3,a4)                    IFTRAP(((t) ? 0 : DebugTrapFn(1,__FILE__,__LINE__,psz,a1,a2,a3,a4),0))
  99. #define AssertSz5(t,psz,a1,a2,a3,a4,a5)                 IFTRAP(((t) ? 0 : DebugTrapFn(1,__FILE__,__LINE__,psz,a1,a2,a3,a4,a5),0))
  100. #define AssertSz6(t,psz,a1,a2,a3,a4,a5,a6)              IFTRAP(((t) ? 0 : DebugTrapFn(1,__FILE__,__LINE__,psz,a1,a2,a3,a4,a5,a6),0))
  101. #define AssertSz7(t,psz,a1,a2,a3,a4,a5,a6,a7)           IFTRAP(((t) ? 0 : DebugTrapFn(1,__FILE__,__LINE__,psz,a1,a2,a3,a4,a5,a6,a7),0))
  102. #define AssertSz8(t,psz,a1,a2,a3,a4,a5,a6,a7,a8)        IFTRAP(((t) ? 0 : DebugTrapFn(1,__FILE__,__LINE__,psz,a1,a2,a3,a4,a5,a6,a7,a8),0))
  103. #define AssertSz9(t,psz,a1,a2,a3,a4,a5,a6,a7,a8,a9)     IFTRAP(((t) ? 0 : DebugTrapFn(1,__FILE__,__LINE__,psz,a1,a2,a3,a4,a5,a6,a7,a8,a9),0))
  104.  
  105. #define SideAssert(t)                                   ((t) ? 0 : IFTRAP(DebugTrapFn(1,__FILE__,__LINE__,"Assertion Failure: " #t)),0)
  106. #define SideAssertSz(t,psz)                             ((t) ? 0 : IFTRAP(DebugTrapFn(1,__FILE__,__LINE__,psz)),0)
  107. #define SideAssertSz1(t,psz,a1)                         ((t) ? 0 : IFTRAP(DebugTrapFn(1,__FILE__,__LINE__,psz,a1)),0)
  108. #define SideAssertSz2(t,psz,a1,a2)                      ((t) ? 0 : IFTRAP(DebugTrapFn(1,__FILE__,__LINE__,psz,a1,a2)),0)
  109. #define SideAssertSz3(t,psz,a1,a2,a3)                   ((t) ? 0 : IFTRAP(DebugTrapFn(1,__FILE__,__LINE__,psz,a1,a2,a3)),0)
  110. #define SideAssertSz4(t,psz,a1,a2,a3,a4)                ((t) ? 0 : IFTRAP(DebugTrapFn(1,__FILE__,__LINE__,psz,a1,a2,a3,a4)),0)
  111. #define SideAssertSz5(t,psz,a1,a2,a3,a4,a5)             ((t) ? 0 : IFTRAP(DebugTrapFn(1,__FILE__,__LINE__,psz,a1,a2,a3,a4,a5)),0)
  112. #define SideAssertSz6(t,psz,a1,a2,a3,a4,a5,a6)          ((t) ? 0 : IFTRAP(DebugTrapFn(1,__FILE__,__LINE__,psz,a1,a2,a3,a4,a5,a6)),0)
  113. #define SideAssertSz7(t,psz,a1,a2,a3,a4,a5,a6,a7)       ((t) ? 0 : IFTRAP(DebugTrapFn(1,__FILE__,__LINE__,psz,a1,a2,a3,a4,a5,a6,a7)),0)
  114. #define SideAssertSz8(t,psz,a1,a2,a3,a4,a5,a6,a7,a8)    ((t) ? 0 : IFTRAP(DebugTrapFn(1,__FILE__,__LINE__,psz,a1,a2,a3,a4,a5,a6,a7,a8)),0)
  115. #define SideAssertSz9(t,psz,a1,a2,a3,a4,a5,a6,a7,a8,a9) ((t) ? 0 : IFTRAP(DebugTrapFn(1,__FILE__,__LINE__,psz,a1,a2,a3,a4,a5,a6,a7,a8,a9)),0)
  116.  
  117. #define NFAssert(t)                                     IFTRAP(((t) ? 0 : DebugTrapFn(0,__FILE__,__LINE__,"Assertion Failure: " #t),0))
  118. #define NFAssertSz(t,psz)                               IFTRAP(((t) ? 0 : DebugTrapFn(0,__FILE__,__LINE__,psz),0))
  119. #define NFAssertSz1(t,psz,a1)                           IFTRAP(((t) ? 0 : DebugTrapFn(0,__FILE__,__LINE__,psz,a1),0))
  120. #define NFAssertSz2(t,psz,a1,a2)                        IFTRAP(((t) ? 0 : DebugTrapFn(0,__FILE__,__LINE__,psz,a1,a2),0))
  121. #define NFAssertSz3(t,psz,a1,a2,a3)                     IFTRAP(((t) ? 0 : DebugTrapFn(0,__FILE__,__LINE__,psz,a1,a2,a3),0))
  122. #define NFAssertSz4(t,psz,a1,a2,a3,a4)                  IFTRAP(((t) ? 0 : DebugTrapFn(0,__FILE__,__LINE__,psz,a1,a2,a3,a4),0))
  123. #define NFAssertSz5(t,psz,a1,a2,a3,a4,a5)               IFTRAP(((t) ? 0 : DebugTrapFn(0,__FILE__,__LINE__,psz,a1,a2,a3,a4,a5),0))
  124. #define NFAssertSz6(t,psz,a1,a2,a3,a4,a5,a6)            IFTRAP(((t) ? 0 : DebugTrapFn(0,__FILE__,__LINE__,psz,a1,a2,a3,a4,a5,a6),0))
  125. #define NFAssertSz7(t,psz,a1,a2,a3,a4,a5,a6,a7)         IFTRAP(((t) ? 0 : DebugTrapFn(0,__FILE__,__LINE__,psz,a1,a2,a3,a4,a5,a6,a7),0))
  126. #define NFAssertSz8(t,psz,a1,a2,a3,a4,a5,a6,a7,a8)      IFTRAP(((t) ? 0 : DebugTrapFn(0,__FILE__,__LINE__,psz,a1,a2,a3,a4,a5,a6,a7,a8),0))
  127. #define NFAssertSz9(t,psz,a1,a2,a3,a4,a5,a6,a7,a8,a9)   IFTRAP(((t) ? 0 : DebugTrapFn(0,__FILE__,__LINE__,psz,a1,a2,a3,a4,a5,a6,a7,a8,a9),0))
  128.  
  129. #define NFSideAssert(t)                                 ((t) ? 0 : IFTRAP(DebugTrapFn(0,__FILE__,__LINE__,"Assertion Failure: " #t)),0)
  130. #define NFSideAssertSz(t,psz)                           ((t) ? 0 : IFTRAP(DebugTrapFn(0,__FILE__,__LINE__,psz)),0)
  131. #define NFSideAssertSz1(t,psz,a1)                       ((t) ? 0 : IFTRAP(DebugTrapFn(0,__FILE__,__LINE__,psz,a1)),0)
  132. #define NFSideAssertSz2(t,psz,a1,a2)                    ((t) ? 0 : IFTRAP(DebugTrapFn(0,__FILE__,__LINE__,psz,a1,a2)),0)
  133. #define NFSideAssertSz3(t,psz,a1,a2,a3)                 ((t) ? 0 : IFTRAP(DebugTrapFn(0,__FILE__,__LINE__,psz,a1,a2,a3)),0)
  134. #define NFSideAssertSz4(t,psz,a1,a2,a3,a4)              ((t) ? 0 : IFTRAP(DebugTrapFn(0,__FILE__,__LINE__,psz,a1,a2,a3,a4)),0)
  135. #define NFSideAssertSz5(t,psz,a1,a2,a3,a4,a5)           ((t) ? 0 : IFTRAP(DebugTrapFn(0,__FILE__,__LINE__,psz,a1,a2,a3,a4,a5)),0)
  136. #define NFSideAssertSz6(t,psz,a1,a2,a3,a4,a5,a6)        ((t) ? 0 : IFTRAP(DebugTrapFn(0,__FILE__,__LINE__,psz,a1,a2,a3,a4,a5,a6)),0)
  137. #define NFSideAssertSz7(t,psz,a1,a2,a3,a4,a5,a6,a7)     ((t) ? 0 : IFTRAP(DebugTrapFn(0,__FILE__,__LINE__,psz,a1,a2,a3,a4,a5,a6,a7)),0)
  138. #define NFSideAssertSz8(t,psz,a1,a2,a3,a4,a5,a6,a7,a8)  ((t) ? 0 : IFTRAP(DebugTrapFn(0,__FILE__,__LINE__,psz,a1,a2,a3,a4,a5,a6,a7,a8)),0)
  139. #define NFSideAssertSz9(t,psz,a1,a2,a3,a4,a5,a6,a7,a8,a9)   ((t) ? 0 : IFTRAP(DebugTrapFn(0,__FILE__,__LINE__,psz,a1,a2,a3,a4,a5,a6,a7,a8,a9)),0)
  140.  
  141. /*
  142.  *   Trace Macros ------------------------------------------------------------
  143.  *  
  144.  *      DebugTrace          Use for arbitrary formatted output. It
  145.  *                          takes exactly the same arguments as the
  146.  *                          Windows wsprintf() function.
  147.  *      DebugTraceResult    Shorthand for error tracing with an
  148.  *                          HRESULT. Arguments are the name of the
  149.  *                          function (not quoted) and the HRESULT.
  150.  *      DebugTraceSc        Shorthand for error tracing with an
  151.  *                          SCODE. Arguments are the name of the
  152.  *                          function (not quoted) and the SCODE.
  153.  *      DebugTraceArg       Shorthand for invalid parameter
  154.  *                          tracing. Arguments are the name of the
  155.  *                          function (not quoted) and a quoted
  156.  *                          string describing the bad parameter.
  157.  */
  158.  
  159. #if defined(DEBUG) || defined(TRACES_ENABLED)
  160. #define IFTRACE(x)          x
  161. #define DebugTrace          DebugTraceFn
  162. #else
  163. #define IFTRACE(x)          0
  164. #define DebugTrace          1?0:DebugTraceFn
  165. #endif
  166.  
  167. #define DebugTraceResult(f,hr)                          IFTRACE(((hr) ? DebugTraceFn(#f " returns 0x%08lX %s\n", GetScode(hr), SzDecodeScode(GetScode(hr))) : 0))
  168. #define DebugTraceSc(f,sc)                              IFTRACE(((sc) ? DebugTraceFn(#f " returns 0x%08lX %s\n", sc, SzDecodeScode(sc)) : 0))
  169. #define DebugTraceArg(f,s)                              IFTRACE(DebugTraceFn(#f ": bad parameter: " s "\n"))
  170. #define DebugTraceLine()                                IFTRACE(DebugTraceFn("File %s, Line %i  \n",__FILE__,__LINE__))
  171. #define DebugTraceProblems(sz, rgprob)                  IFTRACE(DebugTraceProblemsFn(sz, rgprob))
  172.  
  173. #define TraceSz(psz)                                    IFTRACE(DebugTraceFn("~" psz))
  174. #define TraceSz1(psz,a1)                                IFTRACE(DebugTraceFn("~" psz,a1))
  175. #define TraceSz2(psz,a1,a2)                             IFTRACE(DebugTraceFn("~" psz,a1,a2))
  176. #define TraceSz3(psz,a1,a2,a3)                          IFTRACE(DebugTraceFn("~" psz,a1,a2,a3))
  177. #define TraceSz4(psz,a1,a2,a3,a4)                       IFTRACE(DebugTraceFn("~" psz,a1,a2,a3,a4))
  178. #define TraceSz5(psz,a1,a2,a3,a4,a5)                    IFTRACE(DebugTraceFn("~" psz,a1,a2,a3,a4,a5))
  179. #define TraceSz6(psz,a1,a2,a3,a4,a5,a6)                 IFTRACE(DebugTraceFn("~" psz,a1,a2,a3,a4,a5,a6))
  180. #define TraceSz7(psz,a1,a2,a3,a4,a5,a6,a7)              IFTRACE(DebugTraceFn("~" psz,a1,a2,a3,a4,a5,a6,a7))
  181. #define TraceSz8(psz,a1,a2,a3,a4,a5,a6,a7,a8)           IFTRACE(DebugTraceFn("~" psz,a1,a2,a3,a4,a5,a6,a7,a8))
  182. #define TraceSz9(psz,a1,a2,a3,a4,a5,a6,a7,a8,a9)        IFTRACE(DebugTraceFn("~" psz,a1,a2,a3,a4,a5,a6,a7,a8,a9))
  183.  
  184. /* Debugging Functions ---------------------------------------------------- */
  185.  
  186. EXTERN_C_BEGIN
  187.  
  188. #ifdef WIN16
  189. #define EXPORTDBG   __export
  190. #else
  191. #define EXPORTDBG
  192. #endif
  193.  
  194. int EXPORTDBG __cdecl       DebugTrapFn(int fFatal, char *pszFile, int iLine, char *pszFormat, ...);
  195. int EXPORTDBG __cdecl       DebugTraceFn(char *pszFormat, ...);
  196. void EXPORTDBG __cdecl      DebugTraceProblemsFn(char *sz, void *rgprob);
  197. char * EXPORTDBG __cdecl    SzDecodeScodeFn(SCODE sc);
  198. char * EXPORTDBG __cdecl    SzDecodeUlPropTypeFn(unsigned long ulPropType);
  199. char * EXPORTDBG __cdecl    SzDecodeUlPropTagFn(unsigned long ulPropTag);
  200. unsigned long EXPORTDBG __cdecl UlPropTagFromSzFn(char *psz);
  201. SCODE EXPORTDBG __cdecl     ScodeFromSzFn(char *psz);
  202. void * EXPORTDBG __cdecl    DBGMEM_EncapsulateFn(void * pmalloc, char *pszSubsys, int fCheckOften);
  203. void EXPORTDBG __cdecl      DBGMEM_ShutdownFn(void * pmalloc);
  204. void EXPORTDBG __cdecl      DBGMEM_CheckMemFn(void * pmalloc, int fReportOrphans);
  205. #if defined(_WIN32) && defined(_X86_)
  206. void EXPORTDBG __cdecl      DBGMEM_LeakHook(FARPROC pfn);
  207. void EXPORTDBG __cdecl      GetCallStack(DWORD *, int, int);
  208. #endif
  209. void EXPORTDBG __cdecl      DBGMEM_NoLeakDetectFn(void * pmalloc, void *pv);
  210. void EXPORTDBG __cdecl      DBGMEM_SetFailureAtFn(void * pmalloc, ULONG ulFailureAt);
  211. SCODE EXPORTDBG __cdecl     ScCheckScFn(SCODE, SCODE *, char *, char *, int);
  212. void * EXPORTDBG __cdecl    VMAlloc(ULONG);
  213. void * EXPORTDBG __cdecl    VMAllocEx(ULONG, ULONG);
  214. void * EXPORTDBG __cdecl    VMRealloc(void *, ULONG);
  215. void * EXPORTDBG __cdecl    VMReallocEx(void *, ULONG, ULONG);
  216. ULONG EXPORTDBG __cdecl     VMGetSize(void *);
  217. ULONG EXPORTDBG __cdecl     VMGetSizeEx(void *, ULONG);
  218. void EXPORTDBG __cdecl      VMFree(void *);
  219. void EXPORTDBG __cdecl      VMFreeEx(void *, ULONG);
  220.  
  221. EXTERN_C_END
  222.  
  223. /*
  224.  *  Debugging Macros -------------------------------------------------------
  225.  *  
  226.  *      SzDecodeScode           Returns the string name of an SCODE
  227.  *      SzDecodeUlPropTag       Returns the string name of a property
  228.  *                              tag
  229.  *      UlPropTagFromSz         Given a property tag's name, returns
  230.  *                              its value
  231.  *      ScodeFromSz             Given an SCODE's name, returns its
  232.  *                              value
  233.  *  
  234.  *      DBGMEM_Encapsulate      Given an IMalloc interface, adds heap-
  235.  *                              checking functionality and returns a
  236.  *                              wrapped interface
  237.  *      DBGMEM_Shutdown         Undoes DBGMEM_Encapsulate, and prints
  238.  *                              out information on any allocations made
  239.  *                              since the interface was encapsulated
  240.  *                              that have not yet been released.
  241.  *      DBGMEM_CheckMem         Checks all memory allocated on the heap,
  242.  *                              and optionally reports leaked blocks.
  243.  *      DBGMEM_NoLeakDetect     Prevents a block from appearing on the leak
  244.  *                              report.  Pass NULL for pv to inhibit leak
  245.  *                              reports at all from this heap.
  246.  */
  247.  
  248. #ifdef DEBUG
  249.  
  250. #define SzDecodeScode(_sc)              SzDecodeScodeFn(_sc)
  251. #define SzDecodeUlPropType(_ulPropType) SzDecodeUlPropTypeFn(_ulPropType)
  252. #define SzDecodeUlPropTag(_ulPropTag)   SzDecodeUlPropTagFn(_ulPropTag)
  253. #define UlPropTagFromSz(_sz)            UlPropTagFromSzFn(_sz)
  254. #define ScodeFromSz(_sz)                ScodeFromSzFn(_sz)
  255. #define DBGMEM_Encapsulate(pm, psz, f)  DBGMEM_EncapsulateFn(pm, psz, f)
  256. #define DBGMEM_Shutdown(pm)             DBGMEM_ShutdownFn(pm)
  257. #define DBGMEM_CheckMem(pm, f)          DBGMEM_CheckMemFn(pm, f)
  258. #define DBGMEM_NoLeakDetect(pm, pv)     DBGMEM_NoLeakDetectFn(pm, pv)
  259. #define DBGMEM_SetFailureAt(pm, ul)     DBGMEM_SetFailureAtFn(pm, ul)
  260.  
  261. #else
  262.  
  263. #define SzDecodeScode(_sc)              (0)
  264. #define SzDecodeUlPropType(_ulPropType) (0)
  265. #define SzDecodeUlPropTag(_ulPropTag)   (0)
  266. #define UlPropTagFromSz(_sz)            (0)
  267. #define ScodeFromSz(_sz)                (0)
  268.  
  269. #if defined(__cplusplus) && !defined(CINTERFACE)
  270. #define DBGMEM_Encapsulate(pmalloc, pszSubsys, fCheckOften) \
  271.     ((pmalloc)->AddRef(), (pmalloc))
  272. #define DBGMEM_Shutdown(pmalloc) \
  273.     ((pmalloc)->Release())
  274. #else
  275. #define DBGMEM_Encapsulate(pmalloc, pszSubsys, fCheckOften) \
  276.     ((pmalloc)->lpVtbl->AddRef(pmalloc), (pmalloc))
  277. #define DBGMEM_Shutdown(pmalloc) \
  278.     ((pmalloc)->lpVtbl->Release(pmalloc))
  279. #endif
  280. #define DBGMEM_CheckMem(pm, f)
  281. #define DBGMEM_NoLeakDetect(pm, pv)
  282. #define DBGMEM_SetFailureAt(pm, ul)
  283.  
  284. #endif
  285.  
  286. /*
  287.  *  SCODE maps -------------------------------------------------------------
  288.  *  
  289.  *      ScCheckSc       Given an SCODE and method name, verifies
  290.  *                      that the SCODE can legally be returned from
  291.  *                      thet method. Prints out a debug string if
  292.  *                      it cannot.
  293.  *      HrCheckHr       As ScCheckSc, for functions that return
  294.  *                      HRESULT.
  295.  */
  296.  
  297. #if defined(DEBUG) && !defined(DOS)
  298. #define ScCheckSc(sc,fn)                ScCheckScFn(sc,fn##_Scodes,#fn,__FILE__, __LINE__)
  299. #define HrCheckHr(hr,fn)                HrCheckSc(GetScode(hr),fn)
  300. #else
  301. #define ScCheckSc(sc,fn)                (sc)
  302. #define HrCheckHr(hr,fn)                (hr)
  303. #endif
  304.  
  305. #define HrCheckSc(sc,fn)                ResultFromScode(ScCheckSc(sc,fn))
  306.  
  307. #if defined(DEBUG) && !defined(DOS)
  308. extern SCODE Common_Scodes[];
  309. extern SCODE MAPILogon_Scodes[];
  310. extern SCODE MAPIAllocateBuffer_Scodes[];
  311. extern SCODE MAPIAllocateMore_Scodes[];
  312. extern SCODE MAPIFreeBuffer_Scodes[];
  313.  
  314. extern SCODE IUnknown_QueryInterface_Scodes[];
  315. extern SCODE IUnknown_AddRef_Scodes[];
  316. extern SCODE IUnknown_Release_Scodes[];
  317. extern SCODE IUnknown_GetLastError_Scodes[];
  318.  
  319. extern SCODE IMAPIProp_CopyTo_Scodes[];
  320. extern SCODE IMAPIProp_CopyProps_Scodes[];
  321. extern SCODE IMAPIProp_DeleteProps_Scodes[];
  322. extern SCODE IMAPIProp_GetIDsFromNames_Scodes[];
  323. extern SCODE IMAPIProp_GetLastError_Scodes[];
  324. extern SCODE IMAPIProp_GetNamesFromIDs_Scodes[];
  325. extern SCODE IMAPIProp_GetPropList_Scodes[];
  326. extern SCODE IMAPIProp_GetProps_Scodes[];
  327. extern SCODE IMAPIProp_OpenProperty_Scodes[];
  328. extern SCODE IMAPIProp_SetProps_Scodes[];
  329. extern SCODE IMAPIProp_SaveChanges_Scodes[];
  330.  
  331. extern SCODE IStream_Read_Scodes[];
  332. extern SCODE IStream_Write_Scodes[];
  333. extern SCODE IStream_Seek_Scodes[];
  334. extern SCODE IStream_SetSize_Scodes[];
  335. extern SCODE IStream_Tell_Scodes[];
  336. extern SCODE IStream_LockRegion_Scodes[];
  337. extern SCODE IStream_UnlockRegion_Scodes[];
  338. extern SCODE IStream_Clone_Scodes[];
  339. extern SCODE IStream_CopyTo_Scodes[];
  340. extern SCODE IStream_Revert_Scodes[];
  341. extern SCODE IStream_Stat_Scodes[];
  342. extern SCODE IStream_Commit_Scodes[];
  343.  
  344. extern SCODE IMAPITable_GetLastError_Scodes[];
  345. extern SCODE IMAPITable_Advise_Scodes[];
  346. extern SCODE IMAPITable_Unadvise_Scodes[];
  347. extern SCODE IMAPITable_GetStatus_Scodes[];
  348. extern SCODE IMAPITable_SetColumns_Scodes[];
  349. extern SCODE IMAPITable_QueryColumns_Scodes[];
  350. extern SCODE IMAPITable_GetRowCount_Scodes[];
  351. extern SCODE IMAPITable_SeekRow_Scodes[];
  352. extern SCODE IMAPITable_SeekRowApprox_Scodes[];
  353. extern SCODE IMAPITable_QueryPosition_Scodes[];
  354. extern SCODE IMAPITable_FindRow_Scodes[];
  355. extern SCODE IMAPITable_Restrict_Scodes[];
  356. extern SCODE IMAPITable_CreateBookmark_Scodes[];
  357. extern SCODE IMAPITable_FreeBookmark_Scodes[];
  358. extern SCODE IMAPITable_SortTable_Scodes[];
  359. extern SCODE IMAPITable_QuerySortOrder_Scodes[];
  360. extern SCODE IMAPITable_QueryRows_Scodes[];
  361. extern SCODE IMAPITable_Abort_Scodes[];
  362. extern SCODE IMAPITable_ExpandRow_Scodes[];
  363. extern SCODE IMAPITable_CollapseRow_Scodes[];
  364. extern SCODE IMAPITable_WaitForCompletion_Scodes[];
  365. extern SCODE IMAPITable_GetCollapseState_Scodes[];
  366. extern SCODE IMAPITable_SetCollapseState_Scodes[];
  367.  
  368. extern SCODE IMAPISession_LogOff_Scodes[];
  369. extern SCODE IMAPISession_Release_Scodes[];
  370. extern SCODE IMAPISession_GetLastError_Scodes[];
  371. extern SCODE IMAPISession_GetMsgStoresTable_Scodes[];
  372. extern SCODE IMAPISession_GetStatusTable_Scodes[];
  373. extern SCODE IMAPISession_OpenMsgStore_Scodes[];
  374. extern SCODE IMAPISession_OpenAddressBook_Scodes[];
  375. extern SCODE IMAPISession_OpenEntry_Scodes[];
  376. extern SCODE IMAPISession_OpenProfileSection_Scodes[];
  377. extern SCODE IMAPISession_Advise_Scodes[];
  378. extern SCODE IMAPISession_Unadvise_Scodes[];
  379. extern SCODE IMAPISession_CompareEntryIDs_Scodes[];
  380. extern SCODE IMAPISession_MessageOptions_Scodes[];
  381. extern SCODE IMAPISession_QueryDefaultMessageOpt_Scodes[];
  382. extern SCODE IMAPISession_EnumAdrTypes_Scodes[];
  383. extern SCODE IMAPISession_QueryIdentity_Scodes[];
  384. extern SCODE IMAPISession_OpenProfileSection_Scodes[];
  385. extern SCODE IMAPISession_GetStatusTable_Scodes[];
  386.  
  387. extern SCODE IMsgStore_Advise_Scodes[] ;
  388. extern SCODE IMsgStore_Unadvise_Scodes[] ;
  389. extern SCODE IMsgStore_CompareEntryIDs_Scodes[] ;
  390. extern SCODE IMsgStore_OpenEntry_Scodes[] ;
  391. extern SCODE IMsgStore_SetReceiveFolder_Scodes[];
  392. extern SCODE IMsgStore_GetReceiveFolder_Scodes[];
  393. extern SCODE IMsgStore_GetReceiveFolderTable_Scodes[];
  394. extern SCODE IMsgStore_StoreLogoff_Scodes[];
  395. extern SCODE IMsgStore_AbortSubmit_Scodes[];
  396. extern SCODE IMsgStore_GetOutgoingQueue_Scodes[] ;
  397. extern SCODE IMsgStore_SetLockState_Scodes[] ;
  398. extern SCODE IMsgStore_FinishedMsg_Scodes[] ;
  399. extern SCODE IMsgStore_NotifyNewMail_Scodes[];
  400.  
  401. extern SCODE IMAPIFolder_GetContentsTable_Scodes[];
  402. extern SCODE IMAPIFolder_GetHierarchyTable_Scodes[];
  403. extern SCODE IMAPIFolder_SaveContentsSort_Scodes[];
  404. extern SCODE IMAPIFolder_OpenEntry_Scodes[];
  405. extern SCODE IMAPIFolder_CreateMessage_Scodes[];
  406. extern SCODE IMAPIFolder_CopyMessages_Scodes[];
  407. extern SCODE IMAPIFolder_DeleteMessages_Scodes[];
  408. extern SCODE IMAPIFolder_CreateFolder_Scodes[];
  409. extern SCODE IMAPIFolder_CopyFolder_Scodes[];
  410. extern SCODE IMAPIFolder_DeleteFolder_Scodes[];
  411. extern SCODE IMAPIFolder_SetSearchCriteria_Scodes[];
  412. extern SCODE IMAPIFolder_GetSearchCriteria_Scodes[];
  413. extern SCODE IMAPIFolder_SetReadFlags_Scodes[];
  414. extern SCODE IMAPIFolder_GetMessageStatus_Scodes[];
  415. extern SCODE IMAPIFolder_SetMessageStatus_Scodes[];
  416. extern SCODE IMAPIFolder_EmptyFolder_Scodes[];
  417.  
  418. extern SCODE IMessage_SaveChanges_Scodes[];
  419. extern SCODE IMessage_GetAttachmentTable_Scodes[];
  420. extern SCODE IMessage_OpenAttach_Scodes[];
  421. extern SCODE IMessage_CreateAttach_Scodes[];
  422. extern SCODE IMessage_DeleteAttach_Scodes[];
  423. extern SCODE IMessage_GetRecipientTable_Scodes[];
  424. extern SCODE IMessage_ModifyRecipients_Scodes[];
  425. extern SCODE IMessage_SubmitMessage_Scodes[];
  426. extern SCODE IMessage_SetReadFlag_Scodes[];
  427.  
  428. extern SCODE IAttach_SaveChanges_Scodes[];
  429.  
  430. extern SCODE IAddrBook_OpenEntry_Scodes[];
  431. extern SCODE IAddrBook_CompareEntryIDs_Scodes[];
  432. extern SCODE IAddrBook_CreateOneOff_Scodes[];
  433. extern SCODE IAddrBook_ResolveName_Scodes[];
  434. extern SCODE IAddrBook_Address_Scodes[];
  435. extern SCODE IAddrBook_Details_Scodes[];
  436. extern SCODE IAddrBook_RecipOptions_Scodes[];
  437. extern SCODE IAddrBook_QueryDefaultRecipOpt_Scodes[];
  438. extern SCODE IAddrBook_Address_Scodes[];
  439. extern SCODE IAddrBook_ButtonPress_Scodes[];
  440.  
  441. extern SCODE IABContainer_GetContentsTable_Scodes[];
  442. extern SCODE IABContainer_GetHierarchyTable_Scodes[];
  443.  
  444. extern SCODE INotifObj_ChangeEvMask_Scodes[];
  445.  
  446. extern SCODE IMAPIStatus_ChangePassword_Scodes[];
  447. extern SCODE IMAPIStatus_FlushQueues_Scodes[];
  448. extern SCODE IMAPIStatus_SettingsDialog_Scodes[];
  449. extern SCODE IMAPIStatus_ValidateState_Scodes[];
  450.  
  451. extern SCODE IMSProvider_Logon_Scodes[];
  452. extern SCODE IMSProvider_Deinit_Scodes[];
  453. extern SCODE IMSProvider_Init_Scodes[];
  454. extern SCODE IMSProvider_SpoolerLogon_Scodes[];
  455. extern SCODE IMSProvider_Shutdown_Scodes[];
  456.  
  457. extern SCODE SMAPI_MAPILogon_Scodes[];
  458. extern SCODE SMAPI_MAPILogoff_Scodes[];
  459. extern SCODE SMAPI_MAPIFreeBuffer_Scodes[];
  460. extern SCODE SMAPI_MAPISendMail_Scodes[];
  461. extern SCODE SMAPI_MAPISendDocuments_Scodes[];
  462. extern SCODE SMAPI_MAPIFindNext_Scodes[];
  463. extern SCODE SMAPI_MAPIReadMail_Scodes[];
  464. extern SCODE SMAPI_MAPISaveMail_Scodes[];
  465. extern SCODE SMAPI_MAPIDeleteMail_Scodes[];
  466. extern SCODE SMAPI_MAPIAddress_Scodes[];
  467. extern SCODE SMAPI_MAPIResolveName_Scodes[];
  468. extern SCODE SMAPI_MAPIDetails_Scodes[];
  469.  
  470. extern SCODE IMSLogon_OpenEntry_Scodes[];
  471. extern SCODE IMSLogon_OpenStatusEntry_Scodes[];
  472. extern SCODE IMSLogon_CompareEntryIDs_Scodes[];
  473. extern SCODE IMSLogon_Advise_Scodes[];
  474. extern SCODE IMSLogon_Unadvise_Scodes[];
  475. extern SCODE IMSLogon_Logoff_Scodes[];
  476. #endif
  477.  
  478. /* ------------------------------------------------------------------------ */
  479.  
  480. #pragma option pop /*P_O_Pop*/
  481. #endif
  482.