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.

448 lines
16 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows NT **/
  3. /** Copyright(c) Microsoft Corp., 1993 **/
  4. /**********************************************************************/
  5. /*
  6. w3cons.hxx
  7. This file contains the global constant definitions for the
  8. W3 Service.
  9. FILE HISTORY:
  10. KeithMo 07-Mar-1993 Created.
  11. */
  12. #ifndef _W3CONS_H_
  13. #define _W3CONS_H_
  14. # include "strconst.h"
  15. #define W3_MODULE_NAME "w3svc.dll"
  16. #define W3_ADVERTISE_NAME_SUFFIX "_HTTP"
  17. #define W3_ADVERTISE_SECURE_NAME_SUFFIX "_HTTPS"
  18. #define MAX_W3_COMPUTER_NAME_LENGTH 25
  19. #define MAX_W3_ADVERTISE_NAME_LENGTH (MAX_W3_COMPUTER_NAME_LENGTH + sizeof(W3_ADVERTISE_NAME_SUFFIX))
  20. #define MAX_W3_ADVERTISE_SECURE_NAME_LENGTH (MAX_W3_COMPUTER_NAME_LENGTH + sizeof(W3_ADVERTISE_SECURE_NAME_SUFFIX))
  21. #define W3_TEMP_PREFIX "WWW"
  22. //
  23. // HTTP server response string IDs
  24. //
  25. // Commented out codes are not used
  26. //
  27. #define IDS_HTRESP_OK (ID_HTTP_ERROR_BASE+200)
  28. #define IDS_HTRESP_CREATED (ID_HTTP_ERROR_BASE+201)
  29. //#define IDS_HTRESP_ACCEPTED (ID_HTTP_ERROR_BASE+202)
  30. //#define IDS_HTRESP_PARTIAL (ID_HTTP_ERROR_BASE+203)
  31. #define IDS_HTRESP_NO_CONTENT (ID_HTTP_ERROR_BASE+204)
  32. //#define IDS_HTRESP_MULTIPLE_CHOICE (ID_HTTP_ERROR_BASE+300)
  33. #define IDS_HTRESP_MOVED (ID_HTTP_ERROR_BASE+301)
  34. #define IDS_HTRESP_REDIRECT (ID_HTTP_ERROR_BASE+302)
  35. #define IDS_HTRESP_REDIRECT_METHOD (ID_HTTP_ERROR_BASE+303)
  36. #define IDS_HTRESP_NOT_MODIFIED (ID_HTTP_ERROR_BASE+304)
  37. #define IDS_HTRESP_BAD_REQUEST (ID_HTTP_ERROR_BASE+400)
  38. #define IDS_HTRESP_DENIED (ID_HTTP_ERROR_BASE+401)
  39. //#define IDS_HTRESP_PAYMENT_REQ (ID_HTTP_ERROR_BASE+402)
  40. #define IDS_HTRESP_FORBIDDEN (ID_HTTP_ERROR_BASE+403)
  41. #define IDS_HTRESP_NOT_FOUND (ID_HTTP_ERROR_BASE+404)
  42. #define IDS_HTRESP_METHOD_NOT_ALLOWED (ID_HTTP_ERROR_BASE+405)
  43. #define IDS_HTRESP_NONE_ACCEPTABLE (ID_HTTP_ERROR_BASE+406)
  44. #define IDS_HTRESP_PROXY_AUTH_REQ (ID_HTTP_ERROR_BASE+407)
  45. //#define IDS_HTRESP_REQUEST_TIMEOUT (ID_HTTP_ERROR_BASE+408)
  46. //#define IDS_HTRESP_CONFLICT (ID_HTTP_ERROR_BASE+409)
  47. //#define IDS_HTRESP_GONE (ID_HTTP_ERROR_BASE+410)
  48. #define IDS_HTRESP_LENGTH_REQUIRED (ID_HTTP_ERROR_BASE+411)
  49. #define IDS_HTRESP_PRECOND_FAILED (ID_HTTP_ERROR_BASE+412)
  50. #define IDS_HTRESP_URL_TOO_LONG (ID_HTTP_ERROR_BASE+414)
  51. #define IDS_HTRESP_RANGE_NOT_SATISFIABLE (ID_HTTP_ERROR_BASE+416)
  52. #define IDS_HTRESP_SERVER_ERROR (ID_HTTP_ERROR_BASE+500)
  53. #define IDS_HTRESP_NOT_SUPPORTED (ID_HTTP_ERROR_BASE+501)
  54. #define IDS_HTRESP_BAD_GATEWAY (ID_HTTP_ERROR_BASE+502)
  55. #define IDS_HTRESP_SERVICE_UNAVAIL (ID_HTTP_ERROR_BASE+503)
  56. #define IDS_HTRESP_GATEWAY_TIMEOUT (ID_HTTP_ERROR_BASE+504)
  57. //
  58. // Directory browsing strings
  59. //
  60. #define IDS_DIRBROW_TOPARENT (STR_RES_ID_BASE+2000)
  61. #define IDS_DIRBROW_DIRECTORY (STR_RES_ID_BASE+2001)
  62. //
  63. // Mini HTML URL Moved document
  64. //
  65. #define IDS_URL_MOVED (STR_RES_ID_BASE+2100)
  66. #define IDS_SITE_ACCESS_DENIED (STR_RES_ID_BASE+2101)
  67. #define IDS_BAD_CGI_APP (STR_RES_ID_BASE+2102)
  68. #define IDS_CGI_APP_TIMEOUT (STR_RES_ID_BASE+2103)
  69. //
  70. // Various error messages
  71. //
  72. #define IDS_TOO_MANY_USERS (STR_RES_ID_BASE+2122)
  73. #define IDS_OUT_OF_LICENSES (STR_RES_ID_BASE+2123)
  74. #define IDS_READ_ACCESS_DENIED (STR_RES_ID_BASE+2124)
  75. #define IDS_EXECUTE_ACCESS_DENIED (STR_RES_ID_BASE+2125)
  76. #define IDS_SSL_REQUIRED (STR_RES_ID_BASE+2126)
  77. #define IDS_WRITE_ACCESS_DENIED (STR_RES_ID_BASE+2127)
  78. #define IDS_PUT_RANGE_UNSUPPORTED (STR_RES_ID_BASE+2128)
  79. #define IDS_CERT_REQUIRED (STR_RES_ID_BASE+2129)
  80. #define IDS_ADDR_REJECT (STR_RES_ID_BASE+2130)
  81. #define IDS_SSL128_REQUIRED (STR_RES_ID_BASE+2131)
  82. #define IDS_INVALID_CNFG (STR_RES_ID_BASE+2132)
  83. #define IDS_PWD_CHANGE (STR_RES_ID_BASE+2133)
  84. #define IDS_MAPPER_DENY_ACCESS (STR_RES_ID_BASE+2134)
  85. #define IDS_ERROR_FOOTER (STR_RES_ID_BASE+2135)
  86. #define IDS_URL_TOO_LONG (STR_RES_ID_BASE+2136)
  87. #define IDS_CANNOT_DETERMINE_LENGTH (STR_RES_ID_BASE+2137)
  88. #define IDS_UNSUPPORTED_CONTENT_TYPE (STR_RES_ID_BASE+2138)
  89. #if defined(CAL_ENABLED)
  90. #define IDS_CAL_EXCEEDED (STR_RES_ID_BASE+2139)
  91. #endif
  92. #define IDS_HOST_REQUIRED (STR_RES_ID_BASE+2140)
  93. #define IDS_METHOD_NOT_SUPPORTED (STR_RES_ID_BASE+2141)
  94. //
  95. // Next few are metadata config errors. These need to be consecutive
  96. // and corresponding with the error types in metacach.hxx
  97. //
  98. #define IDS_METADATA_CONFIG_ERROR (STR_RES_ID_BASE+2142)
  99. #define IDS_METADATA_CONFIG_TYPE_ERROR (STR_RES_ID_BASE+2142)
  100. #define IDS_METADATA_CONFIG_VALUE_ERROR (STR_RES_ID_BASE+2143)
  101. #define IDS_METADATA_CONFIG_WIN32_ERROR (STR_RES_ID_BASE+2144)
  102. #define IDS_LENGTH_REQUIRED (STR_RES_ID_BASE+2145)
  103. #define IDS_CERT_REVOKED (STR_RES_ID_BASE+2146)
  104. #define IDS_WAM_FAILTOLOAD_ERROR (STR_RES_ID_BASE+2147)
  105. #define IDS_WAM_FAILTOLOADONW95_ERROR (STR_RES_ID_BASE+2148)
  106. #define IDS_WAM_NOMORERECOVERY_ERROR (STR_RES_ID_BASE+2149)
  107. #define IDS_PUT_CONTENTION (STR_RES_ID_BASE+2150)
  108. #define IDS_DIR_LIST_DENIED (STR_RES_ID_BASE+2151)
  109. //
  110. // CPU Logging Strings for UI
  111. //
  112. #define IDS_CPU_LOGGING_NAME_EVENT (STR_RES_ID_BASE+2152)
  113. #define IDS_CPU_LOGGING_NAME_ACTIVE_PROCS (STR_RES_ID_BASE+2153)
  114. #define IDS_CPU_LOGGING_NAME_KERNEL_TIME (STR_RES_ID_BASE+2154)
  115. #define IDS_CPU_LOGGING_NAME_PAGE_FAULTS (STR_RES_ID_BASE+2155)
  116. #define IDS_CPU_LOGGING_NAME_PROC_TYPE (STR_RES_ID_BASE+2156)
  117. #define IDS_CPU_LOGGING_NAME_TERMINATED_PROCS (STR_RES_ID_BASE+2157)
  118. #define IDS_CPU_LOGGING_NAME_TOTAL_PROCS (STR_RES_ID_BASE+2158)
  119. #define IDS_CPU_LOGGING_NAME_USER_TIME (STR_RES_ID_BASE+2159)
  120. #define IDS_SITE_RESOURCE_BLOCKED (STR_RES_ID_BASE+2160)
  121. #define IDS_CPU_LOGGING_NAME (STR_RES_ID_BASE+2161)
  122. #define IDS_CERT_BAD (STR_RES_ID_BASE+2162)
  123. #define IDS_CERT_TIME_INVALID (STR_RES_ID_BASE+2163)
  124. #define IDS_SITE_NOT_FOUND (STR_RES_ID_BASE+2164)
  125. #ifndef RC_INVOKED
  126. //
  127. // Version string for this server
  128. //
  129. #define MSW3_VERSION_STR_IIS "Microsoft-IIS/5.1"
  130. #define MSW3_VERSION_STR_W95 "Microsoft-IIS/5.1"
  131. #define MSW3_VERSION_STR_NTW "Microsoft-IIS/5.1"
  132. //
  133. // Set to the largest of the three
  134. //
  135. #define MSW3_VERSION_STR_MAX MSW3_VERSION_STR_W95
  136. //
  137. // Creates the version string
  138. //
  139. #define MAKE_VERSION_STRING( _s ) ("Server: " ##_s "\r\n")
  140. //
  141. // MIME version we say we support
  142. //
  143. #define W3_MIME_VERSION_STR "MIME-version: 1.0"
  144. //
  145. // The IANA reserved SSL Port
  146. //
  147. #define HTTP_SSL_PORT 443
  148. //
  149. // STR_CONST is defined to expand the parameter (constant string)
  150. // in an efficient manner for STR::Append() and STR::Copy()
  151. //
  152. // Both Append() and Copy do efficient copies (without strlen()
  153. // when given the size of string. Let us give the size as well.
  154. //
  155. // Eg: strResp.Append( STR_CONST( "MyHeader: My Value\r\n"));
  156. //
  157. # define STR_CONST( constSTR) constSTR, (sizeof(constSTR) - 1)
  158. //
  159. // Append a literal string to a pointer and update pointer
  160. //
  161. #define APPEND_STRING(a,b) \
  162. {memcpy(a,b,sizeof(b)); a += sizeof(b)-sizeof(CHAR);}
  163. //
  164. // Append a string to a pointer and update pointer
  165. //
  166. #define APPEND_STRING_VAR(a,b) \
  167. {DWORD cb; cb = strlen(b); memcpy(a,b,cb+sizeof(CHAR)); a += cb;}
  168. //
  169. // Append the server version string
  170. //
  171. #define APPEND_VER_STR(_s) { \
  172. CopyMemory((_s),szServerVersion,cbServerVersionString+1); \
  173. (_s) += cbServerVersionString; \
  174. }
  175. //
  176. // Appends a "<Header> <value> <Trailer>" to the current tail pointer
  177. //
  178. #define APPEND_STR_HEADER( pszTail, Header, Str, Trailer ) \
  179. { DWORD cb = (Str).QueryCB(); \
  180. \
  181. APPEND_STRING( (pszTail), (Header) ); \
  182. memcpy( (pszTail), (Str).QueryStr(), cb + 1 );\
  183. (pszTail) += cb; \
  184. APPEND_STRING( (pszTail), (Trailer) );\
  185. }
  186. #define APPEND_PSZ_HEADER( pszTail, Header, psz, Trailer ) \
  187. { DWORD cb = strlen( psz ); \
  188. \
  189. APPEND_STRING( (pszTail), (Header) ); \
  190. memcpy( (pszTail), (psz), cb + 1 ); \
  191. (pszTail) += cb; \
  192. APPEND_STRING( (pszTail), (Trailer) );\
  193. }
  194. //
  195. // Appends a "<Header> <#> <Trailer>" to the current tail pointer
  196. //
  197. #define APPEND_NUMERIC_HEADER( pszTail, Header, Num, Trailer ) \
  198. { \
  199. DWORD __cb; \
  200. CHAR __ach[32]; \
  201. \
  202. APPEND_STRING( (pszTail), (Header) ); \
  203. _ultoa( (Num), __ach, 10 ); \
  204. __cb = strlen( __ach ); \
  205. CopyMemory( (pszTail), __ach, __cb+1 );\
  206. (pszTail) += __cb; \
  207. APPEND_STRING( (pszTail), (Trailer) );\
  208. }
  209. //
  210. // Appends a "<Header> <#> <Trailer>" to the current tail pointer
  211. //
  212. #define APPEND_NUMERIC_HEADER_TAILVAR( pszTail, Header, Num, Trailer ) \
  213. { \
  214. DWORD __cb; \
  215. CHAR __ach[32]; \
  216. \
  217. APPEND_STRING( (pszTail), (Header) ); \
  218. _ultoa( (Num), __ach, 10 ); \
  219. __cb = strlen( __ach ); \
  220. CopyMemory( (pszTail), __ach, __cb+1 );\
  221. (pszTail) += __cb; \
  222. APPEND_STRING_VAR( (pszTail), (Trailer) );\
  223. }
  224. //
  225. // Global locking functions
  226. //
  227. #define LockGlobals() EnterCriticalSection( &csGlobalLock )
  228. #define UnlockGlobals() LeaveCriticalSection( &csGlobalLock )
  229. //
  230. // Job Object Defines
  231. //
  232. #define NO_W3_CPU_CGI_LIMIT 0
  233. #define NO_W3_CPU_LIMIT 0
  234. //
  235. // defaults
  236. //
  237. #ifdef _NO_TRACING_
  238. #define DEFAULT_DEBUG_FLAGS 0 //0xc0001008
  239. #else
  240. #ifndef DEFAULT_TRACE_FLAGS
  241. #define DEFAULT_TRACE_FLAGS 0 //0xc0001008
  242. #endif
  243. #endif
  244. #define DEFAULT_LOAD_FILE "default.htm"
  245. #define DEFAULT_DIRECTORY_IMAGE "/images/dir.gif"
  246. #define DEFAULT_W3_REALM ""
  247. #define DEFAULT_W3_ACCESS_DENIED_MSG ""
  248. #define DEFAULT_DIR_BROWSE_CONTROL (DIRBROW_SHOW_DATE | \
  249. DIRBROW_SHOW_TIME | \
  250. DIRBROW_SHOW_SIZE | \
  251. DIRBROW_SHOW_EXTENSION | \
  252. DIRBROW_ENABLED | \
  253. DIRBROW_LOADDEFAULT)
  254. #define DEFAULT_SCRIPT_TIMEOUT (15 * 60)
  255. #define DEFAULT_GLOBAL_EXPIRE NO_GLOBAL_EXPIRE
  256. #define DEFAULT_W3_ALLOW_GUEST TRUE
  257. #define DEFAULT_W3_LOG_ERRORS TRUE
  258. #define DEFAULT_W3_LOG_SUCCESS TRUE
  259. #define DEFAULT_W3_UPLOAD_READ_AHEAD (48 * 1024) // 48k
  260. #define DEFAULT_W3_USE_POOL_THREAD_FOR_CGI TRUE
  261. #define DEFAULT_W3_ALLOW_KEEP_ALIVES TRUE
  262. #define DEFAULT_W3_USE_HOST_NAME FALSE
  263. #define DEFAULT_W3_ACCEPT_BYTE_RANGES TRUE
  264. #define DEFAULT_W3_NET_LOGON_WKS MD_NETLOGON_WKS_NONE
  265. #define DEFAULT_W3_ADV_NOT_PWD_EXP_IN_DAYS 14 // advance notification days
  266. #define DEFAULT_W3_ADV_CACHE_TTL (10*60) // in seconds
  267. #define DEFAULT_SEND_11 1
  268. #define DEFAULT_USE_ANDRECV 0
  269. #define DEFAULT_PUT_TIMEOUT 30
  270. #define DEFAULT_W3_ALLOW_PATH_INFO_FOR_SCRIPT_MAPPINGS FALSE
  271. #define DEFAULT_W3_PROCESS_NTCR_IF_LOGGED_ON TRUE
  272. #define DEFAULT_W3_CAL_MODE MD_CAL_MODE_HTTPERR
  273. //
  274. // Job Object Defaults
  275. //
  276. #define DEFAULT_W3_CPU_RESET_INTERVAL (60 * 24)
  277. #define DEFAULT_W3_CPU_QUERY_INTERVAL 60
  278. #define DEFAULT_W3_CPU_CGI_LIMIT NO_W3_CPU_CGI_LIMIT
  279. #define DEFAULT_W3_CPU_LOGGING_OPTIONS MD_CPU_ENABLE_ALL_PROC_LOGGING
  280. #define DEFAULT_W3_CPU_LOGGING_MASK MD_CPU_ENABLE_EVENT | \
  281. MD_CPU_ENABLE_PROC_TYPE | \
  282. MD_CPU_ENABLE_USER_TIME | \
  283. MD_CPU_ENABLE_KERNEL_TIME | \
  284. MD_CPU_ENABLE_PAGE_FAULTS | \
  285. MD_CPU_ENABLE_TOTAL_PROCS | \
  286. MD_CPU_ENABLE_ACTIVE_PROCS | \
  287. MD_CPU_ENABLE_TERMINATED_PROCS
  288. #define DEFAULT_W3_CPU_LIMIT_EVENTLOG NO_W3_CPU_LIMIT
  289. #define DEFAULT_W3_CPU_LIMIT_PRIORITY NO_W3_CPU_LIMIT
  290. #define DEFAULT_W3_CPU_LIMIT_PROCSTOP NO_W3_CPU_LIMIT
  291. #define DEFAULT_W3_CPU_LIMIT_PAUSE NO_W3_CPU_LIMIT
  292. //
  293. // Job Object Logging Metabase Paths
  294. //
  295. #define W3_CPU_LOG_PATH "CPU Accounting/"
  296. #define W3_CPU_LOG_EVENT_PATH "Event"
  297. #define W3_CPU_LOG_ACTIVE_PROCS_PATH "Active Processes"
  298. #define W3_CPU_LOG_KERNEL_TIME_PATH "Kernel Time"
  299. #define W3_CPU_LOG_PAGE_FAULT_PATH "Page Faults"
  300. #define W3_CPU_LOG_PROCESS_TYPE_PATH "Process Type"
  301. #define W3_CPU_LOG_TERMINATED_PROCS_PATH "Terminated Processes"
  302. #define W3_CPU_LOG_TOTAL_PROCS_PATH "Total Processes"
  303. #define W3_CPU_LOG_USER_TIME_PATH "User Time"
  304. #define W3_CPU_LOG_PATH_W L"CPU Accounting/"
  305. #define W3_CPU_LOG_EVENT_PATH_W L"Event"
  306. #define W3_CPU_LOG_ACTIVE_PROCS_PATH_W L"Active Processes"
  307. #define W3_CPU_LOG_KERNEL_TIME_PATH_W L"Kernel Time"
  308. #define W3_CPU_LOG_PAGE_FAULT_PATH_W L"Page Faults"
  309. #define W3_CPU_LOG_PROCESS_TYPE_PATH_W L"Process Type"
  310. #define W3_CPU_LOG_TERMINATED_PROCS_PATH_W L"Terminated Processes"
  311. #define W3_CPU_LOG_TOTAL_PROCS_PATH_W L"Total Processes"
  312. #define W3_CPU_LOG_USER_TIME_PATH_W L"User Time"
  313. #define MIN_W3_CAL_VC_PER_CONNECT 1
  314. #define MAX_W3_CAL_VC_PER_CONNECT 8
  315. #define MIN_CAL_RESERVE_TIMEOUT 1
  316. #define MAX_CAL_RESERVE_TIMEOUT (((DWORD)-1)/1000)
  317. //
  318. // This is the maximum we allow the global expires value to be set to. This
  319. // 10 years in seconds
  320. //
  321. #define MAX_GLOBAL_EXPIRE 0x12cc0300
  322. //
  323. // default connection timeout for w3svc
  324. //
  325. #define W3_DEF_CONNECTION_TIMEOUT 420
  326. //
  327. // Max header name length we'll deal with
  328. //
  329. #define MAX_HEADER_LENGTH 255
  330. //
  331. // They key where the license information is stored
  332. //
  333. #define W3_LICENSE_KEY ("System\\CurrentControlSet\\Services\\LicenseInfo\\" W3_SERVICE_NAME_A)
  334. //
  335. // Downlevel client support constants
  336. //
  337. #define DLC_DEFAULT_COOKIE_NAME "PseudoHost"
  338. #define W3_DLC_SUPPORT "DLCSupport"
  339. #define W3_DLC_MENU_STRING "DLCMenuString"
  340. #define W3_DLC_HOSTNAME_STRING "DLCHostNameString"
  341. #define W3_DLC_COOKIE_MENU_DOCUMENT_STRING "DLCCookieMenuDocumentString"
  342. #define W3_DLC_MUNGE_MENU_DOCUMENT_STRING "DLCMungeMenuDocumentString"
  343. #define W3_DLC_COOKIE_NAME_STRING "DLCCookieNameString"
  344. //
  345. // Max client request buffer size
  346. //
  347. #define W3_DEFAULT_MAX_CLIENT_REQUEST_BUFFER ( 128*1024 )
  348. #define W3_MAX_CLIENT_REQUEST_BUFFER_STRING "MaxClientRequestBuffer"
  349. //
  350. // Toggle for retrieving stack backtraces when appropriate
  351. //
  352. #define W3_GET_BACKTRACES "GetBackTraces"
  353. #endif // !RC_INVOKED
  354. #endif // _W3CONS_H_