2005-09-16 Sebastien Pouliot <sebastien@ximian.com>
authorSebastien Pouliot <sebastien@ximian.com>
Fri, 16 Sep 2005 13:14:38 +0000 (13:14 -0000)
committerSebastien Pouliot <sebastien@ximian.com>
Fri, 16 Sep 2005 13:14:38 +0000 (13:14 -0000)
* gdipFunctions.cs: Add [SuppressUnmanagedCodeSecurity] attributes so
the JIT won't add demands for UnmanagedCode.
* carbonFunctions.cs: Add [SuppressUnmanagedCodeSecurity] attributes
so the JIT won't add demands for UnmanagedCode on Mac OSX.
* Bitmap.cs: Added LinkDemand for UnmanagedCode on GetHbitmap
(+ overloads) and GetHicon methods.
* Graphics.cs: Added LinkDemand for UnmanagedCode on FromHdcInternal,
FromHwndInternal and ReleaseHdcInternal methods (which are all public
despite their names).

svn path=/trunk/mcs/; revision=50150

mcs/class/System.Drawing/System.Drawing/Bitmap.cs
mcs/class/System.Drawing/System.Drawing/ChangeLog
mcs/class/System.Drawing/System.Drawing/Graphics.cs
mcs/class/System.Drawing/System.Drawing/carbonFunctions.cs
mcs/class/System.Drawing/System.Drawing/gdipFunctions.cs

index 32cb1d1b9697c2b0593c666c35f5a9f86c3a7352..d25f21221326902d40d469e5e0d3d082684da31c 100644 (file)
@@ -13,7 +13,7 @@
 //
 
 //
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-using System;
 using System.IO;
 using System.Drawing.Imaging;
 using System.Runtime.Serialization;
 using System.Runtime.InteropServices;
 using System.ComponentModel;
+using System.Security.Permissions;
 
 namespace System.Drawing
 {
@@ -227,12 +227,14 @@ namespace System.Drawing
                }
 
                [EditorBrowsable (EditorBrowsableState.Advanced)]
+               [SecurityPermission (SecurityAction.LinkDemand, UnmanagedCode = true)]
                public IntPtr GetHbitmap ()
                {
                        return GetHbitmap(Color.Gray);
                }
 
                [EditorBrowsable (EditorBrowsableState.Advanced)]
+               [SecurityPermission (SecurityAction.LinkDemand, UnmanagedCode = true)]
                public IntPtr GetHbitmap (Color background)
                {
                        IntPtr HandleBmp;
@@ -244,6 +246,7 @@ namespace System.Drawing
                }
 
                [EditorBrowsable (EditorBrowsableState.Advanced)]
+               [SecurityPermission (SecurityAction.LinkDemand, UnmanagedCode = true)]
                public IntPtr GetHicon ()
                {
                        IntPtr HandleIcon;
index da299bd7fa44b160b5d10945d0808c86adb48912..7d481102cc667290f6bc59955bab11206b2c99bd 100644 (file)
@@ -1,3 +1,15 @@
+2005-09-16  Sebastien Pouliot  <sebastien@ximian.com>
+
+       * gdipFunctions.cs: Add [SuppressUnmanagedCodeSecurity] attributes so 
+       the JIT won't add demands for UnmanagedCode.
+       * carbonFunctions.cs: Add [SuppressUnmanagedCodeSecurity] attributes 
+       so the JIT won't add demands for UnmanagedCode on Mac OSX.
+       * Bitmap.cs: Added LinkDemand for UnmanagedCode on GetHbitmap 
+       (+ overloads) and GetHicon methods.
+       * Graphics.cs: Added LinkDemand for UnmanagedCode on FromHdcInternal, 
+       FromHwndInternal and ReleaseHdcInternal methods (which are all public 
+       despite their names).
+
 2005-09-15 Konstantin Triger <kostat@mainsoft.com>
 
        * Graphics.jvm.cs: text transform, headless session
index 674f978a1ad36717500d9192859e28058e6cbea5..c90c0ab32875b52df067228b67d8d8ea51643245 100644 (file)
@@ -8,7 +8,7 @@
 //
 // Copyright (C) 2003 Ximian, Inc. (http://www.ximian.com)
 //
-// Copyright (C) 2004 Novell, Inc. (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc. (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-using System;
+
 using System.Drawing.Drawing2D;
 using System.Drawing.Imaging;
 using System.Drawing.Text;
 using System.ComponentModel;
 using System.Runtime.InteropServices;
+using System.Security.Permissions;
 using System.Text;
 
 namespace System.Drawing
@@ -1238,6 +1239,7 @@ namespace System.Drawing
                }
 
                [EditorBrowsable (EditorBrowsableState.Advanced)]
+               [SecurityPermission (SecurityAction.LinkDemand, UnmanagedCode = true)]
                public static Graphics FromHdcInternal (IntPtr hdc)
                {
                        GDIPlus.Display = hdc;
@@ -1279,6 +1281,7 @@ namespace System.Drawing
                }
                
                [EditorBrowsable (EditorBrowsableState.Advanced)]
+               [SecurityPermission (SecurityAction.LinkDemand, UnmanagedCode = true)]
                public static Graphics FromHwndInternal (IntPtr hwnd)
                {
                        return FromHwnd (hwnd);
@@ -1595,6 +1598,7 @@ namespace System.Drawing
 
                [MonoTODO]
                [EditorBrowsable (EditorBrowsableState.Advanced)]
+               [SecurityPermission (SecurityAction.LinkDemand, UnmanagedCode = true)]
                public void ReleaseHdcInternal (IntPtr hdc)
                {
                        throw new NotImplementedException ();
index 270331017f4e7361b979048ba7e12e7ce5ce03b4..40e36825b7077cdb4929ced632fd142a4ffa4fb3 100644 (file)
 //
 
 using System.Runtime.InteropServices;
+using System.Security;
 
 namespace System.Drawing {
+
+       [SuppressUnmanagedCodeSecurity]
        internal class Carbon {
 
                internal static CarbonContext GetCGContextForNSView (IntPtr hwnd) {
index 6f653bb8964bc17c314badd9bf53ee57cbb52b1d..a8a80ddc13b3cf95ba83d89dc497f92a465ce6f1 100644 (file)
@@ -36,6 +36,7 @@ using System.Text;
 using System.Drawing.Drawing2D;
 using System.Drawing.Imaging;
 using System.Drawing.Text;
+using System.Security;
 #if NET_2_0
 using System.Runtime.InteropServices.ComTypes;
 #else
@@ -47,6 +48,7 @@ namespace System.Drawing
        /// <summary>
        /// GDI+ API Functions
        /// </summary>
+       [SuppressUnmanagedCodeSecurity]
        internal class GDIPlus
        {
                public const int FACESIZE = 32;