I'm trying to retrieve the default values for the INTERNET_OPTION_SEND_TIMEOUT
, INTERNET_OPTION_SEND_TIMEOUT
, and INTERNET_OPTION_RECEIVE_TIMEOUT
options flags.
From what I read, they are in WinInit.
The below code fails to compile with Types of actual and formal var parameters must be identical
,
but which parameter is incorrect here?
procedure TFrmWininetTimeOuts.FormShow(Sender: TObject);
var
hSession : HINTERNET;
dwTimeOut : DWORD;
begin
hSession := InternetOpen('usersession', INTERNET_OPEN_TYPE_PRECONFIG, nil, nil, 0);
if not Assigned(hSession) then Exit;
try
InternetQueryOption(hSession, INTERNET_OPTION_RECEIVE_TIMEOUT, @dwTimeOut, SizeOf(dwTimeOut));
finally
InternetCloseHandle(hSession);
end;
end;
Code completion says it needs a (pointer,cardinal,pointer,cardinal).
I see code examples with a call to InternetQueryOption(nil,
(which also does not compile) or with an intermediate InternetOpenUrl
but I guess I don't need that.