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.

183 lines
4.2 KiB

  1. #ifndef __SSINC_HXX__
  2. #define __SSINC_HXX__
  3. /*++
  4. Copyright (c) 2000 Microsoft Corporation
  5. Module Name:
  6. ssinc.hxx
  7. Abstract:
  8. This module contains the server side include processing code. We
  9. aim for support as specified by iis\spec\ssi.doc. The code is based
  10. on existing SSI support done in iis\svcs\w3\gateways\ssinc\ssinc.cxx.
  11. Author:
  12. Ming Lu (MingLu) 5-Apr-2000
  13. --*/
  14. /************************************************************
  15. * Macros
  16. ************************************************************/
  17. //
  18. // General Constants
  19. //
  20. #define SSI_DEFAULT_PATH_SIZE 128
  21. #define SSI_DEFAULT_URL_SIZE 128
  22. #define SSI_DEFAULT_TAG_SIZE 10
  23. #define SSI_DEFAULT_RESPONSE_HEADERS_SIZE 128
  24. #define SSI_DEFAULT_USER_MESSAGE 64
  25. #define SSI_DEFAULT_TIME_FMT 20
  26. #ifndef INTERNET_MAX_PATH_LENGTH
  27. //
  28. // added INTERNET_MAX_PATH_LENGTH to maintain compatibility with IIS5
  29. //
  30. #define INTERNET_MAX_PATH_LENGTH 2048
  31. #endif
  32. #define SSI_MAX_PATH ( INTERNET_MAX_PATH_LENGTH + 1 )
  33. #define SSI_MAX_ERROR_MESSAGE 512
  34. #define SSI_MAX_TIME_SIZE 256
  35. #define SSI_MAX_NUMBER_STRING 32
  36. #define SSI_INIT_VARIABLE_OUTPUT_SIZE 64
  37. #define SSI_MAX_NESTED_INCLUDES 255
  38. #define SSI_MAX_FORMAT_LEN 1024
  39. //
  40. // default number of elements (chunks) for Vector Buffer
  41. // (this value will also be used to check when to flush buffered VectorSend elenents)
  42. //
  43. #define SSI_DEFAULT_NUM_VECTOR_ELEMENTS 50
  44. #define SSI_HEADER "Content-Type: text/html\r\n\r\n"
  45. #define SSI_ACCESS_DENIED "401 Authentication Required"
  46. #define SSI_OBJECT_NOT_FOUND "404 Object Not Found"
  47. #define SSI_DLL_NAME L"ssinc.dll"
  48. //
  49. // Default values for #CONFIG options
  50. //
  51. #define SSI_DEF_TIMEFMT "%A %B %d %Y"
  52. #define SSI_DEF_SIZEFMT FALSE
  53. //
  54. // Specific lvalues for #CONFIG SIZEFMT and #CONFIG CMDECHO
  55. //
  56. #define SSI_DEF_BYTES "bytes"
  57. #define SSI_DEF_BYTES_LEN sizeof( SSI_DEF_BYTES )
  58. #define SSI_DEF_ABBREV "abbrev"
  59. #define SSI_DEF_ABBREV_LEN sizeof( SSI_DEF_ABBREV )
  60. //
  61. // Other cache/signature constants
  62. //
  63. #define SIGNATURE_SEI 0x20494553
  64. #define SIGNATURE_SEL 0x204C4553
  65. #define SIGNATURE_SEI_FREE 0x66494553
  66. #define SIGNATURE_SEL_FREE 0x664C4553
  67. #define SSI_FILE_SIGNATURE CREATE_SIGNATURE( 'SFIL' )
  68. #define SSI_FILE_SIGNATURE_FREED CREATE_SIGNATURE( 'sfiX' )
  69. #define W3_PARAMETERS_KEY \
  70. L"System\\CurrentControlSet\\Services\\w3svc\\Parameters"
  71. //
  72. // These are available SSI commands
  73. //
  74. enum SSI_COMMANDS
  75. {
  76. SSI_CMD_INCLUDE = 0,
  77. SSI_CMD_ECHO,
  78. SSI_CMD_FSIZE, // File size of specified file
  79. SSI_CMD_FLASTMOD, // Last modified date of specified file
  80. SSI_CMD_CONFIG, // Configure options
  81. SSI_CMD_EXEC, // Execute CGI or CMD script
  82. SSI_CMD_BYTERANGE, // Custom commands, not defined by NCSA
  83. SSI_CMD_UNKNOWN
  84. };
  85. //
  86. // These tags are essentially subcommands for the various SSI_COMMAND
  87. // values
  88. //
  89. enum SSI_TAGS
  90. {
  91. SSI_TAG_FILE, // Used with include, fsize & flastmod
  92. SSI_TAG_VIRTUAL,
  93. SSI_TAG_VAR, // Used with echo
  94. SSI_TAG_CMD, // Used with Exec
  95. SSI_TAG_CGI,
  96. SSI_TAG_ISA,
  97. SSI_TAG_ERRMSG, // Used with Config
  98. SSI_TAG_TIMEFMT,
  99. SSI_TAG_SIZEFMT,
  100. SSI_TAG_UNKNOWN
  101. };
  102. //
  103. // Variables available to #ECHO VAR = "xxx" but not available in ISAPI
  104. //
  105. enum SSI_VARS
  106. {
  107. SSI_VAR_DOCUMENT_NAME = 0,
  108. SSI_VAR_DOCUMENT_URI,
  109. SSI_VAR_QUERY_STRING_UNESCAPED,
  110. SSI_VAR_DATE_LOCAL,
  111. SSI_VAR_DATE_GMT,
  112. SSI_VAR_LAST_MODIFIED,
  113. SSI_VAR_UNKNOWN
  114. };
  115. //
  116. // SSI Exec types
  117. //
  118. enum SSI_EXEC_TYPE
  119. {
  120. SSI_EXEC_CMD = 1,
  121. SSI_EXEC_CGI = 2,
  122. SSI_EXEC_ISA = 4,
  123. SSI_EXEC_UNKNOWN
  124. };
  125. extern W3_FILE_INFO_CACHE * g_pFileCache;
  126. DWORD
  127. SsiFormatMessageA(
  128. IN DWORD dwMessageId,
  129. IN LPSTR apszParms[],
  130. OUT LPSTR * ppchErrorBuff
  131. );
  132. #endif