* Patch from Bart Broersma to implement Int64 support in xmlreg (bug ID 35227)

git-svn-id: trunk@41810 -
This commit is contained in:
michael 2019-04-01 16:46:48 +00:00
parent 848a563128
commit 17aa8da99f
2 changed files with 11 additions and 1 deletions

View File

@ -10,7 +10,7 @@ uses
Type
TDataType = (dtUnknown,dtDWORD,dtString,dtBinary,dtStrings);
TDataType = (dtUnknown,dtDWORD,dtString,dtBinary,dtStrings,dtQWord);
TDataInfo = record
DataType : TDataType;
DataSize : Integer;
@ -306,6 +306,7 @@ Var
U : UnicodeString;
HasData: Boolean;
D : DWord;
Q : QWord;
begin
//writeln('TXmlRegistry.DoGetValueData: Name=',Name,' IsUnicode=',IsUnicode);
@ -332,6 +333,12 @@ begin
if Result then
PCardinal(@Data)^:=D;
end;
dtQWORD : begin // DataNode is required
NS:=SizeOf(QWORD);
Result:=HasData and TryStrToQWord(String(DataNode.NodeValue),Q) and (DataSize>=NS);
if Result then
PUInt64(@Data)^:=Q;
end;
dtString : // DataNode is optional
if HasData then
begin
@ -396,6 +403,7 @@ begin
Case DataType of
dtDWORD : SW:=UnicodeString(IntToStr(PCardinal(@Data)^));
dtQWORD : SW:=UnicodeString(IntToStr(PUInt64(@Data)^));
dtString : begin
if IsUnicode then
SW:=UnicodeString(PUnicodeChar(@Data))

View File

@ -20,6 +20,7 @@ begin
rdInteger : Result := dtDword;
rdBinary : Result := dtBinary;
rdMultiString : Result := dtStrings;
rdInt64 : Result := dtQword;
else
Raise ERegistryException.CreateFmt(SErrTypeNotSupported,[GetEnumName(TypeInfo(TRegDataType),Ord(RegData))]);
end;
@ -31,6 +32,7 @@ begin
Case DataType of
dtUnknown: Result:=rdUnknown;
dtDword : Result:=rdInteger;
dtQword : Result:=rdInt64;
dtString : Result:=rdString;
dtBinary : Result:=rdBinary;
dtStrings : Result:=rdMultiString;