Merge pull request #3647 from BrzVlad/fix-sgen-internal-alloc
[mono.git] / mcs / class / corlib / System.Security.AccessControl / NativeObjectSecurity.cs
index 141d0c9d6cbe46e6e6b7cb34c0c545091f9c1ef0..db43c8b549001e029973a5926fd63929792a1cd4 100644 (file)
@@ -38,7 +38,9 @@ namespace System.Security.AccessControl
        public abstract class NativeObjectSecurity : CommonObjectSecurity
        {
                ExceptionFromErrorCode exception_from_error_code;
+#if !MOBILE
                ResourceType resource_type;
+#endif
                
                protected internal delegate Exception ExceptionFromErrorCode (int errorCode,
                                                                              string name, SafeHandle handle,
@@ -47,7 +49,9 @@ namespace System.Security.AccessControl
                internal NativeObjectSecurity (CommonSecurityDescriptor securityDescriptor, ResourceType resourceType)
                        : base (securityDescriptor)
                {
+#if !MOBILE                    
                        resource_type = resourceType;
+#endif
                }
 
                protected NativeObjectSecurity (bool isContainer,
@@ -63,7 +67,9 @@ namespace System.Security.AccessControl
                        : base (isContainer)
                {
                        exception_from_error_code = exceptionFromErrorCode;
+#if !MOBILE                    
                        resource_type = resourceType;
+#endif
                }
                
                protected NativeObjectSecurity (bool isContainer,
@@ -129,7 +135,7 @@ namespace System.Security.AccessControl
                {
                        Persist (name, includeSections, null);
                }
-               
+       
                internal void PersistModifications (SafeHandle handle)
                {
                        WriteLock();
@@ -203,6 +209,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 +223,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 +243,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)
                {
@@ -392,13 +417,16 @@ namespace System.Security.AccessControl
                [return: MarshalAs (UnmanagedType.Bool)]
                static extern bool IsValidSecurityDescriptor (IntPtr descriptor);
                
+               /*
                struct SecurityDescriptor
                {
                        public byte Revision, Size;
                        public ushort ControlFlags;
                        public IntPtr Owner, Group, Sacl, Dacl;
                }
+               */
                #endregion
+#endif
        }
 }