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.

941 lines
54 KiB

  1. /*++
  2. Copyright (c) 1985 - 1999, Microsoft Corporation
  3. Module Name:
  4. w32err.h
  5. Abstract:
  6. private header file for Win32 kernel mode driver to do error logging
  7. --*/
  8. #ifndef _W32ERR_
  9. #define _W32ERR_
  10. DWORD GetRipComponent(VOID);
  11. DWORD GetDbgTagFlags(int tag);
  12. DWORD GetRipFlags(VOID);
  13. VOID SetRipFlags(DWORD dwRipFlags);
  14. VOID SetDbgTag(int tag, DWORD dwBitFlags);
  15. VOID SetDbgTagCount(DWORD dwTagCount);
  16. VOID UserSetLastError(DWORD dwErrCode);
  17. VOID SetLastNtError(NTSTATUS Status);
  18. #if DBG
  19. /*
  20. * Note: the only way to have multiple statements in a macro treated
  21. * as a single statement and not cause side effects is to put it
  22. * in a do-while loop.
  23. */
  24. #define UserAssert(exp) \
  25. do { \
  26. if (!(exp)) { \
  27. RIPMSG0(RIP_ERROR, "Assertion failed: " #exp); \
  28. } \
  29. } while (FALSE)
  30. #define UserAssertMsg0(exp, msg) \
  31. do { \
  32. if (!(exp)) { \
  33. RIPMSG0(RIP_ERROR, "Assertion failed: " msg); \
  34. } \
  35. } while (FALSE)
  36. #define UserAssertMsg1(exp, msg, p1) \
  37. do { \
  38. if (!(exp)) { \
  39. RIPMSG1(RIP_ERROR, "Assertion failed: " msg, p1); \
  40. } \
  41. } while (FALSE)
  42. #define UserAssertMsg2(exp, msg, p1, p2) \
  43. do { \
  44. if (!(exp)) { \
  45. RIPMSG2(RIP_ERROR, "Assertion failed: " msg, p1, p2); \
  46. } \
  47. } while (FALSE)
  48. #define UserAssertMsg3(exp, msg, p1, p2, p3) \
  49. do { \
  50. if (!(exp)) { \
  51. RIPMSG3(RIP_ERROR, "Assertion failed: " msg, p1, p2, p3); \
  52. } \
  53. } while (FALSE)
  54. #define UserAssertMsg4(exp, msg, p1, p2, p3, p4) \
  55. do { \
  56. if (!(exp)) { \
  57. RIPMSG4(RIP_ERROR, "Assertion failed: " msg, p1, p2, p3, p4); \
  58. } \
  59. } while (FALSE)
  60. #define UserAssertMsg5(exp, msg, p1, p2, p3, p4, p5) \
  61. do { \
  62. if (!(exp)) { \
  63. RIPMSG5(RIP_ERROR, "Assertion failed: " msg, p1, p2, p3, p4, p5); \
  64. } \
  65. } while (FALSE)
  66. #define UserAssertMsg6(exp, msg, p1, p2, p3, p4, p5, p6) \
  67. do { \
  68. if (!(exp)) { \
  69. RIPMSG6(RIP_ERROR, "Assertion failed: " msg, p1, p2, p3, p4, p5, p6); \
  70. } \
  71. } while (FALSE)
  72. #define UserAssertMsg7(exp, msg, p1, p2, p3, p4, p5, p6, p7) \
  73. do { \
  74. if (!(exp)) { \
  75. RIPMSG7(RIP_ERROR, "Assertion failed: " msg, p1, p2, p3, p4, p5, p6, p7); \
  76. } \
  77. } while (FALSE)
  78. #define UserAssertMsg8(exp, msg, p1, p2, p3, p4, p5, p6, p7, p8) \
  79. do { \
  80. if (!(exp)) { \
  81. RIPMSG8(RIP_ERROR, "Assertion failed: " msg, p1, p2, p3, p4, p5, p6, p7, p8); \
  82. } \
  83. } while (FALSE)
  84. #define UserVerify(exp) UserAssert(exp)
  85. #define UserVerifyMsg0(exp, msg) UserAssertMsg0(exp, msg)
  86. #define UserVerifyMsg1(exp, msg, p1) UserAssertMsg1(exp, msg, p1)
  87. #define UserVerifyMsg2(exp, msg, p1, p2) UserAssertMsg2(exp, msg, p1, p2)
  88. #define UserVerifyMsg3(exp, msg, p1, p2, p3) UserAssertMsg3(exp, msg, p1, p2, p3)
  89. #define UserVerifyMsg4(exp, msg, p1, p2, p3, p4) UserAssertMsg4(exp, msg, p1, p2, p3, p4)
  90. #define UserVerifyMsg5(exp, msg, p1, p2, p3, p4, p5) UserAssertMsg5(exp, msg, p1, p2, p3, p4, p5)
  91. #define UserVerifyMsg6(exp, msg, p1, p2, p3, p4, p5, p6) UserAssertMsg6(exp, msg, p1, p2, p3, p4, p5, p6)
  92. #define UserVerifyMsg7(exp, msg, p1, p2, p3, p4, p5, p6, p7) UserAssertMsg7(exp, msg, p1, p2, p3, p4, p5, p6, p7)
  93. #define UserVerifyMsg8(exp, msg, p1, p2, p3, p4, p5, p6, p7, p8) UserAssertMsg8(exp, msg, p1, p2, p3, p4, p5, p6, p7, p8)
  94. /*
  95. * Invalid Parameter warning message and last error setting.
  96. */
  97. #define VALIDATIONFAIL(p) \
  98. RIPMSG2(RIP_WARNING, "%s: Invalid " #p ": %#lx", __FUNCTION__, ##p); \
  99. goto InvalidParameter;
  100. #define VALIDATIONOBSOLETE(o, u) \
  101. RIPMSG1(RIP_WARNING, "%s: " #o " obsolete; use " #u, __FUNCTION__)
  102. #else
  103. #define UserAssert(exp)
  104. #define UserAssertMsg0(exp, msg)
  105. #define UserAssertMsg1(exp, msg, p1)
  106. #define UserAssertMsg2(exp, msg, p1, p2)
  107. #define UserAssertMsg3(exp, msg, p1, p2, p3)
  108. #define UserAssertMsg4(exp, msg, p1, p2, p3, p4)
  109. #define UserAssertMsg5(exp, msg, p1, p2, p3, p4, p5)
  110. #define UserAssertMsg6(exp, msg, p1, p2, p3, p4, p5, p6)
  111. #define UserAssertMsg7(exp, msg, p1, p2, p3, p4, p5, p6, p7)
  112. #define UserAssertMsg8(exp, msg, p1, p2, p3, p4, p5, p6, p7, p8)
  113. #define UserVerify(exp) exp
  114. #define UserVerifyMsg0(exp, msg) exp
  115. #define UserVerifyMsg1(exp, msg, p1) exp
  116. #define UserVerifyMsg2(exp, msg, p1, p2) exp
  117. #define UserVerifyMsg3(exp, msg, p1, p2, p3) exp
  118. #define UserVerifyMsg4(exp, msg, p1, p2, p3, p4) exp
  119. #define UserVerifyMsg5(exp, msg, p1, p2, p3, p4, p5) exp
  120. #define UserVerifyMsg6(exp, msg, p1, p2, p3, p4, p5, p6) exp
  121. #define UserVerifyMsg7(exp, msg, p1, p2, p3, p4, p5, p6, p7) exp
  122. #define UserVerifyMsg8(exp, msg, p1, p2, p3, p4, p5, p6, p7, p8) exp
  123. #define VALIDATIONFAIL(p) goto InvalidParameter;
  124. #define VALIDATIONOBSOLETE(o, u)
  125. #endif /* #else of #ifdef DEBUG */
  126. #define VALIDATIONERROR(ret) \
  127. InvalidParameter: \
  128. UserSetLastError(ERROR_INVALID_PARAMETER); \
  129. return ret;
  130. /***************************************************************************\
  131. * Tags
  132. *
  133. * Use tags to control "internal" debugging: output we don't want
  134. * external users of a checked build to see and debug code we don't want
  135. * external users to have to run.
  136. *
  137. * You control tag output in the debugger by using the "tag"
  138. * extension in userkdx.dll or userexts.dll, or type 't' at a debug prompt.
  139. *
  140. * You can create your own tag by adding it to ntuser\inc\dbgtag.lst.
  141. * If you need debug output while developing but don't want to check in the
  142. * code using tags, use DBGTAG_Other as a generic tag, and remove the tag code
  143. * when done.
  144. *
  145. * IsDbgTagEnabled() checks if a tag is enabled. Use this to control optional
  146. * debugging features, for example in handtabl.c:
  147. *
  148. * //
  149. * // Record where the object was marked for destruction.
  150. * //
  151. * if (IsDbgTagEnabled(tagTrackLocks)) {
  152. * if (!(phe->bFlags & HANDLEF_DESTROY)) {
  153. * PVOID pfn1, pfn2;
  154. *
  155. * RtlGetCallersAddress(&pfn1, &pfn2);
  156. * HMRecordLock(pfn1, pobj, ((PHEAD)pobj)->cLockObj, 0);
  157. * }
  158. * }
  159. *
  160. * TAGMSG prints a message when a tag has printing or prompting enabled.
  161. * Example in input.c:
  162. *
  163. * TAGMSG5(tagSysPeek,
  164. * "%d pti %lx sets ptiSL %lx to pq %lx ; old ptiSL %lx\n",
  165. * where, ptiCurrent, ptiSysLock, pq, pq->ptiSysLock);
  166. *
  167. *
  168. * Use DbgTagBreak() to break when a tag is enabled (and not just
  169. * when prompting for that tag is enabled).
  170. *
  171. * Use GetDbgTag() and SetDbgTag to temporarily change the state of a tag.
  172. * You should rarely, if ever, do this.
  173. *
  174. \***************************************************************************/
  175. #if DBG
  176. BOOL _cdecl VTagOutput(DWORD flags, LPSTR pszFile, int iLine, LPSTR pszFunction, LPSTR pszFmt, ...);
  177. BOOL IsDbgTagEnabled(int tag);
  178. VOID DbgTagBreak(int tag);
  179. DWORD GetDbgTag(int tag);
  180. VOID InitDbgTags(VOID);
  181. /*
  182. * Use TAGMSG to print a tagged message.
  183. */
  184. #define TAGMSG0(flags, szFmt) CALLRIP((VTagOutput((flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, szFmt)))
  185. #define TAGMSG1(flags, szFmt, p1) CALLRIP((VTagOutput((flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, szFmt, p1)))
  186. #define TAGMSG2(flags, szFmt, p1, p2) CALLRIP((VTagOutput((flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, szFmt, p1, p2)))
  187. #define TAGMSG3(flags, szFmt, p1, p2, p3) CALLRIP((VTagOutput((flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, szFmt, p1, p2, p3)))
  188. #define TAGMSG4(flags, szFmt, p1, p2, p3, p4) CALLRIP((VTagOutput((flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, szFmt, p1, p2, p3, p4)))
  189. #define TAGMSG5(flags, szFmt, p1, p2, p3, p4, p5) CALLRIP((VTagOutput((flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, szFmt, p1, p2, p3, p4, p5)))
  190. #define TAGMSG6(flags, szFmt, p1, p2, p3, p4, p5, p6) CALLRIP((VTagOutput((flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, szFmt, p1, p2, p3, p4, p5, p6)))
  191. #define TAGMSG7(flags, szFmt, p1, p2, p3, p4, p5, p6, p7) CALLRIP((VTagOutput((flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, szFmt, p1, p2, p3, p4, p5, p6, p7)))
  192. #define TAGMSG8(flags, szFmt, p1, p2, p3, p4, p5, p6, p7, p8) CALLRIP((VTagOutput((flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, szFmt, p1, p2, p3, p4, p5, p6, p7, p8)))
  193. #define TAGMSG9(flags, szFmt, p1, p2, p3, p4, p5, p6, p7, p8, p9) CALLRIP((VTagOutput((flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, szFmt, p1, p2, p3, p4, p5, p6, p7, p8, p9)))
  194. #define TAGMSG10(flags, szFmt, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10) CALLRIP((VTagOutput((flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, szFmt, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10)))
  195. #define TAGMSG11(flags, szFmt, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11) CALLRIP((VTagOutput((flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, szFmt, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11)))
  196. #define TAGMSG12(flags, szFmt, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12) CALLRIP((VTagOutput((flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, szFmt, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12)))
  197. #define TAGMSGF0(flags, szFmt) CALLRIP((VTagOutput((flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, __FUNCTION__ ": " szFmt)))
  198. #define TAGMSGF1(flags, szFmt, p1) CALLRIP((VTagOutput((flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, __FUNCTION__ ": " szFmt, p1)))
  199. #define TAGMSGF2(flags, szFmt, p1, p2) CALLRIP((VTagOutput((flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, __FUNCTION__ ": " szFmt, p1, p2)))
  200. #define TAGMSGF3(flags, szFmt, p1, p2, p3) CALLRIP((VTagOutput((flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, __FUNCTION__ ": " szFmt, p1, p2, p3)))
  201. #define TAGMSGF4(flags, szFmt, p1, p2, p3, p4) CALLRIP((VTagOutput((flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, __FUNCTION__ ": " szFmt, p1, p2, p3, p4)))
  202. #define TAGMSGF5(flags, szFmt, p1, p2, p3, p4, p5) CALLRIP((VTagOutput((flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, __FUNCTION__ ": " szFmt, p1, p2, p3, p4, p5)))
  203. #define TAGMSGF6(flags, szFmt, p1, p2, p3, p4, p5, p6) CALLRIP((VTagOutput((flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, __FUNCTION__ ": " szFmt, p1, p2, p3, p4, p5, p6)))
  204. #define TAGMSGF7(flags, szFmt, p1, p2, p3, p4, p5, p6, p7) CALLRIP((VTagOutput((flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, __FUNCTION__ ": " szFmt, p1, p2, p3, p4, p5, p6, p7)))
  205. #define TAGMSGF8(flags, szFmt, p1, p2, p3, p4, p5, p6, p7, p8) CALLRIP((VTagOutput((flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, __FUNCTION__ ": " szFmt, p1, p2, p3, p4, p5, p6, p7, p8)))
  206. #define TAGMSG9F(flags, szFmt, p1, p2, p3, p4, p5, p6, p7, p8, p9) CALLRIP((VTagOutput((flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, __FUNCTION__ ": " szFmt, p1, p2, p3, p4, p5, p6, p7, p8, p9)))
  207. #define TAGMSGF10(flags, szFmt, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10) CALLRIP((VTagOutput((flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, __FUNCTION__ ": " szFmt, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10)))
  208. #define TAGMSGF11(flags, szFmt, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11) CALLRIP((VTagOutput((flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, __FUNCTION__ ": " szFmt, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11)))
  209. #define TAGMSGF12(flags, szFmt, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12) CALLRIP((VTagOutput((flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, __FUNCTION__ ": " szFmt, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12)))
  210. #else
  211. #define IsDbgTagEnabled(tag)
  212. #define DbgTagBreak(tag)
  213. #define InitDbgTags()
  214. #define GetDbgTag(tag)
  215. #define TAGMSG0(flags, szFmt)
  216. #define TAGMSG1(flags, szFmt, p1)
  217. #define TAGMSG2(flags, szFmt, p1, p2)
  218. #define TAGMSG3(flags, szFmt, p1, p2, p3)
  219. #define TAGMSG4(flags, szFmt, p1, p2, p3, p4)
  220. #define TAGMSG5(flags, szFmt, p1, p2, p3, p4, p5)
  221. #define TAGMSG6(flags, szFmt, p1, p2, p3, p4, p5, p6)
  222. #define TAGMSG7(flags, szFmt, p1, p2, p3, p4, p5, p6, p7)
  223. #define TAGMSG8(flags, szFmt, p1, p2, p3, p4, p5, p6, p7, p8)
  224. #define TAGMSG9(flags, szFmt, p1, p2, p3, p4, p5, p6, p7, p8, p9)
  225. #define TAGMSG10(flags, szFmt, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10)
  226. #define TAGMSG11(flags, szFmt, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11)
  227. #define TAGMSG12(flags, szFmt, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12)
  228. #define TAGMSGF0(flags, szFmt)
  229. #define TAGMSGF1(flags, szFmt, p1)
  230. #define TAGMSGF2(flags, szFmt, p1, p2)
  231. #define TAGMSGF3(flags, szFmt, p1, p2, p3)
  232. #define TAGMSGF4(flags, szFmt, p1, p2, p3, p4)
  233. #define TAGMSGF5(flags, szFmt, p1, p2, p3, p4, p5)
  234. #define TAGMSGF6(flags, szFmt, p1, p2, p3, p4, p5, p6)
  235. #define TAGMSGF7(flags, szFmt, p1, p2, p3, p4, p5, p6, p7)
  236. #define TAGMSGF8(flags, szFmt, p1, p2, p3, p4, p5, p6, p7, p8)
  237. #define TAGMSG9F(flags, szFmt, p1, p2, p3, p4, p5, p6, p7, p8, p9)
  238. #define TAGMSGF10(flags, szFmt, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10)
  239. #define TAGMSGF11(flags, szFmt, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11)
  240. #define TAGMSGF12(flags, szFmt, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12)
  241. #endif
  242. #define DUMMYCALLINGTYPE
  243. #if DBG
  244. #define FUNCLOG1(LogClass, retType, CallType, fnName, p1Type, p1) \
  245. retType CallType fnName(p1Type p1); \
  246. retType CallType fnName##_wrapper(p1Type p1) \
  247. { \
  248. retType ret; \
  249. TAGMSG1(DBGTAG_LOG, #fnName"("#p1" 0x%p)", p1); \
  250. ret = fnName(p1); \
  251. TAGMSG1(DBGTAG_LOG, "Return of "#fnName" is 0x%p", ret); \
  252. return ret; \
  253. }
  254. #define FUNCLOG2(LogClass, retType, CallType, fnName, p1Type, p1, p2Type, p2) \
  255. retType CallType fnName(p1Type p1, p2Type p2); \
  256. retType CallType fnName##_wrapper(p1Type p1, p2Type p2) \
  257. { \
  258. retType ret; \
  259. TAGMSG2(DBGTAG_LOG, #fnName"("#p1" 0x%p,"#p2" 0x%p)", p1, p2); \
  260. ret = fnName(p1, p2); \
  261. TAGMSG1(DBGTAG_LOG, "Return of "#fnName" is 0x%p", ret); \
  262. return ret; \
  263. }
  264. #define FUNCLOG3(LogClass, retType, CallType, fnName, p1Type, p1, p2Type, p2, p3Type, p3) \
  265. retType CallType fnName(p1Type p1, p2Type p2, p3Type p3); \
  266. retType CallType fnName##_wrapper(p1Type p1, p2Type p2, p3Type p3) \
  267. { \
  268. retType ret; \
  269. TAGMSG3(DBGTAG_LOG, #fnName"("#p1" 0x%p,"#p2" 0x%p,"#p3" 0x%p)", p1, p2, p3); \
  270. ret = fnName(p1, p2, p3); \
  271. TAGMSG1(DBGTAG_LOG, "Return of "#fnName" is 0x%p", ret); \
  272. return ret; \
  273. }
  274. #define FUNCLOG4(LogClass, retType, CallType, fnName, p1Type, p1, p2Type, p2, p3Type, p3, p4Type, p4) \
  275. retType CallType fnName(p1Type p1, p2Type p2, p3Type p3, p4Type p4); \
  276. retType CallType fnName##_wrapper(p1Type p1, p2Type p2, p3Type p3, p4Type p4) \
  277. { \
  278. retType ret; \
  279. TAGMSG4(DBGTAG_LOG, #fnName"("#p1" 0x%p,"#p2" 0x%p,"#p3" 0x%p,"#p4" 0x%p)", p1, p2, p3, p4); \
  280. ret = fnName(p1, p2, p3, p4); \
  281. TAGMSG1(DBGTAG_LOG, "Return of "#fnName" is 0x%p", ret); \
  282. return ret; \
  283. }
  284. #define FUNCLOG5(LogClass, retType, CallType, fnName, p1Type, p1, p2Type, p2, p3Type, p3, p4Type, p4, p5Type, p5) \
  285. retType CallType fnName(p1Type p1, p2Type p2, p3Type p3, p4Type p4, p5Type p5); \
  286. retType CallType fnName##_wrapper(p1Type p1, p2Type p2, p3Type p3, p4Type p4, p5Type p5) \
  287. { \
  288. retType ret; \
  289. TAGMSG5(DBGTAG_LOG, #fnName"("#p1" 0x%p,"#p2" 0x%p,"#p3" 0x%p,"#p4" 0x%p,"#p5" 0x%p)", p1, p2, p3, p4, p5); \
  290. ret = fnName(p1, p2, p3, p4, p5); \
  291. TAGMSG1(DBGTAG_LOG, "Return of "#fnName" is 0x%p", ret); \
  292. return ret; \
  293. }
  294. #define FUNCLOG6(LogClass, retType, CallType, fnName, p1Type, p1, p2Type, p2, p3Type, p3, p4Type, p4, p5Type, p5, p6Type, p6) \
  295. retType CallType fnName(p1Type p1, p2Type p2, p3Type p3, p4Type p4, p5Type p5, p6Type p6); \
  296. retType CallType fnName##_wrapper(p1Type p1, p2Type p2, p3Type p3, p4Type p4, p5Type p5, p6Type p6) \
  297. { \
  298. retType ret; \
  299. TAGMSG6(DBGTAG_LOG, #fnName"("#p1" 0x%p,"#p2" 0x%p,"#p3" 0x%p,"#p4" 0x%p,"#p5" 0x%p,"#p6" 0x%p)", p1, p2, p3, p4, p5, p6); \
  300. ret = fnName(p1, p2, p3, p4, p5, p6); \
  301. TAGMSG1(DBGTAG_LOG, "Return of "#fnName" is 0x%p", ret); \
  302. return ret; \
  303. }
  304. #define FUNCLOG7(LogClass, retType, CallType, fnName, p1Type, p1, p2Type, p2, p3Type, p3, p4Type, p4, p5Type, p5, p6Type, p6, p7Type, p7) \
  305. retType CallType fnName(p1Type p1, p2Type p2, p3Type p3, p4Type p4, p5Type p5, p6Type p6, p7Type p7); \
  306. retType CallType fnName##_wrapper(p1Type p1, p2Type p2, p3Type p3, p4Type p4, p5Type p5, p6Type p6, p7Type p7) \
  307. { \
  308. retType ret; \
  309. TAGMSG7(DBGTAG_LOG, #fnName"("#p1" 0x%p,"#p2" 0x%p,"#p3" 0x%p,"#p4" 0x%p,"#p5" 0x%p,"#p6" 0x%p,"#p7" 0x%p)", p1, p2, p3, p4, p5, p6, p7); \
  310. ret = fnName(p1, p2, p3, p4, p5, p6, p7); \
  311. TAGMSG1(DBGTAG_LOG, "Return of "#fnName" is 0x%p", ret); \
  312. return ret; \
  313. }
  314. #define FUNCLOG8(LogClass, retType, CallType, fnName, p1Type, p1, p2Type, p2, p3Type, p3, p4Type, p4, p5Type, p5, p6Type, p6, p7Type, p7, p8Type, p8) \
  315. retType CallType fnName##_wrapper(p1Type p1, p2Type p2, p3Type p3, p4Type p4, p5Type p5, p6Type p6, p7Type p7, p8Type p8); \
  316. retType CallType fnName##_wrapper(p1Type p1, p2Type p2, p3Type p3, p4Type p4, p5Type p5, p6Type p6, p7Type p7, p8Type p8) \
  317. { \
  318. retType ret; \
  319. TAGMSG8(DBGTAG_LOG, #fnName"("#p1" 0x%p,"#p2" 0x%p,"#p3" 0x%p,"#p4" 0x%p,"#p5" 0x%p,"#p6" 0x%p,"#p7" 0x%p,"#p8" 0x%p)", p1, p2, p3, p4, p5, p6, p7, p8); \
  320. ret = fnName(p1, p2, p3, p4, p5, p6, p7, p8); \
  321. TAGMSG1(DBGTAG_LOG, "Return of "#fnName" is 0x%p", ret); \
  322. return ret; \
  323. }
  324. #define FUNCLOG9(LogClass, retType, CallType, fnName, p1Type, p1, p2Type, p2, p3Type, p3, p4Type, p4, p5Type, p5, p6Type, p6, p7Type, p7, p8Type, p8, p9Type, p9) \
  325. retType CallType fnName(p1Type p1, p2Type p2, p3Type p3, p4Type p4, p5Type p5, p6Type p6, p7Type p7, p8Type p8, p9Type p9); \
  326. retType CallType fnName##_wrapper(p1Type p1, p2Type p2, p3Type p3, p4Type p4, p5Type p5, p6Type p6, p7Type p7, p8Type p8, p9Type p9) \
  327. { \
  328. retType ret; \
  329. TAGMSG9(DBGTAG_LOG, #fnName"("#p1" 0x%p,"#p2" 0x%p,"#p3" 0x%p,"#p4" 0x%p,"#p5" 0x%p,"#p6" 0x%p,"#p7" 0x%p,"#p8" 0x%p,"#p9" 0x%p)", p1, p2, p3, p4, p5, p6, p7, p8, p9); \
  330. ret = fnName(p1, p2, p3, p4, p5, p6, p7, p8, p9); \
  331. TAGMSG1(DBGTAG_LOG, "Return of "#fnName" is 0x%p", ret); \
  332. return ret; \
  333. }
  334. #define FUNCLOG10(LogClass, retType, CallType, fnName, p1Type, p1, p2Type, p2, p3Type, p3, p4Type, p4, p5Type, p5, p6Type, p6, p7Type, p7, p8Type, p8, p9Type, p9, p10Type, p10) \
  335. retType CallType fnName(p1Type p1, p2Type p2, p3Type p3, p4Type p4, p5Type p5, p6Type p6, p7Type p7, p8Type p8, p9Type p9, p10Type p10); \
  336. retType CallType fnName##_wrapper(p1Type p1, p2Type p2, p3Type p3, p4Type p4, p5Type p5, p6Type p6, p7Type p7, p8Type p8, p9Type p9, p10Type p10) \
  337. { \
  338. retType ret; \
  339. TAGMSG10(DBGTAG_LOG, #fnName"("#p1" 0x%p,"#p2" 0x%p,"#p3" 0x%p,"#p4" 0x%p,"#p5" 0x%p,"#p6" 0x%p,"#p7" 0x%p,"#p8" 0x%p,"#p9" 0x%p,"#p10" 0x%p)", p1, p2, p3, p4, p5, p6, p7, p8, p9, p10); \
  340. ret = fnName(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10); \
  341. TAGMSG1(DBGTAG_LOG, "Return of "#fnName" is 0x%p", ret); \
  342. return ret; \
  343. }
  344. #define FUNCLOG11(LogClass, retType, CallType, fnName, p1Type, p1, p2Type, p2, p3Type, p3, p4Type, p4, p5Type, p5, p6Type, p6, p7Type, p7, p8Type, p8, p9Type, p9, p10Type, p10, p11Type, p11) \
  345. retType CallType fnName(p1Type p1, p2Type p2, p3Type p3, p4Type p4, p5Type p5, p6Type p6, p7Type p7, p8Type p8, p9Type p9, p10Type p10, p11Type p11); \
  346. retType CallType fnName##_wrapper(p1Type p1, p2Type p2, p3Type p3, p4Type p4, p5Type p5, p6Type p6, p7Type p7, p8Type p8, p9Type p9, p10Type p10, p11Type p11) \
  347. { \
  348. retType ret; \
  349. TAGMSG11(DBGTAG_LOG, #fnName"("#p1" 0x%p,"#p2" 0x%p,"#p3" 0x%p,"#p4" 0x%p,"#p5" 0x%p,"#p6" 0x%p,"#p7" 0x%p,"#p8" 0x%p,"#p9" 0x%p,"#p10" 0x%p,"#p11" 0x%p)", p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11); \
  350. ret = fnName(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11); \
  351. TAGMSG1(DBGTAG_LOG, "Return of "#fnName" is 0x%p", ret); \
  352. return ret; \
  353. }
  354. #define FUNCLOG12(LogClass, retType, CallType, fnName, p1Type, p1, p2Type, p2, p3Type, p3, p4Type, p4, p5Type, p5, p6Type, p6, p7Type, p7, p8Type, p8, p9Type, p9, p10Type, p10, p11Type, p11, p12Type, p12) \
  355. retType CallType fnName(p1Type p1, p2Type p2, p3Type p3, p4Type p4, p5Type p5, p6Type p6, p7Type p7, p8Type p8, p9Type p9, p10Type p10, p11Type p11, p12Type p12); \
  356. retType CallType fnName##_wrapper(p1Type p1, p2Type p2, p3Type p3, p4Type p4, p5Type p5, p6Type p6, p7Type p7, p8Type p8, p9Type p9, p10Type p10, p11Type p11, p12Type p12) \
  357. { \
  358. retType ret; \
  359. TAGMSG12(DBGTAG_LOG, #fnName"("#p1" 0x%p,"#p2" 0x%p,"#p3" 0x%p,"#p4" 0x%p,"#p5" 0x%p,"#p6" 0x%p,"#p7" 0x%p,"#p8" 0x%p,"#p9" 0x%p,"#p10" 0x%p,"#p11" 0x%p,"#p12" 0x%p)", p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12); \
  360. ret = fnName(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12); \
  361. TAGMSG1(DBGTAG_LOG, "Return of "#fnName" is 0x%p", ret); \
  362. return ret; \
  363. }
  364. #define FUNCLOGVOID1(LogClass, CallType, fnName, p1Type, p1) \
  365. VOID CallType fnName(p1Type p1); \
  366. VOID CallType fnName##_wrapper(p1Type p1) \
  367. { \
  368. TAGMSG1(DBGTAG_LOG, #fnName"("#p1" 0x%p)", p1); \
  369. fnName(p1); \
  370. return; \
  371. }
  372. #define FUNCLOGVOID2(LogClass, CallType, fnName, p1Type, p1, p2Type, p2) \
  373. VOID CallType fnName(p1Type p1, p2Type p2); \
  374. VOID CallType fnName##_wrapper(p1Type p1, p2Type p2) \
  375. { \
  376. TAGMSG2(DBGTAG_LOG, #fnName"("#p1" 0x%p,"#p2" 0x%p)", p1, p2); \
  377. fnName(p1, p2); \
  378. return; \
  379. }
  380. #define FUNCLOGVOID3(LogClass, CallType, fnName, p1Type, p1, p2Type, p2, p3Type, p3) \
  381. VOID CallType fnName(p1Type p1, p2Type p2, p3Type p3); \
  382. VOID CallType fnName##_wrapper(p1Type p1, p2Type p2, p3Type p3) \
  383. { \
  384. TAGMSG3(DBGTAG_LOG, #fnName"("#p1" 0x%p,"#p2" 0x%p,"#p3" 0x%p)", p1, p2, p3); \
  385. fnName(p1, p2, p3); \
  386. return; \
  387. }
  388. #define FUNCLOGVOID4(LogClass, CallType, fnName, p1Type, p1, p2Type, p2, p3Type, p3, p4Type, p4) \
  389. VOID CallType fnName(p1Type p1, p2Type p2, p3Type p3, p4Type p4); \
  390. VOID CallType fnName##_wrapper(p1Type p1, p2Type p2, p3Type p3, p4Type p4) \
  391. { \
  392. TAGMSG4(DBGTAG_LOG, #fnName"("#p1" 0x%p,"#p2" 0x%p,"#p3" 0x%p,"#p4" 0x%p)", p1, p2, p3, p4); \
  393. fnName(p1, p2, p3, p4); \
  394. return; \
  395. }
  396. #define FUNCLOGVOID5(LogClass, CallType, fnName, p1Type, p1, p2Type, p2, p3Type, p3, p4Type, p4, p5Type, p5) \
  397. VOID CallType fnName(p1Type p1, p2Type p2, p3Type p3, p4Type p4, p5Type p5); \
  398. VOID CallType fnName##_wrapper(p1Type p1, p2Type p2, p3Type p3, p4Type p4, p5Type p5) \
  399. { \
  400. TAGMSG5(DBGTAG_LOG, #fnName"("#p1" 0x%p,"#p2" 0x%p,"#p3" 0x%p,"#p4" 0x%p,"#p5" 0x%p)", p1, p2, p3, p4, p5); \
  401. fnName(p1, p2, p3, p4, p5); \
  402. return; \
  403. }
  404. #define FUNCLOGVOID6(LogClass, CallType, fnName, p1Type, p1, p2Type, p2, p3Type, p3, p4Type, p4, p5Type, p5, p6Type, p6) \
  405. VOID CallType fnName(p1Type p1, p2Type p2, p3Type p3, p4Type p4, p5Type p5, p6Type p6); \
  406. VOID CallType fnName##_wrapper(p1Type p1, p2Type p2, p3Type p3, p4Type p4, p5Type p5, p6Type p6) \
  407. { \
  408. TAGMSG6(DBGTAG_LOG, #fnName"("#p1" 0x%p,"#p2" 0x%p,"#p3" 0x%p,"#p4" 0x%p,"#p5" 0x%p,"#p6" 0x%p)", p1, p2, p3, p4, p5, p6); \
  409. fnName(p1, p2, p3, p4, p5, p6); \
  410. return; \
  411. }
  412. #define FUNCLOGVOID7(LogClass, CallType, fnName, p1Type, p1, p2Type, p2, p3Type, p3, p4Type, p4, p5Type, p5, p6Type, p6, p7Type, p7) \
  413. VOID CallType fnName(p1Type p1, p2Type p2, p3Type p3, p4Type p4, p5Type p5, p6Type p6, p7Type p7); \
  414. VOID CallType fnName##_wrapper(p1Type p1, p2Type p2, p3Type p3, p4Type p4, p5Type p5, p6Type p6, p7Type p7) \
  415. { \
  416. TAGMSG7(DBGTAG_LOG, #fnName"("#p1" 0x%p,"#p2" 0x%p,"#p3" 0x%p,"#p4" 0x%p,"#p5" 0x%p,"#p6" 0x%p,"#p7" 0x%p)", p1, p2, p3, p4, p5, p6, p7); \
  417. fnName(p1, p2, p3, p4, p5, p6, p7); \
  418. return; \
  419. }
  420. #define FUNCLOGVOID8(LogClass, CallType, fnName, p1Type, p1, p2Type, p2, p3Type, p3, p4Type, p4, p5Type, p5, p6Type, p6, p7Type, p7, p8Type, p8) \
  421. VOID CallType fnName(p1Type p1, p2Type p2, p3Type p3, p4Type p4, p5Type p5, p6Type p6, p7Type p7, p8Type p8); \
  422. VOID CallType fnName##_wrapper(p1Type p1, p2Type p2, p3Type p3, p4Type p4, p5Type p5, p6Type p6, p7Type p7, p8Type p8) \
  423. { \
  424. TAGMSG4(DBGTAG_LOG, #fnName"("#p1" 0x%p,"#p2" 0x%p,"#p3" 0x%p,"#p4" 0x%p,"#p5" 0x%p,"#p6" 0x%p,"#p7" 0x%p,"#p8" 0x%p)", p1, p2, p3, p4, p5, p6, p7, p8); \
  425. fnName(p1, p2, p3, p4, p5, p6, p7, p8); \
  426. return; \
  427. }
  428. #define FUNCLOGVOID9(LogClass, CallType, fnName, p1Type, p1, p2Type, p2, p3Type, p3, p4Type, p4, p5Type, p5, p6Type, p6, p7Type, p7, p8Type, p8, p9Type, p9) \
  429. VOID CallType fnName(p1Type p1, p2Type p2, p3Type p3, p4Type p4, p5Type p5, p6Type p6, p7Type p7, p8Type p8, p9Type p9); \
  430. VOID CallType fnName##_wrapper(p1Type p1, p2Type p2, p3Type p3, p4Type p4, p5Type p5, p6Type p6, p7Type p7, p8Type p8, p9Type p9) \
  431. { \
  432. TAGMSG9(DBGTAG_LOG, #fnName"("#p1" 0x%p,"#p2" 0x%p,"#p3" 0x%p,"#p4" 0x%p,"#p5" 0x%p,"#p6" 0x%p,"#p7" 0x%p,"#p8" 0x%p,"#p9" 0x%p)", p1, p2, p3, p4, p5, p6, p7, p8, p9); \
  433. fnName(p1, p2, p3, p4, p5, p6, p7, p8, p9); \
  434. return; \
  435. }
  436. #define FUNCLOGVOID10(LogClass, CallType, fnName, p1Type, p1, p2Type, p2, p3Type, p3, p4Type, p4, p5Type, p5, p6Type, p6, p7Type, p7, p8Type, p8, p9Type, p9, p10Type, p10) \
  437. VOID CallType fnName(p1Type p1, p2Type p2, p3Type p3, p4Type p4, p5Type p5, p6Type p6, p7Type p7, p8Type p8, p9Type p9, p10Type p10); \
  438. VOID CallType fnName##_wrapper(p1Type p1, p2Type p2, p3Type p3, p4Type p4, p5Type p5, p6Type p6, p7Type p7, p8Type p8, p9Type p9, p10Type p10) \
  439. { \
  440. TAGMSG10(DBGTAG_LOG, #fnName"("#p1" 0x%p,"#p2" 0x%p,"#p3" 0x%p,"#p4" 0x%p,"#p5" 0x%p,"#p6" 0x%p,"#p7" 0x%p,"#p8" 0x%p,"#p9" 0x%p,"#p10" 0x%p)", p1, p2, p3, p4, p5, p6, p7, p8, p9, p10); \
  441. fnName(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10); \
  442. return; \
  443. }
  444. #define FUNCLOGVOID11(LogClass, CallType, fnName, p1Type, p1, p2Type, p2, p3Type, p3, p4Type, p4, p5Type, p5, p6Type, p6, p7Type, p7, p8Type, p8, p9Type, p9, p10Type, p10, p11Type, p11) \
  445. VOID CallType fnName(p1Type p1, p2Type p2, p3Type p3, p4Type p4, p5Type p5, p6Type p6, p7Type p7, p8Type p8, p9Type p9, p10Type p10, p11Type p11); \
  446. VOID CallType fnName##_wrapper(p1Type p1, p2Type p2, p3Type p3, p4Type p4, p5Type p5, p6Type p6, p7Type p7, p8Type p8, p9Type p9, p10Type p10, p11Type p11) \
  447. { \
  448. TAGMSG11(DBGTAG_LOG, #fnName"("#p1" 0x%p,"#p2" 0x%p,"#p3" 0x%p,"#p4" 0x%p,"#p5" 0x%p,"#p6" 0x%p,"#p7" 0x%p,"#p8" 0x%p,"#p9" 0x%p,"#p10" 0x%p,"#p11" 0x%p)", p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11); \
  449. fnName(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11); \
  450. return; \
  451. }
  452. #define FUNCLOGVOID12(LogClass, CallType, fnName, p1Type, p1, p2Type, p2, p3Type, p3, p4Type, p4, p5Type, p5, p6Type, p6, p7Type, p7, p8Type, p8, p9Type, p9, p10Type, p10, p11Type, p11, p12Type, p12) \
  453. VOID CallType fnName(p1Type p1, p2Type p2, p3Type p3, p4Type p4, p5Type p5, p6Type p6, p7Type p7, p8Type p8, p9Type p9, p10Type p10, p11Type p11, p12Type p12); \
  454. VOID CallType fnName##_wrapper(p1Type p1, p2Type p2, p3Type p3, p4Type p4, p5Type p5, p6Type p6, p7Type p7, p8Type p8, p9Type p9, p10Type p10, p11Type p11, p12Type p12) \
  455. { \
  456. TAGMSG12(DBGTAG_LOG, #fnName"("#p1" 0x%p,"#p2" 0x%p,"#p3" 0x%p,"#p4" 0x%p,"#p5" 0x%p,"#p6" 0x%p,"#p7" 0x%p,"#p8" 0x%p,"#p9" 0x%p,"#p10" 0x%p,"#p11" 0x%p,"#p12" 0x%p)", p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12); \
  457. fnName(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12); \
  458. return; \
  459. }
  460. #else
  461. #define FUNCLOG1(LogClass, retType, CallType, fnName, p1Type, p1)
  462. #define FUNCLOG2(LogClass, retType, CallType, fnName, p1Type, p1, p2Type, p2)
  463. #define FUNCLOG3(LogClass, retType, CallType, fnName, p1Type, p1, p2Type, p2, p3Type, p3)
  464. #define FUNCLOG4(LogClass, retType, CallType, fnName, p1Type, p1, p2Type, p2, p3Type, p3, p4Type, p4)
  465. #define FUNCLOG5(LogClass, retType, CallType, fnName, p1Type, p1, p2Type, p2, p3Type, p3, p4Type, p4, p5Type, p5)
  466. #define FUNCLOG6(LogClass, retType, CallType, fnName, p1Type, p1, p2Type, p2, p3Type, p3, p4Type, p4, p5Type, p5, p6Type, p6)
  467. #define FUNCLOG7(LogClass, retType, CallType, fnName, p1Type, p1, p2Type, p2, p3Type, p3, p4Type, p4, p5Type, p5, p6Type, p6, p7Type, p7)
  468. #define FUNCLOG8(LogClass, retType, CallType, fnName, p1Type, p1, p2Type, p2, p3Type, p3, p4Type, p4, p5Type, p5, p6Type, p6, p7Type, p7, p8Type, p8)
  469. #define FUNCLOG9(LogClass, retType, CallType, fnName, p1Type, p1, p2Type, p2, p3Type, p3, p4Type, p4, p5Type, p5, p6Type, p6, p7Type, p7, p8Type, p8, p9Type, p9)
  470. #define FUNCLOG10(LogClass, retType, CallType, fnName, p1Type, p1, p2Type, p2, p3Type, p3, p4Type, p4, p5Type, p5, p6Type, p6, p7Type, p7, p8Type, p8, p9Type, p9, p10Type, p10)
  471. #define FUNCLOG11(LogClass, retType, CallType, fnName, p1Type, p1, p2Type, p2, p3Type, p3, p4Type, p4, p5Type, p5, p6Type, p6, p7Type, p7, p8Type, p8, p9Type, p9, p10Type, p10, p11Type, p11)
  472. #define FUNCLOG12(LogClass, retType, CallType, fnName, p1Type, p1, p2Type, p2, p3Type, p3, p4Type, p4, p5Type, p5, p6Type, p6, p7Type, p7, p8Type, p8, p9Type, p9, p10Type, p10, p11Type, p11, p12Type, p12)
  473. #define FUNCLOGVOID1(LogClass, CallType, fnName, p1Type, p1)
  474. #define FUNCLOGVOID2(LogClass, CallType, fnName, p1Type, p1, p2Type, p2)
  475. #define FUNCLOGVOID3(LogClass, CallType, fnName, p1Type, p1, p2Type, p2, p3Type, p3)
  476. #define FUNCLOGVOID4(LogClass, CallType, fnName, p1Type, p1, p2Type, p2, p3Type, p3, p4Type, p4)
  477. #define FUNCLOGVOID5(LogClass, CallType, fnName, p1Type, p1, p2Type, p2, p3Type, p3, p4Type, p4, p5Type, p5)
  478. #define FUNCLOGVOID6(LogClass, CallType, fnName, p1Type, p1, p2Type, p2, p3Type, p3, p4Type, p4, p5Type, p5, p6Type, p6)
  479. #define FUNCLOGVOID7(LogClass, CallType, fnName, p1Type, p1, p2Type, p2, p3Type, p3, p4Type, p4, p5Type, p5, p6Type, p6, p7Type, p7)
  480. #define FUNCLOGVOID8(LogClass, CallType, fnName, p1Type, p1, p2Type, p2, p3Type, p3, p4Type, p4, p5Type, p5, p6Type, p6, p7Type, p7, p8Type, p8)
  481. #define FUNCLOGVOID9(LogClass, CallType, fnName, p1Type, p1, p2Type, p2, p3Type, p3, p4Type, p4, p5Type, p5, p6Type, p6, p7Type, p7, p8Type, p8, p9Type, p9)
  482. #define FUNCLOGVOID10(LogClass, CallType, fnName, p1Type, p1, p2Type, p2, p3Type, p3, p4Type, p4, p5Type, p5, p6Type, p6, p7Type, p7, p8Type, p8, p9Type, p9, p10Type, p10)
  483. #define FUNCLOGVOID11(LogClass, CallType, fnName, p1Type, p1, p2Type, p2, p3Type, p3, p4Type, p4, p5Type, p5, p6Type, p6, p7Type, p7, p8Type, p8, p9Type, p9, p10Type, p10, p11Type, p11)
  484. #define FUNCLOGVOID12(LogClass, CallType, fnName, p1Type, p1, p2Type, p2, p3Type, p3, p4Type, p4, p5Type, p5, p6Type, p6, p7Type, p7, p8Type, p8, p9Type, p9, p10Type, p10, p11Type, p11, p12Type, p12)
  485. #endif
  486. /*
  487. * Tag implementation declarations.
  488. */
  489. /*
  490. * Define debug type information.
  491. */
  492. #define DBGTAG_NAMELENGTH 19
  493. #define DBGTAG_DESCRIPTIONLENGTH 41
  494. typedef struct tagDBGTAG
  495. {
  496. DWORD dwDBGTAGFlags;
  497. char achName[DBGTAG_NAMELENGTH + 1];
  498. char achDescription[DBGTAG_DESCRIPTIONLENGTH + 1];
  499. } DBGTAG;
  500. #define DECLARE_DBGTAG(tagName, tagDescription, tagFlags, tagIndex)
  501. #include "dbgtag.h"
  502. #define DBGTAG_DISABLED 0x00000000
  503. #define DBGTAG_ENABLED 0x00000001
  504. #define DBGTAG_PRINT 0x00000002
  505. #define DBGTAG_PROMPT 0x00000003
  506. #define DBGTAG_VALIDUSERFLAGS 0x00000003
  507. #define DBGTAG_REQUIRESREBOOT 0x10000000
  508. #if DBG
  509. __inline VOID DbgTagBreak(
  510. int tag)
  511. {
  512. if (IsDbgTagEnabled(tag)) {
  513. DbgBreakPoint();
  514. }
  515. }
  516. #endif
  517. /*
  518. * W32 wide RIP and error setting flags
  519. */
  520. #define RIP_COMPONENT GetRipComponent()
  521. #define RIP_USERTAGBITS 0x0000ffff
  522. /* shift amount to make RIP_LEVELBITS a 0-based index */
  523. #define RIP_LEVELBITSSHIFT 0x1c
  524. #define RIP_LEVELBITS 0x30000000
  525. #define RIP_ERROR 0x10000000
  526. #define RIP_WARNING 0x20000000
  527. #define RIP_VERBOSE 0x30000000
  528. #define RIP_NONAME 0x01000000
  529. #define RIP_NONEWLINE 0x02000000
  530. #define RIP_THERESMORE 0x04000000
  531. /* shift amount to make RIP_COMPBITS a 0-based index */
  532. #define RIP_COMPBITSSHIFT 0x10
  533. #define RIP_COMPBITS 0x000f0000
  534. #define RIP_USER 0x00010000
  535. #define RIP_USERSRV 0x00020000
  536. #define RIP_USERRTL 0x00030000
  537. #define RIP_GDI 0x00040000
  538. #define RIP_GDIKRNL 0x00050000
  539. #define RIP_GDIRTL 0x00060000
  540. #define RIP_BASE 0x00070000
  541. #define RIP_BASESRV 0x00080000
  542. #define RIP_BASERTL 0x00090000
  543. #define RIP_DISPLAYDRV 0x000a0000
  544. #define RIP_CONSRV 0x000b0000
  545. #define RIP_USERKRNL 0x000c0000
  546. #define RIP_IMM 0x000d0000
  547. #if DBG
  548. ULONG RipOutput(ULONG idErr, ULONG flags, LPSTR pszFile, int iLine, LPSTR pszFunction, LPSTR pszErr, PEXCEPTION_POINTERS pexi);
  549. ULONG _cdecl VRipOutput(ULONG idErr, ULONG flags, LPSTR pszFile, int iLine, LPSTR pszFunction, LPSTR pszFmt, ...);
  550. __inline VOID CALLRIP(
  551. BOOL fBreak)
  552. {
  553. if (fBreak) {
  554. DbgBreakPoint();
  555. }
  556. }
  557. /***************************************************************************\
  558. * Macros to set the last error and print a message to the debugger.
  559. * Use one of the following flags:
  560. *
  561. * RIP_ERROR: A serious error in NTUSER. Will be printed and will cause a
  562. * debug break by default. NTUSER should fix any occurance of a RIP_ERROR.
  563. * Assertions use the RIP_ERROR flag.
  564. *
  565. * RIP_WARNING: A less serious error caused by an application. Will be printed
  566. * but will not cause a debug break by default. Applications should fix
  567. * any occurance of a RIP_WARNING.
  568. *
  569. * RIP_VERBOSE: An error caused by an application or intermediate USER code,
  570. * or useful information for an application. Will not be printed and will
  571. * not cause a debug break by default. Applications may want to fix
  572. * occurances of RIP_VERBOSE messages to optimize their program.
  573. *
  574. *
  575. * Use the following flags to control printing:
  576. *
  577. * RIP_NONAME: Doesn't print the prefix to the message. Useful for
  578. * multiple RIPs.
  579. *
  580. * RIP_NONEWLINE: Doesn't print a newline after the message. Useful for
  581. * multiple rips on a single line.
  582. *
  583. * RIP_THERESMORE: Indicates that this RIP will be followed by others in
  584. * the same group. Prevents file/line and prompting until the last RIP
  585. * in the group.
  586. *
  587. * You control RIP output in the debugger by using the "df"
  588. * extension in userkdx.dll or userexts.dll, or type 'f' at a debug prompt.
  589. *
  590. * You can also control the default state of RIP output by setting the
  591. * following registry values to 0 or 1 under the key
  592. * HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\Current Version\Windows
  593. *
  594. * fPromptOnError, fPromptOnWarning, fPromptOnVerbose
  595. * fPrintError, fPrintWarning, fPrintVerbose
  596. * fPrintFileLine
  597. *
  598. \***************************************************************************/
  599. /*
  600. * Use RIPERR to set a Win32 error code as the last error and print a message.
  601. */
  602. #define RIPERR0(idErr, flags, szFmt) CALLRIP((VRipOutput(idErr, (flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, szFmt)))
  603. #define RIPERR1(idErr, flags, szFmt, p1) CALLRIP((VRipOutput(idErr, (flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, szFmt, p1)))
  604. #define RIPERR2(idErr, flags, szFmt, p1, p2) CALLRIP((VRipOutput(idErr, (flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, szFmt, p1, p2)))
  605. #define RIPERR3(idErr, flags, szFmt, p1, p2, p3) CALLRIP((VRipOutput(idErr, (flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, szFmt, p1, p2, p3)))
  606. #define RIPERR4(idErr, flags, szFmt, p1, p2, p3, p4) CALLRIP((VRipOutput(idErr, (flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, szFmt, p1, p2, p3, p4)))
  607. #define RIPERR5(idErr, flags, szFmt, p1, p2, p3, p4, p5) CALLRIP((VRipOutput(idErr, (flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, szFmt, p1, p2, p3, p4, p5)))
  608. #define RIPERR6(idErr, flags, szFmt, p1, p2, p3, p4, p5, p6) CALLRIP((VRipOutput(idErr, (flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, szFmt, p1, p2, p3, p4, p5, p6)))
  609. #define RIPERR7(idErr, flags, szFmt, p1, p2, p3, p4, p5, p6, p7) CALLRIP((VRipOutput(idErr, (flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, szFmt, p1, p2, p3, p4, p5, p6, p7)))
  610. #define RIPERR8(idErr, flags, szFmt, p1, p2, p3, p4, p5, p6, p7, p8) CALLRIP((VRipOutput(idErr, (flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, szFmt, p1, p2, p3, p4, p5, p6, p7, p8)))
  611. /*
  612. * Use RIPNTERR to set an NTSTATUS as the last error and print a message.
  613. */
  614. #define RIPNTERR0(status, flags, szFmt) CALLRIP((VRipOutput(RtlNtStatusToDosError(status), (flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, szFmt)))
  615. #define RIPNTERR1(status, flags, szFmt, p1) CALLRIP((VRipOutput(RtlNtStatusToDosError(status), (flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, szFmt, p1)))
  616. #define RIPNTERR2(status, flags, szFmt, p1, p2) CALLRIP((VRipOutput(RtlNtStatusToDosError(status), (flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, szFmt, p1, p2)))
  617. #define RIPNTERR3(status, flags, szFmt, p1, p2, p3) CALLRIP((VRipOutput(RtlNtStatusToDosError(status), (flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, szFmt, p1, p2, p3)))
  618. #define RIPNTERR4(status, flags, szFmt, p1, p2, p3, p4) CALLRIP((VRipOutput(RtlNtStatusToDosError(status), (flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, szFmt, p1, p2, p3, p4)))
  619. #define RIPNTERR5(status, flags, szFmt, p1, p2, p3, p4, p5) CALLRIP((VRipOutput(RtlNtStatusToDosError(status), (flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, szFmt, p1, p2, p3, p4, p5)))
  620. #define RIPNTERR6(status, flags, szFmt, p1, p2, p3, p4, p5, p6) CALLRIP((VRipOutput(RtlNtStatusToDosError(status), (flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, szFmt, p1, p2, p3, p4, p5, p6)))
  621. #define RIPNTERR7(status, flags, szFmt, p1, p2, p3, p4, p5, p6, p7) CALLRIP((VRipOutput(RtlNtStatusToDosError(status), (flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, szFmt, p1, p2, p3, p4, p5, p6, p7)))
  622. #define RIPNTERR8(status, flags, szFmt, p1, p2, p3, p4, p5, p6, p7, p8) CALLRIP((VRipOutput(RtlNtStatusToDosError(status), (flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, szFmt, p1, p2, p3, p4, p5, p6, p7, p8)))
  623. /*
  624. * Use RIPMSG to print a message without setting the last error.
  625. */
  626. #define RIPMSG0(flags, szFmt) CALLRIP((VRipOutput(0, (flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, szFmt)))
  627. #define RIPMSG1(flags, szFmt, p1) CALLRIP((VRipOutput(0, (flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, szFmt, p1)))
  628. #define RIPMSG2(flags, szFmt, p1, p2) CALLRIP((VRipOutput(0, (flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, szFmt, p1, p2)))
  629. #define RIPMSG3(flags, szFmt, p1, p2, p3) CALLRIP((VRipOutput(0, (flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, szFmt, p1, p2, p3)))
  630. #define RIPMSG4(flags, szFmt, p1, p2, p3, p4) CALLRIP((VRipOutput(0, (flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, szFmt, p1, p2, p3, p4)))
  631. #define RIPMSG5(flags, szFmt, p1, p2, p3, p4, p5) CALLRIP((VRipOutput(0, (flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, szFmt, p1, p2, p3, p4, p5)))
  632. #define RIPMSG6(flags, szFmt, p1, p2, p3, p4, p5, p6) CALLRIP((VRipOutput(0, (flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, szFmt, p1, p2, p3, p4, p5, p6)))
  633. #define RIPMSG7(flags, szFmt, p1, p2, p3, p4, p5, p6, p7) CALLRIP((VRipOutput(0, (flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, szFmt, p1, p2, p3, p4, p5, p6, p7)))
  634. #define RIPMSG8(flags, szFmt, p1, p2, p3, p4, p5, p6, p7, p8) CALLRIP((VRipOutput(0, (flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, szFmt, p1, p2, p3, p4, p5, p6, p7, p8)))
  635. /*
  636. * Use RIPMSGxF to print a message without setting the last error; msg is prefixed by function name.
  637. */
  638. #define RIPMSGF0(flags, szFmt) CALLRIP((VRipOutput(0, (flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, __FUNCTION__ ": " szFmt)))
  639. #define RIPMSGF1(flags, szFmt, p1) CALLRIP((VRipOutput(0, (flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, __FUNCTION__ ": " szFmt, p1)))
  640. #define RIPMSGF2(flags, szFmt, p1, p2) CALLRIP((VRipOutput(0, (flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, __FUNCTION__ ": " szFmt, p1, p2)))
  641. #define RIPMSGF3(flags, szFmt, p1, p2, p3) CALLRIP((VRipOutput(0, (flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, __FUNCTION__ ": " szFmt, p1, p2, p3)))
  642. #define RIPMSGF4(flags, szFmt, p1, p2, p3, p4) CALLRIP((VRipOutput(0, (flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, __FUNCTION__ ": " szFmt, p1, p2, p3, p4)))
  643. #define RIPMSGF5(flags, szFmt, p1, p2, p3, p4, p5) CALLRIP((VRipOutput(0, (flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, __FUNCTION__ ": " szFmt, p1, p2, p3, p4, p5)))
  644. #define RIPMSGF6(flags, szFmt, p1, p2, p3, p4, p5, p6) CALLRIP((VRipOutput(0, (flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, __FUNCTION__ ": " szFmt, p1, p2, p3, p4, p5, p6)))
  645. #define RIPMSGF7(flags, szFmt, p1, p2, p3, p4, p5, p6, p7) CALLRIP((VRipOutput(0, (flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, __FUNCTION__ ": " szFmt, p1, p2, p3, p4, p5, p6, p7)))
  646. #define RIPMSGF8(flags, szFmt, p1, p2, p3, p4, p5, p6, p7, p8) CALLRIP((VRipOutput(0, (flags) | RIP_COMPONENT, __FILE__, __LINE__, __FUNCTION__, __FUNCTION__ ": " szFmt, p1, p2, p3, p4, p5, p6, p7, p8)))
  647. /*
  648. * Use W32ExceptionHandler in try-except blocks
  649. */
  650. ULONG DBGW32ExceptionHandler(PEXCEPTION_POINTERS pexi, BOOL fSetLastError, ULONG ulflags);
  651. #define W32ExceptionHandler(fSetLastError, ulflags) \
  652. DBGW32ExceptionHandler(GetExceptionInformation(), (fSetLastError), (ulflags))
  653. #else /* of #ifdef DEBUG */
  654. #define RIPERR0(idErr, flags, szFmt) UserSetLastError(idErr)
  655. #define RIPERR1(idErr, flags, szFmt, p1) UserSetLastError(idErr)
  656. #define RIPERR2(idErr, flags, szFmt, p1, p2) UserSetLastError(idErr)
  657. #define RIPERR3(idErr, flags, szFmt, p1, p2, p3) UserSetLastError(idErr)
  658. #define RIPERR4(idErr, flags, szFmt, p1, p2, p3, p4) UserSetLastError(idErr)
  659. #define RIPERR5(idErr, flags, szFmt, p1, p2, p3, p4, p5) UserSetLastError(idErr)
  660. #define RIPERR6(idErr, flags, szFmt, p1, p2, p3, p4, p5, p6) UserSetLastError(idErr)
  661. #define RIPERR7(idErr, flags, szFmt, p1, p2, p3, p4, p5, p6, p7) UserSetLastError(idErr)
  662. #define RIPERR8(idErr, flags, szFmt, p1, p2, p3, p4, p5, p6, p7, p8) UserSetLastError(idErr)
  663. #define RIPNTERR0(status, flags, szFmt) SetLastNtError(status)
  664. #define RIPNTERR1(status, flags, szFmt, p1) SetLastNtError(status)
  665. #define RIPNTERR2(status, flags, szFmt, p1, p2) SetLastNtError(status)
  666. #define RIPNTERR3(status, flags, szFmt, p1, p2, p3) SetLastNtError(status)
  667. #define RIPNTERR4(status, flags, szFmt, p1, p2, p3, p4) SetLastNtError(status)
  668. #define RIPNTERR5(status, flags, szFmt, p1, p2, p3, p4, p5) SetLastNtError(status)
  669. #define RIPNTERR6(status, flags, szFmt, p1, p2, p3, p4, p5, p6) SetLastNtError(status)
  670. #define RIPNTERR7(status, flags, szFmt, p1, p2, p3, p4, p5, p6, p7) SetLastNtError(status)
  671. #define RIPNTERR8(status, flags, szFmt, p1, p2, p3, p4, p5, p6, p7, p8) SetLastNtError(status)
  672. #define RIPMSG0(flags, szFmt)
  673. #define RIPMSG1(flags, szFmt, p1)
  674. #define RIPMSG2(flags, szFmt, p1, p2)
  675. #define RIPMSG3(flags, szFmt, p1, p2, p3)
  676. #define RIPMSG4(flags, szFmt, p1, p2, p3, p4)
  677. #define RIPMSG5(flags, szFmt, p1, p2, p3, p4, p5)
  678. #define RIPMSG6(flags, szFmt, p1, p2, p3, p4, p5, p6)
  679. #define RIPMSG7(flags, szFmt, p1, p2, p3, p4, p5, p6, p7)
  680. #define RIPMSG8(flags, szFmt, p1, p2, p3, p4, p5, p6, p7, p8)
  681. #define RIPMSGF0(flags, szFmt)
  682. #define RIPMSGF1(flags, szFmt, p1)
  683. #define RIPMSGF2(flags, szFmt, p1, p2)
  684. #define RIPMSGF3(flags, szFmt, p1, p2, p3)
  685. #define RIPMSGF4(flags, szFmt, p1, p2, p3, p4)
  686. #define RIPMSGF5(flags, szFmt, p1, p2, p3, p4, p5)
  687. #define RIPMSGF6(flags, szFmt, p1, p2, p3, p4, p5, p6)
  688. #define RIPMSGF7(flags, szFmt, p1, p2, p3, p4, p5, p6, p7)
  689. #define RIPMSGF8(flags, szFmt, p1, p2, p3, p4, p5, p6, p7, p8)
  690. ULONG _W32ExceptionHandler(NTSTATUS ExceptionCode);
  691. #define W32ExceptionHandler(fSetLastError, ulflags) \
  692. ((fSetLastError) ? _W32ExceptionHandler(GetExceptionCode()) : EXCEPTION_EXECUTE_HANDLER)
  693. #endif /* #else of #ifdef DEBUG */
  694. #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
  695. /*
  696. * Macros for manipulating flag fields. All work for multiple flags.
  697. */
  698. #define TEST_FLAG(field, flag) ((field) & (flag))
  699. #define TEST_BOOL_FLAG(field, flag) (((field) & (flag)) != 0)
  700. #define SET_FLAG(field, flag) ((field) |= (flag))
  701. #define CLEAR_FLAG(field, flag) ((field) &= ~(flag))
  702. #define TOGGLE_FLAG(field, flag) ((field ^= (flag))
  703. /*
  704. * COPY_FLAG copies the value of flags from a source field
  705. * into a destination field.
  706. *
  707. * In the macro:
  708. * + "&flag" limits the outer xor operation to just the flag we're interested in.
  709. * + These are the results of the two xor operations:
  710. *
  711. * fieldDst fieldSrc inner xor outer xor
  712. * 0 0 0 0
  713. * 0 1 1 1
  714. * 1 0 1 0
  715. * 1 1 0 1
  716. */
  717. #define COPY_FLAG(fieldDst, fieldSrc, flag) ((fieldDst) ^= ((fieldDst) ^ (fieldSrc)) & (flag))
  718. /*
  719. * Define SET_OR_CLEAR_FLAG to do the following logically:
  720. *
  721. * #define SET_OR_CLEAR_FLAG(field, flag, fset) ((fset) ? SET_FLAG(field, flag) : CLEAR_FLAG(field, flag))
  722. *
  723. * but with 5 fewer bytes.
  724. *
  725. * In the macro,
  726. * + "-!!(fset)" sets all bits in the source field to 1 if setting,
  727. * 0 if clearing.
  728. */
  729. #define SET_OR_CLEAR_FLAG(field, flag, fset) COPY_FLAG((field), -!!(fset), (flag))
  730. // RIP flags and macros
  731. #define RIPF_PROMPTONERROR 0x0001
  732. #define RIPF_PROMPTONWARNING 0x0002
  733. #define RIPF_PROMPTONVERBOSE 0x0004
  734. #define RIPF_PRINTONERROR 0x0010
  735. #define RIPF_PRINTONWARNING 0x0020
  736. #define RIPF_PRINTONVERBOSE 0x0040
  737. #define RIPF_PRINTFILELINE 0x0100
  738. #define RIPF_HIDEPID 0x0200
  739. #define RIPF_DEFAULT ((WORD)(RIPF_PROMPTONERROR | \
  740. RIPF_PRINTONERROR | \
  741. RIPF_PRINTONWARNING))
  742. #define RIPF_PROMPT_MASK 0x0007
  743. #define RIPF_PROMPT_SHIFT 0x00
  744. #define RIPF_PRINT_MASK 0x0070
  745. #define RIPF_PRINT_SHIFT 0x04
  746. #define RIPF_VALIDUSERFLAGS 0x0377
  747. #define TEST_RIPF(f) TEST_BOOL_FLAG(GetRipFlags(), f)
  748. /*
  749. * Provides zero'd memory so you don't have to create zero'd memory on the
  750. * stack. The zero'd memory should never be modified. Use the ZERO and PZERO
  751. * macros to access the memory to ensure it is zero before it is used.
  752. *
  753. * Feel free to add more fields to the union as you need them.
  754. */
  755. typedef union tagALWAYSZERO
  756. {
  757. BYTE b;
  758. WORD w;
  759. DWORD dw;
  760. int i;
  761. POINT pt;
  762. POINTL ptl;
  763. RECT rc;
  764. RECTL rcl;
  765. LARGE_INTEGER li;
  766. } ALWAYSZERO;
  767. #if DBG
  768. extern VOID ValidateZero(VOID);
  769. #define ZERO(t) (ValidateZero(), (*(t *)(PVOID)&gZero))
  770. #define PZERO(t) (ValidateZero(), ((t *)(PVOID)&gZero))
  771. #else
  772. #define ZERO(t) ((*(t *)&gZero))
  773. #define PZERO(t) ((t *)&gZero)
  774. #endif
  775. /*
  776. * Special DbgPrint that is also available for Fre build.
  777. */
  778. #if DBG
  779. VOID FreDbgPrint(ULONG flags, LPSTR pszFile, int iLine, LPSTR pszFunction, LPSTR pszFmt, ...);
  780. #define FRE_RIPMSG0 RIPMSG0
  781. #define FRE_RIPMSG1 RIPMSG1
  782. #define FRE_RIPMSG2 RIPMSG2
  783. #define FRE_RIPMSG3 RIPMSG3
  784. #define FRE_RIPMSG4 RIPMSG4
  785. #define FRE_RIPMSG5 RIPMSG5
  786. #else
  787. #if defined(PRERELEASE) || defined(USER_INSTRUMENTATION)
  788. VOID FreDbgPrint(ULONG flags, LPSTR pszFile, int iLine, LPSTR pszFunction, LPSTR pszFmt, ...);
  789. #define FRE_RIPMSG0(flags, s) FreDbgPrint(flags, __FILE__, __LINE__, __FUNCTION__, s)
  790. #define FRE_RIPMSG1(flags, s, a) FreDbgPrint(flags, __FILE__, __LINE__, __FUNCTION__, s, a)
  791. #define FRE_RIPMSG2(flags, s, a, b) FreDbgPrint(flags, __FILE__, __LINE__, __FUNCTION__, s, a, b)
  792. #define FRE_RIPMSG3(flags, s, a, b, c) FreDbgPrint(flags, __FILE__, __LINE__, __FUNCTION__, s, a, b, c)
  793. #define FRE_RIPMSG4(flags, s, a, b, c, d) FreDbgPrint(flags, __FILE__, __LINE__, __FUNCTION__, s, a, b, c, d)
  794. #define FRE_RIPMSG5(flags, s, a, b, c, d, e) FreDbgPrint(flags, __FILE__, __LINE__, __FUNCTION__, s, a, b, c, d, e)
  795. #else
  796. #define FRE_RIPMSG0(flags, x)
  797. #define FRE_RIPMSG1(flags, x, a)
  798. #define FRE_RIPMSG2(flags, x, a, b)
  799. #define FRE_RIPMSG3(flags, x, a, b, c)
  800. #define FRE_RIPMSG4(flags, x, a, b, c, d)
  801. #define FRE_RIPMSG5(flags, x, a, b, c, d, e)
  802. #endif // PRERELEASE || USER_INSTRUMENTATION
  803. #endif
  804. #endif