comobj.pp - Registry Functions accept Root-Keys as DWORD, are QWORD on x64
Original Reporter info from Mantis: 21347
-
Reporter name:
Original Reporter info from Mantis: 21347
- Reporter name:
Description:
comobj.pp's Functions CreateRegKey, DeleteRegKey and GetRegStringValue all except the RootKey-Variable to be a DWORD, but HKEY is defined as a THandle, which is QWORD on x64-Windows.
Resolution: change DWord to HKEY, e.g.:
procedure CreateRegKey(const Key, ValueName, Value: string; RootKey: HKEY = HKEY_CLASSES_ROOT);
procedure DeleteRegKey(const Key: string; RootKey: HKEY = HKEY_CLASSES_ROOT);
function GetRegStringValue(const Key, ValueName: string; RootKey: HKEY = HKEY_CLASSES_ROOT): string;
However, I've not used Delphi for ages, so I don't know if this should be left "broken" for compatibility reasons. A Workaround is also simple: Cast any value passed to that function to DWord, HKEY-Definitions IMHO don't break the 32-Bit limit...
Mantis conversion info:
- Mantis ID: 25515
- OS: Windows
- OS Build: 7
- Platform: x86_64
- Version: 2.7.1
- Fixed in version: 2.6.4
- Fixed in revision: 26447 (#9cf9faf4)