View Issue Details

IDProjectCategoryView StatusLast Update
0031297FPCRTLpublic2017-01-30 08:38
ReporterKurt Fitzner Assigned ToMichael Van Canneyt  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionduplicate 
PlatformAllOSAll 
Product Version3.1.1 
Summary0031297: TXmlRegistry writes numbers as cardinals but reads as signed integers
DescriptionTXmlRegistry.SetValueData uses IntToStr() from an unsigned integer to create the the string to write. This causes the system to promote it to IntToStr(QWORD). TXmlRegistry.GetValueData uses TryStrToInt() which then treats it as an unsigned 32 bit value. Any cardinal with the high bit set is, thusly, written to the XML file as an unsigned integer, but then read back in as a signed integer causing an overflow error.

They both need to be consistent.
Steps To ReproduceD := $FFFFFFFF;
TXmlRegistry.SetValueData('Anything', DTDWORD, D, sizeof(Cardinal));

Writes value as 4294967295

TXmlRegistry.GetValueData('Anything', DTDWORD, D, sizeof(Cardinal));

Returns an error.
TagsNo tags attached.
Fixed in Revision
FPCOldBugId
FPCTarget
Attached Files

Relationships

duplicate of 0031277 closedMichael Van Canneyt tRegistry.ReadInteger fails if negative number written 

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2017-01-30 00:32 Kurt Fitzner New Issue
2017-01-30 08:36 Michael Van Canneyt Assigned To => Michael Van Canneyt
2017-01-30 08:36 Michael Van Canneyt Status new => assigned
2017-01-30 08:37 Michael Van Canneyt Relationship added duplicate of 0031277
2017-01-30 08:38 Michael Van Canneyt Status assigned => resolved
2017-01-30 08:38 Michael Van Canneyt Resolution open => duplicate