Source code of Windows XP (NT5)
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.

396 lines
15 KiB

  1. /*++
  2. Copyright (c) 1998-2001 Microsoft Corporation
  3. Module Name:
  4. config.h
  5. Abstract:
  6. This module contains global configuration constants.
  7. Author:
  8. Keith Moore (keithmo) 10-Jun-1998
  9. Revision History:
  10. --*/
  11. #ifndef _CONFIG_H_
  12. #define _CONFIG_H_
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. //
  17. // Set ALLOW_UNLOAD to a non-zero value to enable driver unloading.
  18. //
  19. // Set REFERENCE_DEBUG to a non-zero value to enable ref trace logging.
  20. //
  21. // Set ENABLE_OWNER_REF_TRACE to a non-zero value to enable
  22. // owner reference tracing
  23. //
  24. // Set USE_FREE_POOL_WITH_TAG to a non-zero value to enable use of
  25. // the new-for-NT5 ExFreePoolWithTag() API.
  26. //
  27. // Set ENABLE_IRP_TRACE to a non-zero value to enable IRP tracing.
  28. //
  29. // Set ENABLE_TIME_TRACE to a non-zero value to enable time tracing.
  30. //
  31. // Set ENABLE_REPL_TRACE to a non-zero value to enable replenish tracing.
  32. //
  33. // Set ENABLE_FILTQ_TRACE to a non-zero value to enable filter queue tracing.
  34. //
  35. #if DBG
  36. #define ALLOW_UNLOAD 1
  37. #define REFERENCE_DEBUG 1
  38. #define ENABLE_OWNER_REF_TRACE 1
  39. #define ENABLE_IRP_TRACE 0
  40. #define ENABLE_TIME_TRACE 0
  41. #define ENABLE_REPL_TRACE 0
  42. #define ENABLE_FILTQ_TRACE 1
  43. #else // !DBG
  44. #define ALLOW_UNLOAD 1
  45. #define REFERENCE_DEBUG 0
  46. #define ENABLE_OWNER_REF_TRACE 0
  47. #define ENABLE_IRP_TRACE 0
  48. #define ENABLE_TIME_TRACE 0
  49. #define ENABLE_REPL_TRACE 0
  50. #define ENABLE_FILTQ_TRACE 0
  51. #endif // DBG
  52. #define USE_FREE_POOL_WITH_TAG 0
  53. //
  54. // ENABLE_*_TRACE flags require REFERENCE_DEBUG to get the logging
  55. // stuff. Enforce this here.
  56. //
  57. #if (ENABLE_TIME_TRACE || ENABLE_IRP_TRACE || ENABLE_REPL_TRACE || ENABLE_FILTQ_TRACE || ENABLE_OWNER_REF_TRACE) && !REFERENCE_DEBUG
  58. #undef REFERENCE_DEBUG
  59. #define REFERENCE_DEBUG 1
  60. #endif
  61. //
  62. // Define the additional formal and actual parameters used for the
  63. // various Reference/Dereference functions when reference debugging
  64. // is enabled.
  65. //
  66. #if REFERENCE_DEBUG
  67. #define REFERENCE_DEBUG_FORMAL_PARAMS ,PSTR pFileName,USHORT LineNumber
  68. #define REFERENCE_DEBUG_ACTUAL_PARAMS ,(PSTR)__FILE__,(USHORT)__LINE__
  69. #else // !REFERENCE_DEBUG
  70. #define REFERENCE_DEBUG_FORMAL_PARAMS
  71. #define REFERENCE_DEBUG_ACTUAL_PARAMS
  72. #endif // REFERENCE_DEBUG
  73. //
  74. // Make a free structure signature from a valid signature.
  75. //
  76. #define MAKE_FREE_SIGNATURE(sig) ( (((ULONG)(sig)) << 8) | 'x' )
  77. //
  78. // Pool tags.
  79. //
  80. #if USE_FREE_POOL_WITH_TAG
  81. #define MAKE_TAG(tag) ( (ULONG)(tag) | PROTECTED_POOL )
  82. #define MyFreePoolWithTag(a,t) ExFreePoolWithTag(a,t)
  83. #else // !USE_FREE_POOL_WITH_TAG
  84. #define MAKE_TAG(tag) ( (ULONG)(tag) )
  85. #define MyFreePoolWithTag(a,t) ExFreePool(a)
  86. #endif // USE_FREE_POOL_WITH_TAG
  87. #define MAKE_FREE_TAG(Tag) (((Tag) & 0xffffff00) | (ULONG)'x')
  88. #define IS_VALID_TAG(Tag) (((Tag) & 0x0000ffff) == 'lU' )
  89. //
  90. // NOTE: Keep these reverse sorted by tag so it's easy to see dup's
  91. //
  92. // If you add, change, or remove a tag, please make the corresponding
  93. // change to .\pooltag.txt
  94. //
  95. #define UL_AUXILIARY_BUFFER_POOL_TAG MAKE_TAG( 'BAlU' )
  96. #define UL_APP_POOL_OBJECT_POOL_TAG MAKE_TAG( 'OAlU' )
  97. #define UL_APP_POOL_PROCESS_POOL_TAG MAKE_TAG( 'PAlU' )
  98. #define UL_APP_POOL_RESOURCE_TAG MAKE_TAG( 'RAlU' )
  99. #define UL_BUFFER_IO_POOL_TAG MAKE_TAG( 'OBlU' )
  100. #define UL_CONTROL_CHANNEL_POOL_TAG MAKE_TAG( 'CClU' )
  101. #define UL_CG_TREE_ENTRY_POOL_TAG MAKE_TAG( 'EClU' )
  102. #define UL_CG_TREE_HEADER_POOL_TAG MAKE_TAG( 'HClU' )
  103. #define UL_CG_URL_INFO_POOL_TAG MAKE_TAG( 'IClU' )
  104. #define UL_CG_OBJECT_POOL_TAG MAKE_TAG( 'JClU' )
  105. #define UL_CHUNK_TRACKER_POOL_TAG MAKE_TAG( 'KClU' )
  106. #define UL_CG_LOGDIR_POOL_TAG MAKE_TAG( 'LClU' )
  107. #define UL_CONNECTION_POOL_TAG MAKE_TAG( 'OClU' )
  108. #define UL_CG_RESOURCE_TAG MAKE_TAG( 'qClU' )
  109. #define UL_CG_TIMESTAMP_POOL_TAG MAKE_TAG( 'TClU' )
  110. #define UL_CONNECTION_COUNT_ENTRY_POOL_TAG MAKE_TAG( 'YClU' )
  111. #define UL_DEBUG_POOL_TAG MAKE_TAG( 'BDlU' )
  112. #define UL_DATE_HEADER_RESOURCE_TAG MAKE_TAG( 'HDlU' )
  113. #define UL_DISCONNECT_OBJECT_POOL_TAG MAKE_TAG( 'ODlU' )
  114. #define UL_DISCONNECT_RESOURCE_TAG MAKE_TAG( 'qDlU' )
  115. #define UL_DEFERRED_REMOVE_ITEM_POOL_TAG MAKE_TAG( 'RDlU' )
  116. #define UL_DEBUG_THREAD_POOL_TAG MAKE_TAG( 'TDlU' )
  117. #define UL_ENDPOINT_POOL_TAG MAKE_TAG( 'PElU' )
  118. #define UL_FILE_CACHE_ENTRY_POOL_TAG MAKE_TAG( 'CFlU' )
  119. #define URI_FILTER_CONTEXT_POOL_TAG MAKE_TAG( 'cflU' )
  120. #define UL_NONCACHED_FILE_DATA_POOL_TAG MAKE_TAG( 'DFlU' )
  121. #define UL_FILTER_PROCESS_POOL_TAG MAKE_TAG( 'PFlU' )
  122. #define UL_FILTER_CHANNEL_POOL_TAG MAKE_TAG( 'TFlU' )
  123. #define UL_FULL_TRACKER_POOL_TAG MAKE_TAG( 'UFlU' )
  124. #define UX_FILTER_WRITE_TRACKER_POOL_TAG MAKE_TAG( 'WFlU' )
  125. #define UL_HTTP_CONNECTION_POOL_TAG MAKE_TAG( 'CHlU' )
  126. #define UL_HTTP_CONNECTION_RESOURCE_TAG MAKE_TAG( 'qHlU' )
  127. #define UL_INTERNAL_REQUEST_POOL_TAG MAKE_TAG( 'RHlU' )
  128. #define UL_HASH_TABLE_POOL_TAG MAKE_TAG( 'THlU' )
  129. #define HEADER_VALUE_POOL_TAG MAKE_TAG( 'VHlU' )
  130. #define UL_IRP_CONTEXT_POOL_TAG MAKE_TAG( 'CIlU' )
  131. #define UL_CONN_ID_TABLE_POOL_TAG MAKE_TAG( 'DIlU' )
  132. #define UL_INTERNAL_RESPONSE_POOL_TAG MAKE_TAG( 'RIlU' )
  133. #define UL_LARGE_ALLOC_TAG MAKE_TAG( 'ALlU' )
  134. #define UL_LOG_DATA_BUFFER_POOL_TAG MAKE_TAG( 'BLlU' )
  135. #define UL_LOG_FIELD_POOL_TAG MAKE_TAG( 'DLlU' )
  136. #define UL_LOG_FILE_ENTRY_POOL_TAG MAKE_TAG( 'FLlU' )
  137. #define UL_LOG_GENERIC_POOL_TAG MAKE_TAG( 'GLlU' )
  138. #define UL_LOG_FILE_BUFFER_POOL_TAG MAKE_TAG( 'LLlU' )
  139. #define UL_LOG_LIST_RESOURCE_TAG MAKE_TAG( 'RLlU' )
  140. #define UL_NONPAGED_DATA_POOL_TAG MAKE_TAG( 'PNlU' )
  141. #define UL_NSGO_POOL_TAG MAKE_TAG( 'ONlU' )
  142. #define UL_OWNER_REF_POOL_TAG MAKE_TAG( 'ROlU' )
  143. #define UL_OPAQUE_ID_TABLE_POOL_TAG MAKE_TAG( 'TOlU' )
  144. #define UL_APOOL_PROC_BINDING_POOL_TAG MAKE_TAG( 'BPlU' )
  145. #define UL_PIPELINE_POOL_TAG MAKE_TAG( 'LPlU' )
  146. #define UL_TCI_FILTER_POOL_TAG MAKE_TAG( 'FQlU' )
  147. #define UL_TCI_GENERIC_POOL_TAG MAKE_TAG( 'GQlU' )
  148. #define UL_TCI_INTERFACE_POOL_TAG MAKE_TAG( 'IQlU' )
  149. #define UL_TCI_FLOW_POOL_TAG MAKE_TAG( 'LQlU' )
  150. #define UL_TCI_RESOURCE_TAG MAKE_TAG( 'RQlU' )
  151. #define UL_TCI_TRACKER_POOL_TAG MAKE_TAG( 'TQlU' )
  152. #define UL_TCI_WMI_POOL_TAG MAKE_TAG( 'WQlU' )
  153. #define UL_RCV_BUFFER_POOL_TAG MAKE_TAG( 'BRlU' )
  154. #define UL_REGISTRY_DATA_POOL_TAG MAKE_TAG( 'DRlU' )
  155. #define UL_REQUEST_BODY_BUFFER_POOL_TAG MAKE_TAG( 'ERlU' )
  156. #define UL_REQUEST_BUFFER_POOL_TAG MAKE_TAG( 'PRlU' )
  157. #define UL_REF_REQUEST_BUFFER_POOL_TAG MAKE_TAG( 'RRlU' )
  158. #define UL_NONPAGED_RESOURCE_POOL_TAG MAKE_TAG( 'SRlU' )
  159. #define UL_REF_OWNER_TRACELOG_POOL_TAG MAKE_TAG( 'TRlU' )
  160. #define UL_SIMPLE_STATUS_ITEM_TAG MAKE_TAG( 'SSlU' )
  161. #define UL_SSL_CERT_DATA_POOL_TAG MAKE_TAG( 'CSlU' )
  162. #define UL_SECURITY_DATA_POOL_TAG MAKE_TAG( 'DSlU' )
  163. #define UL_SITE_COUNTER_ENTRY_POOL_TAG MAKE_TAG( 'OSlU' )
  164. #define UL_ADDRESS_POOL_TAG MAKE_TAG( 'ATlU' )
  165. #define UL_THREAD_TRACKER_POOL_TAG MAKE_TAG( 'TTlU' )
  166. #define UL_URI_CACHE_ENTRY_POOL_TAG MAKE_TAG( 'CUlU' )
  167. #define UL_HTTP_UNKNOWN_HEADER_POOL_TAG MAKE_TAG( 'HUlU' )
  168. #define URL_POOL_TAG MAKE_TAG( 'LUlU' )
  169. #define UL_URLMAP_POOL_TAG MAKE_TAG( 'MUlU' )
  170. #define UL_VIRTHOST_POOL_TAG MAKE_TAG( 'HVlU' )
  171. #define UL_WORK_CONTEXT_POOL_TAG MAKE_TAG( 'CWlU' )
  172. #define UL_WORK_ITEM_POOL_TAG MAKE_TAG( 'IWlU' )
  173. #define UL_ZOMBIE_RESOURCE_TAG MAKE_TAG( 'RZlU' )
  174. //
  175. // Registry paths.
  176. // If you change or add a setting, please update the ConfigTable
  177. // in ul\util\tul.c.
  178. //
  179. #define REGISTRY_PARAMETERS L"Parameters"
  180. #define REGISTRY_UL_INFORMATION L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\Http"
  181. #define REGISTRY_IIS_INFORMATION L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\Inetinfo"
  182. #define REGISTRY_IRP_STACK_SIZE L"IrpStackSize"
  183. #define REGISTRY_PRIORITY_BOOST L"PriorityBoost"
  184. #define REGISTRY_DEBUG_FLAGS L"DebugFlags"
  185. #define REGISTRY_BREAK_ON_STARTUP L"BreakOnStartup"
  186. #define REGISTRY_BREAK_ON_ERROR L"BreakOnError"
  187. #define REGISTRY_VERBOSE_ERRORS L"VerboseErrors"
  188. #define REGISTRY_ENABLE_UNLOAD L"EnableUnload"
  189. #define REGISTRY_ENABLE_SECURITY L"EnableSecurity"
  190. #define REGISTRY_MIN_IDLE_CONNECTIONS L"MinIdleConnections"
  191. #define REGISTRY_MAX_IDLE_CONNECTIONS L"MaxIdleConnections"
  192. #define REGISTRY_IRP_CONTEXT_LOOKASIDE_DEPTH L"IrpContextLookasideDepth"
  193. #define REGISTRY_RCV_BUFFER_SIZE L"ReceiveBufferSize"
  194. #define REGISTRY_RCV_BUFFER_LOOKASIDE_DEPTH L"ReceiveBufferLookasideDepth"
  195. #define REGISTRY_RESOURCE_LOOKASIDE_DEPTH L"ResourceLookasideDepth"
  196. #define REGISTRY_REQ_BUFFER_LOOKASIDE_DEPTH L"RequestBufferLookasideDepth"
  197. #define REGISTRY_INT_REQUEST_LOOKASIDE_DEPTH L"InternalRequestLookasideDepth"
  198. #define REGISTRY_RESP_BUFFER_SIZE L"ResponseBufferSize"
  199. #define REGISTRY_RESP_BUFFER_LOOKASIDE_DEPTH L"ResponseBufferLookasideDepth"
  200. #define REGISTRY_SEND_TRACKER_LOOKASIDE_DEPTH L"SendTrackerLookasideDepth"
  201. #define REGISTRY_LOG_BUFFER_LOOKASIDE_DEPTH L"LogBufferLookasideDepth"
  202. #define REGISTRY_MAX_INTERNAL_URL_LENGTH L"MaxInternalUrlLength"
  203. #define REGISTRY_MAX_REQUEST_BYTES L"MaxRequestBytes"
  204. #define REGISTRY_ENABLE_CONNECTION_REUSE L"EnableConnectionReuse"
  205. #define REGISTRY_ENABLE_NAGLING L"EnableNagling"
  206. #define REGISTRY_ENABLE_THREAD_AFFINITY L"EnableThreadAffinity"
  207. #define REGISTRY_THREAD_AFFINITY_MASK L"ThreadAffinityMask"
  208. #define REGISTRY_THREADS_PER_CPU L"ThreadsPerCpu"
  209. #define REGISTRY_MAX_URL_LENGTH L"MaxUrlLength"
  210. #define REGISTRY_MAX_WORK_QUEUE_DEPTH L"MaxWorkQueueDepth"
  211. #define REGISTRY_MIN_WORK_DEQUEUE_DEPTH L"MinWorkDequeueDepth"
  212. #define REGISTRY_OPAQUE_ID_TABLE_SIZE L"OpaqueIdTableSize"
  213. #define REGISTRY_MAX_FIELD_LENGTH L"MaxFieldLength"
  214. #define REGISTRY_DEBUG_LOGTIMER_CYCLE L"DebugLogTimerCycle"
  215. #define REGISTRY_DEBUG_LOG_BUFFER_PERIOD L"DebugLogBufferPeriod"
  216. #define REGISTRY_LOG_BUFFER_SIZE L"LogBufferSize"
  217. #define REGISTRY_ENABLE_NON_UTF8_URL L"EnableNonUTF8"
  218. #define REGISTRY_ENABLE_DBCS_URL L"EnableDBCS"
  219. #define REGISTRY_FAVOR_DBCS_URL L"FavorDBCS"
  220. #define REGISTRY_CACHE_ENABLED L"UriEnableCache"
  221. #define REGISTRY_MAX_CACHE_URI_COUNT L"UriMaxCacheUriCount"
  222. #define REGISTRY_MAX_CACHE_MEGABYTE_COUNT L"UriMaxCacheMegabyteCount"
  223. #define REGISTRY_CACHE_SCAVENGER_PERIOD L"UriScavengerPeriod"
  224. #define REGISTRY_MAX_URI_BYTES L"UriMaxUriBytes"
  225. #define REGISTRY_HASH_TABLE_BITS L"HashTableBits"
  226. #define REGISTRY_LARGE_MEM_MEGABYTES L"LargeMemMegabytes"
  227. // Foward declaration; defined in data.h
  228. typedef struct _UL_CONFIG *PUL_CONFIG;
  229. //
  230. // IO parameters.
  231. //
  232. #define DEFAULT_IRP_STACK_SIZE 1
  233. #define DEFAULT_PRIORITY_BOOST 2
  234. //
  235. // Cache line requirement.
  236. //
  237. #ifdef _WIN64
  238. #define UL_CACHE_LINE 64
  239. #else
  240. #define UL_CACHE_LINE 32
  241. #endif
  242. //
  243. // Debugging parameters.
  244. //
  245. #define DEFAULT_DEBUG_FLAGS 0x00000000
  246. #define DEFAULT_BREAK_ON_STARTUP FALSE
  247. #define DEFAULT_BREAK_ON_ERROR FALSE
  248. #define DEFAULT_VERBOSE_ERRORS FALSE
  249. #define DEFAULT_ENABLE_UNLOAD FALSE
  250. #define DEFAULT_ENABLE_SECURITY TRUE
  251. //
  252. // URI Cache parameters.
  253. //
  254. #define DEFAULT_CACHE_ENABLED 1 /* enabled by default */
  255. #define DEFAULT_MAX_CACHE_URI_COUNT 0 /* max cache entries: 0 => none*/
  256. #define DEFAULT_MAX_CACHE_MEGABYTE_COUNT 0 /* adaptive limit by default */
  257. #define DEFAULT_CACHE_SCAVENGER_PERIOD 120 /* two-minute scavenger */
  258. #define DEFAULT_MAX_URI_BYTES (256<<10) /* 256KB per entry */
  259. #define DEFAULT_HASH_TABLE_BITS (-1) /* -1: determined by system mem size later */
  260. //
  261. // Queueing and timeouts
  262. //
  263. #define DEFAULT_APP_POOL_QUEUE_MAX 3000
  264. //
  265. // Miscellaneous
  266. //
  267. #define POOL_VERIFIER_OVERHEAD 64 // for large page-size allocations
  268. //
  269. // Other parameters.
  270. //
  271. #define DEFAULT_MIN_IDLE_CONNECTIONS 10
  272. #define DEFAULT_MAX_IDLE_CONNECTIONS 64
  273. #define DEFAULT_LOOKASIDE_DEPTH 64
  274. #define DEFAULT_IRP_CONTEXT_LOOKASIDE_DEPTH 64
  275. #define DEFAULT_RCV_BUFFER_SIZE (8192-POOL_VERIFIER_OVERHEAD)
  276. #define DEFAULT_RCV_BUFFER_LOOKASIDE_DEPTH 64
  277. #define DEFAULT_RESOURCE_LOOKASIDE_DEPTH 32
  278. #define DEFAULT_REQ_BUFFER_LOOKASIDE_DEPTH 64
  279. #define DEFAULT_INT_REQUEST_LOOKASIDE_DEPTH 64
  280. #define DEFAULT_RESP_BUFFER_LOOKASIDE_DEPTH 64
  281. #define DEFAULT_RESP_BUFFER_SIZE (8192-POOL_VERIFIER_OVERHEAD)
  282. #define DEFAULT_SEND_TRACKER_LOOKASIDE_DEPTH 64
  283. #define DEFAULT_LOG_BUFFER_LOOKASIDE_DEPTH 16
  284. #define DEFAULT_MAX_REQUEST_BYTES (16*1024)
  285. #define DEFAULT_ENABLE_CONNECTION_REUSE TRUE
  286. #define DEFAULT_ENABLE_NAGLING FALSE
  287. #define DEFAULT_ENABLE_THREAD_AFFINITY FALSE
  288. #define DEFAULT_THREADS_PER_CPU 1
  289. #define DEFAULT_MAX_URL_LENGTH (16*1024)
  290. #define DEFAULT_MAX_FIELD_LENGTH (16*1024)
  291. #define DEFAULT_ENABLE_NON_UTF8_URL FALSE
  292. #define DEFAULT_ENABLE_DBCS_URL FALSE
  293. #define DEFAULT_FAVOR_DBCS_URL FALSE
  294. #define DEFAULT_MAX_REQUEST_BUFFER_SIZE 1504
  295. #define DEFAULT_MAX_INTERNAL_URL_LENGTH 1024
  296. #define DEFAULT_MAX_UNKNOWN_HEADERS 8
  297. #define DEFAULT_MAX_IRP_STACK_SIZE 8
  298. #define DEFAULT_MAX_FIXED_HEADER_SIZE 1024
  299. #define DEFAULT_MAX_CONNECTION_ACTIVE_LISTS 64
  300. #define DEFAULT_LARGE_MEM_MEGABYTES (-1)
  301. #define DEFAULT_MAX_BUFFERED_BYTES (16*1024)
  302. #define DEFAULT_MAX_WORK_QUEUE_DEPTH 1
  303. #define DEFAULT_MIN_WORK_DEQUEUE_DEPTH 1
  304. #define DEFAULT_MAX_COPY_THRESHOLD (2048)
  305. #define DEFAULT_MAX_SEND_BUFFERED_BYTES (8192)
  306. #define DEFAULT_OPAQUE_ID_TABLE_SIZE 1024
  307. #define DEFAULT_DEBUG_LOGTIMER_CYCLE 0
  308. #define DEFAULT_DEBUG_LOG_BUFFER_PERIOD 0
  309. #define DEFAULT_LOG_BUFFER_SIZE 0
  310. #ifdef __cplusplus
  311. }; // extern "C"
  312. #endif
  313. #endif // _CONFIG_H_