Bug 1423 – Registry: corrupted value

Status
RESOLVED
Resolution
FIXED
Severity
blocker
Priority
P2
Component
phobos
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2007-08-16T08:16:00Z
Last change time
2014-02-16T15:26:16Z
Assigned to
bugzilla
Creator
keystuffs

Comments

Comment #0 by keystuffs — 2007-08-16T08:16:12Z
Sometimes the value returned from the registry in corrupted. Ex: writefln(Registry.classesRoot().getKey(".txt").getValue("").value_SZ()); Display "☺ ile" instead of "txtfile". writefln(Registry.classesRoot().getKey(".rar").getValue("").value_SZ()); Display "☺ AR" instead of "WinRAR". But: writefln(Registry.classesRoot().getKey(".html").getValue("").value_SZ()); Display "htmlfile". I tried others keys and it seems that if the length of the value is less than 8, the value returned is corrupted.
Comment #1 by dlang-bugzilla — 2007-08-16T09:14:06Z
Sounds like a duplicate of Bug 961.
Comment #2 by keystuffs — 2007-08-29T08:37:59Z
I was able to fix this bug: in the function Reg_QueryValue_, I just added a .dup case REG_VALUE_TYPE.REG_EXPAND_SZ: value = std.string.toString(cast(char*)data); value = value.dup; // fix the bug. break;
Comment #3 by bugzilla — 2007-09-28T22:12:32Z
Fixed dmd 1.021 and 2.004