Win64 write to registry fails if section does not exist
Original Reporter info from Mantis: mftq75
-
Reporter name: C Western
Original Reporter info from Mantis: mftq75
- Reporter name: C Western
Description:
TRegIniFile.WriteString fails on 64 bit windows if the section does not exist, but not for 32 bit applications. The documentation for the function used, RegOpenKeyEx suggests this should always fail, so presumably there is some registry redirection making it work by accident for 32 bits. I think the intent is that the section should be created automatically, given that there is no CreateSection procedure in TIniFile, though there is an EraseSection procedure. The attached patch fixes the problem for me.
Mantis conversion info:
- Mantis ID: 25483
- OS: Win 8.1
- Platform: x86_64
- Version: 2.7.1
- Fixed in version: 3.0.0
- Fixed in revision: 26762 (#e65fd31b)
- Monitored by: » abdenasseroul (abdenasseroul)
- Target version: 3.0.0