风
风铃夜思雨
Unregistered / Unconfirmed
GUEST, unregistred user!
请教下会ISAPI的朋友,我下面这样无法实现网址重定向,不知该怎么实现
library RtoLib;
uses
SysUtils, windows, isapi2, Classes;
function HttpFilterProc(var pfc: THTTP_FILTER_CONTEXT; Notificationtype: DWORD;
pvNotification: Pointer): DWORD; export; stdcall;
var
pUrlMap: PHTTP_FILTER_URL_MAP; //指向pvNotification的指针
begin
try
pUrlMap := pvNotification;
//pUrlMap.pszPhysicalPath := PChar('D:/Inetpub/wwwroot/index.asp');
pUrlMap.pszURL := 'http://www.skygz.com/index.asp';
//result := SF_STATUS_REQ_FINISHED;
result:=HSE_REQ_SEND_URL_REDIRECT_RESP;
Exit;
finally
//总是返回成功,并且如果有其他过滤器的话,还将继续调用
result := SF_STATUS_REQ_NEXT_NOTIFICATION;
end;
end;
//------------------------------------
// 功能:用于初始化和处理事件的登记
// 说明:此函数有系统调用
//------------------------------------
function GetFilterVersion(var pVer: THTTP_FILTER_VERSION): BOOL; export; stdcall;
var
strTemp: array[0..MAX_PATH] of char;
begin
result := true; //初始化成功
try
//过滤器要处理的事件和其他一些标志
pVer.dwFlags := (SF_NOTIFY_URL_MAP or SF_NOTIFY_ORDER_DEFAULT);
//当前过滤器使用的版本HTTP_FILTER_REVISION
pVer.dwFilterVersion := HTTP_FILTER_REVISION;
//过滤器的描述
pVer.lpszFilterDesc := 'RtoLib 1.0';
except
result := false;
end;
end;
exports
HttpFilterProc, GetFilterVersion;
begin
end.
library RtoLib;
uses
SysUtils, windows, isapi2, Classes;
function HttpFilterProc(var pfc: THTTP_FILTER_CONTEXT; Notificationtype: DWORD;
pvNotification: Pointer): DWORD; export; stdcall;
var
pUrlMap: PHTTP_FILTER_URL_MAP; //指向pvNotification的指针
begin
try
pUrlMap := pvNotification;
//pUrlMap.pszPhysicalPath := PChar('D:/Inetpub/wwwroot/index.asp');
pUrlMap.pszURL := 'http://www.skygz.com/index.asp';
//result := SF_STATUS_REQ_FINISHED;
result:=HSE_REQ_SEND_URL_REDIRECT_RESP;
Exit;
finally
//总是返回成功,并且如果有其他过滤器的话,还将继续调用
result := SF_STATUS_REQ_NEXT_NOTIFICATION;
end;
end;
//------------------------------------
// 功能:用于初始化和处理事件的登记
// 说明:此函数有系统调用
//------------------------------------
function GetFilterVersion(var pVer: THTTP_FILTER_VERSION): BOOL; export; stdcall;
var
strTemp: array[0..MAX_PATH] of char;
begin
result := true; //初始化成功
try
//过滤器要处理的事件和其他一些标志
pVer.dwFlags := (SF_NOTIFY_URL_MAP or SF_NOTIFY_ORDER_DEFAULT);
//当前过滤器使用的版本HTTP_FILTER_REVISION
pVer.dwFilterVersion := HTTP_FILTER_REVISION;
//过滤器的描述
pVer.lpszFilterDesc := 'RtoLib 1.0';
except
result := false;
end;
end;
exports
HttpFilterProc, GetFilterVersion;
begin
end.