uses
Winapi.Windows,
Winapi.WinHTTP,
DDetours;
var
TrampolineWinHttpOpenRequest:
function(hConnect: HINTERNET; pwszVerb: LPCWSTR; pwszObjectName: LPCWSTR; pwszVersion: LPCWSTR;
pwszReferrer: LPCWSTR; ppwszAcceptTypes: PLPWSTR; dwFlags: DWORD): HINTERNET;
stdcall =
nil;
function InterceptWinHttpOpenRequest(hConnect: HINTERNET; pwszVerb: LPCWSTR; pwszObjectName: LPCWSTR; pwszVersion: LPCWSTR;
pwszReferrer: LPCWSTR; ppwszAcceptTypes: PLPWSTR; dwFlags: DWORD): HINTERNET;
stdcall;
begin
Result := TrampolineWinHttpOpenRequest(hConnect, pwszVerb, pwszObjectName, pwszVersion, pwszReferrer, ppwszAcceptTypes, dwFlags);
Winapi.WinHTTP.WinHttpSetTimeouts(Result, 10, 10, 10, 10);
// Hier dann deine gewünschten Timeouts eingeben (vllt. über Class Property oder so!)
end;
procedure MakeMagic;
begin
if not Assigned(TrampolineWinHttpOpenRequest)
then
begin
@TrampolineWinHttpOpenRequest := InterceptCreate(@WinHttpOpenRequest, @InterceptWinHttpOpenRequest);
end;
end;