diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.AbortDoc.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.AbortDoc.cs deleted file mode 100644 index 0326ead026c33..0000000000000 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.AbortDoc.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.InteropServices; -#if NET -using System.Runtime.InteropServices.Marshalling; -#endif - -internal static partial class Interop -{ - internal static partial class Gdi32 - { - [LibraryImport(Libraries.Gdi32, SetLastError = true)] - internal static partial int AbortDoc( -#if NET - [MarshalUsing(typeof(HandleRefMarshaller))] -#endif - HandleRef hDC); - } -} diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.AddFontResourceEx.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.AddFontResourceEx.cs deleted file mode 100644 index 10aa264b72938..0000000000000 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.AddFontResourceEx.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Gdi32 - { - [LibraryImport(Libraries.Gdi32, EntryPoint = "AddFontResourceExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] - internal static partial int AddFontResourceEx(string lpszFilename, int fl, IntPtr pdv); - - internal static int AddFontFile(string fileName) - { - return AddFontResourceEx(fileName, /*FR_PRIVATE*/ 0x10, IntPtr.Zero); - } - } -} diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.BITMAPINFO_FLAT.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.BITMAPINFO_FLAT.cs deleted file mode 100644 index 9cce923687de8..0000000000000 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.BITMAPINFO_FLAT.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Gdi32 - { - internal const int BITMAPINFO_MAX_COLORSIZE = 256; - - [StructLayout(LayoutKind.Sequential)] - internal unsafe struct BITMAPINFO_FLAT - { - public int bmiHeader_biSize; // = sizeof(BITMAPINFOHEADER) - public int bmiHeader_biWidth; - public int bmiHeader_biHeight; - public short bmiHeader_biPlanes; - public short bmiHeader_biBitCount; - public int bmiHeader_biCompression; - public int bmiHeader_biSizeImage; - public int bmiHeader_biXPelsPerMeter; - public int bmiHeader_biYPelsPerMeter; - public int bmiHeader_biClrUsed; - public int bmiHeader_biClrImportant; - - public fixed byte bmiColors[BITMAPINFO_MAX_COLORSIZE * 4]; // RGBQUAD structs... Blue-Green-Red-Reserved, repeat... - } - } -} diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.BitBlt.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.BitBlt.cs deleted file mode 100644 index fb62fb82f7273..0000000000000 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.BitBlt.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Gdi32 - { - [LibraryImport(Libraries.Gdi32, SetLastError = true)] - public static partial int BitBlt(IntPtr hdc, int x, int y, int cx, int cy, - IntPtr hdcSrc, int x1, int y1, RasterOp rop); - - public static int BitBlt(HandleRef hdc, int x, int y, int cx, int cy, - HandleRef hdcSrc, int x1, int y1, RasterOp rop) - { - int result = BitBlt(hdc.Handle, x, y, cx, cy, hdcSrc.Handle, x1, y1, rop); - GC.KeepAlive(hdc.Wrapper); - GC.KeepAlive(hdcSrc.Wrapper); - return result; - } - } -} diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.CombineRgn.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.CombineRgn.cs deleted file mode 100644 index 4573cfc54de8d..0000000000000 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.CombineRgn.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Diagnostics; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Gdi32 - { - public enum CombineMode : int - { - RGN_AND = 1, - RGN_XOR = 3, - RGN_DIFF = 4, - } - - [LibraryImport(Libraries.Gdi32, SetLastError = true)] - public static partial RegionType CombineRgn(IntPtr hrgnDst, IntPtr hrgnSrc1, IntPtr hrgnSrc2, CombineMode iMode); - - public static RegionType CombineRgn(HandleRef hrgnDst, HandleRef hrgnSrc1, HandleRef hrgnSrc2, CombineMode iMode) - { - RegionType result = CombineRgn(hrgnDst.Handle, hrgnSrc1.Handle, hrgnSrc2.Handle, iMode); - GC.KeepAlive(hrgnDst.Wrapper); - GC.KeepAlive(hrgnSrc1.Wrapper); - GC.KeepAlive(hrgnSrc2.Wrapper); - return result; - } - } -} diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.CreateCompatibleBitmap.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.CreateCompatibleBitmap.cs deleted file mode 100644 index fdfc84cddf583..0000000000000 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.CreateCompatibleBitmap.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Runtime.InteropServices; -#if NET -using System.Runtime.InteropServices.Marshalling; -#endif - -internal static partial class Interop -{ - internal static partial class Gdi32 - { - [LibraryImport(Libraries.Gdi32, SetLastError = true)] - internal static partial IntPtr CreateCompatibleBitmap( -#if NET - [MarshalUsing(typeof(HandleRefMarshaller))] -#endif - HandleRef hDC, int width, int height); - } -} diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.CreateCompatibleDC.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.CreateCompatibleDC.cs deleted file mode 100644 index 3066c33fdf2d4..0000000000000 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.CreateCompatibleDC.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Gdi32 - { - [LibraryImport(Libraries.Gdi32)] - public static partial IntPtr CreateCompatibleDC(IntPtr hdc); - } -} diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.CreateDC.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.CreateDC.cs deleted file mode 100644 index 1474463954316..0000000000000 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.CreateDC.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Gdi32 - { - [LibraryImport(Libraries.Gdi32, StringMarshalling = StringMarshalling.Utf16)] - public static partial IntPtr CreateDCW(string pwszDriver, string pwszDevice, string? pszPort, IntPtr pdm); - } -} diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.CreateDIBSection.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.CreateDIBSection.cs deleted file mode 100644 index 2654d0e653ad1..0000000000000 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.CreateDIBSection.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Runtime.InteropServices; -#if NET -using System.Runtime.InteropServices.Marshalling; -#endif - -internal static partial class Interop -{ - internal static partial class Gdi32 - { - [LibraryImport(Libraries.Gdi32, SetLastError = true)] - internal static partial IntPtr CreateDIBSection( -#if NET - [MarshalUsing(typeof(HandleRefMarshaller))] -#endif - HandleRef hdc, ref BITMAPINFO_FLAT bmi, int iUsage, ref IntPtr ppvBits, IntPtr hSection, int dwOffset); - } -} diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.CreateFontIndirect.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.CreateFontIndirect.cs deleted file mode 100644 index 2a4b9b7c77412..0000000000000 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.CreateFontIndirect.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Gdi32 - { - [LibraryImport(Libraries.Gdi32)] - public static partial IntPtr CreateFontIndirectW(ref User32.LOGFONT lplf); - } -} diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.CreateIC.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.CreateIC.cs deleted file mode 100644 index afbc6ba440915..0000000000000 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.CreateIC.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Gdi32 - { - [LibraryImport(Libraries.Gdi32, StringMarshalling = StringMarshalling.Utf16)] - public static partial IntPtr CreateICW(string pszDriver, string pszDevice, string? pszPort, IntPtr pdm); - } -} diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.CreateRectRgn.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.CreateRectRgn.cs deleted file mode 100644 index edf59c56dec6c..0000000000000 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.CreateRectRgn.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Gdi32 - { - [LibraryImport(Libraries.Gdi32)] - public static partial IntPtr CreateRectRgn(int x1, int y1, int x2, int y2); - } -} diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.DEVMODE.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.DEVMODE.cs deleted file mode 100644 index bb0fa59f77127..0000000000000 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.DEVMODE.cs +++ /dev/null @@ -1,96 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Runtime.InteropServices; -#if NET -using System.Runtime.InteropServices.Marshalling; -#endif - -internal static partial class Interop -{ - internal static partial class Gdi32 - { - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] - public sealed class DEVMODE - { - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] - public string? dmDeviceName; - public short dmSpecVersion; - public short dmDriverVersion; - public short dmSize; - public short dmDriverExtra; - public int dmFields; - public short dmOrientation; - public short dmPaperSize; - public short dmPaperLength; - public short dmPaperWidth; - public short dmScale; - public short dmCopies; - public short dmDefaultSource; - public short dmPrintQuality; - public short dmColor; - public short dmDuplex; - public short dmYResolution; - public short dmTTOption; - public short dmCollate; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] - public string? dmFormName; - public short dmLogPixels; - public int dmBitsPerPel; - public int dmPelsWidth; - public int dmPelsHeight; - public int dmDisplayFlags; - public int dmDisplayFrequency; - public int dmICMMethod; - public int dmICMIntent; - public int dmMediaType; - public int dmDitherType; - public int dmICCManufacturer; - public int dmICCModel; - public int dmPanningWidth; - public int dmPanningHeight; - - - public override string ToString() - { - return "[DEVMODE: " - + "dmDeviceName=" + dmDeviceName - + ", dmSpecVersion=" + dmSpecVersion - + ", dmDriverVersion=" + dmDriverVersion - + ", dmSize=" + dmSize - + ", dmDriverExtra=" + dmDriverExtra - + ", dmFields=" + dmFields - + ", dmOrientation=" + dmOrientation - + ", dmPaperSize=" + dmPaperSize - + ", dmPaperLength=" + dmPaperLength - + ", dmPaperWidth=" + dmPaperWidth - + ", dmScale=" + dmScale - + ", dmCopies=" + dmCopies - + ", dmDefaultSource=" + dmDefaultSource - + ", dmPrintQuality=" + dmPrintQuality - + ", dmColor=" + dmColor - + ", dmDuplex=" + dmDuplex - + ", dmYResolution=" + dmYResolution - + ", dmTTOption=" + dmTTOption - + ", dmCollate=" + dmCollate - + ", dmFormName=" + dmFormName - + ", dmLogPixels=" + dmLogPixels - + ", dmBitsPerPel=" + dmBitsPerPel - + ", dmPelsWidth=" + dmPelsWidth - + ", dmPelsHeight=" + dmPelsHeight - + ", dmDisplayFlags=" + dmDisplayFlags - + ", dmDisplayFrequency=" + dmDisplayFrequency - + ", dmICMMethod=" + dmICMMethod - + ", dmICMIntent=" + dmICMIntent - + ", dmMediaType=" + dmMediaType - + ", dmDitherType=" + dmDitherType - + ", dmICCManufacturer=" + dmICCManufacturer - + ", dmICCModel=" + dmICCModel - + ", dmPanningWidth=" + dmPanningWidth - + ", dmPanningHeight=" + dmPanningHeight - + "]"; - } - } - } -} diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.DeleteDC.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.DeleteDC.cs deleted file mode 100644 index 98c0a13552109..0000000000000 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.DeleteDC.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Gdi32 - { - [LibraryImport(Libraries.Gdi32)] - [return: MarshalAs(UnmanagedType.Bool)] - public static partial bool DeleteDC(IntPtr hdc); - - public static bool DeleteDC(HandleRef hdc) - { - bool result = DeleteDC(hdc.Handle); - GC.KeepAlive(hdc.Wrapper); - return result; - } - } -} diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.DeleteObject.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.DeleteObject.cs deleted file mode 100644 index db9776eae9433..0000000000000 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.DeleteObject.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Gdi32 - { - [LibraryImport(Libraries.Gdi32)] - [return: MarshalAs(UnmanagedType.Bool)] - public static partial bool DeleteObject(IntPtr ho); - - public static bool DeleteObject(HandleRef ho) - { - bool result = DeleteObject(ho.Handle); - GC.KeepAlive(ho.Wrapper); - return result; - } - } -} diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.EndDoc.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.EndDoc.cs deleted file mode 100644 index 2bd8ad7241634..0000000000000 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.EndDoc.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.InteropServices; -#if NET -using System.Runtime.InteropServices.Marshalling; -#endif - -internal static partial class Interop -{ - internal static partial class Gdi32 - { - [LibraryImport(Libraries.Gdi32, SetLastError = true)] - internal static partial int EndDoc( -#if NET - [MarshalUsing(typeof(HandleRefMarshaller))] -#endif - HandleRef hDC); - } -} diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.EndPage.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.EndPage.cs deleted file mode 100644 index 0349c5044ba19..0000000000000 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.EndPage.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.InteropServices; -#if NET -using System.Runtime.InteropServices.Marshalling; -#endif - -internal static partial class Interop -{ - internal static partial class Gdi32 - { - [LibraryImport(Libraries.Gdi32, SetLastError = true)] - internal static partial int EndPage( -#if NET - [MarshalUsing(typeof(HandleRefMarshaller))] -#endif - HandleRef hDC); - } -} diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.ExtEscape.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.ExtEscape.cs deleted file mode 100644 index 6ade151f8b066..0000000000000 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.ExtEscape.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.InteropServices; -#if NET -using System.Runtime.InteropServices.Marshalling; -#endif - -internal static partial class Interop -{ - internal static partial class Gdi32 - { - internal const int QUERYESCSUPPORT = 8; - internal const int CHECKJPEGFORMAT = 4119; - internal const int CHECKPNGFORMAT = 4120; - - [LibraryImport(Libraries.Gdi32, SetLastError = true)] - internal static partial int ExtEscape( -#if NET - [MarshalUsing(typeof(HandleRefMarshaller))] -#endif - HandleRef hDC, int nEscape, int cbInput, ref int inData, int cbOutput, out int outData); - - [LibraryImport(Libraries.Gdi32, SetLastError = true)] - internal static partial int ExtEscape( -#if NET - [MarshalUsing(typeof(HandleRefMarshaller))] -#endif - HandleRef hDC, int nEscape, int cbInput, byte[] inData, int cbOutput, out int outData); - } -} diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetClipRgn.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetClipRgn.cs deleted file mode 100644 index fc309ed51ee3c..0000000000000 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetClipRgn.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Diagnostics; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Gdi32 - { - [LibraryImport(Libraries.Gdi32)] - public static partial int GetClipRgn(IntPtr hdc, IntPtr hrgn); - - public static int GetClipRgn(HandleRef hdc, IntPtr hrgn) - { - int result = GetClipRgn(hdc.Handle, hrgn); - GC.KeepAlive(hdc.Wrapper); - return result; - } - - public static int GetClipRgn(HandleRef hdc, HandleRef hrgn) - { - int result = GetClipRgn(hdc.Handle, hrgn.Handle); - GC.KeepAlive(hdc.Wrapper); - GC.KeepAlive(hrgn.Wrapper); - return result; - } - } -} diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetCurrentObject.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetCurrentObject.cs deleted file mode 100644 index 4ca4eba089ca0..0000000000000 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetCurrentObject.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Gdi32 - { - [LibraryImport(Libraries.Gdi32)] - public static partial IntPtr GetCurrentObject(IntPtr hdc, ObjectType type); - - public static IntPtr GetCurrentObject(HandleRef hdc, ObjectType type) - { - IntPtr result = GetCurrentObject(hdc.Handle, type); - GC.KeepAlive(hdc.Wrapper); - return result; - } - } -} diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetDIBits.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetDIBits.cs deleted file mode 100644 index 11900ac16602c..0000000000000 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetDIBits.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Runtime.InteropServices; -#if NET -using System.Runtime.InteropServices.Marshalling; -#endif - -internal static partial class Interop -{ - internal static partial class Gdi32 - { - [LibraryImport(Libraries.Gdi32)] - internal static partial int GetDIBits( -#if NET - [MarshalUsing(typeof(HandleRefMarshaller))] -#endif - HandleRef hdc, -#if NET - [MarshalUsing(typeof(HandleRefMarshaller))] -#endif - HandleRef hbm, int arg1, int arg2, IntPtr arg3, ref BITMAPINFO_FLAT bmi, int arg5); - - } -} diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetDeviceCaps.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetDeviceCaps.cs deleted file mode 100644 index e45e30bee2138..0000000000000 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetDeviceCaps.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Diagnostics; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Gdi32 - { - public enum DeviceCapability : int - { - TECHNOLOGY = 2, - VERTRES = 10, - HORZRES = 8, - BITSPIXEL = 12, - PLANES = 14, - LOGPIXELSX = 88, - LOGPIXELSY = 90, - PHYSICALWIDTH = 110, - PHYSICALHEIGHT = 111, - PHYSICALOFFSETX = 112, - PHYSICALOFFSETY = 113 - } - - public static class DeviceTechnology - { - public const int DT_PLOTTER = 0; - public const int DT_RASPRINTER = 2; - } - - [LibraryImport(Libraries.Gdi32)] - public static partial int GetDeviceCaps(IntPtr hdc, DeviceCapability index); - - public static int GetDeviceCaps(HandleRef hdc, DeviceCapability index) - { - int caps = GetDeviceCaps(hdc.Handle, index); - GC.KeepAlive(hdc.Wrapper); - return caps; - } - } -} diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetObject.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetObject.cs deleted file mode 100644 index afb88d5bd14a5..0000000000000 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetObject.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Runtime.InteropServices; -#if NET -using System.Runtime.InteropServices.Marshalling; -#endif - -internal static partial class Interop -{ - internal static partial class Gdi32 - { - [LibraryImport(Libraries.Gdi32, EntryPoint = "GetObjectW", SetLastError = true)] - internal static partial int GetObject( -#if NET - [MarshalUsing(typeof(HandleRefMarshaller))] -#endif - HandleRef hObject, int nSize, ref BITMAP bm); - - [LibraryImport(Libraries.Gdi32, EntryPoint = "GetObjectW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] - internal static partial int GetObject( -#if NET - [MarshalUsing(typeof(HandleRefMarshaller))] -#endif - HandleRef hObject, int nSize, ref Interop.User32.LOGFONT lf); - - internal static unsafe int GetObject( -#if NET - [MarshalUsing(typeof(HandleRefMarshaller))] -#endif - HandleRef hObject, ref Interop.User32.LOGFONT lp) - => GetObject(hObject, sizeof(Interop.User32.LOGFONT), ref lp); - - [StructLayout(LayoutKind.Sequential)] - public struct BITMAP - { - public uint bmType; - public uint bmWidth; - public uint bmHeight; - public uint bmWidthBytes; - public ushort bmPlanes; - public ushort bmBitsPixel; - public IntPtr bmBits; - } - } -} diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetObjectType.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetObjectType.cs deleted file mode 100644 index 1517e07d7253c..0000000000000 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetObjectType.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Gdi32 - { - [LibraryImport(Libraries.Gdi32)] - public static partial ObjectType GetObjectType(IntPtr h); - } -} diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetPaletteEntries.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetPaletteEntries.cs deleted file mode 100644 index ab2ad0b6ea33b..0000000000000 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetPaletteEntries.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.InteropServices; -#if NET -using System.Runtime.InteropServices.Marshalling; -#endif - -internal static partial class Interop -{ - internal static partial class Gdi32 - { - [LibraryImport(Libraries.Gdi32)] - internal static partial uint GetPaletteEntries( -#if NET - [MarshalUsing(typeof(HandleRefMarshaller))] -#endif - HandleRef hpal, int iStartIndex, int nEntries, byte[] lppe); - } -} diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetRgnBox.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetRgnBox.cs deleted file mode 100644 index 58d4d9af1ab59..0000000000000 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetRgnBox.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Gdi32 - { - [LibraryImport(Libraries.Gdi32)] - public static partial RegionType GetRgnBox(IntPtr hrgn, ref RECT lprc); - - public static RegionType GetRgnBox(HandleRef hrgn, ref RECT lprc) - { - RegionType result = GetRgnBox(hrgn.Handle, ref lprc); - GC.KeepAlive(hrgn.Wrapper); - return result; - } - } -} diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetStockObject.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetStockObject.cs deleted file mode 100644 index 1c3f5c64dd38f..0000000000000 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetStockObject.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Gdi32 - { - public enum StockObject : int - { - DEFAULT_GUI_FONT = 17 - } - - [LibraryImport(Libraries.Gdi32)] - public static partial IntPtr GetStockObject(StockObject i); - } -} diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.IntersectClipRect.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.IntersectClipRect.cs deleted file mode 100644 index 0084bcd626527..0000000000000 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.IntersectClipRect.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Runtime.InteropServices; -#if NET -using System.Runtime.InteropServices.Marshalling; -#endif - -internal static partial class Interop -{ - internal static partial class Gdi32 - { - [LibraryImport(Libraries.Gdi32, SetLastError = true)] - internal static partial int IntersectClipRect( -#if NET - [MarshalUsing(typeof(HandleRefMarshaller))] -#endif - HandleRef hDC, int x1, int y1, int x2, int y2); - } -} diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.ObjectType.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.ObjectType.cs deleted file mode 100644 index c0aa0cffcf65a..0000000000000 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.ObjectType.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -internal static partial class Interop -{ - internal static partial class Gdi32 - { - public enum ObjectType : int - { - OBJ_PEN = 1, - OBJ_BRUSH = 2, - OBJ_DC = 3, - OBJ_METADC = 4, - OBJ_PAL = 5, - OBJ_FONT = 6, - OBJ_BITMAP = 7, - OBJ_REGION = 8, - OBJ_METAFILE = 9, - OBJ_MEMDC = 10, - OBJ_EXTPEN = 11, - OBJ_ENHMETADC = 12, - OBJ_ENHMETAFILE = 13, - OBJ_COLORSPACE = 14 - } - } -} diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.OffsetViewportOrgEx.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.OffsetViewportOrgEx.cs deleted file mode 100644 index aae92ce24ebcd..0000000000000 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.OffsetViewportOrgEx.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Drawing; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Gdi32 - { - [LibraryImport(Libraries.Gdi32)] - [return: MarshalAs(UnmanagedType.Bool)] - public static partial bool OffsetViewportOrgEx(IntPtr hdc, int x, int y, ref Point lppt); - - public static bool OffsetViewportOrgEx(HandleRef hdc, int x, int y, ref Point lppt) - { - bool result = OffsetViewportOrgEx(hdc.Handle, x, y, ref lppt); - GC.KeepAlive(hdc.Wrapper); - return result; - } - } -} diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.RECT.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.RECT.cs deleted file mode 100644 index fdd5de32a0e5c..0000000000000 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.RECT.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Drawing; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Gdi32 - { - [StructLayout(LayoutKind.Sequential)] - public struct RECT - { - public int left; - public int top; - public int right; - public int bottom; - - public Size Size => new Size(right - left, bottom - top); - } - } -} diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.RasterOp.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.RasterOp.cs deleted file mode 100644 index 987a0cff614ee..0000000000000 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.RasterOp.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Gdi32 - { - public enum RasterOp : int - { - SRCPAINT = 0x00EE0086, // dest = source OR dest - SRCAND = 0x008800C6, // dest = source AND dest - SRCCOPY = 0x00CC0020, - SRCINVERT = 0x00660046, // dest = source XOR dest - SRCERASE = 0x00440328, // dest = source AND (NOT dest ) - NOTSRCCOPY = 0x00330008, // dest = (NOT source) - NOTSRCERASE = 0x001100A6, // dest = (NOT src) AND (NOT dest) - MERGECOPY = 0x00C000CA, // dest = (source AND pattern) - MERGEPAINT = 0x00BB0226, // dest = (NOT source) OR dest - PATCOPY = 0x00F00021, // dest = pattern - PATPAINT = 0x00FB0A09, // dest = DPSnoo - PATINVERT = 0x005A0049, // dest = pattern XOR dest - DSTINVERT = 0x00550009, // dest = (NOT dest) - BLACKNESS = 0x00000042, // dest = BLACK - WHITENESS = 0x00FF0062, // dest = WHITE - CAPTUREBLT = 0x40000000, // Include layered windows - NOMIRRORBITMAP = unchecked((int)0x80000000), // Do not Mirror the bitmap in this call - } - } -} diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.RegionType.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.RegionType.cs deleted file mode 100644 index 6039a732fcb5c..0000000000000 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.RegionType.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -internal static partial class Interop -{ - internal enum RegionType : int - { - ERROR = 0, - NULLREGION = 1, - SIMPLEREGION = 2, - COMPLEXREGION = 3, - } -} diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.ResetDC.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.ResetDC.cs deleted file mode 100644 index e26750aa2895f..0000000000000 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.ResetDC.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Runtime.InteropServices; -#if NET -using System.Runtime.InteropServices.Marshalling; -#endif - -internal static partial class Interop -{ - internal static partial class Gdi32 - { - [LibraryImport(Libraries.Gdi32, EntryPoint = "ResetDCW", SetLastError = true)] - internal static partial IntPtr /*HDC*/ ResetDC( -#if NET - [MarshalUsing(typeof(HandleRefMarshaller))] -#endif - HandleRef hDC, -#if NET - [MarshalUsing(typeof(HandleRefMarshaller))] -#endif - HandleRef /*DEVMODE*/ lpDevMode); - } -} diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.RestoreDC.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.RestoreDC.cs deleted file mode 100644 index ac9d431ae7632..0000000000000 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.RestoreDC.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Gdi32 - { - [LibraryImport(Libraries.Gdi32)] - [return: MarshalAs(UnmanagedType.Bool)] - public static partial bool RestoreDC(IntPtr hdc, int nSavedDC); - - public static bool RestoreDC(HandleRef hdc, int nSavedDC) - { - bool result = RestoreDC(hdc.Handle, nSavedDC); - GC.KeepAlive(hdc.Wrapper); - return result; - } - } -} diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.SaveDC.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.SaveDC.cs deleted file mode 100644 index 31accb0e1ecd0..0000000000000 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.SaveDC.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Gdi32 - { - [LibraryImport(Libraries.Gdi32)] - public static partial int SaveDC(IntPtr hdc); - - public static int SaveDC(HandleRef hdc) - { - int result = SaveDC(hdc.Handle); - GC.KeepAlive(hdc.Wrapper); - return result; - } - } -} diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.SelectClipRgn.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.SelectClipRgn.cs deleted file mode 100644 index d528fb8fecc15..0000000000000 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.SelectClipRgn.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Gdi32 - { - [LibraryImport(Libraries.Gdi32, SetLastError = true)] - public static partial RegionType SelectClipRgn(IntPtr hdc, IntPtr hrgn); - - public static RegionType SelectClipRgn(HandleRef hdc, HandleRef hrgn) - { - RegionType result = SelectClipRgn(hdc.Handle, hrgn.Handle); - GC.KeepAlive(hdc.Wrapper); - GC.KeepAlive(hrgn.Wrapper); - return result; - } - } -} diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.StartDoc.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.StartDoc.cs deleted file mode 100644 index 8199ff3f217ff..0000000000000 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.StartDoc.cs +++ /dev/null @@ -1,70 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Runtime.InteropServices; -#if NET -using System.Runtime.InteropServices.Marshalling; -#endif - -internal static partial class Interop -{ - internal static partial class Gdi32 - { - [LibraryImport(Libraries.Gdi32, EntryPoint = "StartDocW", SetLastError = true)] - internal static partial int StartDoc( -#if NET - [MarshalUsing(typeof(HandleRefMarshaller))] -#endif - HandleRef hDC, in DOCINFO lpDocInfo); - -#if NET - [NativeMarshalling(typeof(Marshaller))] -#endif - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] - internal struct DOCINFO - { - internal int cbSize = 20; - internal string? lpszDocName; - internal string? lpszOutput; - internal string? lpszDatatype; - internal int fwType; - - public DOCINFO() { } - -#if NET - [CustomMarshaller(typeof(DOCINFO), MarshalMode.ManagedToUnmanagedIn, typeof(Marshaller))] - public static class Marshaller - { - public static Native ConvertToUnmanaged(DOCINFO managed) => new(managed); - public static void Free(Native native) => native.FreeNative(); - - internal struct Native - { - internal int cbSize; - internal IntPtr lpszDocName; - internal IntPtr lpszOutput; - internal IntPtr lpszDatatype; - internal int fwType; - - public Native(DOCINFO docInfo) - { - cbSize = docInfo.cbSize; - lpszDocName = Marshal.StringToCoTaskMemAuto(docInfo.lpszDocName); - lpszOutput = Marshal.StringToCoTaskMemAuto(docInfo.lpszOutput); - lpszDatatype = Marshal.StringToCoTaskMemAuto(docInfo.lpszDatatype); - fwType = docInfo.fwType; - } - - public void FreeNative() - { - Marshal.FreeCoTaskMem(lpszDocName); - Marshal.FreeCoTaskMem(lpszOutput); - Marshal.FreeCoTaskMem(lpszDatatype); - } - } - } -#endif - } - } -} diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.StartPage.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.StartPage.cs deleted file mode 100644 index 549151d43337d..0000000000000 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.StartPage.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.InteropServices; -#if NET -using System.Runtime.InteropServices.Marshalling; -#endif - -internal static partial class Interop -{ - internal static partial class Gdi32 - { - [LibraryImport(Libraries.Gdi32, SetLastError = true)] - internal static partial int StartPage( -#if NET - [MarshalUsing(typeof(HandleRefMarshaller))] -#endif - HandleRef hDC); - } -}