TRegistry.OpenKey does not open correct Key if Key is absolute
Original Reporter info from Mantis: Bart @flyingsheep
-
Reporter name: Bart Broersma
Original Reporter info from Mantis: Bart @flyingsheep
- Reporter name: Bart Broersma
Description:
If you try to open a key with an absolute path, the actual key that is opened is the rootkey, not the specified key.
This is a regression compared to 3.0.4
Steps to reproduce:
Compile and run attached program openkeyabs.pp (on Windows)
C:\Users\Bart\LazarusProjecten\bugs\Console\registry>fpc openkeyabs.pp
Free Pascal Compiler version 3.3.1 [2019/02/16] for i386
Copyright (c) 1993-2018 by Florian Klaempfl and others
..
C:\Users\Bart\LazarusProjecten\bugs\Console\registry>openkeyabs
CurrentKey=80000001=HKEY_CURRENT_USER
An unhandled exception occurred at $0040F0E6:
EAssertionFailed: Key not found: "Software\Classes" [CurrentPath=""] (openkeyabs.pp, line 39)
$0040F0E6
C:\Users\Bart\LazarusProjecten\bugs\Console\registry>dcc32 openkeyabs.pp
Borland Delphi Version 15.0
..
C:\Users\Bart\LazarusProjecten\bugs\Console\registry>openkeyabs
CurrentKey=00000188
C:\Users\Bart\LazarusProjecten\bugs\Console\registry>fpc openkeyabs.pp
Free Pascal Compiler version 3.0.4rc1 [2017/07/03] for i386
..
C:\Users\Bart\LazarusProjecten\bugs\Console\registry>openkeyabs
CurrentKey=0000018C
Additional information:
The program aassumes that HKCU\Software\Classes exists &LtPos;b>and&LtPos;/b> that HKCU\Classes does &LtPos;b>not&LtPos;/b> exist.
Mantis conversion info:
- Mantis ID: 35123
- OS: Windows
- OS Build: 10
- Build: r41343
- Platform: i386
- Version: 3.3.1