diff options
author | George Hazan <ghazan@miranda.im> | 2017-01-11 22:23:57 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-01-11 22:24:06 +0300 |
commit | d958e3fb847813075cc059bd5a7aa28252982268 (patch) | |
tree | d9c02a7ddee830628248219e9c83c7de3c335140 /plugins/Utils.pas/mirutils.pas | |
parent | c8e1c429321ed8aa2efce0fc00b6dfd08f1b2735 (diff) |
strong typization - better typization
Diffstat (limited to 'plugins/Utils.pas/mirutils.pas')
-rw-r--r-- | plugins/Utils.pas/mirutils.pas | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/plugins/Utils.pas/mirutils.pas b/plugins/Utils.pas/mirutils.pas index 4ede3640a2..5b3e87a33b 100644 --- a/plugins/Utils.pas/mirutils.pas +++ b/plugins/Utils.pas/mirutils.pas @@ -434,10 +434,9 @@ begin if hNetLib=0 then
begin
FillChar(nlu,SizeOf(nlu),0);
- nlu.cbSize :=SizeOf(nlu);
- nlu.flags :=NUF_HTTPCONNS or NUF_NOHTTPSOPTION or NUF_OUTGOING or NUF_NOOPTIONS;
+ nlu.flags :=NUF_HTTPCONNS or NUF_NOHTTPSOPTION or NUF_OUTGOING or NUF_NOOPTIONS;
nlu.szSettingsModule:='dummy';
- hTmpNetLib:=CallService(MS_NETLIB_REGISTERUSER,0,lparam(@nlu));
+ hTmpNetLib:=Netlib_RegisterUser(@nlu);
end
else
hTmpNetLib:=hNetLib;
@@ -457,7 +456,7 @@ begin CallService(MS_NETLIB_FREEHTTPREQUESTSTRUCT,0,lparam(resp));
end;
- if (hNetLib=0) and (nlu.cbSize<>0) then
+ if (hNetLib=0) and (nlu.flags<>0) then
Netlib_CloseHandle(hTmpNetLib);
end;
@@ -466,8 +465,7 @@ static int __inline NLog(AnsiChar *msg) { return CallService(MS_NETLIB_LOG, (WPARAM)hNetlibUser, (LPARAM)msg);
}
*)
-function GetFile(url:PAnsiChar;save_file:PAnsiChar;
- hNetLib:THANDLE=0;recurse_count:integer=0):bool;
+function GetFile(url:PAnsiChar; save_file:PAnsiChar; hNetLib:THANDLE=0; recurse_count:integer=0):bool;
var
nlu:TNETLIBUSER;
req :TNETLIBHTTPREQUEST;
@@ -491,10 +489,9 @@ begin FillChar(nlu,SizeOf(nlu),0);
if hNetLib=0 then
begin
- nlu.cbSize :=SizeOf(nlu);
- nlu.flags :=NUF_HTTPCONNS or NUF_NOHTTPSOPTION or NUF_OUTGOING or NUF_NOOPTIONS;
+ nlu.flags := NUF_HTTPCONNS or NUF_NOHTTPSOPTION or NUF_OUTGOING or NUF_NOOPTIONS;
nlu.szSettingsModule:='dummy';
- hNetLib:=CallService(MS_NETLIB_REGISTERUSER,0,lparam(@nlu));
+ hNetLib:=Netlib_RegisterUser(@nlu);
end;
resp:=pointer(CallService(MS_NETLIB_HTTPTRANSACTION,hNetLib,lparam(@req)));
@@ -536,7 +533,7 @@ begin end;
CallService(MS_NETLIB_FREEHTTPREQUESTSTRUCT,0,lparam(resp));
- if nlu.cbSize<>0 then
+ if nlu.flags<>0 then
Netlib_CloseHandle(hNetLib);
end;
end;
@@ -619,10 +616,9 @@ begin req.flags :=NLHRF_NODUMP;
FillChar(nlu,SizeOf(nlu),0);
- nlu.cbSize :=SizeOf(nlu);
- nlu.flags :=NUF_HTTPCONNS or NUF_NOHTTPSOPTION or NUF_OUTGOING or NUF_NOOPTIONS;
+ nlu.flags := NUF_HTTPCONNS or NUF_NOHTTPSOPTION or NUF_OUTGOING or NUF_NOOPTIONS;
nlu.szSettingsModule:='dummy';
- hNetLib:=CallService(MS_NETLIB_REGISTERUSER,0,lparam(@nlu));
+ hNetLib:=Netlib_RegisterUser(@nlu);
resp:=pointer(CallService(MS_NETLIB_HTTPTRANSACTION,hNetLib,lparam(@req)));
|