Skip to content

Instantly share code, notes, and snippets.

@SimonCropp
Created September 6, 2011 07:25
Show Gist options
  • Save SimonCropp/1196839 to your computer and use it in GitHub Desktop.
Save SimonCropp/1196839 to your computer and use it in GitHub Desktop.
ResiliencyTests
[TestFixture]
public class ResiliencyTests
{
[Test]
public void Foo()
{
using (var disabledItems = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Office\14.0\Outlook\Resiliency\DisabledItems"))
{
foreach (var valueName in disabledItems.GetValueNames())
{
Debug.WriteLine(valueName);
var bytes = (byte[]) disabledItems.GetValue(valueName);
var pathLengthAsBytes = bytes.Skip(4).Take(4).ToList();
var pathLength = pathLengthAsBytes[0] | pathLengthAsBytes[1] << 8 | pathLengthAsBytes[2] << 16 | pathLengthAsBytes[3] << 24;
var path = Encoding.Unicode.GetString(bytes, 12, pathLength - 2);
Debug.WriteLine(path);
var alreadyProcessed = 12 + pathLength;
if (bytes.Length > alreadyProcessed)
{
var friendlyName = Encoding.Unicode.GetString(bytes, alreadyProcessed, bytes.Length - alreadyProcessed);
Debug.WriteLine(friendlyName);
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment