TXmlRegistry writes numbers as cardinals but reads as signed integers
Original Reporter info from Mantis: Kurt
-
Reporter name: Kurt Fitzner
Original Reporter info from Mantis: Kurt
- Reporter name: Kurt Fitzner
Description:
TXmlRegistry.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 reproduce:
D := $FFFFFFFF;
TXmlRegistry.SetValueData('Anything', DTDWORD, D, sizeof(Cardinal));
Writes value as 4294967295
TXmlRegistry.GetValueData('Anything', DTDWORD, D, sizeof(Cardinal));
Returns an error.
Mantis conversion info:
- Mantis ID: 31297
- OS: All
- OS Build: All
- Build: Trunk
- Platform: All
- Version: 3.1.1