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;