home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1997 May / Pcwk0597.iso / borland / cb / setup / cbuilder / data.z / ISAPI.PAS < prev    next >
Pascal/Delphi Source File  |  1997-02-28  |  4KB  |  125 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. // passed to GetExtensionVersion
  52. //
  53.  
  54. type
  55.   PHSE_VERSION_INFO = ^THSE_VERSION_INFO;
  56.   THSE_VERSION_INFO = packed record
  57.     dwExtensionVersion: DWORD;
  58.     lpszExtensionDesc: array [0..HSE_MAX_EXT_DLL_NAME_LEN-1] of Char;
  59.   end;
  60.  
  61. type
  62.   TGetServerVariableProc = function ( hConn: HCONN;
  63.                                       VariableName: PChar;
  64.                       Buffer: Pointer;
  65.                                       var Size: DWORD ): BOOL stdcall;
  66.  
  67.   TWriteClientProc = function ( ConnID: HCONN;
  68.                                 Buffer: Pointer;
  69.                                 var Bytes: DWORD;
  70.                                 dwReserved: DWORD ): BOOL stdcall;
  71.  
  72.   TReadClientProc  = function ( ConnID: HCONN;
  73.                                 Buffer: Pointer;
  74.                                 var Size: DWORD ): BOOL stdcall;
  75.  
  76.   TServerSupportFunctionProc = function ( hConn: HCONN;
  77.                                           HSERRequest: DWORD;
  78.                                           Buffer: Pointer;
  79.                                           var Size: DWORD;
  80.                                           var DataType: DWORD ): BOOL stdcall;
  81.  
  82. //
  83. // passed to extension procedure on a new request
  84. //
  85. type
  86.  
  87.   PEXTENSION_CONTROL_BLOCK = ^TEXTENSION_CONTROL_BLOCK;
  88.   TEXTENSION_CONTROL_BLOCK = packed record
  89.     cbSize: DWORD;                    // size of this struct.
  90.     dwVersion: DWORD;                 // version info of this spec
  91.     ConnID: HCONN;                    // Context number not to be modified!
  92.     dwHttpStatusCode: DWORD;          // HTTP Status code
  93.              // null terminated log info specific to this Extension DLL
  94.     lpszLogData: array [0..HSE_LOG_BUFFER_LEN-1] of Char;
  95.     lpszMethod: PChar;                // REQUEST_METHOD
  96.     lpszQueryString: PChar;           // QUERY_STRING
  97.     lpszPathInfo: PChar;              // PATH_INFO
  98.     lpszPathTranslated: PChar;        // PATH_TRANSLATED
  99.     cbTotalBytes: DWORD;              // Total bytes indicated from client
  100.     cbAvailable: DWORD;               // Available number of bytes
  101.     lpbData: Pointer;                 // pointer to cbAvailable bytes
  102.     lpszContentType: PChar;           // Content type of client data
  103.  
  104.     GetServerVariable: TGetServerVariableProc;
  105.     WriteClient: TWriteClientProc;
  106.     ReadClient: TReadClientProc;
  107.     ServerSupportFunction: TServerSupportFunctionProc;
  108.   end;
  109.  
  110. //
  111. //  these are the prototypes that must be exported from the extension DLL
  112. //
  113.  
  114. //  function GetExtensionVersion( var Ver: THSE_VERSION_INFO ): BOOL; stdcall;
  115. //  function HttpExtensionProc( var ECB: TEXTENSION_CONTROL_BLOCK ): DWORD; stdcall;
  116.  
  117. // the following type declarations is for the server side
  118.  
  119. // typedef BOOL  (WINAPI * PFN_GETEXTENSIONVERSION)( HSE_VERSION_INFO  *pVer );
  120. // typedef DWORD (WINAPI * PFN_HTTPEXTENSIONPROC )( EXTENSION_CONTROL_BLOCK *pECB );
  121.  
  122. implementation
  123.  
  124. end.
  125.