Fixed #47: Error parsing corrupted registry hives
This commit is contained in:
parent
393e5af563
commit
3b1806c038
|
@ -104,9 +104,17 @@ namespace DSInternals.DataStore
|
||||||
private static int GetCurrentControlSetId(RegistryKey systemKey)
|
private static int GetCurrentControlSetId(RegistryKey systemKey)
|
||||||
{
|
{
|
||||||
using (var ccsKey = systemKey.OpenSubKey(CurrentControlSetKey))
|
using (var ccsKey = systemKey.OpenSubKey(CurrentControlSetKey))
|
||||||
|
{
|
||||||
|
if(ccsKey != null)
|
||||||
{
|
{
|
||||||
return (int)ccsKey.GetValue(CurrentControlSetValue, DefaultControlSetId);
|
return (int)ccsKey.GetValue(CurrentControlSetValue, DefaultControlSetId);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// The "Select" value may be absent in SYSTEM registry hives that were copied from live systems without the corresponding transaction logs.
|
||||||
|
return DefaultControlSetId;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static byte[] DecodeKey(byte[] bootKey)
|
private static byte[] DecodeKey(byte[] bootKey)
|
||||||
|
|
Loading…
Reference in New Issue