1 /* 2 httpext.h - Header for ISAPI extensions. 3 4 This file is part of a free library for the Win32 API. 5 6 This library is distributed in the hope that it will be useful, 7 but WITHOUT ANY WARRANTY; without even the implied warranty of 8 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 9 */ 10 11 #ifndef _HTTPEXT_H 12 #define _HTTPEXT_H 13 14 #include <windows.h> 15 16 #ifdef __cplusplus 17 extern "C" { 18 #endif 19 20 #define HSE_VERSION_MAJOR 2 21 #define HSE_VERSION_MINOR 0 22 #define HSE_LOG_BUFFER_LEN 80 23 #define HSE_MAX_EXT_DLL_NAME_LEN 256 24 #define HSE_STATUS_SUCCESS 1 25 #define HSE_STATUS_SUCCESS_AND_KEEP_CONN 2 26 #define HSE_STATUS_PENDING 3 27 #define HSE_STATUS_ERROR 4 28 #define HSE_REQ_BASE 0 29 #define HSE_REQ_SEND_URL_REDIRECT_RESP 1 30 #define HSE_REQ_SEND_URL 2 31 #define HSE_REQ_SEND_RESPONSE_HEADER 3 32 #define HSE_REQ_DONE_WITH_SESSION 4 33 #define HSE_REQ_END_RESERVED 1000 34 #define HSE_TERM_ADVISORY_UNLOAD 0x00000001 35 #define HSE_TERM_MUST_UNLOAD 0x00000002 36 #define HSE_IO_SYNC 0x00000001 37 #define HSE_IO_ASYNC 0x00000002 38 #define HSE_IO_DISCONNECT_AFTER_SEND 0x00000004 39 #define HSE_IO_SEND_HEADERS 0x00000008 40 typedef LPVOID HCONN; 41 typedef struct _HSE_VERSION_INFO { 42 DWORD dwExtensionVersion; 43 CHAR lpszExtensionDesc[HSE_MAX_EXT_DLL_NAME_LEN]; 44 } HSE_VERSION_INFO, *LPHSE_VERSION_INFO; 45 typedef struct _EXTENSION_CONTROL_BLOCK { 46 DWORD cbSize; 47 DWORD dwVersion; 48 HCONN ConnID; 49 DWORD dwHttpStatusCode; 50 CHAR lpszLogData[HSE_LOG_BUFFER_LEN]; 51 LPSTR lpszMethod; 52 LPSTR lpszQueryString; 53 LPSTR lpszPathInfo; 54 LPSTR lpszPathTranslated; 55 DWORD cbTotalBytes; 56 DWORD cbAvailable; 57 LPBYTE lpbData; 58 LPSTR lpszContentType; 59 BOOL (PASCAL *GetServerVariable)(HCONN,LPSTR,LPVOID,LPDWORD); 60 BOOL (PASCAL *WriteClient)(HCONN,LPVOID,LPDWORD,DWORD); 61 BOOL (PASCAL *ReadClient)(HCONN,LPVOID,LPDWORD); 62 BOOL (PASCAL *ServerSupportFunction)(HCONN,DWORD,LPVOID,LPDWORD,LPDWORD); 63 } EXTENSION_CONTROL_BLOCK, *LPEXTENSION_CONTROL_BLOCK; 64 typedef BOOL (PASCAL *PFN_GETEXTENSIONVERSION)(HSE_VERSION_INFO*); 65 typedef DWORD (PASCAL *PFN_HTTPEXTENSIONPROC)(EXTENSION_CONTROL_BLOCK*); 66 typedef BOOL (PASCAL *PFN_TERMINATEEXTENSION)(DWORD); 67 typedef VOID (PASCAL *PFN_HSE_IO_COMPLETION)(EXTENSION_CONTROL_BLOCK*,PVOID,DWORD,DWORD); 68 typedef struct _HSE_TF_INFO { 69 PFN_HSE_IO_COMPLETION pfnHseIO; 70 PVOID pContext; 71 HANDLE hFile; 72 LPCSTR pszStatusCode; 73 DWORD BytesToWrite; 74 DWORD Offset; 75 PVOID pHead; 76 DWORD HeadLength; 77 PVOID pTail; 78 DWORD TailLength; 79 DWORD dwFlags; 80 } HSE_TF_INFO, *LPHSE_TF_INFO; 81 BOOL PASCAL GetExtensionVersion(HSE_VERSION_INFO*); 82 DWORD PASCAL HttpExtensionProc(EXTENSION_CONTROL_BLOCK*); 83 BOOL PASCAL TerminateExtension(DWORD); 84 #ifdef __cplusplus 85 } 86 #endif 87 #endif /* _HTTPEXT_H */ 88