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.

252 lines
9.1 KiB

  1. /*++
  2. Copyright (c) 1995 Microsoft Corporation
  3. Module Name:
  4. wininetd.h
  5. Abstract:
  6. Contains the interface for the WININET diagnostic capabilities.
  7. This interface only exists in the debug version of WININET.DLL.
  8. Calling the debug functions in the retail version of the DLL will
  9. yield ERROR_INVALID_PARAMETER
  10. Author:
  11. Richard L Firth (rfirth) 14-Jun-1995
  12. Revision History:
  13. 14-Jun-1995 rfirth
  14. Created
  15. --*/
  16. //
  17. // manifests
  18. //
  19. //
  20. // if the environment or registry variable "WininetLog" is set to !0 then the
  21. // following values will be used for control, category and error level resp.
  22. // These options generate "WININET.LOG" in the current directory
  23. //
  24. #define INTERNET_DEBUG_CONTROL_DEFAULT (DBG_THREAD_INFO \
  25. | DBG_CALL_DEPTH \
  26. | DBG_ENTRY_TIME \
  27. | DBG_PARAMETER_LIST \
  28. | DBG_TO_FILE \
  29. | DBG_INDENT_DUMP \
  30. | DBG_SEPARATE_APIS \
  31. | DBG_AT_ERROR_LEVEL \
  32. | DBG_NO_ASSERT_BREAK \
  33. | DBG_DUMP_LENGTH \
  34. | DBG_NO_LINE_NUMBER \
  35. | DBG_ASYNC_ID \
  36. )
  37. #define INTERNET_DEBUG_CATEGORY_DEFAULT DBG_ANY
  38. #define INTERNET_DEBUG_ERROR_LEVEL_DEFAULT DBG_INFO
  39. //
  40. // options. These are the option values to use with InternetQueryOption()/
  41. // InternetSetOption() to get/set the information described herein
  42. //
  43. #define INTERNET_OPTION_GET_DEBUG_INFO 1001
  44. #define INTERNET_OPTION_SET_DEBUG_INFO 1002
  45. #define INTERNET_OPTION_GET_HANDLE_COUNT 1003
  46. #define INTERNET_OPTION_GET_TRIGGERS 1004
  47. #define INTERNET_OPTION_SET_TRIGGERS 1005
  48. #define INTERNET_OPTION_RESET_TRIGGERS 1006
  49. #define INTERNET_FIRST_DEBUG_OPTION INTERNET_OPTION_GET_DEBUG_INFO
  50. #define INTERNET_LAST_DEBUG_OPTION INTERNET_OPTION_RESET_TRIGGERS
  51. //
  52. // debug levels
  53. //
  54. #define DBG_INFO 0
  55. #define DBG_WARNING 1
  56. #define DBG_ERROR 2
  57. #define DBG_FATAL 3
  58. #define DBG_ALWAYS 99
  59. //
  60. // debug control flags - these flags control where the debug output goes (file,
  61. // debugger, console) and how it is formatted
  62. //
  63. #define DBG_THREAD_INFO 0x00000001 // dump the thread id
  64. #define DBG_CALL_DEPTH 0x00000002 // dump the call level
  65. #define DBG_ENTRY_TIME 0x00000004 // dump the local time when the function is called
  66. #define DBG_PARAMETER_LIST 0x00000008 // dump the parameter list
  67. #define DBG_TO_DEBUGGER 0x00000010 // output via OutputDebugString()
  68. #define DBG_TO_CONSOLE 0x00000020 // output via printf()
  69. #define DBG_TO_FILE 0x00000040 // output via fprintf()
  70. #define DBG_FLUSH_OUTPUT 0x00000080 // fflush() after every fprintf()
  71. #define DBG_INDENT_DUMP 0x00000100 // indent dumped data to current level
  72. #define DBG_SEPARATE_APIS 0x00000200 // empty line after leaving each API
  73. #define DBG_AT_ERROR_LEVEL 0x00000400 // always output diagnostics >= InternetDebugErrorLevel
  74. #define DBG_NO_ASSERT_BREAK 0x00000800 // don't call DebugBreak() in InternetAssert()
  75. #define DBG_DUMP_LENGTH 0x00001000 // dump length information when dumping data
  76. #define DBG_NO_LINE_NUMBER 0x00002000 // don't dump line number info
  77. #define DBG_APPEND_FILE 0x00004000 // append to the log file (default is truncate)
  78. #define DBG_LEVEL_INDICATOR 0x00008000 // dump error level indicator (E for Error, etc.)
  79. #define DBG_DUMP_API_DATA 0x00010000 // dump data at API level (InternetReadFile(), etc.)
  80. #define DBG_DELTA_TIME 0x00020000 // dump times as millisecond delta if DBG_ENTRY_TIME
  81. #define DBG_CUMULATIVE_TIME 0x00040000 // dump delta time from start of trace if DBG_ENTRY_TIME
  82. #define DBG_FIBER_INFO 0x00080000 // dump the fiber address if DBG_THREAD_INFO
  83. #define DBG_THREAD_INFO_ADR 0x00100000 // dump INTERNET_THREAD_INFO address if DBG_THREAD_INFO
  84. #define DBG_ARB_ADDR 0x00200000 // dump ARB address if DBG_THREAD_INFO
  85. #define DBG_ASYNC_ID 0x00400000 // dump async ID
  86. #define DBG_REQUEST_HANDLE 0x00800000 // dump request handle
  87. #define DBG_TRIGGER_ON 0x10000000 // function is an enabling trigger
  88. #define DBG_TRIGGER_OFF 0x20000000 // function is a disabling trigger
  89. #define DBG_NO_DATA_DUMP 0x40000000 // turn off all data dumping
  90. #define DBG_NO_DEBUG 0x80000000 // turn off all debugging
  91. //
  92. // debug category flags - these control what category of information is output
  93. //
  94. #define DBG_NOTHING 0x00000000 // internal
  95. #define DBG_INET 0x00000001 // e.g. InternetOpenUrl()
  96. #define DBG_FTP 0x00000002 // e.g. FtpFindFirstFile()
  97. #define DBG_GOPHER 0x00000004 // e.g. GopherFindFirstFile()
  98. #define DBG_HTTP 0x00000008 // e.g. HttpOpenRequest()
  99. #define DBG_API 0x00000010 // APIs
  100. #define DBG_UTIL 0x00000020 // various utility functions
  101. #define DBG_UNICODE 0x00000040 // wide character functions
  102. #define DBG_WORKER 0x00000080 // worker functions
  103. #define DBG_HANDLE 0x00000100 // handle creation/deletion functions
  104. #define DBG_SESSION 0x00000200 // session/creation functions
  105. #define DBG_SOCKETS 0x00000400 // sockets functions
  106. #define DBG_VIEW 0x00000800 // gopher view functions
  107. #define DBG_BUFFER 0x00001000 // gopher buffer functions
  108. #define DBG_PARSE 0x00002000 // FTP/gopher parse functions
  109. #define DBG_MEMALLOC 0x00004000 // Debug memory allocation/free functions
  110. #define DBG_SERIALST 0x00008000 // Serialized List functions
  111. #define DBG_THRDINFO 0x00010000 // INTERNET_THREAD_INFO functions
  112. #define DBG_PROTOCOL 0x00020000 // protocol functions
  113. #define DBG_DLL 0x00040000 // DLL functions
  114. #define DBG_REFCOUNT 0x00080000 // logs all reference count functions
  115. #define DBG_REGISTRY 0x00100000 // logs all registry functions
  116. #define DBG_TRACE_SOCKETS 0x00200000 // monitors socket usage
  117. #define DBG_ASYNC 0x00400000 // logs async functions
  118. #define DBG_CACHE 0x00800000 // logs cache specific stuff
  119. #define DBG_INVALID_HANDLES 0x01000000 // logs invalid handles (e.g. in InternetCloseHandle())
  120. #define DBG_OBJECTS 0x02000000 // dump object info
  121. #define DBG_PROXY 0x04000000 // dump proxy info
  122. #define DBG_RESLOCK 0x08000000 // dump resource lock info
  123. #define DBG_DIALUP 0x10000000 // dump dial-up info
  124. #define DBG_GLOBAL 0x20000000 // dump global-scope functions
  125. #define DBG_HTTPAUTH 0x40000000 // authentication functions
  126. #define DBG_ANY 0xFFFFFFFF // internal
  127. //
  128. // types
  129. //
  130. //
  131. // INTERNET_DEBUG_INFO - structure that receives the current debugging variables
  132. // via InternetQueryOption(), or which contains the new debugging variables to
  133. // be set via InternetSetOption()
  134. //
  135. typedef struct {
  136. //
  137. // ErrorLevel - DBG_INFO, etc.
  138. //
  139. int ErrorLevel;
  140. //
  141. // ControlFlags - DBG_THREAD_INFO, etc.
  142. //
  143. DWORD ControlFlags;
  144. //
  145. // CategoryFlags - DBG_INET, etc.
  146. //
  147. DWORD CategoryFlags;
  148. //
  149. // BreakFlags - DBG_API, etc. where breakpoints will be taken
  150. //
  151. DWORD BreakFlags;
  152. //
  153. // IndentIncrement - increment to use for each depth increase
  154. //
  155. int IndentIncrement;
  156. //
  157. // Filename - name of output log being used/to use
  158. //
  159. char Filename[1];
  160. } INTERNET_DEBUG_INFO, *LPINTERNET_DEBUG_INFO;
  161. //
  162. // INTERNET_TRIGGER_INFO - a diagnostic trigger. Triggers are enabled when the
  163. // function named in this structure is executed. Triggers can enable or disable
  164. // diagnostics
  165. //
  166. typedef struct {
  167. //
  168. // FunctionName - name of the function to act as trigger. ControlFlags has
  169. // DBG_TRIGGER_ON or DBG_TRIGGER_OFF set
  170. //
  171. LPCSTR FunctionName;
  172. //
  173. // ControlFlags - control flags to use when the trigger is enabled. If the
  174. // trigger disables diagnostics then the previous control flags will be
  175. // restored
  176. //
  177. DWORD ControlFlags;
  178. //
  179. // CategoryFlags - category flags to use when the trigger is enabled. See
  180. // ControlFlags
  181. //
  182. DWORD CategoryFlags;
  183. } INTERNET_TRIGGER_INFO, *LPINTERNET_TRIGGER_INFO;
  184. //
  185. // INTERNET_DEBUG_TRIGGERS - 1 or more of these will be returned from/given to
  186. // InternetQueryOption()/InternetSetOption()
  187. //
  188. typedef struct {
  189. //
  190. // Count - number of INTERNET_TRIGGER_INFO structures contained herein
  191. //
  192. DWORD Count;
  193. //
  194. // Triggers - an array of 0 or more INTERNET_TRIGGER_INFO structures
  195. //
  196. INTERNET_TRIGGER_INFO Triggers[1];
  197. } INTERNET_DEBUG_TRIGGERS, *LPINTERNET_DEBUG_TRIGGERS;