Merge pull request #3528 from BrzVlad/fix-sgen-check-before-collections
[mono.git] / mcs / class / corlib / System.Security.AccessControl / NativeObjectSecurity.cs
index 141d0c9d6cbe46e6e6b7cb34c0c545091f9c1ef0..b951a8141d5d38927a3798202cdfae98f9751474 100644 (file)
@@ -129,6 +129,11 @@ namespace System.Security.AccessControl
                {
                        Persist (name, includeSections, null);
                }
+
+               internal void Persist (SafeHandle handle)
+               {
+                       PersistModifications (handle);
+               }
                
                internal void PersistModifications (SafeHandle handle)
                {
@@ -203,6 +208,9 @@ namespace System.Security.AccessControl
                internal virtual int InternalGet (SafeHandle handle,
                                                  AccessControlSections includeSections)
                {
+#if MOBILE
+                       throw new PlatformNotSupportedException ();
+#else
                        if (Environment.OSVersion.Platform != PlatformID.Win32NT)
                                throw new PlatformNotSupportedException ();
 
@@ -214,11 +222,15 @@ namespace System.Security.AccessControl
                                                                out owner, out group,
                                                                out dacl, out sacl, out descriptor);
                                }, includeSections);
+#endif
                }
                
                internal virtual int InternalGet (string name,
                                                  AccessControlSections includeSections)
                {
+#if MOBILE
+                       throw new PlatformNotSupportedException ();
+#else
                        if (Environment.OSVersion.Platform != PlatformID.Win32NT)
                                throw new PlatformNotSupportedException ();
 
@@ -230,8 +242,20 @@ namespace System.Security.AccessControl
                                                                     out owner, out group,
                                                                     out dacl, out sacl, out descriptor);
                                }, includeSections);
+#endif
                }
                
+#if MOBILE
+               internal virtual int InternalSet (SafeHandle handle, AccessControlSections includeSections)
+               {
+                       throw new PlatformNotSupportedException ();
+               }
+
+               internal virtual int InternalSet (string name, AccessControlSections includeSections)
+               {
+                       throw new PlatformNotSupportedException ();
+               }
+#else
                internal virtual int InternalSet (SafeHandle handle,
                                                  AccessControlSections includeSections)
                {
@@ -399,6 +423,7 @@ namespace System.Security.AccessControl
                        public IntPtr Owner, Group, Sacl, Dacl;
                }
                #endregion
+#endif
        }
 }