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.

251 lines
9.0 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 WINHTTP_OPTION_GET_DEBUG_INFO 1001
  44. #define WINHTTP_OPTION_SET_DEBUG_INFO 1002
  45. #define WINHTTP_OPTION_GET_HANDLE_COUNT 1003
  46. #define WINHTTP_OPTION_GET_TRIGGERS 1004
  47. #define WINHTTP_OPTION_SET_TRIGGERS 1005
  48. #define WINHTTP_OPTION_RESET_TRIGGERS 1006
  49. #define INTERNET_FIRST_DEBUG_OPTION WINHTTP_OPTION_GET_DEBUG_INFO
  50. #define INTERNET_LAST_DEBUG_OPTION WINHTTP_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_ANY 0xFFFFFFFF // internal
  126. //
  127. // types
  128. //
  129. //
  130. // INTERNET_DEBUG_INFO - structure that receives the current debugging variables
  131. // via InternetQueryOption(), or which contains the new debugging variables to
  132. // be set via InternetSetOption()
  133. //
  134. typedef struct {
  135. //
  136. // ErrorLevel - DBG_INFO, etc.
  137. //
  138. int ErrorLevel;
  139. //
  140. // ControlFlags - DBG_THREAD_INFO, etc.
  141. //
  142. DWORD ControlFlags;
  143. //
  144. // CategoryFlags - DBG_INET, etc.
  145. //
  146. DWORD CategoryFlags;
  147. //
  148. // BreakFlags - DBG_API, etc. where breakpoints will be taken
  149. //
  150. DWORD BreakFlags;
  151. //
  152. // IndentIncrement - increment to use for each depth increase
  153. //
  154. int IndentIncrement;
  155. //
  156. // Filename - name of output log being used/to use
  157. //
  158. char Filename[1];
  159. } INTERNET_DEBUG_INFO, *LPINTERNET_DEBUG_INFO;
  160. //
  161. // INTERNET_TRIGGER_INFO - a diagnostic trigger. Triggers are enabled when the
  162. // function named in this structure is executed. Triggers can enable or disable
  163. // diagnostics
  164. //
  165. typedef struct {
  166. //
  167. // FunctionName - name of the function to act as trigger. ControlFlags has
  168. // DBG_TRIGGER_ON or DBG_TRIGGER_OFF set
  169. //
  170. LPCSTR FunctionName;
  171. //
  172. // ControlFlags - control flags to use when the trigger is enabled. If the
  173. // trigger disables diagnostics then the previous control flags will be
  174. // restored
  175. //
  176. DWORD ControlFlags;
  177. //
  178. // CategoryFlags - category flags to use when the trigger is enabled. See
  179. // ControlFlags
  180. //
  181. DWORD CategoryFlags;
  182. } INTERNET_TRIGGER_INFO, *LPINTERNET_TRIGGER_INFO;
  183. //
  184. // INTERNET_DEBUG_TRIGGERS - 1 or more of these will be returned from/given to
  185. // InternetQueryOption()/InternetSetOption()
  186. //
  187. typedef struct {
  188. //
  189. // Count - number of INTERNET_TRIGGER_INFO structures contained herein
  190. //
  191. DWORD Count;
  192. //
  193. // Triggers - an array of 0 or more INTERNET_TRIGGER_INFO structures
  194. //
  195. INTERNET_TRIGGER_INFO Triggers[1];
  196. } INTERNET_DEBUG_TRIGGERS, *LPINTERNET_DEBUG_TRIGGERS;