home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1996 May / PCW596.iso / wtest / microsft / sdk / httpext.h < prev    next >
Text File  |  1996-01-03  |  5KB  |  131 lines

  1. /********
  2. *
  3. *  Copyright (c) 1995  Process Software Corporation
  4. *
  5. *  Copyright (c) 1995  Microsoft Corporation
  6. *
  7. *
  8. *  Module Name  : HttpExt.h
  9. *
  10. *  Abstract :
  11. *
  12. *     This module contains  the structure definitions and prototypes for the
  13. *     version 1.0 HTTP Server Extension interface.
  14. *
  15. ******************/
  16.  
  17. #ifndef _HTTPEXT_H_
  18. #define _HTTPEXT_H_
  19.  
  20. #include <windows.h>
  21.  
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25.  
  26. #define   HSE_VERSION_MAJOR           1      // major version of this spec
  27. #define   HSE_VERSION_MINOR           0      // minor version of this spec
  28. #define   HSE_LOG_BUFFER_LEN         80
  29. #define   HSE_MAX_EXT_DLL_NAME_LEN  256
  30.  
  31. typedef   LPVOID  HCONN;
  32.  
  33. // the following are the status codes returned by the Extension DLL
  34.  
  35. #define   HSE_STATUS_SUCCESS                       1
  36. #define   HSE_STATUS_SUCCESS_AND_KEEP_CONN         2
  37. #define   HSE_STATUS_PENDING                       3
  38. #define   HSE_STATUS_ERROR                         4
  39.  
  40. // The following are the values to request services with the ServerSupportFunction.
  41. //  Values from 0 to 1000 are reserved for future versions of the interface
  42.  
  43. #define   HSE_REQ_BASE                             0
  44. #define   HSE_REQ_SEND_URL_REDIRECT_RESP           ( HSE_REQ_BASE + 1 )
  45. #define   HSE_REQ_SEND_URL                         ( HSE_REQ_BASE + 2 )
  46. #define   HSE_REQ_SEND_RESPONSE_HEADER             ( HSE_REQ_BASE + 3 )
  47. #define   HSE_REQ_DONE_WITH_SESSION                ( HSE_REQ_BASE + 4 )
  48. #define   HSE_REQ_END_RESERVED                     1000
  49.  
  50. //
  51. //  These are Microsoft specific extensions
  52. //
  53.  
  54. #define   HSE_REQ_MAP_URL_TO_PATH                  (HSE_REQ_END_RESERVED+1)
  55. #define   HSE_REQ_GET_SSPI_INFO                    (HSE_REQ_END_RESERVED+2)
  56.  
  57.  
  58. //
  59. // passed to GetExtensionVersion
  60. //
  61.  
  62. typedef struct   _HSE_VERSION_INFO {
  63.  
  64.     DWORD  dwExtensionVersion;
  65.     CHAR   lpszExtensionDesc[HSE_MAX_EXT_DLL_NAME_LEN];
  66.  
  67. } HSE_VERSION_INFO, *LPHSE_VERSION_INFO;
  68.  
  69. //
  70. // passed to extension procedure on a new request
  71. //
  72. typedef struct _EXTENSION_CONTROL_BLOCK {
  73.  
  74.     DWORD     cbSize;                 // size of this struct.
  75.     DWORD     dwVersion;              // version info of this spec
  76.     HCONN     ConnID;                 // Context number not to be modified!
  77.     DWORD     dwHttpStatusCode;       // HTTP Status code
  78.     CHAR      lpszLogData[HSE_LOG_BUFFER_LEN];// null terminated log info specific to this Extension DLL
  79.  
  80.     LPSTR     lpszMethod;             // REQUEST_METHOD
  81.     LPSTR     lpszQueryString;        // QUERY_STRING
  82.     LPSTR     lpszPathInfo;           // PATH_INFO
  83.     LPSTR     lpszPathTranslated;     // PATH_TRANSLATED
  84.  
  85.     DWORD     cbTotalBytes;           // Total bytes indicated from client
  86.     DWORD     cbAvailable;            // Available number of bytes
  87.     LPBYTE    lpbData;                // pointer to cbAvailable bytes
  88.  
  89.     LPSTR     lpszContentType;        // Content type of client data
  90.  
  91.     BOOL (WINAPI * GetServerVariable) ( HCONN       hConn,
  92.                                         LPSTR       lpszVariableName,                                                                                                 
  93.                                         LPVOID      lpvBuffer,
  94.                                         LPDWORD     lpdwSize );
  95.  
  96.     BOOL (WINAPI * WriteClient)  ( HCONN      ConnID,
  97.                                    LPVOID     Buffer,
  98.                                    LPDWORD    lpdwBytes,
  99.                                    DWORD      dwReserved );
  100.  
  101.     BOOL (WINAPI * ReadClient)  ( HCONN      ConnID,
  102.                                   LPVOID     lpvBuffer,
  103.                                   LPDWORD    lpdwSize );
  104.  
  105.     BOOL (WINAPI * ServerSupportFunction)( HCONN      hConn,
  106.                                            DWORD      dwHSERRequest,
  107.                                            LPVOID     lpvBuffer,
  108.                                            LPDWORD    lpdwSize,
  109.                                            LPDWORD    lpdwDataType );
  110.  
  111. } EXTENSION_CONTROL_BLOCK, *LPEXTENSION_CONTROL_BLOCK;
  112.  
  113. //
  114. //  these are the prototypes that must be exported from the extension DLL
  115. //
  116.  
  117. BOOL  WINAPI   GetExtensionVersion( HSE_VERSION_INFO  *pVer );
  118. DWORD WINAPI   HttpExtensionProc(  EXTENSION_CONTROL_BLOCK *pECB );
  119.  
  120. // the following type declarations is for the server side
  121.  
  122. typedef BOOL  (WINAPI * PFN_GETEXTENSIONVERSION)( HSE_VERSION_INFO  *pVer );
  123. typedef DWORD (WINAPI * PFN_HTTPEXTENSIONPROC )( EXTENSION_CONTROL_BLOCK *pECB );
  124.  
  125. #ifdef __cplusplus
  126. }
  127. #endif
  128.  
  129. #endif  // end definition _HTTPEXT_H_
  130.  
  131.