要用开发工具(如:c++、delphi等)把程序编译成dll形式。
在dll中导出两个函数,函数原形如下:
function GetExtensionVersion(var Ver: THSE_VERSION_INFO): boolean; stdcall;
function HttpExtensionProc(var ECB: TEXTENSION_CONTROL_BLOCK): DWORD; stdcall;
参数类型定义如下:
type
THSE_VERSION_INFO = packed record
dwExtensionVersion: DWORD;
lpszExtensionDesc: array [0..HSE_MAX_EXT_DLL_NAME_LEN-1] of Char;
end;
type
TEXTENSION_CONTROL_BLOCK = packed record
cbSize: DWORD; // 结构大小
dwVersion: DWORD; // Version info of this spec
ConnID: HCONN; // Context number not to be modified!
dwHttpStatusCode: DWORD; // HTTP Status code
lpszLogData: array [0..HSE_LOG_BUFFER_LEN-1] of Char; // DLL specific log information
lpszMethod: PChar; // REQUEST_METHOD
lpszQueryString: PChar; // QUERY_STRING
lpszPathInfo: PChar; // PATH_INFO
lpszPathTranslated: PChar; // PATH_TRANSLATED
cbTotalBytes: DWORD; //Total bytes from client
cbAvailable: DWORD; // Available number of bytes
lpbData: Pointer; // pointer to cbAvailable bytes
lpszContentType: PChar; // Content type of client data
GetServerVariable: TGetServerVariableProc; //取得服务器变量函数
WriteClient: TWriteClientProc; //输出函数
ReadClient: TReadClientProc; //读post参数函数(大于49KB部分)
ServerSupportFunction: TServerSupportFunctionProc;
end;