From b2ea27c2959f2d50702cffb6cb0698a36da8167e Mon Sep 17 00:00:00 2001 From: Jan Kotas Date: Tue, 8 Jan 2019 22:55:58 -0800 Subject: Delete files moved to shared partition --- .../System.Private.CoreLib.csproj | 13 ------ .../Runtime/InteropServices/ArrayWithOffset.cs | 5 ++- .../Runtime/InteropServices/ArrayWithOffset.cs | 52 ---------------------- .../System/Runtime/InteropServices/BStrWrapper.cs | 26 ----------- .../Runtime/InteropServices/ComMemberType.cs | 13 ------ .../Runtime/InteropServices/CurrencyWrapper.cs | 31 ------------- .../Runtime/InteropServices/DispatchWrapper.cs | 29 ------------ .../System/Runtime/InteropServices/ErrorWrapper.cs | 36 --------------- .../Runtime/InteropServices/ICustomAdapter.cs | 15 ------- .../Runtime/InteropServices/ICustomFactory.cs | 11 ----- .../Runtime/InteropServices/ICustomMarshaler.cs | 22 --------- .../InteropServices/ICustomQueryInterface.cs | 25 ----------- .../src/System/Runtime/InteropServices/Marshal.cs | 6 --- .../Runtime/InteropServices/UnknownWrapper.cs | 21 --------- .../Runtime/InteropServices/VariantWrapper.cs | 21 --------- 15 files changed, 4 insertions(+), 322 deletions(-) delete mode 100644 src/System.Private.CoreLib/src/System/Runtime/InteropServices/ArrayWithOffset.cs delete mode 100644 src/System.Private.CoreLib/src/System/Runtime/InteropServices/BStrWrapper.cs delete mode 100644 src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComMemberType.cs delete mode 100644 src/System.Private.CoreLib/src/System/Runtime/InteropServices/CurrencyWrapper.cs delete mode 100644 src/System.Private.CoreLib/src/System/Runtime/InteropServices/DispatchWrapper.cs delete mode 100644 src/System.Private.CoreLib/src/System/Runtime/InteropServices/ErrorWrapper.cs delete mode 100644 src/System.Private.CoreLib/src/System/Runtime/InteropServices/ICustomAdapter.cs delete mode 100644 src/System.Private.CoreLib/src/System/Runtime/InteropServices/ICustomFactory.cs delete mode 100644 src/System.Private.CoreLib/src/System/Runtime/InteropServices/ICustomMarshaler.cs delete mode 100644 src/System.Private.CoreLib/src/System/Runtime/InteropServices/ICustomQueryInterface.cs delete mode 100644 src/System.Private.CoreLib/src/System/Runtime/InteropServices/UnknownWrapper.cs delete mode 100644 src/System.Private.CoreLib/src/System/Runtime/InteropServices/VariantWrapper.cs (limited to 'src') diff --git a/src/System.Private.CoreLib/System.Private.CoreLib.csproj b/src/System.Private.CoreLib/System.Private.CoreLib.csproj index d901db3355..0be3c65690 100644 --- a/src/System.Private.CoreLib/System.Private.CoreLib.csproj +++ b/src/System.Private.CoreLib/System.Private.CoreLib.csproj @@ -252,22 +252,12 @@ - - - - - - - - - - @@ -277,8 +267,6 @@ - - @@ -338,7 +326,6 @@ - diff --git a/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ArrayWithOffset.cs b/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ArrayWithOffset.cs index d246f55748..3bef38a0b7 100644 --- a/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ArrayWithOffset.cs +++ b/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ArrayWithOffset.cs @@ -45,7 +45,10 @@ namespace System.Runtime.InteropServices return !(a == b); } -#if !CORECLR // TODO: Cleanup +#if CORECLR // TODO: Cleanup + [MethodImpl(MethodImplOptions.InternalCall)] + private extern int CalculateCount(); +#else private int CalculateCount() { if (m_array == null) diff --git a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ArrayWithOffset.cs b/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ArrayWithOffset.cs deleted file mode 100644 index dd2ec7bd9d..0000000000 --- a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ArrayWithOffset.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System.Runtime.CompilerServices; - -namespace System.Runtime.InteropServices -{ - public struct ArrayWithOffset - { - public ArrayWithOffset(object array, int offset) - { - m_array = array; - m_offset = offset; - m_count = 0; - m_count = CalculateCount(); - } - - public object GetArray() => m_array; - - public int GetOffset() => m_offset; - - public override int GetHashCode() => m_count + m_offset; - - public override bool Equals(object obj) - { - return obj is ArrayWithOffset && Equals((ArrayWithOffset)obj); - } - - public bool Equals(ArrayWithOffset obj) - { - return obj.m_array == m_array && obj.m_offset == m_offset && obj.m_count == m_count; - } - - public static bool operator ==(ArrayWithOffset a, ArrayWithOffset b) - { - return a.Equals(b); - } - - public static bool operator !=(ArrayWithOffset a, ArrayWithOffset b) - { - return !(a == b); - } - - [MethodImpl(MethodImplOptions.InternalCall)] - private extern int CalculateCount(); - - private object m_array; - private int m_offset; - private int m_count; - } -} diff --git a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/BStrWrapper.cs b/src/System.Private.CoreLib/src/System/Runtime/InteropServices/BStrWrapper.cs deleted file mode 100644 index ae7e6e445c..0000000000 --- a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/BStrWrapper.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. -// See the LICENSE file in the project root for more information. - -namespace System.Runtime.InteropServices -{ - /// - /// Wrapper that is converted to a variant with VT_BSTR. - /// - public sealed class BStrWrapper - { - public BStrWrapper(string value) - { - m_WrappedObject = value; - } - - public BStrWrapper(object value) - { - m_WrappedObject = (string)value; - } - - public string WrappedObject => m_WrappedObject; - - private string m_WrappedObject; - } -} diff --git a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComMemberType.cs b/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComMemberType.cs deleted file mode 100644 index 4be75b03b9..0000000000 --- a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComMemberType.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. -// See the LICENSE file in the project root for more information. - -namespace System.Runtime.InteropServices -{ - public enum ComMemberType - { - Method = 0, - PropGet = 1, - PropSet = 2 - } -} diff --git a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CurrencyWrapper.cs b/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CurrencyWrapper.cs deleted file mode 100644 index 429e65f0af..0000000000 --- a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CurrencyWrapper.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. -// See the LICENSE file in the project root for more information. - -namespace System.Runtime.InteropServices -{ - /// - /// Wrapper that is converted to a variant with VT_CURRENCY. - /// - public sealed class CurrencyWrapper - { - public CurrencyWrapper(decimal obj) - { - m_WrappedObject = obj; - } - - public CurrencyWrapper(object obj) - { - if (!(obj is decimal)) - { - throw new ArgumentException(SR.Arg_MustBeDecimal, nameof(obj)); - } - - m_WrappedObject = (decimal)obj; - } - - public decimal WrappedObject => m_WrappedObject; - - private decimal m_WrappedObject; - } -} diff --git a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/DispatchWrapper.cs b/src/System.Private.CoreLib/src/System/Runtime/InteropServices/DispatchWrapper.cs deleted file mode 100644 index b96ba43a0e..0000000000 --- a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/DispatchWrapper.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -namespace System.Runtime.InteropServices -{ - /// - /// Wrapper that is converted to a variant with VT_DISPATCH. - /// - public sealed class DispatchWrapper - { - public DispatchWrapper(object obj) - { - if (obj != null) - { - // Make sure this guy has an IDispatch - IntPtr pdisp = Marshal.GetIDispatchForObject(obj); - - // If we got here without throwing an exception, the QI for IDispatch succeeded. - Marshal.Release(pdisp); - } - m_WrappedObject = obj; - } - - public object WrappedObject => m_WrappedObject; - - private object m_WrappedObject; - } -} diff --git a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ErrorWrapper.cs b/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ErrorWrapper.cs deleted file mode 100644 index af139f83fa..0000000000 --- a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ErrorWrapper.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -namespace System.Runtime.InteropServices -{ - /// - /// Wrapper that is converted to a variant with VT_ERROR. - /// - public sealed class ErrorWrapper - { - public ErrorWrapper(int errorCode) - { - m_ErrorCode = errorCode; - } - - public ErrorWrapper(object errorCode) - { - if (!(errorCode is int)) - { - throw new ArgumentException(SR.Arg_MustBeInt32, nameof(errorCode)); - } - - m_ErrorCode = (int)errorCode; - } - - public ErrorWrapper(Exception e) - { - m_ErrorCode = Marshal.GetHRForException(e); - } - - public int ErrorCode => m_ErrorCode; - - private int m_ErrorCode; - } -} diff --git a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ICustomAdapter.cs b/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ICustomAdapter.cs deleted file mode 100644 index 9ef34004c6..0000000000 --- a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ICustomAdapter.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -namespace System.Runtime.InteropServices -{ - /// - /// The base interface that custom adapters can chose to implement - /// when they want to expose the underlying object. - /// - public interface ICustomAdapter - { - [return: MarshalAs(UnmanagedType.IUnknown)] object GetUnderlyingObject(); - } -} diff --git a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ICustomFactory.cs b/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ICustomFactory.cs deleted file mode 100644 index 799db6a2d3..0000000000 --- a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ICustomFactory.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -namespace System.Runtime.InteropServices -{ - public interface ICustomFactory - { - MarshalByRefObject CreateInstance(Type serverType); - } -} diff --git a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ICustomMarshaler.cs b/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ICustomMarshaler.cs deleted file mode 100644 index 164304512a..0000000000 --- a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ICustomMarshaler.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. -// See the LICENSE file in the project root for more information. - -namespace System.Runtime.InteropServices -{ - /// - /// The base interface that must be implemented by all custom marshalers. - /// - public interface ICustomMarshaler - { - object MarshalNativeToManaged(IntPtr pNativeData); - - IntPtr MarshalManagedToNative(object ManagedObj); - - void CleanUpNativeData(IntPtr pNativeData); - - void CleanUpManagedData(object ManagedObj); - - int GetNativeDataSize(); - } -} diff --git a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ICustomQueryInterface.cs b/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ICustomQueryInterface.cs deleted file mode 100644 index b0e6534aab..0000000000 --- a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ICustomQueryInterface.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. -// See the LICENSE file in the project root for more information. - -namespace System.Runtime.InteropServices -{ - /// - /// The enum of the return value of IQuerable.GetInterface. - /// - public enum CustomQueryInterfaceResult - { - Handled = 0, - NotHandled = 1, - Failed = 2, - } - - /// - /// the interface that be implemented by class that want to - /// customize the behavior of QueryInterface. - /// - public interface ICustomQueryInterface - { - CustomQueryInterfaceResult GetInterface([In]ref Guid iid, out IntPtr ppv); - } -} diff --git a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.cs b/src/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.cs index ed3d648586..5e9fd31081 100644 --- a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.cs +++ b/src/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.cs @@ -16,12 +16,6 @@ using System.StubHelpers; namespace System.Runtime.InteropServices { - public enum CustomQueryInterfaceMode - { - Ignore = 0, - Allow = 1 - } - /// /// This class contains methods that are mainly used to marshal between unmanaged /// and managed types. diff --git a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/UnknownWrapper.cs b/src/System.Private.CoreLib/src/System/Runtime/InteropServices/UnknownWrapper.cs deleted file mode 100644 index 4f5a6b3bcd..0000000000 --- a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/UnknownWrapper.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. -// See the LICENSE file in the project root for more information. - -namespace System.Runtime.InteropServices -{ - /// - /// Wrapper that is converted to a variant with VT_UNKNOWN. - /// - public sealed class UnknownWrapper - { - public UnknownWrapper(object obj) - { - m_WrappedObject = obj; - } - - public object WrappedObject => m_WrappedObject; - - private object m_WrappedObject; - } -} diff --git a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/VariantWrapper.cs b/src/System.Private.CoreLib/src/System/Runtime/InteropServices/VariantWrapper.cs deleted file mode 100644 index 0266987316..0000000000 --- a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/VariantWrapper.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. -// See the LICENSE file in the project root for more information. - -namespace System.Runtime.InteropServices -{ - /// - /// Wrapper that is converted to a variant with VT_BYREF | VT_VARIANT. - /// - public sealed class VariantWrapper - { - public VariantWrapper(object obj) - { - m_WrappedObject = obj; - } - - public object WrappedObject => m_WrappedObject; - - private object m_WrappedObject; - } -} -- cgit v1.2.3