I was informed by ViRuSTriNiTy (thanks for this – and no, he would never use the library in LCDHype…) about a bug in XMLLib under RAD Studio 2010. I am still not owning this release and so I had to learn CodeGear has changed the definition of the fmCreate constant. Due to this change, the original code of the unicode stream classes did not work under actual RAD Studio releases. The original code was nearly the same as in original VCL sources and failed with the new constant. The library did not create any new file and only worked when the target file was existing on save.
Some days before this investigating in this misbehaviour, I got a mail from Mr. Neumann (thanks for the hint!) having some problems using the library under Delphi 5. I recalled some earlier problems using Delphi 4 or 5 a year ago. At that time I located the integrated Borland memory manager as the source of misbehaviour. But the new bug was still present using FastMM4 and actual update packs. It turns out to be the Delphi compiler optimizer: disabling optimization fixes the problem (even when using the original memory manager). I added a compiler option to disable the optimization inside of the XMLLib.pas implementation under Delphi 4/5 and C++Builder 4/5.
While debugging the problems, I found some code snippets with some doubtful pointer calculations. These calculation were not incorrect when used with addresses below 2 GB, but with higher memory locations they were. I changed all casts and calculation to be calculated unsigned and so getting safe to be used with memory locations or addresses above 2 GB. So it should be safe to use the XMLLib with projects using FastMM4 and the activated PE Flags 0×20. If you have some experience under this circumstances (or even bugs), please feel free to report them to me. See the imprint for details.
The library is actually in daily use in many different applications at work and home. So if have any hint or even bug reports, please do not hesitate to inform me (see imprint as mention earlier). The actual release (1.96) can be found on the XMLLib page.
Tags: XMLLib