mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 22:49:23 +02:00
* update lNet to 0.5.2
git-svn-id: trunk@7733 -
This commit is contained in:
parent
9525ad6edf
commit
a1108a8fbb
@ -102,31 +102,58 @@ uses
|
|||||||
{$IFDEF WINDOWS}
|
{$IFDEF WINDOWS}
|
||||||
, Windows;
|
, Windows;
|
||||||
|
|
||||||
|
{$IFDEF WINCE}
|
||||||
|
|
||||||
function LStrError(const Ernum: Longint; const UseUTF8: Boolean = False): string;
|
function LStrError(const Ernum: Longint; const UseUTF8: Boolean = False): string;
|
||||||
|
const
|
||||||
|
MAX_ERROR = 1024;
|
||||||
|
var
|
||||||
|
Tmp: string;
|
||||||
|
TmpW: widestring;
|
||||||
|
begin
|
||||||
|
Result := '[' + IntToStr(Ernum) + '] ';
|
||||||
|
SetLength(TmpW, MAX_ERROR);
|
||||||
|
SetLength(TmpW, FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM or
|
||||||
|
FORMAT_MESSAGE_IGNORE_INSERTS or
|
||||||
|
FORMAT_MESSAGE_ARGUMENT_ARRAY,
|
||||||
|
nil, Ernum, 0, @TmpW[1], MAX_ERROR, nil));
|
||||||
|
Tmp := UTF8Encode(TmpW);
|
||||||
|
if Length(Tmp) > 2 then
|
||||||
|
Delete(Tmp, Length(Tmp)-1, 2);
|
||||||
|
Result := Tmp;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{$ELSE} // any other windows
|
||||||
|
|
||||||
|
function LStrError(const Ernum: Longint; const UseUTF8: Boolean = False): string;
|
||||||
|
const
|
||||||
|
MAX_ERROR = 1024;
|
||||||
var
|
var
|
||||||
Tmp: string;
|
Tmp: string;
|
||||||
TmpW: widestring;
|
TmpW: widestring;
|
||||||
begin
|
begin
|
||||||
Result := '[' + IntToStr(Ernum) + '] ';
|
Result := '[' + IntToStr(Ernum) + '] ';
|
||||||
if USEUtf8 then begin
|
if USEUtf8 then begin
|
||||||
SetLength(TmpW, 256);
|
SetLength(TmpW, MAX_ERROR);
|
||||||
SetLength(TmpW, FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM or
|
SetLength(TmpW, FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM or
|
||||||
FORMAT_MESSAGE_IGNORE_INSERTS or
|
FORMAT_MESSAGE_IGNORE_INSERTS or
|
||||||
FORMAT_MESSAGE_ARGUMENT_ARRAY,
|
FORMAT_MESSAGE_ARGUMENT_ARRAY,
|
||||||
nil, Ernum, 0, @TmpW[1], 256, nil));
|
nil, Ernum, 0, @TmpW[1], MAX_ERROR, nil));
|
||||||
Tmp := UTF8Encode(TmpW);
|
Tmp := UTF8Encode(TmpW);
|
||||||
end else begin
|
end else begin
|
||||||
SetLength(Tmp, 256);
|
SetLength(Tmp, MAX_ERROR);
|
||||||
SetLength(Tmp, FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM or
|
SetLength(Tmp, FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM or
|
||||||
FORMAT_MESSAGE_IGNORE_INSERTS or
|
FORMAT_MESSAGE_IGNORE_INSERTS or
|
||||||
FORMAT_MESSAGE_ARGUMENT_ARRAY,
|
FORMAT_MESSAGE_ARGUMENT_ARRAY,
|
||||||
nil, Ernum, 0, @Tmp[1], 256, nil));
|
nil, Ernum, 0, @Tmp[1], MAX_ERROR, nil));
|
||||||
end;
|
end;
|
||||||
if Length(Tmp) > 2 then
|
if Length(Tmp) > 2 then
|
||||||
Delete(Tmp, Length(Tmp)-1, 2);
|
Delete(Tmp, Length(Tmp)-1, 2);
|
||||||
Result := Tmp;
|
Result := Tmp;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
function TZSeconds: integer; inline;
|
function TZSeconds: integer; inline;
|
||||||
var
|
var
|
||||||
lInfo: Windows.TIME_ZONE_INFORMATION;
|
lInfo: Windows.TIME_ZONE_INFORMATION;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ lNet v0.5.1
|
{ lNet v0.5.2
|
||||||
|
|
||||||
CopyRight (C) 2004-2006 Ales Katona
|
CopyRight (C) 2004-2006 Ales Katona
|
||||||
|
|
||||||
@ -408,8 +408,9 @@ destructor TLSocket.Destroy;
|
|||||||
begin
|
begin
|
||||||
if Assigned(FOnFree) then
|
if Assigned(FOnFree) then
|
||||||
FOnFree(Self);
|
FOnFree(Self);
|
||||||
|
|
||||||
|
inherited Destroy; // important! must be called before disconnect
|
||||||
Disconnect;
|
Disconnect;
|
||||||
inherited Destroy;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TLSocket.Disconnect;
|
procedure TLSocket.Disconnect;
|
||||||
|
Loading…
Reference in New Issue
Block a user