home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 1999 February / DPPCPRO0299.ISO / February / Delphi / Install / DATA.Z / ISAPI.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1996-06-09  |  4.3 KB  |  126 lines

  1. {********
  2. *
  3. *  Copyright (c) 1996  Borland International
  4. *
  5. *  This module contains  the structure definitions and prototypes for the
  6. *  Microsoft Internet Server API (ISAPI)
  7. *
  8. ******************}
  9.  
  10. unit isapi;
  11.  
  12. interface
  13.  
  14. uses Windows;
  15.  
  16. const
  17.   HSE_VERSION_MAJOR         =   1;      // major version of this spec
  18.   HSE_VERSION_MINOR         =   0;      // minor version of this spec
  19.   HSE_LOG_BUFFER_LEN        =  80;
  20.   HSE_MAX_EXT_DLL_NAME_LEN  = 256;
  21.  
  22. type
  23.   HCONN = THandle;
  24.  
  25. // the following are the status codes returned by the Extension DLL
  26.  
  27. const
  28.   HSE_STATUS_SUCCESS                      = 1;
  29.   HSE_STATUS_SUCCESS_AND_KEEP_CONN        = 2;
  30.   HSE_STATUS_PENDING                      = 3;
  31.   HSE_STATUS_ERROR                        = 4;
  32.  
  33. // The following are the values to request services with the ServerSupportFunction.
  34. //  Values from 0 to 1000 are reserved for future versions of the interface
  35.  
  36.   HSE_REQ_BASE                             = 0;
  37.   HSE_REQ_SEND_URL_REDIRECT_RESP           = ( HSE_REQ_BASE + 1 );
  38.   HSE_REQ_SEND_URL                         = ( HSE_REQ_BASE + 2 );
  39.   HSE_REQ_SEND_RESPONSE_HEADER             = ( HSE_REQ_BASE + 3 );
  40.   HSE_REQ_DONE_WITH_SESSION                = ( HSE_REQ_BASE + 4 );
  41.   HSE_REQ_END_RESERVED                     = 1000;
  42.  
  43. //
  44. //  These are Microsoft specific extensions
  45. //
  46.  
  47.   HSE_REQ_MAP_URL_TO_PATH                  = (HSE_REQ_END_RESERVED+1);
  48.   HSE_REQ_GET_SSPI_INFO                    = (HSE_REQ_END_RESERVED+2);
  49.  
  50.  
  51. //
  52. // passed to GetExtensionVersion
  53. //
  54.  
  55. type
  56.   PHSE_VERSION_INFO = ^THSE_VERSION_INFO;
  57.   THSE_VERSION_INFO = packed record
  58.     dwExtensionVersion: DWORD;
  59.     lpszExtensionDesc: array [0..HSE_MAX_EXT_DLL_NAME_LEN-1] of Char;
  60.   end;
  61.  
  62. type
  63.   TGetServerVariableProc = function ( hConn: HCONN;
  64.                                       VariableName: PChar;
  65.                       Buffer: Pointer;
  66.                                       var Size: DWORD ): BOOL stdcall;
  67.  
  68.   TWriteClientProc = function ( ConnID: HCONN;
  69.                                 Buffer: Pointer;
  70.                                 var Bytes: DWORD;
  71.                                 dwReserved: DWORD ): BOOL stdcall;
  72.  
  73.   TReadClientProc  = function ( ConnID: HCONN;
  74.                                 Buffer: Pointer;
  75.                                 var Size: DWORD ): BOOL stdcall;
  76.  
  77.   TServerSupportFunctionProc = function ( hConn: HCONN;
  78.                                           HSERRequest: DWORD;
  79.                                           Buffer: Pointer;
  80.                                           var Size: DWORD;
  81.                                           var DataType: DWORD ): BOOL stdcall;
  82.  
  83. //
  84. // passed to extension procedure on a new request
  85. //
  86. type
  87.  
  88.   PEXTENSION_CONTROL_BLOCK = ^TEXTENSION_CONTROL_BLOCK;
  89.   TEXTENSION_CONTROL_BLOCK = packed record
  90.     cbSize: DWORD;                    // size of this struct.
  91.     dwVersion: DWORD;                 // version info of this spec
  92.     ConnID: HCONN;                    // Context number not to be modified!
  93.     dwHttpStatusCode: DWORD;          // HTTP Status code
  94.              // null terminated log info specific to this Extension DLL
  95.     lpszLogData: array [0..HSE_LOG_BUFFER_LEN-1] of Char;
  96.     lpszMethod: PChar;                // REQUEST_METHOD
  97.     lpszQueryString: PChar;           // QUERY_STRING
  98.     lpszPathInfo: PChar;              // PATH_INFO
  99.     lpszPathTranslated: PChar;        // PATH_TRANSLATED
  100.     cbTotalBytes: DWORD;              // Total bytes indicated from client
  101.     cbAvailable: DWORD;               // Available number of bytes
  102.     lpbData: Pointer;                 // pointer to cbAvailable bytes
  103.     lpszContentType: PChar;           // Content type of client data
  104.  
  105.     GetServerVariable: TGetServerVariableProc;
  106.     WriteClient: TWriteClientProc;
  107.     ReadClient: TReadClientProc;
  108.     ServerSupportFunction: TServerSupportFunctionProc;
  109.   end;
  110.  
  111. //
  112. //  these are the prototypes that must be exported from the extension DLL
  113. //
  114.  
  115. //  function GetExtensionVersion( var Ver: THSE_VERSION_INFO ): BOOL; stdcall;
  116. //  function HttpExtensionProc( var ECB: TEXTENSION_CONTROL_BLOCK ): DWORD; stdcall;
  117.  
  118. // the following type declarations is for the server side
  119.  
  120. // typedef BOOL  (WINAPI * PFN_GETEXTENSIONVERSION)( HSE_VERSION_INFO  *pVer );
  121. // typedef DWORD (WINAPI * PFN_HTTPEXTENSIONPROC )( EXTENSION_CONTROL_BLOCK *pECB );
  122.  
  123. implementation
  124.  
  125. end.
  126.