|
1 | 1 | using System; |
2 | 2 | using System.Collections.Generic; |
| 3 | +using System.Collections.ObjectModel; |
3 | 4 | using System.ComponentModel; |
4 | 5 | using System.Configuration; |
5 | 6 | using System.Diagnostics; |
@@ -72,26 +73,41 @@ public enum TYPE { |
72 | 73 | // (but that's already handled, so it doesn't matter) |
73 | 74 |
|
74 | 75 | // note the trailing slashes on keys to make lookups easier |
75 | | - private Dictionary<string, List<string>> WOW64KeyList = new Dictionary<string, List<string>>(StringComparer.OrdinalIgnoreCase) { |
76 | | - {"HKEY_LOCAL_MACHINE\\SOFTWARE\\", null}, |
77 | | - {"HKEY_LOCAL_MACHINE\\SOFTWARE\\CLASSES\\", new List<string>() { |
78 | | - "APPID", |
79 | | - "CLSID", |
80 | | - "DIRECTSHOW", |
81 | | - "INTERFACE", |
82 | | - "MEDIA TYPE", |
83 | | - "MEDIAFOUNDATION", |
84 | | - "PROTOCOLS", |
85 | | - "TYPELIB" |
86 | | - }}, |
87 | | - {"HKEY_CURRENT_USER\\SOFTWARE\\CLASSES\\", new List<string>() { |
88 | | - "CLSID", |
89 | | - "DIRECTSHOW", |
90 | | - "INTERFACE", |
91 | | - "MEDIA TYPE", |
92 | | - "MEDIAFOUNDATION" |
93 | | - }} |
94 | | - }; |
| 76 | + private ReadOnlyDictionary<string, IReadOnlyList<string>> WOW64KeyList { get; } = new ReadOnlyDictionary<string, IReadOnlyList<string>>( |
| 77 | + new Dictionary<string, IReadOnlyList<string>>(StringComparer.OrdinalIgnoreCase) { |
| 78 | + { |
| 79 | + "HKEY_LOCAL_MACHINE\\SOFTWARE\\", |
| 80 | + null |
| 81 | + }, |
| 82 | + |
| 83 | + { |
| 84 | + "HKEY_LOCAL_MACHINE\\SOFTWARE\\CLASSES\\", |
| 85 | + |
| 86 | + new List<string>() { |
| 87 | + "APPID", |
| 88 | + "CLSID", |
| 89 | + "DIRECTSHOW", |
| 90 | + "INTERFACE", |
| 91 | + "MEDIA TYPE", |
| 92 | + "MEDIAFOUNDATION", |
| 93 | + "PROTOCOLS", |
| 94 | + "TYPELIB" |
| 95 | + }.AsReadOnly() |
| 96 | + }, |
| 97 | + |
| 98 | + { |
| 99 | + "HKEY_CURRENT_USER\\SOFTWARE\\CLASSES\\", |
| 100 | + |
| 101 | + new List<string>() { |
| 102 | + "CLSID", |
| 103 | + "DIRECTSHOW", |
| 104 | + "INTERFACE", |
| 105 | + "MEDIA TYPE", |
| 106 | + "MEDIAFOUNDATION" |
| 107 | + }.AsReadOnly() |
| 108 | + } |
| 109 | + } |
| 110 | + ); |
95 | 111 |
|
96 | 112 | public RegistryStates(EventHandler importStart, EventHandler importStop) : base(importStart, importStop) { } |
97 | 113 |
|
@@ -512,7 +528,7 @@ private string GetRedirectedKeyValueName(string keyValueName, BINARY_TYPE binary |
512 | 528 | && wow64NodeSubkeys.Length > 0) { |
513 | 529 | redirected = false; |
514 | 530 |
|
515 | | - if (WOW64KeyList.TryGetValue(redirectedKeyValueName.ToString(), out List<string> wow64SubkeyList)) { |
| 531 | + if (WOW64KeyList.TryGetValue(redirectedKeyValueName.ToString(), out IReadOnlyList<string> wow64SubkeyList)) { |
516 | 532 | // if there's no subkey list or we are at the end |
517 | 533 | if (wow64SubkeyList == null || wow64Node) { |
518 | 534 | redirected = true; |
|
0 commit comments