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.

279 lines
10 KiB

  1. //0c2c06fa Generated File. Do not edit.
  2. // File created by WPP compiler version 0.01-Sat Apr 1 17:27:32 2000
  3. // on 07/22/2000 at 04:41:51 UTC
  4. //
  5. // Source files: name_table.c prefix.c.
  6. #ifndef _WPP_H_
  7. #define _WPP_H_
  8. #define _DFS_ENABLE_USER_AGENT 0x0001
  9. #define _DFS_ENABLE_ERRORS 0x0002
  10. #define _DFS_ENABLE_PREFIX 0x0004
  11. #define _DFS_ENABLE_RPC 0x0008
  12. #define _DFS_ENABLE_REFERRAL_SERVER 0x0010
  13. #define _DFS_ENABLE_UNUSED11 0x0020
  14. #define _DFS_ENABLE_UNUSED10 0x0040
  15. #define _DFS_ENABLE_UNUSED9 0x0080
  16. #define _DFS_ENABLE_UNUSED8 0x0100
  17. #define _DFS_ENABLE_UNUSED7 0x0200
  18. #define _DFS_ENABLE_UNUSED6 0x0400
  19. #define _DFS_ENABLE_UNUSED5 0x0800
  20. #define _DFS_ENABLE_UNUSED4 0x1000
  21. #define _DFS_ENABLE_UNUSED3 0x2000
  22. #define _DFS_ENABLE_UNUSED2 0x4000
  23. #define _DFS_ENABLE_UNUSED1 0x8000
  24. #define _LEVEL_HIGH 0x1
  25. #define _LEVEL_NORM 0x2
  26. #define _LEVEL_LOW 0x4
  27. #define LOG_FLAGS(_flag) _DFS_ENABLE_ ## _flag
  28. #define LOG_ENABLED( _level, _flags) \
  29. (( DfsRtlWmiReg.EnableLevel >= (_level) ) && \
  30. ( DfsRtlWmiReg.EnableFlags & _flags ))
  31. #define DFS_LOG_ENABLED(_ArrayPrefix_, _Id_, _level, _flags) \
  32. ((_ArrayPrefix_ ## ControlGuids[0].EnableFlags & _flags ) && \
  33. (_ArrayPrefix_ ## ControlGuids[0].EnableLevel >= (_level)))
  34. #define DFS_LOG(_level, _flags, _id, _arg) \
  35. { \
  36. if ( DFS_LOG_ENABLED(PrefixLib_, _id, _level, _flags) ) { \
  37. WmlData.Trace( WPP_MSG_NO(_id), \
  38. &WPP_TRACE_GUID(PrefixLib_,_id) , \
  39. PrefixLib_ ## ControlGuids[0].LoggerHandle, _arg 0); \
  40. } \
  41. }
  42. #define SET_LIB_TRACE(_prefix) \
  43. _prefix ## ControlGuids = PrefixLib_ ## ControlGuids;
  44. #define DFS_TRACE_NORM(_flags, _msg, _args) \
  45. DFS_LOG(_LEVEL_NORM, LOG_FLAGS(_flags), MSG_ID_WPP_AUTO_ID, _args)
  46. #define DFS_TRACE_LOW(_flags, _msg, _args) \
  47. DFS_LOG(_LEVEL_LOW, LOG_FLAGS(_flags), MSG_ID_WPP_AUTO_ID, _args)
  48. #define DFS_TRACE_HIGH( _flag, _msg, _arg) \
  49. DFS_LOG(_LEVEL_HIGH, LOG_FLAGS(_flag), MSG_ID_WPP_AUTO_ID, _arg)
  50. #define DFS_TRACE_ERROR_NORM(_status, _flag, _msg, _arg) \
  51. DFS_LOG(_LEVEL_NORM, (LOG_FLAGS(_flag) | (NT_ERROR(_status) ? LOG_FLAGS(ERRORS) : 0)), MSG_ID_WPP_AUTO_ID, _arg)
  52. #define DFS_TRACE_ERROR_HIGH(_status, _flag, _msg, _arg) \
  53. DFS_LOG(_LEVEL_HIGH, (LOG_FLAGS(_flag) | (NT_ERROR(_status) ? LOG_FLAGS(ERRORS) : 0)), MSG_ID_WPP_AUTO_ID, _arg)
  54. #define DFS_TRACE_ERROR_LOW(_status, _flag, _msg, _arg) \
  55. DFS_LOG(_LEVEL_LOW, (LOG_FLAGS(_flag) | (NT_ERROR(_status) ? LOG_FLAGS(ERRORS) : 0)), MSG_ID_WPP_AUTO_ID, _arg)
  56. enum WPP_FILES {WPP_FILE_name_table_c,WPP_FILE_prefix_c,};
  57. //
  58. // Unless disabled, WPP selects one of the source
  59. // files as a "guid store". That file will have definitions
  60. // of trace and control arrays
  61. //
  62. #if defined(NAME_TABLE_C)
  63. #define WPP_DEFINE_ARRAYS
  64. #endif
  65. # define WPP_CONTROL_GUID_ARRAY PrefixLib_ControlGuids
  66. //
  67. // Define default flavors of the trace macro
  68. //
  69. #if defined(WMLUM_H)
  70. extern WML_DATA WmlData;
  71. # define WPP_TRACE_MESSAGE(_lh,_fl,_guid,_id,_msg,_arg) (*WmlData.Trace)(_id,&_guid,_lh,_arg)
  72. # define WPP_DECLARE_CONTROL_GUIDS
  73. #elif defined(WMLKM_H)
  74. # define WPP_TRACE_MESSAGE(_lh,_fl,_guid,_id,_msg,_arg) WmlTrace(_id,&_guid,_lh,_arg)
  75. # define WPP_DECLARE_CONTROL_GUIDS
  76. #else
  77. # define WPP_PTRLEN
  78. # define WPP_USE_WmiTraceMessage
  79. # if defined(WPP_KERNEL_MODE)
  80. # define WPP_WMI_TRACE_MESSAGE WmiTraceMessage
  81. # else
  82. # define WPP_WMI_TRACE_MESSAGE TraceMessage
  83. # endif
  84. # define WPP_TRACE_MESSAGE(_lh,_fl,_guid,_id,_msg,_arg) WPP_WMI_TRACE_MESSAGE(_lh,_fl,_guid,_id,_arg)
  85. #endif
  86. #if defined(WPP_DEFINE_ARRAYS)
  87. # define WPP_DEFINE_TRACE_GUIDS
  88. # define WPP_DEFINE_CONTROL_GUIDS
  89. #endif
  90. #define NOARGS // Yep. No args, alright.
  91. #define LOGNOTHING 0,
  92. # define WPP_DEFINE_GRP_ID(_a,_b) ( ((_a) << 16) | ( _b) )
  93. # define WPP_CTRL_FLAGS(_id) (1 << ((_id) & 0xFFFF) )
  94. # define WPP_CTRL_GUID_NO(_id) ((_id) >> 16)
  95. # define WPP_DEFINE_MSG_ID(_a,_b) ( ((_a) << 16) | ( _b) )
  96. # define WPP_MSG_NO(_id) ((_id) & 0xFFFF)
  97. # define WPP_TRACE_GUID_NO(_id) ((_id) >> 16)
  98. #define WPP_TRACE_GUID(_ArrayPrefix_,_Id_) (_ArrayPrefix_ ## TraceGuids[ WPP_TRACE_GUID_NO(_Id_) ] )
  99. #define WPP_LOGGER_HANDLE(_ArrayPrefix_,_Id_) (_ArrayPrefix_ ## ControlGuids[ WPP_CTRL_GUID_NO(_Id_) ].LoggerHandle )
  100. #define WPP_ENABLED(_ArrayPrefix_,_Id_) \
  101. (_ArrayPrefix_ ## ControlGuids[ WPP_CTRL_GUID_NO(_Id_) ].EnableFlags & WPP_CTRL_FLAGS(_Id_) )
  102. #define LOGARSTR(_Value_) WPP_LOGASTR( _Value_ )
  103. #define LOGBOOLEAN(_Value_) WPP_LOGTYPEVAL(signed char, _Value_ )
  104. #define LOGPTR(_Value_) WPP_LOGTYPEVAL(void*, _Value_ )
  105. #define LOGSTATUS(_Value_) WPP_LOGTYPEVAL(signed int, _Value_ )
  106. # define MSG_ID_prefix_c114 WPP_DEFINE_MSG_ID(0,11)
  107. # define MSG_ID_prefix_c163 WPP_DEFINE_MSG_ID(0,12)
  108. # define MSG_ID_prefix_c69 WPP_DEFINE_MSG_ID(0,10)
  109. extern GUID PrefixLib_TraceGuids[];
  110. #define PrefixLib_TraceGuids_len 1 // I don't think we need this [BUGBUG]
  111. #if defined(WPP_DECLARE_CONTROL_GUIDS)
  112. extern WML_CONTROL_GUID_REG WPP_CONTROL_GUID_ARRAY[];
  113. #endif
  114. #ifdef WPP_DEFINE_TRACE_GUIDS
  115. #if 1 // if # traceguids > 0
  116. GUID PrefixLib_TraceGuids[] = {
  117. // 0da06be7-a84a-4d9b-be44-70a2e7917f35 prefix.c
  118. {0x0da06be7,0xa84a,0x4d9b,{0xbe,0x44,0x70,0xa2,0xe7,0x91,0x7f,0x35}}, // prefix.c
  119. };
  120. #endif
  121. #endif // WPP_DEFINE_TRACE_GUIDS
  122. #if defined(WMLUM_H)
  123. # define WPP_INIT_TRACING_SIMPLE_EX(AppName, PrintFunc) \
  124. do { \
  125. DWORD status; \
  126. LOADWML(status, WmlData); \
  127. SetupReg( \
  128. AppName, \
  129. L"%SystemRoot%\\PrefixLib_.log",\
  130. ); \
  131. if (status == ERROR_SUCCESS) { \
  132. status = (*WmlData.Initialize)( \
  133. AppName, \
  134. PrintFunc, \
  135. &WPP_CONTROL_GUID_ARRAY[0]); \
  136. } \
  137. } while(0)
  138. # define WPP_INIT_TRACING_SIMPLE(AppName) WPP_INIT_TRACING_SIMPLE_EX(AppName, NULL)
  139. #endif
  140. #ifdef WPP_DEFINE_CONTROL_GUIDS
  141. #if defined(WMLUM_H)
  142. WML_DATA WmlData;
  143. #endif
  144. # if 0 == 0 // if # CtrlGuids == 0
  145. WML_CONTROL_GUID_REG WPP_CONTROL_GUID_ARRAY[1];
  146. # else
  147. WML_CONTROL_GUID_REG WPP_CONTROL_GUID_ARRAY[] = {
  148. };
  149. #endif
  150. #endif // WPP_DEFINE_CONTROL_GUIDS
  151. #define WPP_DEFAULT_GROUP_ID WPP_DEFINE_GRP_ID(0,0)
  152. #if !defined(DFS_TRACE_ERROR_HIGH)
  153. #define DFS_TRACE_ERROR_HIGH(_unknown1, _unknown2, MSG, ARG) WPP_LOG(PrefixLib_, WPP_DEFAULT_GROUP_ID, MSG_ID_ ## WPP_AUTO_ID, MSG, ARG -0)
  154. #endif
  155. #if !defined(DFS_TRACE_ERROR_LOW)
  156. #define DFS_TRACE_ERROR_LOW(_unknown1, _unknown2, MSG, ARG) WPP_LOG(PrefixLib_, WPP_DEFAULT_GROUP_ID, MSG_ID_ ## WPP_AUTO_ID, MSG, ARG -0)
  157. #endif
  158. #if !defined(DFS_TRACE_ERROR_NORM)
  159. #define DFS_TRACE_ERROR_NORM(_unknown1, _unknown2, MSG, ARG) WPP_LOG(PrefixLib_, WPP_DEFAULT_GROUP_ID, MSG_ID_ ## WPP_AUTO_ID, MSG, ARG -0)
  160. #endif
  161. #if !defined(DFS_TRACE_HIGH)
  162. #define DFS_TRACE_HIGH(_unknown1, MSG, ARG) WPP_LOG(PrefixLib_, WPP_DEFAULT_GROUP_ID, MSG_ID_ ## WPP_AUTO_ID, MSG, ARG -0)
  163. #endif
  164. #if !defined(DFS_TRACE_LOW)
  165. #define DFS_TRACE_LOW(_unknown1, MSG, ARG) WPP_LOG(PrefixLib_, WPP_DEFAULT_GROUP_ID, MSG_ID_ ## WPP_AUTO_ID, MSG, ARG -0)
  166. #endif
  167. #if !defined(DFS_TRACE_NORM)
  168. #define DFS_TRACE_NORM(_unknown1, MSG, ARG) WPP_LOG(PrefixLib_, WPP_DEFAULT_GROUP_ID, MSG_ID_ ## WPP_AUTO_ID, MSG, ARG -0)
  169. #endif
  170. #if !defined(SimpleTrace)
  171. #define SimpleTrace(MSG, ARG) WPP_LOG(PrefixLib_, WPP_DEFAULT_GROUP_ID, MSG_ID_ ## WPP_AUTO_ID, MSG, ARG -0)
  172. #endif
  173. #if !defined(SimpleTraceEx)
  174. #define SimpleTraceEx(GRP, MSG, ARG) WPP_LOG(PrefixLib_, GRP, MSG_ID_ ## WPP_AUTO_ID, MSG, ARG -0)
  175. #endif
  176. #if 0 // Real check is done in elif
  177. #elif defined(NAME_TABLE_C) // name_table.c
  178. # define WPP_THIS_FILE name_table_c
  179. #elif defined(PREFIX_C) // prefix.c
  180. # define WPP_THIS_FILE prefix_c
  181. #endif
  182. #define WPP_EVAL(_value_) _value_
  183. #define MSG_ID_WPP_AUTO_ID WPP_EVAL(MSG_ID_) ## WPP_EVAL(WPP_THIS_FILE) ## WPP_EVAL(__LINE__)
  184. //
  185. // WPP_CHECKED_ZERO will be expanded to 0, if
  186. // expression _value has the same size as the type _Type,
  187. // or to division by 0, if the sizes are different
  188. //
  189. // This is poor man compile time argument checking. So don't be surprised
  190. // if a compiler will tell you suddenly that you have a division by 0
  191. // in line such and such
  192. //
  193. #define WPP_CHECKED_ZERO(_Value, _Type) \
  194. (0 * (1/(int)!(sizeof(_Type) - sizeof(_Value) )))
  195. #define WPP_CHECKED_SIZEOF(_Value, _Type) \
  196. (sizeof(_Value) + WPP_CHECKED_ZERO( _Value, _Type) )
  197. #if defined(WPP_PTRLEN)
  198. # define WPP_LOGPAIR(_Size, _Addr) (_Addr),(_Size),
  199. #else
  200. # define WPP_LOGPAIR(_Size, _Addr) (_Size),(_Addr),
  201. #endif
  202. # define WPP_LOGTYPEVAL(_Type, _Value) \
  203. WPP_LOGPAIR(WPP_CHECKED_SIZEOF(_Value, _Type), &(_Value))
  204. # define WPP_LOGASTR(_value) \
  205. WPP_LOGPAIR( strlen(_value) + WPP_CHECKED_SIZEOF((_value)[0],CHAR), _value )
  206. # define WPP_LOGWSTR(_value) \
  207. WPP_LOGPAIR( wcslen(_value) * sizeof(WCHAR) + WPP_CHECKED_SIZEOF((_value)[0],WCHAR), _value)
  208. # define WPP_LOGCSTR(_x) \
  209. WPP_LOGPAIR( sizeof((_x).Length) + WPP_CHECKED_ZERO(_x,STRING), &(_x).Length ) \
  210. WPP_LOGPAIR( (_x).Length, (_x).Buffer )
  211. # define WPP_LOGUSTR(_x) \
  212. WPP_LOGPAIR( WPP_CHECKED_SIZEOF((_x).Length, short) \
  213. + WPP_CHECKED_ZERO((_x),UNICODE_STRING), &(_x).Length) \
  214. WPP_LOGPAIR( (_x).Length, (_x).Buffer )
  215. # define WPP_LOG(_ArrayPrefix_, _Group_, _Id_, _Msg_, _Args_) \
  216. if (!WPP_ENABLED(_ArrayPrefix_, _Group_)) {;} else \
  217. WPP_TRACE_MESSAGE(WPP_LOGGER_HANDLE(_ArrayPrefix_, _Group_), \
  218. WPP_TRACE_FLAGS, \
  219. WPP_TRACE_GUID(_ArrayPrefix_,_Id_), \
  220. WPP_MSG_NO(_Id_), _Msg_, _Args_)
  221. #endif // _WPP_H_