<Compile Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\RuntimeHelpers.cs" />
<Compile Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\TypeDependencyAttribute.cs" />
<Compile Include="$(BclSourcesRoot)\System\Runtime\GcSettings.cs" />
- <Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ArrayWithOffset.cs" />
- <Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\Attributes.cs" />
- <Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\BStrWrapper.cs" />
<Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\COMException.cs" />
- <Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ComMemberType.cs" />
<Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ComTypes\IEnumerable.cs" />
<Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\CriticalHandle.CoreCLR.cs" />
- <Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\CurrencyWrapper.cs" />
- <Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ErrorWrapper.cs" />
<Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\Expando\IExpando.cs" />
<Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\GcHandle.cs" />
<Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\GCHandleCookieTable.cs" />
- <Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ICustomAdapter.cs" />
- <Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ICustomFactory.cs" />
- <Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ICustomMarshaler.cs" />
- <Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ICustomQueryInterface.cs" />
<Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\InvalidComObjectException.cs" />
<Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\InvalidOleVariantTypeException.cs" />
<Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\Marshal.cs" />
<Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\SafeArrayTypeMismatchException.cs" />
<Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\SafeHandle.cs" />
<Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\SEHException.cs" />
- <Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\UnknownWrapper.cs" />
- <Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\VariantWrapper.cs" />
<Compile Include="$(BclSourcesRoot)\System\Runtime\Loader\AssemblyLoadContext.cs" />
<Compile Include="$(BclSourcesRoot)\System\Runtime\MemoryFailPoint.cs" />
<Compile Include="$(BclSourcesRoot)\System\Runtime\Serialization\FormatterServices.cs" />
<Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\CustomMarshalers\EnumeratorViewOfEnumVariant.cs" />
<Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\CustomMarshalers\ExpandoToDispatchExMarshaler.cs" />
<Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\CustomMarshalers\TypeToTypeInfoMarshaler.cs" />
- <Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\DispatchWrapper.cs" />
<Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\IDispatch.cs" />
<Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\Attributes.cs" />
<Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\BindableVectorToCollectionAdapter.cs" />
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)
+++ /dev/null
-// 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;
- }
-}
+++ /dev/null
-// 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
-{
- /// <summary>
- /// Wrapper that is converted to a variant with VT_BSTR.
- /// </summary>
- 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;
- }
-}
+++ /dev/null
-// 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
- }
-}
+++ /dev/null
-// 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
-{
- /// <summary>
- /// Wrapper that is converted to a variant with VT_CURRENCY.
- /// </summary>
- 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;
- }
-}
+++ /dev/null
-// 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
-{
- /// <summary>
- /// Wrapper that is converted to a variant with VT_DISPATCH.
- /// </summary>
- 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;
- }
-}
+++ /dev/null
-// 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
-{
- /// <summary>
- /// Wrapper that is converted to a variant with VT_ERROR.
- /// </summary>
- 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;
- }
-}
+++ /dev/null
-// 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
-{
- /// <summary>
- /// The base interface that custom adapters can chose to implement
- /// when they want to expose the underlying object.
- /// </summary>
- public interface ICustomAdapter
- {
- [return: MarshalAs(UnmanagedType.IUnknown)] object GetUnderlyingObject();
- }
-}
+++ /dev/null
-// 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);
- }
-}
+++ /dev/null
-// 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
-{
- /// <summary>
- /// The base interface that must be implemented by all custom marshalers.
- /// </summary>
- public interface ICustomMarshaler
- {
- object MarshalNativeToManaged(IntPtr pNativeData);
-
- IntPtr MarshalManagedToNative(object ManagedObj);
-
- void CleanUpNativeData(IntPtr pNativeData);
-
- void CleanUpManagedData(object ManagedObj);
-
- int GetNativeDataSize();
- }
-}
+++ /dev/null
-// 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
-{
- /// <summary>
- /// The enum of the return value of IQuerable.GetInterface.
- /// </summary>
- public enum CustomQueryInterfaceResult
- {
- Handled = 0,
- NotHandled = 1,
- Failed = 2,
- }
-
- /// <summary>
- /// the interface that be implemented by class that want to
- /// customize the behavior of QueryInterface.
- /// </summary>
- public interface ICustomQueryInterface
- {
- CustomQueryInterfaceResult GetInterface([In]ref Guid iid, out IntPtr ppv);
- }
-}
namespace System.Runtime.InteropServices
{
- public enum CustomQueryInterfaceMode
- {
- Ignore = 0,
- Allow = 1
- }
-
/// <summary>
/// This class contains methods that are mainly used to marshal between unmanaged
/// and managed types.
+++ /dev/null
-// 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
-{
- /// <summary>
- /// Wrapper that is converted to a variant with VT_UNKNOWN.
- /// </summary>
- public sealed class UnknownWrapper
- {
- public UnknownWrapper(object obj)
- {
- m_WrappedObject = obj;
- }
-
- public object WrappedObject => m_WrappedObject;
-
- private object m_WrappedObject;
- }
-}
+++ /dev/null
-// 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
-{
- /// <summary>
- /// Wrapper that is converted to a variant with VT_BYREF | VT_VARIANT.
- /// </summary>
- public sealed class VariantWrapper
- {
- public VariantWrapper(object obj)
- {
- m_WrappedObject = obj;
- }
-
- public object WrappedObject => m_WrappedObject;
-
- private object m_WrappedObject;
- }
-}