home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / Runimage / Delphi50 / Source / Rtl / Win / ISAPI2.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1999-08-11  |  22.8 KB  |  700 lines

  1.  
  2. {*******************************************************}
  3. {                                                       }
  4. {       Borland Delphi Runtime Library                  }
  5. {       Structure definitions and prototypes for the    }
  6. {       version 2.0 HTTP Server Extension interface.    }
  7. {                                                       }
  8. {       Copyright (C) 1997,99 Inprise Corporation       }
  9. {                                                       }
  10. {*******************************************************}
  11.  
  12. unit Isapi2;
  13.  
  14. {$WEAKPACKAGEUNIT}
  15.  
  16. interface
  17.  
  18. uses Windows;
  19.  
  20. const
  21.   HSE_VERSION_MAJOR         =   2;      // major version of this spec
  22.   {$EXTERNALSYM HSE_VERSION_MAJOR}
  23.   HSE_VERSION_MINOR         =   0;      // minor version of this spec
  24.   {$EXTERNALSYM HSE_VERSION_MINOR}
  25.   HSE_LOG_BUFFER_LEN        =  80;
  26.   {$EXTERNALSYM HSE_LOG_BUFFER_LEN}
  27.   HSE_MAX_EXT_DLL_NAME_LEN  = 256;
  28.   {$EXTERNALSYM HSE_MAX_EXT_DLL_NAME_LEN}
  29.  
  30. type
  31.   HCONN = THandle;
  32.   {$EXTERNALSYM HCONN}
  33.  
  34. // the following are the status codes returned by the Extension DLL
  35.  
  36. const
  37.   HSE_STATUS_SUCCESS                      = 1;
  38.   {$EXTERNALSYM HSE_STATUS_SUCCESS}
  39.   HSE_STATUS_SUCCESS_AND_KEEP_CONN        = 2;
  40.   {$EXTERNALSYM HSE_STATUS_SUCCESS_AND_KEEP_CONN}
  41.   HSE_STATUS_PENDING                      = 3;
  42.   {$EXTERNALSYM HSE_STATUS_PENDING}
  43.   HSE_STATUS_ERROR                        = 4;
  44.   {$EXTERNALSYM HSE_STATUS_ERROR}
  45.  
  46. // The following are the values to request services with the ServerSupportFunction.
  47. //  Values from 0 to 1000 are reserved for future versions of the interface
  48.  
  49.   HSE_REQ_BASE                             = 0;
  50.   {$EXTERNALSYM HSE_REQ_BASE}
  51.   HSE_REQ_SEND_URL_REDIRECT_RESP           = ( HSE_REQ_BASE + 1 );
  52.   {$EXTERNALSYM HSE_REQ_SEND_URL_REDIRECT_RESP}
  53.   HSE_REQ_SEND_URL                         = ( HSE_REQ_BASE + 2 );
  54.   {$EXTERNALSYM HSE_REQ_SEND_URL}
  55.   HSE_REQ_SEND_RESPONSE_HEADER             = ( HSE_REQ_BASE + 3 );
  56.   {$EXTERNALSYM HSE_REQ_SEND_RESPONSE_HEADER}
  57.   HSE_REQ_DONE_WITH_SESSION                = ( HSE_REQ_BASE + 4 );
  58.   {$EXTERNALSYM HSE_REQ_DONE_WITH_SESSION}
  59.   HSE_REQ_END_RESERVED                     = 1000;
  60.   {$EXTERNALSYM HSE_REQ_END_RESERVED}
  61.  
  62. //
  63. //  These are Microsoft specific extensions
  64. //
  65.  
  66.   HSE_REQ_MAP_URL_TO_PATH                  = (HSE_REQ_END_RESERVED+1);
  67.   {$EXTERNALSYM HSE_REQ_MAP_URL_TO_PATH}
  68.   HSE_REQ_GET_SSPI_INFO                    = (HSE_REQ_END_RESERVED+2);
  69.   {$EXTERNALSYM HSE_REQ_GET_SSPI_INFO}
  70.   HSE_APPEND_LOG_PARAMETER                 = (HSE_REQ_END_RESERVED+3);
  71.   {$EXTERNALSYM HSE_APPEND_LOG_PARAMETER}
  72.   HSE_REQ_SEND_URL_EX                      = (HSE_REQ_END_RESERVED+4);
  73.   {$EXTERNALSYM HSE_REQ_SEND_URL_EX}
  74.   HSE_REQ_IO_COMPLETION                    = (HSE_REQ_END_RESERVED+5);
  75.   {$EXTERNALSYM HSE_REQ_IO_COMPLETION}
  76.   HSE_REQ_TRANSMIT_FILE                    = (HSE_REQ_END_RESERVED+6);
  77.   {$EXTERNALSYM HSE_REQ_TRANSMIT_FILE}
  78.   HSE_REQ_REFRESH_ISAPI_ACL                = (HSE_REQ_END_RESERVED+7);
  79.   {$EXTERNALSYM HSE_REQ_REFRESH_ISAPI_ACL}
  80.  
  81. //
  82. //  Bit Flags for TerminateExtension
  83. //
  84. //    HSE_TERM_ADVISORY_UNLOAD - Server wants to unload the extension,
  85. //          extension can return TRUE if OK, FALSE if the server should not
  86. //          unload the extension
  87. //
  88. //    HSE_TERM_MUST_UNLOAD - Server indicating the extension is about to be
  89. //          unloaded, the extension cannot refuse.
  90. //
  91.  
  92.   HSE_TERM_ADVISORY_UNLOAD                 = $00000001;
  93.   {$EXTERNALSYM HSE_TERM_ADVISORY_UNLOAD}
  94.   HSE_TERM_MUST_UNLOAD                     = $00000002;
  95.   {$EXTERNALSYM HSE_TERM_MUST_UNLOAD}
  96.  
  97. //
  98. // Flags for IO Functions, supported for IO Funcs.
  99. //  TF means ServerSupportFunction( HSE_REQ_TRANSMIT_FILE)
  100. //
  101.  
  102. {  HSE_IO_SYNC                      = $00000001;   // for WriteClient
  103.   HSE_IO_ASYNC                     = $00000002;   // for WriteClient/TF
  104.   HSE_IO_DISCONNECT_AFTER_SEND     = $00000004;   // for TF
  105.   HSE_IO_SEND_HEADERS              = $00000008;   // for TF }
  106.  
  107. //
  108. // passed to GetExtensionVersion
  109. //
  110.  
  111. type
  112.   PHSE_VERSION_INFO = ^HSE_VERSION_INFO;
  113.   HSE_VERSION_INFO = packed record
  114.     dwExtensionVersion: DWORD;
  115.     lpszExtensionDesc: array [0..HSE_MAX_EXT_DLL_NAME_LEN-1] of Char;
  116.   end;
  117.   {$EXTERNALSYM HSE_VERSION_INFO}
  118.   THSE_VERSION_INFO = HSE_VERSION_INFO;
  119.   LPHSE_VERSION_INFO = PHSE_VERSION_INFO;
  120.   {$EXTERNALSYM LPHSE_VERSION_INFO}
  121.  
  122. type
  123.   TGetServerVariableProc = function ( hConn: HCONN;
  124.                                       VariableName: PChar;
  125.                                       Buffer: Pointer;
  126.                                       var Size: DWORD ): BOOL stdcall;
  127.  
  128.   TWriteClientProc = function ( ConnID: HCONN;
  129.                                 Buffer: Pointer;
  130.                                 var Bytes: DWORD;
  131.                                 dwReserved: DWORD ): BOOL stdcall;
  132.  
  133.   TReadClientProc = function ( ConnID: HCONN;
  134.                                Buffer: Pointer;
  135.                                var Size: DWORD ): BOOL stdcall;
  136.  
  137.   TServerSupportFunctionProc = function ( hConn: HCONN;
  138.                                           HSERRequest: DWORD;
  139.                                           Buffer: Pointer;
  140.                                           Size: LPDWORD;
  141.                                           DataType: LPDWORD ): BOOL stdcall;
  142.  
  143. //
  144. // passed to extension procedure on a new request
  145. //
  146. type
  147.  
  148.   PEXTENSION_CONTROL_BLOCK = ^TEXTENSION_CONTROL_BLOCK;
  149.   TEXTENSION_CONTROL_BLOCK = packed record
  150.     cbSize: DWORD;                    // size of this struct.
  151.     dwVersion: DWORD;                 // version info of this spec
  152.     ConnID: HCONN;                    // Context number not to be modified!
  153.     dwHttpStatusCode: DWORD;          // HTTP Status code
  154.                      // null terminated log info specific to this Extension DLL
  155.     lpszLogData: array [0..HSE_LOG_BUFFER_LEN-1] of Char;
  156.     lpszMethod: PChar;                // REQUEST_METHOD
  157.     lpszQueryString: PChar;           // QUERY_STRING
  158.     lpszPathInfo: PChar;              // PATH_INFO
  159.     lpszPathTranslated: PChar;        // PATH_TRANSLATED
  160.     cbTotalBytes: DWORD;              // Total bytes indicated from client
  161.     cbAvailable: DWORD;               // Available number of bytes
  162.     lpbData: Pointer;                 // pointer to cbAvailable bytes
  163.     lpszContentType: PChar;           // Content type of client data
  164.  
  165.     GetServerVariable: TGetServerVariableProc;
  166.     WriteClient: TWriteClientProc;
  167.     ReadClient: TReadClientProc;
  168.     ServerSupportFunction: TServerSupportFunctionProc;
  169.   end;
  170.  
  171. //
  172. //  these are the prototypes that must be exported from the extension DLL
  173. //
  174.  
  175. //  function GetExtensionVersion(var Ver: THSE_VERSION_INFO): BOOL; stdcall;
  176. //  function HttpExtensionProc(var ECB: TEXTENSION_CONTROL_BLOCK): DWORD; stdcall;
  177. //  function TerminateExtension(dwFlags: DWORD): BOOL; stdcall;
  178.  
  179. // the following type declarations are for the server side
  180.  
  181.   TGetExtensionVersion = function (var Ver: THSE_VERSION_INFO): BOOL stdcall;
  182.   THttpExtensionProc = function (var ECB: TEXTENSION_CONTROL_BLOCK): DWORD stdcall;
  183.   TTerminateExtension = function (dwFlags: DWORD): BOOL stdcall;
  184.  
  185.   THseIoCompletion = procedure (var ECB: TEXTENSION_CONTROL_BLOCK; pContext: Pointer;
  186.     cbIO: DWORD; dwError: DWORD) stdcall;
  187.  
  188. //
  189. // HSE_TF_INFO defines the type for HTTP SERVER EXTENSION support for
  190. //  ISAPI applications to send files using TransmitFile.
  191. // A pointer to this object should be used with ServerSupportFunction()
  192. //  for HSE_REQ_TRANSMIT_FILE.
  193. //
  194.  
  195.   PHSE_TF_INFO = ^THSE_TF_INFO;
  196.   THSE_TF_INFO = record
  197.  
  198.     //
  199.     // callback and context information
  200.     // the callback function will be called when IO is completed.
  201.     // the context specified will be used during such callback.
  202.     //
  203.     // These values (if non-NULL) will override the one set by calling
  204.     //  ServerSupportFunction() with HSE_REQ_IO_COMPLETION
  205.     //
  206.     pfnHseIO: THseIoCompletion;
  207.     pContext: Pointer;
  208.  
  209.     // file should have been opened with FILE_FLAG_SEQUENTIAL_SCAN
  210.     hFile: THandle;
  211.  
  212.     //
  213.     // HTTP header and status code
  214.     // These fields are used only if HSE_IO_SEND_HEADERS is present in dwFlags
  215.     //
  216.  
  217.     pszStatusCode: PChar; // HTTP Status Code  eg: "200 OK"
  218.  
  219.     BytesToWrite: DWORD;  // special value of "0" means write entire file.
  220.     Offset: DWORD;        // offset value within the file to start from
  221.  
  222.     pHead: Pointer;       // Head buffer to be sent before file data
  223.     HeadLength: DWORD;    // header length
  224.     pTail: Pointer;       // Tail buffer to be sent after file data
  225.     TailLength: DWORD;    // tail length
  226.  
  227.     dwFlags: DWORD;       // includes HSE_IO_DISCONNECT_AFTER_SEND, ...
  228.   end;
  229.    
  230. /////////////////////////////////////////////////////////////////////////////
  231.  
  232. {********
  233. *
  234. *    This module contains the Microsoft HTTP filter extension info
  235. *
  236. ******************}
  237.  
  238. //
  239. //  Current version of the filter spec is 2.0
  240. //
  241.  
  242. const
  243.   HTTP_FILTER_REVISION    = $00020000;
  244.   {$EXTERNALSYM HTTP_FILTER_REVISION}
  245.  
  246.   SF_MAX_USERNAME         = (256+1);
  247.   {$EXTERNALSYM SF_MAX_USERNAME}
  248.   SF_MAX_PASSWORD         = (256+1);
  249.   {$EXTERNALSYM SF_MAX_PASSWORD}
  250.  
  251.   SF_MAX_FILTER_DESC_LEN  = (256+1);
  252.   {$EXTERNALSYM SF_MAX_FILTER_DESC_LEN}
  253.  
  254.   //
  255.   //  These values can be used with the pfnSFCallback function supplied in
  256.   //  the filter context structure
  257.   //
  258.  
  259.   //
  260.   //  Sends a complete HTTP server response header including
  261.   //  the status, server version, message time and MIME version.
  262.   //
  263.   //  Server extensions should append other information at the end,
  264.   //  such as Content-type, Content-length etc followed by an extra
  265.   //  '\r\n'.
  266.   //
  267.   //  pData - Zero terminated string pointing to optional
  268.   //      status string (i.e., "401 Access Denied") or NULL for
  269.   //      the default response of "200 OK".
  270.   //
  271.   //  ul1 - Zero terminated string pointing to optional data to be
  272.   //      appended and set with the header.  If NULL, the header will
  273.   //      be terminated with an empty line.
  274.   //
  275.  
  276.   SF_REQ_SEND_RESPONSE_HEADER = 0;
  277.   {$EXTERNALSYM SF_REQ_SEND_RESPONSE_HEADER}
  278.  
  279.   //
  280.   //  If the server denies the HTTP request, add the specified headers
  281.   //  to the server error response.
  282.   //
  283.   //  This allows an authentication filter to advertise its services
  284.   //  w/o filtering every request.  Generally the headers will be
  285.   //  WWW-Authenticate headers with custom authentication schemes but
  286.   //  no restriction is placed on what headers may be specified.
  287.   //
  288.   //  pData - Zero terminated string pointing to one or more header lines
  289.   //      with terminating '\r\n'.
  290.   //
  291.  
  292.   SF_REQ_ADD_HEADERS_ON_DENIAL = 1;
  293.   {$EXTERNALSYM SF_REQ_ADD_HEADERS_ON_DENIAL}
  294.  
  295.   //
  296.   //  Only used by raw data filters that return SF_STATUS_READ_NEXT
  297.   //
  298.   //  ul1 - size in bytes for the next read
  299.   //
  300.  
  301.   SF_REQ_SET_NEXT_READ_SIZE = 2;
  302.   {$EXTERNALSYM SF_REQ_SET_NEXT_READ_SIZE}
  303.  
  304.   //
  305.   //  Used to indicate this request is a proxy request
  306.   //
  307.   //  ul1 - The proxy flags to set
  308.   //      0x00000001 - This is a HTTP proxy request
  309.   //
  310.   //
  311.  
  312.   SF_REQ_SET_PROXY_INFO = 3;
  313.   {$EXTERNALSYM SF_REQ_SET_PROXY_INFO}
  314.  
  315.   //
  316.   //  These values are returned by the filter entry point when a new request is
  317.   //  received indicating their interest in this particular request
  318.   //
  319.  
  320.   //
  321.   //  The filter has handled the HTTP request.  The server should disconnect
  322.   //  the session.
  323.   //
  324.  
  325.   SF_STATUS_REQ_FINISHED = $8000000;
  326.   {$EXTERNALSYM SF_STATUS_REQ_FINISHED}
  327.  
  328.   //
  329.   //  Same as SF_STATUS_FINISHED except the server should keep the TCP
  330.   //  session open if the option was negotiated
  331.   //
  332.  
  333.   SF_STATUS_REQ_FINISHED_KEEP_CONN = $8000001;
  334.   {$EXTERNALSYM SF_STATUS_REQ_FINISHED_KEEP_CONN}
  335.  
  336.   //
  337.   //  The next filter in the notification chain should be called
  338.   //
  339.  
  340.   SF_STATUS_REQ_NEXT_NOTIFICATION = $8000002;
  341.   {$EXTERNALSYM SF_STATUS_REQ_NEXT_NOTIFICATION}
  342.  
  343.   //
  344.   //  This filter handled the notification.  No other handles should be
  345.   //  called for this particular notification type
  346.   //
  347.  
  348.   SF_STATUS_REQ_HANDLED_NOTIFICATION = $8000003;
  349.   {$EXTERNALSYM SF_STATUS_REQ_HANDLED_NOTIFICATION}
  350.  
  351.   //
  352.   //  An error occurred.  The server should use GetLastError() and indicate
  353.   //  the error to the client
  354.   //
  355.  
  356.   SF_STATUS_REQ_ERROR = $8000004;
  357.   {$EXTERNALSYM SF_STATUS_REQ_ERROR}
  358.  
  359.   //
  360.   //  The filter is an opaque stream filter and we're negotiating the
  361.   //  session parameters.  Only valid for raw read notification.
  362.   //
  363.  
  364.   SF_STATUS_REQ_READ_NEXT = $8000005;
  365.   {$EXTERNALSYM SF_STATUS_REQ_READ_NEXT}
  366.  
  367. //
  368. //  pvNotification points to this structure for all request notification types
  369. //
  370.  
  371. type
  372.  
  373.   TFilterGetServerVariableProc = function (var pfc{: THTTP_FILTER_CONTEXT};
  374.     VariableName: PChar; Buffer: Pointer; var Size: DWORD ): BOOL stdcall;
  375.  
  376.   TFilterAddResponseHeadersProc = function (var pfc{: THTTP_FILTER_CONTEXT};
  377.     lpszHeaders: PChar; dwReserved: DWORD): BOOL stdcall;
  378.  
  379.   TFilterWriteClientProc = function (var pfc{: THTTP_FILTER_CONTEXT};
  380.     Buffer: Pointer; var Bytes: DWORD; dwReserved: DWORD ): BOOL stdcall;
  381.  
  382.   TFilterAllocMemProc = function (var pfc{: THTTP_FILTER_CONTEXT}; cbSize: DWORD;
  383.     dwReserved: DWORD): Pointer stdcall;
  384.  
  385.   TFilterServerSupportFunctionProc = function (var pfc{: THTTP_FILTER_CONTEXT};
  386.     sfReq: DWORD; pData: Pointer; ul1, ul2: DWORD): BOOL stdcall;
  387.  
  388.   PHTTP_FILTER_CONTEXT = ^THTTP_FILTER_CONTEXT;
  389.   THTTP_FILTER_CONTEXT = record
  390.     cbSize: DWORD;
  391.  
  392.     //
  393.     //  This is the structure revision level.
  394.     //
  395.  
  396.     Revision: DWORD;
  397.  
  398.     //
  399.     //  Private context information for the server.
  400.     //
  401.  
  402.     ServerContext: Pointer;
  403.     ulReserved: DWORD;
  404.  
  405.     //
  406.     //  TRUE if this request is coming over a secure port
  407.     //
  408.  
  409.     fIsSecurePort: BOOL;
  410.  
  411.     //
  412.     //  A context that can be used by the filter
  413.     //
  414.  
  415.     pFilterContext: Pointer;
  416.  
  417.     //
  418.     //  Server callbacks
  419.     //
  420.  
  421.     GetServerVariable: TFilterGetServerVariableProc;
  422.     AddResponseHeaders: TFilterAddResponseHeadersProc;
  423.     WriteClient: TFilterWriteClientProc;
  424.     AllocMem: TFilterAllocMemProc;
  425.     ServerSupportFunction: TFilterServerSupportFunctionProc;
  426.   end;
  427.  
  428.   //
  429.   //  This structure is the notification info for the read and send raw data
  430.   //  notification types
  431.   //
  432.  
  433.   PHTTP_FILTER_RAW_DATA = ^HTTP_FILTER_RAW_DATA;
  434.   HTTP_FILTER_RAW_DATA = record
  435.     //
  436.     //  This is a pointer to the data for the filter to process.
  437.     //
  438.  
  439.     pvInData: Pointer;
  440.     cbInData: DWORD;       // Number of valid data bytes
  441.     cbInBuffer: DWORD;     // Total size of buffer
  442.  
  443.     dwReserved: DWORD;
  444.   end;
  445.   {$EXTERNALSYM HTTP_FILTER_RAW_DATA}
  446.   THTTP_FILTER_RAW_DATA = HTTP_FILTER_RAW_DATA;
  447.   LPHTTP_FILTER_RAW_DATA = PHTTP_FILTER_RAW_DATA;
  448.   {$EXTERNALSYM LPHTTP_FILTER_RAW_DATA}
  449.  
  450.   //
  451.   //  This structure is the notification info for when the server is about to
  452.   //  process the client headers
  453.   //
  454.  
  455.   TGetHeaderProc = function (var pfc: THTTP_FILTER_CONTEXT; lpszName: PChar;
  456.     var lpvBuffer; var lpdwSize: DWORD): BOOL stdcall;
  457.  
  458.   TSetHeaderProc = function (var pfc: THTTP_FILTER_CONTEXT; lpszName,
  459.     lpszValue: PChar): BOOL stdcall;
  460.  
  461.   TAddHeaderProc = function (var pfc: THTTP_FILTER_CONTEXT; lpszName,
  462.     lpszValue: PChar): BOOL stdcall;
  463.  
  464.   PHTTP_FILTER_PREPROC_HEADERS = ^THTTP_FILTER_PREPROC_HEADERS;
  465.   THTTP_FILTER_PREPROC_HEADERS = record
  466.     //
  467.     //  Retrieves the specified header value.  Header names should include
  468.     //  the trailing ':'.  The special values 'method', 'url' and 'version'
  469.     //  can be used to retrieve the individual portions of the request line
  470.     //
  471.  
  472.     GetHeader: TGetHeaderProc;
  473.  
  474.     //
  475.     //  Replaces this header value to the specified value.  To delete a header,
  476.     //  specified a value of '\0'.
  477.     //
  478.  
  479.     SetHeader: TSetHeaderProc;
  480.  
  481.     //
  482.     //  Adds the specified header and value
  483.     //
  484.  
  485.     AddHeader: TAddHeaderProc;
  486.  
  487.     dwReserved: DWORD;
  488.   end;
  489.  
  490.   //
  491.   //  Authentication information for this request.
  492.   //
  493.  
  494.   PHTTP_FILTER_AUTHENT = ^HTTP_FILTER_AUTHENT;
  495.   HTTP_FILTER_AUTHENT = record
  496.     //
  497.     //  Pointer to username and password, empty strings for the anonymous user
  498.     //
  499.     //  Client's can overwrite these buffers which are guaranteed to be at
  500.     //  least SF_MAX_USERNAME and SF_MAX_PASSWORD bytes large.
  501.     //
  502.  
  503.     pszUser: PChar;
  504.     cbUserBuff: DWORD;
  505.  
  506.     pszPassword: PChar;
  507.     cbPasswordBuff: DWORD;
  508.   end;
  509.   {$EXTERNALSYM HTTP_FILTER_AUTHENT}
  510.   THTTP_FILTER_AUTHENT = HTTP_FILTER_AUTHENT;
  511.   LPHTTP_FILTER_AUTHENT = PHTTP_FILTER_AUTHENT;
  512.   {$EXTERNALSYM LPHTTP_FILTER_AUTHENT}
  513.  
  514.   //
  515.   //  Indicates the server is going to use the specific physical mapping for
  516.   //  the specified URL.  Filters can modify the physical path in place.
  517.   //
  518.  
  519.   PHTTP_FILTER_URL_MAP = ^HTTP_FILTER_URL_MAP;
  520.   HTTP_FILTER_URL_MAP = record
  521.     pszURL: PChar;
  522.     pszPhysicalPath: PChar;
  523.     cbPathBuff: DWORD;
  524.   end;
  525.   {$EXTERNALSYM HTTP_FILTER_URL_MAP}
  526.   THTTP_FILTER_URL_MAP = HTTP_FILTER_URL_MAP;
  527.   LPHTTP_FILTER_URL_MAP = PHTTP_FILTER_URL_MAP;
  528.   {$EXTERNALSYM LPHTTP_FILTER_URL_MAP}
  529.  
  530. const
  531.   //
  532.   //  Bitfield indicating the requested resource has been denied by the server due
  533.   //  to a logon failure, an ACL on a resource, an ISAPI Filter or an
  534.   //  ISAPI Application/CGI Application.
  535.   //
  536.   //  SF_DENIED_BY_CONFIG can appear with SF_DENIED_LOGON if the server
  537.   //  configuration did not allow the user to logon.
  538.   //
  539.  
  540.   SF_DENIED_LOGON             = $00000001;
  541.   {$EXTERNALSYM SF_DENIED_LOGON}
  542.   SF_DENIED_RESOURCE          = $00000002;
  543.   {$EXTERNALSYM SF_DENIED_RESOURCE}
  544.   SF_DENIED_FILTER            = $00000004;
  545.   {$EXTERNALSYM SF_DENIED_FILTER}
  546.   SF_DENIED_APPLICATION       = $00000008;
  547.   {$EXTERNALSYM SF_DENIED_APPLICATION}
  548.   SF_DENIED_BY_CONFIG         = $00010000;
  549.   {$EXTERNALSYM SF_DENIED_BY_CONFIG}
  550.  
  551. type
  552.   PHTTP_FILTER_ACCESS_DENIED = ^HTTP_FILTER_ACCESS_DENIED;
  553.   HTTP_FILTER_ACCESS_DENIED = record
  554.     pszURL: PChar;            // Requesting URL
  555.     pszPhysicalPath: PChar;   // Physical path of resource
  556.     dwReason: DWORD;          // Bitfield of SF_DENIED flags
  557.   end;
  558.   {$EXTERNALSYM HTTP_FILTER_ACCESS_DENIED}
  559.   THTTP_FILTER_ACCESS_DENIED = HTTP_FILTER_ACCESS_DENIED;
  560.   LPHTTP_FILTER_ACCESS_DENIED = PHTTP_FILTER_ACCESS_DENIED;
  561.   {$EXTERNALSYM LPHTTP_FILTER_ACCESS_DENIED}
  562.  
  563.   //
  564.   //  The log information about to be written to the server log file.  The
  565.   //  string pointers can be replaced but the memory must remain valid until
  566.   //  the next notification
  567.   //
  568.  
  569.   PHTTP_FILTER_LOG = ^HTTP_FILTER_LOG;
  570.   HTTP_FILTER_LOG = record
  571.     pszClientHostName: PChar;
  572.     pszClientUserName: PChar;
  573.     pszServerName: PChar;
  574.     pszOperation: PChar;
  575.     pszTarget: PChar;
  576.     pszParameters: PChar;
  577.     dwHttpStatus: DWORD;
  578.     dwWin32Status: DWORD;
  579.   end;
  580.   {$EXTERNALSYM HTTP_FILTER_LOG}
  581.   THTTP_FILTER_LOG = HTTP_FILTER_LOG;
  582.   LPHTTP_FILTER_LOG = PHTTP_FILTER_LOG;
  583.   {$EXTERNALSYM LPHTTP_FILTER_LOG}
  584.  
  585. const
  586.   //
  587.   //  Notification Flags
  588.   //
  589.   //  SF_NOTIFY_SECURE_PORT
  590.   //  SF_NOTIFY_NONSECURE_PORT
  591.   //
  592.   //      Indicates whether the application wants to be notified for transactions
  593.   //      that are happenning on the server port(s) that support data encryption
  594.   //      (such as PCT and SSL), on only the non-secure port(s) or both.
  595.   //
  596.   //  SF_NOTIFY_READ_RAW_DATA
  597.   //
  598.   //      Applications are notified after the server reads a block of memory
  599.   //      from the client but before the server does any processing on the
  600.   //      block.  The data block may contain HTTP headers and entity data.
  601.   //
  602.   //
  603.   //
  604.  
  605.   SF_NOTIFY_SECURE_PORT               = $00000001;
  606.   {$EXTERNALSYM SF_NOTIFY_SECURE_PORT}
  607.   SF_NOTIFY_NONSECURE_PORT            = $00000002;
  608.   {$EXTERNALSYM SF_NOTIFY_NONSECURE_PORT}
  609.   SF_NOTIFY_READ_RAW_DATA             = $00008000;
  610.   {$EXTERNALSYM SF_NOTIFY_READ_RAW_DATA}
  611.   SF_NOTIFY_PREPROC_HEADERS           = $00004000;
  612.   {$EXTERNALSYM SF_NOTIFY_PREPROC_HEADERS}
  613.   SF_NOTIFY_AUTHENTICATION            = $00002000;
  614.   {$EXTERNALSYM SF_NOTIFY_AUTHENTICATION}
  615.   SF_NOTIFY_URL_MAP                   = $00001000;
  616.   {$EXTERNALSYM SF_NOTIFY_URL_MAP}
  617.   SF_NOTIFY_ACCESS_DENIED             = $00000800;
  618.   {$EXTERNALSYM SF_NOTIFY_ACCESS_DENIED}
  619.   SF_NOTIFY_SEND_RAW_DATA             = $00000400;
  620.   {$EXTERNALSYM SF_NOTIFY_SEND_RAW_DATA}
  621.   SF_NOTIFY_LOG                       = $00000200;
  622.   {$EXTERNALSYM SF_NOTIFY_LOG}
  623.   SF_NOTIFY_END_OF_NET_SESSION        = $00000100;
  624.   {$EXTERNALSYM SF_NOTIFY_END_OF_NET_SESSION}
  625.  
  626.   //
  627.   //  Filter ordering flags
  628.   //
  629.   //  Filters will tend to be notified by their specified
  630.   //  ordering.  For ties, notification order is determined by load order.
  631.   //
  632.   //  SF_NOTIFY_ORDER_HIGH - Authentication or data transformation filters
  633.   //  SF_NOTIFY_ORDER_MEDIUM
  634.   //  SF_NOTIFY_ORDER_LOW  - Logging filters that want the results of any other
  635.   //                      filters might specify this order.
  636.   //
  637.  
  638.   SF_NOTIFY_ORDER_HIGH               = $00080000;
  639.   {$EXTERNALSYM SF_NOTIFY_ORDER_HIGH}
  640.   SF_NOTIFY_ORDER_MEDIUM             = $00040000;
  641.   {$EXTERNALSYM SF_NOTIFY_ORDER_MEDIUM}
  642.   SF_NOTIFY_ORDER_LOW                = $00020000;
  643.   {$EXTERNALSYM SF_NOTIFY_ORDER_LOW}
  644.   SF_NOTIFY_ORDER_DEFAULT            = SF_NOTIFY_ORDER_LOW;
  645.   {$EXTERNALSYM SF_NOTIFY_ORDER_DEFAULT}
  646.   SF_NOTIFY_ORDER_MASK               = SF_NOTIFY_ORDER_HIGH or
  647.                                        SF_NOTIFY_ORDER_MEDIUM or
  648.                                        SF_NOTIFY_ORDER_LOW;
  649.   {$EXTERNALSYM SF_NOTIFY_ORDER_MASK}
  650.  
  651.   //
  652.   //  Filter version information, passed to GetFilterVersion
  653.   //
  654.  
  655. type
  656.   PHTTP_FILTER_VERSION = ^HTTP_FILTER_VERSION;
  657.   HTTP_FILTER_VERSION = record
  658.     //
  659.     //  Version of the spec the server is using
  660.     //
  661.  
  662.     dwServerFilterVersion: DWORD;
  663.  
  664.     //
  665.     //  Fields specified by the client
  666.     //
  667.  
  668.     dwFilterVersion: DWORD;
  669.     lpszFilterDesc: array[0..SF_MAX_FILTER_DESC_LEN - 1] of Char;
  670.     dwFlags: DWORD;
  671.   end;
  672.   {$EXTERNALSYM HTTP_FILTER_VERSION}
  673.   THTTP_FILTER_VERSION = HTTP_FILTER_VERSION;
  674.   LPHTTP_FILTER_VERSION = PHTTP_FILTER_VERSION;
  675.   {$EXTERNALSYM LPHTTP_FILTER_VERSION}
  676.  
  677. //
  678. //  A filter DLL's entry point looks like this.  The return code should be
  679. //  an SF_STATUS_TYPE
  680. //
  681. //  NotificationType - Type of notification
  682. //  pvNotification - Pointer to notification specific data
  683. //
  684.  
  685. // function HttpFilterProc(var pfc: THTTP_FILTER_CONTEXT; Notificationtype: DWORD;
  686. //   pvNotification: Pointer): DWORD; stdcall;
  687. //
  688. // function GetFilterVersion(var pVer: THTTP_FILTER_VERSION): BOOL; stdcall;
  689.  
  690. // the following type declarations are for the server side
  691.  
  692.   THttpFilterProc = function (var pfc: THTTP_FILTER_CONTEXT;
  693.     Notificationtype: DWORD; pvNotification: Pointer): DWORD stdcall;
  694.  
  695.   TGetFilterVersion = function (var pVer: THTTP_FILTER_VERSION): BOOL stdcall;
  696.  
  697. implementation
  698.  
  699. end.
  700.