Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.4.2, 5.5.1, 5.6.0
-
None
-
Microsoft Windows 7 - 64 bits
Description
Having a Windows registry key with a type REG_BINARY. When reading the key using QSettings, it returns a wrong value.
A sample code is attached to this issue (main.cpp)
- when registry value = "01af", it returns "eabc81"
- when registry value = "00" it returns an empty value.
In file "qsettings_win.cpp", data (ByteArray) is converted to WCharArray with a size divided by 2.
case REG_BINARY: {
QString s;
if (dataSize)
In case of REG_BINARY, only returning the ByteArray is enough :
case REG_BINARY:
{ if (value != 0) *value = data; break; }Fix proposition is attached in the diff file. On Windows 7 64 Bits, it works, I don't know if this fix covers all windows platforms ?