TRegistry works not correct in win7 64 bit with some fields
Original Reporter info from Mantis: poiuyt555
-
Reporter name:
Original Reporter info from Mantis: poiuyt555
- Reporter name:
Description:
Dont know what category excactly.
I tried to use TRegistry to read registry values in windows 7 64-bit. codepage=1251 (rus).
Key: SOFTWARE\Microsoft\Windows NT\CurrentVersion<br/>
Start Code:
r := TRegistry.Create(KEY_READ or $0100);
r.RootKey := HKEY_LOCAL_MACHINE;
if r.OpenKeyReadOnly(KeyPath)=true then
begin
...
OpenKeyReadOnly(KeyPath) - works fine, and return true.
r.ReadString('ProductName') - works fine, and return name.
But, Errors:
r.ReadString('ProductID') - returns empty string.
r.GetDataType('DigitalProductId') returns rdUnknown
and i can not retrive ProductID and read correct DigitalProductId value.
I tried
like this: TRegistry.Create($0100);
like this: TRegistry.Create(KEY_READ);
like this: TRegistry.Create();
tried another key: SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion<br/>
But it is NOT WORKING.
But if i use WinAPI:
RegOpenKeyEx... with KEY_READ or $0100 and RegQueryValueEx...
All works fine.
I want to use TRegistry, because it is more easy than winapi.
Can you solve this problem and fix this bug?
Mantis conversion info:
- Mantis ID: 23188
- OS: 7
- OS Build: 64-bit
- Platform: windows
- Version: 2.6.0
- Fixed in version: 2.6.4
- Fixed in revision: 25843 (#cca3b8ee)