home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 2000 March / pcp161b.iso / full / delphi / RUNIMAGE / DELPHI30 / SOURCE / RTL / WIN / ISAPI2.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1997-08-03  |  19.0 KB  |  618 lines

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