ifndef _HTTPEXT_H_
define _HTTPEXT_H_
.pragma list(push, 0)

include windows.inc

HSE_VERSION_MAJOR	equ 7
HSE_VERSION_MINOR	equ 5
HSE_LOG_BUFFER_LEN	equ 80
HSE_MAX_EXT_DLL_NAME_LEN equ 256

HSE_VERSION		equ MAKELONG( HSE_VERSION_MINOR, HSE_VERSION_MAJOR )

HSE_STATUS_SUCCESS	equ 1
HSE_STATUS_SUCCESS_AND_KEEP_CONN equ 2
HSE_STATUS_PENDING	equ 3
HSE_STATUS_ERROR	equ 4

HSE_REQ_BASE		equ 0
HSE_REQ_SEND_URL_REDIRECT_RESP equ ( HSE_REQ_BASE + 1 )
HSE_REQ_SEND_URL	equ ( HSE_REQ_BASE + 2 )
HSE_REQ_SEND_RESPONSE_HEADER equ ( HSE_REQ_BASE + 3 )
HSE_REQ_DONE_WITH_SESSION equ ( HSE_REQ_BASE + 4 )
HSE_REQ_END_RESERVED	equ 1000

HSE_REQ_MAP_URL_TO_PATH equ (HSE_REQ_END_RESERVED+1)
HSE_REQ_GET_SSPI_INFO	equ (HSE_REQ_END_RESERVED+2)
HSE_APPEND_LOG_PARAMETER equ (HSE_REQ_END_RESERVED+3)
HSE_REQ_IO_COMPLETION	equ (HSE_REQ_END_RESERVED+5)
HSE_REQ_TRANSMIT_FILE	equ (HSE_REQ_END_RESERVED+6)
HSE_REQ_REFRESH_ISAPI_ACL equ (HSE_REQ_END_RESERVED+7)
HSE_REQ_IS_KEEP_CONN	equ (HSE_REQ_END_RESERVED+8)
HSE_REQ_ASYNC_READ_CLIENT equ (HSE_REQ_END_RESERVED+10)
HSE_REQ_GET_IMPERSONATION_TOKEN equ (HSE_REQ_END_RESERVED+11)
HSE_REQ_MAP_URL_TO_PATH_EX equ (HSE_REQ_END_RESERVED+12)
HSE_REQ_ABORTIVE_CLOSE	equ (HSE_REQ_END_RESERVED+14)
HSE_REQ_GET_CERT_INFO_EX equ (HSE_REQ_END_RESERVED+15)
HSE_REQ_SEND_RESPONSE_HEADER_EX equ (HSE_REQ_END_RESERVED+16)
HSE_REQ_CLOSE_CONNECTION equ (HSE_REQ_END_RESERVED+17)
HSE_REQ_IS_CONNECTED	equ (HSE_REQ_END_RESERVED+18)
HSE_REQ_MAP_UNICODE_URL_TO_PATH equ (HSE_REQ_END_RESERVED+23)
HSE_REQ_MAP_UNICODE_URL_TO_PATH_EX equ (HSE_REQ_END_RESERVED+24)
HSE_REQ_EXEC_UNICODE_URL equ (HSE_REQ_END_RESERVED+25)
HSE_REQ_EXEC_URL	equ (HSE_REQ_END_RESERVED+26)
HSE_REQ_GET_EXEC_URL_STATUS equ (HSE_REQ_END_RESERVED+27)
HSE_REQ_SEND_CUSTOM_ERROR equ (HSE_REQ_END_RESERVED+28)
HSE_REQ_IS_IN_PROCESS	equ (HSE_REQ_END_RESERVED+30)
HSE_REQ_REPORT_UNHEALTHY equ (HSE_REQ_END_RESERVED+32)
HSE_REQ_NORMALIZE_URL	equ (HSE_REQ_END_RESERVED+33)
HSE_REQ_VECTOR_SEND	equ (HSE_REQ_END_RESERVED+37)
HSE_REQ_GET_ANONYMOUS_TOKEN equ (HSE_REQ_END_RESERVED+38)
HSE_REQ_GET_CACHE_INVALIDATION_CALLBACK equ (HSE_REQ_END_RESERVED+40)
HSE_REQ_GET_UNICODE_ANONYMOUS_TOKEN equ (HSE_REQ_END_RESERVED+41)
HSE_REQ_GET_TRACE_INFO	equ (HSE_REQ_END_RESERVED+42)
HSE_REQ_SET_FLUSH_FLAG	equ (HSE_REQ_END_RESERVED+43)
HSE_REQ_GET_TRACE_INFO_EX equ (HSE_REQ_END_RESERVED+44)
HSE_REQ_RAISE_TRACE_EVENT equ (HSE_REQ_END_RESERVED+45)
HSE_REQ_GET_CONFIG_OBJECT equ (HSE_REQ_END_RESERVED+46)
HSE_REQ_GET_WORKER_PROCESS_SETTINGS equ (HSE_REQ_END_RESERVED+47)
HSE_REQ_GET_PROTOCOL_MANAGER_CUSTOM_INTERFACE_CALLBACK equ (HSE_REQ_END_RESERVED+48)
HSE_REQ_CANCEL_IO	equ (HSE_REQ_END_RESERVED+49)
HSE_REQ_GET_CHANNEL_BINDING_TOKEN equ (HSE_REQ_END_RESERVED+50)

HSE_TERM_ADVISORY_UNLOAD equ 0x00000001
HSE_TERM_MUST_UNLOAD	equ 0x00000002

HSE_IO_SYNC			 equ 0x00000001 ; for WriteClient
HSE_IO_ASYNC			 equ 0x00000002 ; for WriteClient/TF/EU
HSE_IO_DISCONNECT_AFTER_SEND	 equ 0x00000004 ; for TF
HSE_IO_SEND_HEADERS		 equ 0x00000008 ; for TF
HSE_IO_NODELAY			 equ 0x00001000 ; turn off nagling

HSE_IO_FINAL_SEND		 equ 0x00000010
HSE_IO_CACHE_RESPONSE		 equ 0x00000020
HSE_IO_TRY_SKIP_CUSTOM_ERRORS	 equ 0x00000040

HCONN			typedef ptr

HSE_VERSION_INFO	STRUC
dwExtensionVersion	dd ?
lpszExtensionDesc	CHAR HSE_MAX_EXT_DLL_NAME_LEN dup(?)
HSE_VERSION_INFO	ENDS
LPHSE_VERSION_INFO	typedef ptr HSE_VERSION_INFO

EXTENSION_CONTROL_BLOCK	 STRUC
cbSize			dd ?
dwVersion		dd ?
ConnID			HCONN ?
dwHttpStatusCode	dd ?
lpszLogData		db HSE_LOG_BUFFER_LEN dup(?)
lpszMethod		LPSTR ?
lpszQueryString		LPSTR ?
lpszPathInfo		LPSTR ?
lpszPathTranslated	LPSTR ?
cbTotalBytes		dd ?
cbAvailable		dd ?
lpbData			LPBYTE ?
lpszContentType		LPSTR ?
GetServerVariable	PVOID ?
WriteClient		PVOID ?
ReadClient		PVOID ?
ServerSupportFunction	PVOID ?
EXTENSION_CONTROL_BLOCK ENDS
LPEXTENSION_CONTROL_BLOCK typedef ptr EXTENSION_CONTROL_BLOCK

HSE_URL_FLAGS_READ	equ 0x00000001
HSE_URL_FLAGS_WRITE	equ 0x00000002
HSE_URL_FLAGS_EXECUTE	equ 0x00000004
HSE_URL_FLAGS_SSL	equ 0x00000008
HSE_URL_FLAGS_DONT_CACHE equ 0x00000010
HSE_URL_FLAGS_NEGO_CERT equ 0x00000020
HSE_URL_FLAGS_REQUIRE_CERT equ 0x00000040
HSE_URL_FLAGS_MAP_CERT	equ 0x00000080
HSE_URL_FLAGS_SSL128	equ 0x00000100
HSE_URL_FLAGS_SCRIPT	equ 0x00000200

HSE_URL_FLAGS_MASK	equ 0x000003ff

HSE_URL_MAPEX_INFO	STRUC
lpszPath		db MAX_PATH dup(?)
dwFlags			dd ?
cchMatchingPath		dd ?
cchMatchingURL		dd ?
dwReserved1		dd ?
dwReserved2		dd ?
HSE_URL_MAPEX_INFO	ENDS
LPHSE_URL_MAPEX_INFO	typedef ptr HSE_URL_MAPEX_INFO

HSE_UNICODE_URL_MAPEX_INFO STRUC
lpszPath		WCHAR MAX_PATH dup(?)
dwFlags			dd ?
cchMatchingPath		dd ?
cchMatchingURL		dd ?
HSE_UNICODE_URL_MAPEX_INFO ENDS
LPHSE_UNICODE_URL_MAPEX_INFO typedef ptr HSE_UNICODE_URL_MAPEX_INFO

HSE_TF_INFO		STRUC
pfnHseIO		PVOID ?;PFN_HSE_IO_COMPLETION ?
pContext		PVOID ?
hFile			HANDLE ?
pszStatusCode		LPCSTR ?
BytesToWrite		dd ?
_Offset			dd ?
pHead			PVOID ?
HeadLength		dd ?
pTail			PVOID ?
TailLength		dd ?
dwFlags			dd ?
HSE_TF_INFO		ENDS
LPHSE_TF_INFO		typedef ptr HSE_TF_INFO

HSE_SEND_HEADER_EX_INFO STRUC
pszStatus		LPCSTR ?
pszHeader		LPCSTR ?
cchStatus		dd ?
cchHeader		dd ?
fKeepConn		BOOL ?
HSE_SEND_HEADER_EX_INFO ENDS
LPHSE_SEND_HEADER_EX_INFO typedef ptr HSE_SEND_HEADER_EX_INFO

HSE_EXEC_URL_NO_HEADERS equ 0x02
HSE_EXEC_URL_IGNORE_CURRENT_INTERCEPTOR equ 0x04
HSE_EXEC_URL_IGNORE_VALIDATION_AND_RANGE equ 0x10
HSE_EXEC_URL_DISABLE_CUSTOM_ERROR equ 0x20
HSE_EXEC_URL_SSI_CMD	equ 0x40
HSE_EXEC_URL_HTTP_CACHE_ELIGIBLE equ 0x80

HSE_EXEC_URL_USER_INFO	STRUC
hImpersonationToken	HANDLE ?
pszCustomUserName	LPSTR ?
pszCustomAuthType	LPSTR ?
HSE_EXEC_URL_USER_INFO	ENDS
LPHSE_EXEC_URL_USER_INFO typedef ptr HSE_EXEC_URL_USER_INFO

HSE_EXEC_URL_ENTITY_INFO STRUC
cbAvailable		dd ?
lpbData			LPVOID ?
HSE_EXEC_URL_ENTITY_INFO ENDS
LPHSE_EXEC_URL_ENTITY_INFO typedef ptr HSE_EXEC_URL_ENTITY_INFO

HSE_EXEC_URL_STATUS	STRUC
uHttpStatusCode		USHORT ?
uHttpSubStatus		USHORT ?
dwWin32Error		dd ?
HSE_EXEC_URL_STATUS	ENDS
LPHSE_EXEC_URL_STATUS	typedef ptr HSE_EXEC_URL_STATUS

HSE_EXEC_URL_INFO	STRUC
pszUrl			LPSTR ?
pszMethod		LPSTR ?
pszChildHeaders		LPSTR ?
pUserInfo		LPHSE_EXEC_URL_USER_INFO ?
pEntity			LPHSE_EXEC_URL_ENTITY_INFO ?
dwExecUrlFlags		dd ?
HSE_EXEC_URL_INFO	ENDS
LPHSE_EXEC_URL_INFO	typedef ptr HSE_EXEC_URL_INFO

HSE_EXEC_UNICODE_URL_USER_INFO STRUC
hImpersonationToken	HANDLE ?
pszCustomUserName	LPWSTR ?
pszCustomAuthType	LPSTR ?
HSE_EXEC_UNICODE_URL_USER_INFO ENDS
LPHSE_EXEC_UNICODE_URL_USER_INFO typedef ptr HSE_EXEC_UNICODE_URL_USER_INFO

HSE_EXEC_UNICODE_URL_INFO STRUC
pszUrl			LPWSTR ?
pszMethod		LPSTR ?
pszChildHeaders		LPSTR ?
pUserInfo		LPHSE_EXEC_UNICODE_URL_USER_INFO ?
pEntity			LPHSE_EXEC_URL_ENTITY_INFO ?
dwExecUrlFlags		dd ?
HSE_EXEC_UNICODE_URL_INFO ENDS
LPHSE_EXEC_UNICODE_URL_INFO typedef ptr HSE_EXEC_UNICODE_URL_INFO

HSE_CUSTOM_ERROR_INFO	STRUC
pszStatus		LPSTR ?
uHttpSubError		USHORT ?
fAsync			BOOL ?
HSE_CUSTOM_ERROR_INFO	ENDS
LPHSE_CUSTOM_ERROR_INFO typedef ptr HSE_CUSTOM_ERROR_INFO

HSE_VECTOR_ELEMENT_TYPE_MEMORY_BUFFER equ 0
HSE_VECTOR_ELEMENT_TYPE_FILE_HANDLE equ 1

HSE_VECTOR_ELEMENT	STRUC
ElementType		dd ?
pvContext		PVOID ?
cbOffset		ULONGLONG ?
cbSize			ULONGLONG ?
HSE_VECTOR_ELEMENT	ENDS
LPHSE_VECTOR_ELEMENT	typedef ptr HSE_VECTOR_ELEMENT


HSE_RESPONSE_VECTOR	STRUC
dwFlags			dd ?
pszStatus		LPSTR ?
pszHeaders		LPSTR ?
nElementCount		dd ?
lpElementArray		LPHSE_VECTOR_ELEMENT ?
HSE_RESPONSE_VECTOR	ENDS
LPHSE_RESPONSE_VECTOR	typedef ptr HSE_RESPONSE_VECTOR

if(_WIN32_WINNT GE 0x400)
include wincrypt.inc

CERT_CONTEXT_EX		STRUC
CertContext		CERT_CONTEXT <>
cbAllocated		dd ?
dwCertificateFlags	dd ?
CERT_CONTEXT_EX		ENDS
endif

HSE_TRACE_INFO		STRUC
fTraceRequest		BOOL ?
TraceContextId		db 16 dup(?)
dwReserved1		dd ?
dwReserved2		dd ?
HSE_TRACE_INFO		ENDS
LPHSE_TRACE_INFO	typedef ptr HSE_TRACE_INFO

HSE_APP_FLAG_IN_PROCESS	  equ 0
HSE_APP_FLAG_ISOLATED_OOP equ 1
HSE_APP_FLAG_POOLED_OOP	  equ 2

GetExtensionVersion proto WINAPI :ptr
HttpExtensionProc proto WINAPI :ptr
TerminateExtension proto WINAPI :DWORD

.pragma list(pop)
endif
