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.

406 lines
16 KiB

  1. /*++
  2. Copyright (c) 1998-2002 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. //
  14. // Set REFERENCE_DEBUG to a non-zero value to enable ref trace logging.
  15. //
  16. // Set USE_FREE_POOL_WITH_TAG to a non-zero value to enable use of
  17. // the new-for-NT5 ExFreePoolWithTag() API.
  18. //
  19. // Set ENABLE_IRP_TRACE to a non-zero value to enable IRP tracing.
  20. //
  21. // Set ENABLE_TIME_TRACE to a non-zero value to enable time tracing.
  22. //
  23. // Set TRACE_TO_STRING_LOG to have all UlTrace output written to an
  24. // in-memory STRING_LOG instead of to the debug port (DBG only).
  25. //
  26. // Set ENABLE_TC_STATS to a non-zero value to ...
  27. //
  28. // Set ENABLE_MDL_TRACKER to a non-zero value to ...
  29. //
  30. #if DBG
  31. #define REFERENCE_DEBUG 1
  32. #define ENABLE_THREAD_DBEUG 0
  33. #define ENABLE_IRP_TRACE 0
  34. #define ENABLE_TIME_TRACE 0
  35. #define ENABLE_APP_POOL_TIME_TRACE 1
  36. #define ENABLE_HTTP_CONN_STATS 1
  37. #define TRACE_TO_STRING_LOG 0
  38. #define ENABLE_TC_STATS 1
  39. #define ENABLE_MDL_TRACKER 0
  40. #else // !DBG
  41. #define REFERENCE_DEBUG 0
  42. #define ENABLE_THREAD_DBEUG 0
  43. #define ENABLE_IRP_TRACE 0
  44. #define ENABLE_TIME_TRACE 0
  45. #define ENABLE_APP_POOL_TIME_TRACE 0
  46. #define ENABLE_TC_STATS 0
  47. #define ENABLE_MDL_TRACKER 0
  48. #endif // !DBG
  49. #define USE_FREE_POOL_WITH_TAG 0
  50. //
  51. // ENABLE_*_TRACE flags require REFERENCE_DEBUG to get the logging
  52. // stuff. Enforce this here.
  53. //
  54. #if (ENABLE_TIME_TRACE || ENABLE_IRP_TRACE) && !REFERENCE_DEBUG
  55. #undef REFERENCE_DEBUG
  56. #define REFERENCE_DEBUG 1
  57. #endif
  58. //
  59. // Define the additional formal and actual parameters used for the
  60. // various Reference/Dereference functions when reference debugging
  61. // is enabled.
  62. //
  63. #if REFERENCE_DEBUG
  64. #define REFERENCE_DEBUG_FORMAL_PARAMS ,PCSTR pFileName,USHORT LineNumber
  65. #define REFERENCE_DEBUG_ACTUAL_PARAMS ,(PCSTR)__FILE__,(USHORT)__LINE__
  66. #else // !REFERENCE_DEBUG
  67. #define REFERENCE_DEBUG_FORMAL_PARAMS
  68. #define REFERENCE_DEBUG_ACTUAL_PARAMS
  69. #endif // REFERENCE_DEBUG
  70. #if USE_FREE_POOL_WITH_TAG
  71. # define MAKE_POOL_TAG(tag) ( REVERSE_CHAR_CONSTANT(tag) | PROTECTED_POOL )
  72. # define MyFreePoolWithTag(a,t) ExFreePoolWithTag(a,t)
  73. #else // !USE_FREE_POOL_WITH_TAG
  74. # define MAKE_POOL_TAG(tag) ( REVERSE_CHAR_CONSTANT(tag) )
  75. # define MyFreePoolWithTag(a,t) ExFreePool(a)
  76. #endif // USE_FREE_POOL_WITH_TAG
  77. #include <PoolTag.h>
  78. //
  79. // UL_RESOURCE and UL_PUSH_LOCK tags. These are NOT passed to
  80. // UL_ALLOCATE_POOL*() and should not appear in .\pooltag.txt.
  81. //
  82. #define UC_SERVINFO_PUSHLOCK_TAG MAKE_SIGNATURE( 'UcSp' )
  83. #define UL_APP_POOL_RESOURCE_TAG MAKE_SIGNATURE( 'UlAR' )
  84. #define UL_CG_RESOURCE_TAG MAKE_SIGNATURE( 'UlCq' )
  85. #define UL_CONTROL_CHANNEL_PUSHLOCK_TAG MAKE_SIGNATURE( 'UlCc' )
  86. #define UL_DATE_HEADER_PUSHLOCK_TAG MAKE_SIGNATURE( 'UlDH' )
  87. #define UL_DISCONNECT_RESOURCE_TAG MAKE_SIGNATURE( 'UlDq' )
  88. #define UL_HTTP_CONNECTION_PUSHLOCK_TAG MAKE_SIGNATURE( 'UlHq' )
  89. #define UL_INTERNAL_RESPONSE_PUSHLOCK_TAG MAKE_SIGNATURE( 'UlIr' )
  90. #define UL_LOG_LIST_PUSHLOCK_TAG MAKE_SIGNATURE( 'UlLR' )
  91. #define UL_PSCHED_STATE_PUSHLOCK_TAG MAKE_SIGNATURE( 'UlQP' )
  92. #define UL_TCI_PUSHLOCK_TAG MAKE_SIGNATURE( 'UlQR' )
  93. #define UL_ZOMBIE_RESOURCE_TAG MAKE_SIGNATURE( 'UlZR' )
  94. //
  95. // Registry paths.
  96. // If you change or add a setting, please update the ConfigTable
  97. // in ..\util\tul.c.
  98. //
  99. #define REGISTRY_PARAMETERS L"Parameters"
  100. #define REGISTRY_UL_INFORMATION L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\Http"
  101. #define REGISTRY_IIS_INFORMATION L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\Inetinfo"
  102. #define REGISTRY_URLACL_INFORMATION REGISTRY_UL_INFORMATION L"\\Parameters\\UrlAclInfo"
  103. #define REGISTRY_COMPUTER_NAME_PATH L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\ComputerName"
  104. #define REGISTRY_COMPUTER_NAME L"ComputerName"
  105. #define REGISTRY_NLS_PATH L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Nls"
  106. #define REGISTRY_NLS_CODEPAGE_KEY L"CodePage"
  107. #define REGISTRY_ACP_NAME L"ACP"
  108. #define REGISTRY_DEBUG_FLAGS L"DebugFlags"
  109. #define REGISTRY_BREAK_ON_STARTUP L"BreakOnStartup"
  110. #define REGISTRY_BREAK_ON_ERROR L"BreakOnError"
  111. #define REGISTRY_VERBOSE_ERRORS L"VerboseErrors"
  112. #define REGISTRY_IDLE_CONNECTIONS_HIGH_MARK L"IdleConnectionsHighMark"
  113. #define REGISTRY_IDLE_CONNECTIONS_LOW_MARK L"IdleConnectionsLowMark"
  114. #define REGISTRY_IDLE_LIST_TRIMMER_PERIOD L"IdleListTrimmerPeriod"
  115. #define REGISTRY_MAX_ENDPOINTS L"MaxEndpoints"
  116. #define REGISTRY_IRP_CONTEXT_LOOKASIDE_DEPTH L"IrpContextLookasideDepth"
  117. #define REGISTRY_RCV_BUFFER_SIZE L"ReceiveBufferSize"
  118. #define REGISTRY_RCV_BUFFER_LOOKASIDE_DEPTH L"ReceiveBufferLookasideDepth"
  119. #define REGISTRY_RESOURCE_LOOKASIDE_DEPTH L"ResourceLookasideDepth"
  120. #define REGISTRY_REQ_BUFFER_LOOKASIDE_DEPTH L"RequestBufferLookasideDepth"
  121. #define REGISTRY_INT_REQUEST_LOOKASIDE_DEPTH L"InternalRequestLookasideDepth"
  122. #define REGISTRY_RESP_BUFFER_SIZE L"ResponseBufferSize"
  123. #define REGISTRY_RESP_BUFFER_LOOKASIDE_DEPTH L"ResponseBufferLookasideDepth"
  124. #define REGISTRY_SEND_TRACKER_LOOKASIDE_DEPTH L"SendTrackerLookasideDepth"
  125. #define REGISTRY_LOG_BUFFER_LOOKASIDE_DEPTH L"LogBufferLookasideDepth"
  126. #define REGISTRY_LOG_DATA_BUFFER_LOOKASIDE_DEPTH L"LogDataBufferLookasideDepth"
  127. #define REGISTRY_MAX_INTERNAL_URL_LENGTH L"MaxInternalUrlLength"
  128. #define REGISTRY_MAX_REQUESTS_QUEUED L"MaxRequestsQueued"
  129. #define REGISTRY_MAX_REQUEST_BYTES L"MaxRequestBytes"
  130. #define REGISTRY_MAX_FIELD_LENGTH L"MaxFieldLength"
  131. #define REGISTRY_OPT_FOR_INTR_MOD L"OptimizeForInterruptModeration"
  132. #define REGISTRY_ENABLE_NAGLING L"EnableNagling"
  133. #define REGISTRY_ENABLE_THREAD_AFFINITY L"EnableThreadAffinity"
  134. #define REGISTRY_THREAD_AFFINITY_MASK L"ThreadAffinityMask"
  135. #define REGISTRY_THREADS_PER_CPU L"ThreadsPerCpu"
  136. #define REGISTRY_MAX_WORK_QUEUE_DEPTH L"MaxWorkQueueDepth"
  137. #define REGISTRY_MIN_WORK_DEQUEUE_DEPTH L"MinWorkDequeueDepth"
  138. #define REGISTRY_MAX_COPY_THRESHOLD L"MaxCopyThreshold"
  139. #define REGISTRY_MAX_BUFFERED_SENDS L"MaxBufferedSends"
  140. #define REGISTRY_MAX_BYTES_PER_SEND L"MaxBytesPerSend"
  141. #define REGISTRY_MAX_BYTES_PER_READ L"MaxBytesPerRead"
  142. #define REGISTRY_MAX_PIPELINED_REQUESTS L"MaxPipelinedRequests"
  143. #define REGISTRY_ENABLE_COPY_SEND L"EnableCopySend"
  144. #define REGISTRY_MAX_CONNECTIONS L"MaxConnections"
  145. #define REGISTRY_CONNECTION_SEND_LIMIT L"ConnectionSendLimit"
  146. #define REGISTRY_GLOBAL_SEND_LIMIT L"GlobalSendLimit"
  147. #define REGISTRY_OPAQUE_ID_TABLE_SIZE L"OpaqueIdTableSize"
  148. #define REGISTRY_DISABLE_LOG_BUFFERING L"DisableLogBuffering"
  149. #define REGISTRY_LOG_BUFFER_SIZE L"LogBufferSize"
  150. #define REGISTRY_DISABLE_SERVER_HEADER L"DisableServerHeader"
  151. #define REGISTRY_ERROR_LOGGING_ENABLED L"EnableErrorLogging"
  152. #define REGISTRY_ERROR_LOGGING_TRUNCATION_SIZE L"ErrorLogFileTruncateSize"
  153. #define REGISTRY_ERROR_LOGGING_DIRECTORY L"ErrorLoggingDir"
  154. #define REGISTRY_ENABLE_NON_UTF8_URL L"EnableNonUTF8"
  155. #define REGISTRY_FAVOR_UTF8_URL L"FavorUTF8"
  156. #define REGISTRY_PERCENT_U_ALLOWED L"PercentUAllowed"
  157. #define REGISTRY_ALLOW_RESTRICTED_CHARS L"AllowRestrictedChars"
  158. #define REGISTRY_URL_SEGMENT_MAX_LENGTH L"UrlSegmentMaxLength"
  159. #define REGISTRY_URL_SEGMENT_MAX_COUNT L"UrlSegmentMaxCount"
  160. #define REGISTRY_CACHE_ENABLED L"UriEnableCache"
  161. #define REGISTRY_MAX_CACHE_URI_COUNT L"UriMaxCacheUriCount"
  162. #define REGISTRY_MAX_CACHE_MEGABYTE_COUNT L"UriMaxCacheMegabyteCount"
  163. #define REGISTRY_CACHE_SCAVENGER_PERIOD L"UriScavengerPeriod"
  164. #define REGISTRY_MAX_URI_BYTES L"UriMaxUriBytes"
  165. #define REGISTRY_HASH_TABLE_BITS L"HashTableBits"
  166. #define REGISTRY_MAX_ZOMBIE_HTTP_CONN_COUNT L"MaxZombieHttpConnectionCount"
  167. #define REGISTRY_HTTP_CLIENT_ENABLED L"EnableHttpClient"
  168. // List of addresses to override INADDR_ANY/in6addr_any (REG_MULTI_SZ)
  169. #define REGISTRY_LISTEN_ONLY_LIST L"ListenOnlyList"
  170. // Amount of memory to free on each low memory event
  171. #define REGISTRY_SCAVENGER_TRIM_MB L"ScavengerTrimMB"
  172. // Foward declaration; defined in data.h
  173. typedef struct _UL_CONFIG *PUL_CONFIG;
  174. //
  175. // IO parameters.
  176. //
  177. #define DEFAULT_IRP_STACK_SIZE 4
  178. //
  179. // Debugging parameters.
  180. //
  181. #define DEFAULT_DEBUG_FLAGS 0x0000000000000000ui64
  182. #define DEFAULT_BREAK_ON_STARTUP FALSE
  183. #define DEFAULT_BREAK_ON_ERROR FALSE
  184. #define DEFAULT_VERBOSE_ERRORS FALSE
  185. #define DEFAULT_ENABLE_SECURITY TRUE
  186. //
  187. // URI Cache parameters.
  188. //
  189. #define DEFAULT_CACHE_ENABLED 1 /* enabled by default */
  190. #define DEFAULT_MAX_CACHE_URI_COUNT 0 /* max cache entries: 0 => none*/
  191. #define DEFAULT_MAX_CACHE_MEGABYTE_COUNT 0 /* adaptive limit by default */
  192. #define DEFAULT_CACHE_SCAVENGER_PERIOD 120 /* two-minute scavenger */
  193. #define DEFAULT_MAX_URI_BYTES (256*1024) /* 256KB per entry */
  194. #define DEFAULT_HASH_TABLE_BITS (-1) /* -1: determined by system mem size later */
  195. #define DEFAULT_HTTP_CLIENT_ENABLED 0 /* client http stack */
  196. //
  197. // Queueing and timeouts
  198. //
  199. #define DEFAULT_APP_POOL_QUEUE_MAX 3000
  200. //
  201. // Miscellaneous
  202. //
  203. #define POOL_VERIFIER_OVERHEAD 16 // no extra page allocation with verifier on
  204. #define UL_PAGE_SIZE (PAGE_SIZE - POOL_VERIFIER_OVERHEAD)
  205. //
  206. // Server header config
  207. // 0 - Enable Server Header
  208. // 1 - Disable Server Header for driver generated responses (400, 503, etc.)
  209. // 2 - Disable Server Header on all responses
  210. //
  211. // Algorithm for generating the Server: header:
  212. //
  213. // If (DisableServerHeader != 2)
  214. // {
  215. // if (Driver-generated response)
  216. // {
  217. // if (DisableServerHeader != 1)
  218. // {
  219. // Set header to "Server: Microsoft-HTTPAPI/1.0"
  220. // }
  221. // else
  222. // {
  223. // Suppress "Server: " header completely in response;
  224. // }
  225. // }
  226. // else // Application-generated response
  227. // {
  228. // If (Application specifies a HttpHeaderServer string AppServerName in its response)
  229. // {
  230. // Set header to "Server: AppServerName Microsoft-HTTPAPI/1.0"
  231. // }
  232. // else if (Application requests that the header be suppressed)
  233. // {
  234. // Suppress "Server: " header completely in response;
  235. // }
  236. // else
  237. // {
  238. // // Application did not set the header, i.e. it is NULL
  239. // Set header to "Server: Microsoft-HTTP/1.0"
  240. // }
  241. //}
  242. //else
  243. //{
  244. // // Server header generation disabled globally via registry
  245. // Suppress "Server: " header completely in response;
  246. //}
  247. //
  248. //
  249. #define UL_ENABLE_SERVER_HEADER 0
  250. #define UL_DISABLE_SERVER_HEADER_DRIVER 1
  251. #define UL_DISABLE_SERVER_HEADER_ALL 2
  252. #define DEFAULT_DISABLE_SERVER_HEADER UL_ENABLE_SERVER_HEADER
  253. //
  254. // Other parameters.
  255. //
  256. #define DEFAULT_IDLE_CONNECTIONS_HIGH_MARK 0
  257. #define DEFAULT_IDLE_CONNECTIONS_LOW_MARK 0
  258. #define DEFAULT_IDLE_LIST_TRIMMER_PERIOD 30
  259. #define DEFAULT_MAX_ENDPOINTS 0
  260. #define DEFAULT_LOOKASIDE_DEPTH 64
  261. #define DEFAULT_IRP_CONTEXT_LOOKASIDE_DEPTH 64
  262. #define DEFAULT_RCV_BUFFER_SIZE (8192-POOL_VERIFIER_OVERHEAD)
  263. #define DEFAULT_RCV_BUFFER_LOOKASIDE_DEPTH 64
  264. #define DEFAULT_RESOURCE_LOOKASIDE_DEPTH 32
  265. #define DEFAULT_REQ_BUFFER_LOOKASIDE_DEPTH 64
  266. #define DEFAULT_INT_REQUEST_LOOKASIDE_DEPTH 64
  267. #define DEFAULT_RESP_BUFFER_LOOKASIDE_DEPTH 64
  268. #define DEFAULT_RESP_BUFFER_SIZE 0
  269. #define DEFAULT_SEND_TRACKER_LOOKASIDE_DEPTH 64
  270. #define DEFAULT_LOG_BUFFER_LOOKASIDE_DEPTH 16
  271. #define DEFAULT_LOG_DATA_BUFFER_LOOKASIDE_DEPTH 64
  272. #define DEFAULT_ERROR_LOG_BUFFER_LOOKASIDE_DEPTH 64
  273. #define DEFAULT_MAX_REQUESTS_QUEUED (64*1024)
  274. #define DEFAULT_MAX_REQUEST_BYTES (16*1024)
  275. #define DEFAULT_OPT_FOR_INTR_MOD FALSE
  276. #define DEFAULT_ENABLE_NAGLING FALSE
  277. #define DEFAULT_ENABLE_THREAD_AFFINITY FALSE
  278. #define DEFAULT_THREADS_PER_CPU 1
  279. #define DEFAULT_MAX_WORK_QUEUE_DEPTH 1
  280. #define DEFAULT_MIN_WORK_DEQUEUE_DEPTH 1
  281. #define DEFAULT_MAX_FIELD_LENGTH (16*1024)
  282. #define DEFAULT_ENABLE_NON_UTF8_URL DEFAULT_C14N_ENABLE_NON_UTF8_URL
  283. #define DEFAULT_FAVOR_UTF8_URL DEFAULT_C14N_FAVOR_UTF8_URL
  284. #define DEFAULT_PERCENT_U_ALLOWED DEFAULT_C14N_PERCENT_U_ALLOWED
  285. #define DEFAULT_ALLOW_RESTRICTED_CHARS DEFAULT_C14N_ALLOW_RESTRICTED_CHARS
  286. #define DEFAULT_URL_SEGMENT_MAX_LENGTH DEFAULT_C14N_URL_SEGMENT_MAX_LENGTH
  287. #define DEFAULT_URL_SEGMENT_MAX_COUNT DEFAULT_C14N_URL_SEGMENT_MAX_COUNT
  288. #define DEFAULT_MAX_REQUEST_BUFFER_SIZE 512
  289. #define DEFAULT_MAX_INTERNAL_URL_LENGTH 256
  290. #define DEFAULT_MAX_ROUTING_TOKEN_LENGTH 272
  291. #define DEFAULT_MAX_UNKNOWN_HEADERS 8
  292. #define DEFAULT_MAX_IRP_STACK_SIZE 8
  293. #define DEFAULT_MAX_FIXED_HEADER_SIZE 1024
  294. #define DEFAULT_MAX_CONNECTION_ACTIVE_LISTS 64
  295. #define DEFAULT_LARGE_MEM_MEGABYTES (-1)
  296. #define DEFAULT_MAX_BUFFERED_BYTES (16*1024)
  297. #define DEFAULT_MAX_COPY_THRESHOLD 2048
  298. #define DEFAULT_MAX_BUFFERED_SENDS (4)
  299. #define DEFAULT_MAX_BYTES_PER_SEND (64*1024)
  300. #define DEFAULT_MAX_BYTES_PER_READ (64*1024)
  301. #define DEFAULT_ENABLE_COPY_SEND FALSE
  302. #define DEFAULT_MAX_PIPELINED_REQUESTS 2
  303. #define DEFAULT_CONNECTION_SEND_LIMIT (128*1024)
  304. #define DEFAULT_GLOBAL_SEND_LIMIT 0
  305. #define DEFAULT_OPAQUE_ID_TABLE_SIZE 1024
  306. #define DEFAULT_DISABLE_LOG_BUFFERING FALSE
  307. #define DEFAULT_LOG_BUFFER_SIZE 0
  308. #define DEFAULT_MAX_ZOMBIE_HTTP_CONN_COUNT (128)
  309. #define DEFAULT_SCAVENGER_TRIM_MB 0
  310. #define DEFAULT_ENABLE_ERROR_LOGGING TRUE
  311. #define DEFAULT_DEMAND_START_THRESHOLD 400
  312. #define DEFAULT_ERROR_FILE_TRUNCATION_SIZE (1 * 1024 * 1024)
  313. #define DEFAULT_MIN_ERROR_FILE_TRUNCATION_SIZE (HTTP_MIN_ALLOWED_TRUNCATE_SIZE_FOR_LOG_FILE)
  314. //
  315. // The default error logging directory is always under %SystemRoot%
  316. //
  317. #define DEFAULT_ERROR_LOGGING_DIR L"\\SystemRoot\\System32\\LogFiles"
  318. C_ASSERT(DEFAULT_MAX_FIELD_LENGTH <= DEFAULT_MAX_REQUEST_BYTES);
  319. #define MAX_THREADS_PER_CPU 4
  320. //
  321. // DBCS Code page constants as currently listed on
  322. // http://www.microsoft.com/globaldev/reference/WinCP.asp
  323. //
  324. // 932 (Japanese Shift-JIS)
  325. // 936 (Simplified Chinese GBK)
  326. // 949 (Korean)
  327. // 950 (Traditional Chinese Big5)
  328. //
  329. #define CP_JAPANESE_SHIFT_JIS 932
  330. #define CP_SIMPLIFIED_CHINESE_GBK 936
  331. #define CP_KOREAN 949
  332. #define CP_TRADITIONAL_CHINESE_BIG5 950
  333. #endif // _CONFIG_H_