Author: gert
Date: 2006-08-11 05:59:06 -0400 (Fri, 11 Aug 2006)
New Revision: 63632
Modified:
trunk/mcs/class/corlib/Microsoft.Win32/ChangeLog
trunk/mcs/class/corlib/Microsoft.Win32/UnixRegistryApi.cs
Log:
* UnixRegistryApi.cs: Consider HKLM\SYSTEM\CurrentControlSet\Services\
EventLog a wellknown key. Required for new EventLog implementation.
Added RegistryStore property.
Modified: trunk/mcs/class/corlib/Microsoft.Win32/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/Microsoft.Win32/ChangeLog 2006-08-11 04:42:38 UTC
(rev 63631)
+++ trunk/mcs/class/corlib/Microsoft.Win32/ChangeLog 2006-08-11 09:59:06 UTC
(rev 63632)
@@ -1,3 +1,9 @@
+2006-08-11 Gert Driesen <[EMAIL PROTECTED]>
+
+ * UnixRegistryApi.cs: Consider HKLM\SYSTEM\CurrentControlSet\Services\
+ EventLog a wellknown key. Required for new EventLog implementation.
+ Added RegistryStore property.
+
2006-06-06 Miguel de Icaza <[EMAIL PROTECTED]>
* UnixRegistryApi.cs: Do not crash if there are no values stored.
Modified: trunk/mcs/class/corlib/Microsoft.Win32/UnixRegistryApi.cs
===================================================================
--- trunk/mcs/class/corlib/Microsoft.Win32/UnixRegistryApi.cs 2006-08-11
04:42:38 UTC (rev 63631)
+++ trunk/mcs/class/corlib/Microsoft.Win32/UnixRegistryApi.cs 2006-08-11
09:59:06 UTC (rev 63632)
@@ -190,11 +190,8 @@
case RegistryHive.LocalMachine:
case RegistryHive.PerformanceData:
case RegistryHive.Users:
- string d = Path.Combine
(Environment.GetFolderPath (Environment.SpecialFolder.Personal),
".mono/registry");
- d = Path.Combine (d, x.ToString ());
-
+ string d = Path.Combine (RegistryStore,
x.ToString ());
k = new KeyHandler (rkey, d);
- key_to_handler [rkey] = k;
break;
default:
throw new Exception ("Unknown
RegistryHive");
@@ -264,7 +261,7 @@
{
if (!File.Exists (file) && values.Count == 0)
return;
-
+
SecurityElement se = new SecurityElement ("values");
foreach (DictionaryEntry de in values){
@@ -304,6 +301,14 @@
Console.Error.WriteLine ("When saving {0} got
{1}", file, e);
}
}
+
+ public static string RegistryStore {
+ get {
+ return Path.Combine (Environment.GetFolderPath
(Environment.SpecialFolder.Personal),
+ ".mono/registry");
+ }
+ }
+
}
internal class UnixRegistryApi : IRegistryApi {
@@ -317,11 +322,14 @@
static bool IsWellKnownKey (string parentKeyName, string
keyname)
{
- // FIXME: Add more keys if needed
- if (parentKeyName == Registry.CurrentUser.Name ||
- parentKeyName == Registry.LocalMachine.Name)
- return (0 == String.Compare ("software",
keyname, true, CultureInfo.InvariantCulture));
+ if (string.Compare ("software", keyname, true,
CultureInfo.InvariantCulture) == 0)
+ return (parentKeyName ==
Registry.CurrentUser.Name ||
+ parentKeyName ==
Registry.LocalMachine.Name);
+ // required for event log support
+ if (string.Compare
(@"SYSTEM\CurrentControlSet\Services\EventLog", keyname, true,
CultureInfo.InvariantCulture) == 0)
+ return (parentKeyName ==
Registry.LocalMachine.Name);
+
return false;
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches