www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1423] New: Registry: corrupted value

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1423

           Summary: Registry: corrupted value
           Product: D
           Version: 1.018
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: blocker
          Priority: P2
         Component: Phobos
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: keystuffs netscape.net


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.


-- 
Aug 16 2007
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1423






Sounds like a duplicate of Bug 961.


-- 
Aug 16 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1423






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;


-- 
Aug 29 2007
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1423


bugzilla digitalmars.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED





Fixed dmd 1.021 and 2.004


-- 
Sep 28 2007