reading in a Windows 7 standard BCD file causes an exception

Mar 1, 2010 at 12:30 PM


I think the BootConfig code has a problem with the standard windows 7 BCD file, as it causes an exception by only iterating over the different elements and reading their values.

I tested it with a copy paste from the osclone utility commented out the "elem.value = ....." line and wrote this instead:
     Guid g = elem.Value.ParentObject;
and opened the BCD File which I copied before under WinPE to a stick, as it is always opened by the system while windows is running.

So a read only access to elem.value causes this exception.

The stacktrace looks as follows:

   bei DiscUtils.BootConfig.DeviceElementValue..ctor(Byte[] value) in ...trunk\\src\\BootConfig\\ElementValue.cs:Zeile 424.
   bei DiscUtils.BootConfig.Element.LoadValue() in ...trunk\\src\\BootConfig\\Element.cs:Zeile 326.
   bei DiscUtils.BootConfig.Element.get_Value() in ...trunk\\src\\BootConfig\\Element.cs:Zeile 89.
   bei vhdEditMBR.Form1.tmp_Click(Object sender, EventArgs e) in d:\\Projekte\\vhdEditMBR\\Form1.cs:Zeile 329.

The exception text is "Unknown device type: 0"

Ciao Ephraim

PS: Ken as you might need such a BCD file, I send you one via PM.

Mar 2, 2010 at 8:56 AM

Hey again,

today I tried BCDDump with such a BCD File and it dies at the line which reads the elem.value too.

Same Problem.

Ciao Ephraim

Mar 2, 2010 at 10:00 PM

Hi Ephraim,

I've got the file, and am taking a look.  It may take a little while to fix - this structure is not well documented, so it's educated guess work as to how to interpret it.



Mar 3, 2010 at 7:51 AM

A painful amount of documentation ,)  I started looking at this issue, it's blowing up reading the device entry for the Windows Boot Manager {bootmgr} aka 9dea862c-5cdd-4e70-acc1-f32b344d4795 entry.  Unfortunately I need to crash out (traveling tomorrow), but will continue digging when I return on Thursday.  Hopefully I can send you some useful informaton on the part of the parser that is throwing the exception of the device type being '0'


Mar 6, 2010 at 11:36 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.