未验证 提交 11c08b50 编写于 作者: A Aaron Robinson 提交者: GitHub

Feedback from 38072 (#38155)

上级 a8d8b4a0
......@@ -43,6 +43,7 @@
<type fullname="System.Runtime.InteropServices.CustomMarshalers.*" />
<!-- Workaround for https://github.com/mono/linker/issues/378 -->
<type fullname="System.Runtime.InteropServices.IDispatch" />
<type fullname="System.Runtime.InteropServices.IMarshal" />
<type fullname="Internal.Runtime.InteropServices.IClassFactory2" />
<type fullname="System.Threading.ThreadPoolBoundHandle">
<!-- Workaround to keep .interfaceimpl even though this type
......
......@@ -746,7 +746,6 @@
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\InteropServices\ICustomMarshaler.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\InteropServices\ICustomQueryInterface.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\InteropServices\IDynamicInterfaceCastable.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\InteropServices\IMarshal.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\InteropServices\InAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\InteropServices\InterfaceTypeAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\InteropServices\InvalidComObjectException.cs" />
......
// 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
{
[ComImport]
[Guid("00000003-0000-0000-C000-000000000046")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
internal interface IMarshal
{
[PreserveSig]
int GetUnmarshalClass(ref Guid riid, IntPtr pv, int dwDestContext, IntPtr pvDestContext, int mshlflags, out Guid pCid);
[PreserveSig]
int GetMarshalSizeMax(ref Guid riid, IntPtr pv, int dwDestContext, IntPtr pvDestContext, int mshlflags, out int pSize);
[PreserveSig]
int MarshalInterface(IntPtr pStm, ref Guid riid, IntPtr pv, int dwDestContext, IntPtr pvDestContext, int mshlflags);
[PreserveSig]
int UnmarshalInterface(IntPtr pStm, ref Guid riid, out IntPtr ppv);
[PreserveSig]
int ReleaseMarshalData(IntPtr pStm);
[PreserveSig]
int DisconnectObject(int dwReserved);
}
}
......@@ -4,43 +4,10 @@
namespace System.Runtime.InteropServices
{
public class StandardOleMarshalObject : MarshalByRefObject, IMarshal
public class StandardOleMarshalObject : MarshalByRefObject
{
protected StandardOleMarshalObject()
{
}
int IMarshal.GetUnmarshalClass(ref Guid riid, IntPtr pv, int dwDestContext, IntPtr pvDestContext, int mshlflags, out Guid pCid)
{
pCid = Guid.Empty;
return HResults.E_NOTIMPL;
}
int IMarshal.GetMarshalSizeMax(ref Guid riid, IntPtr pv, int dwDestContext, IntPtr pvDestContext, int mshlflags, out int pSize)
{
pSize = -1;
return HResults.E_NOTIMPL;
}
int IMarshal.MarshalInterface(IntPtr pStm, ref Guid riid, IntPtr pv, int dwDestContext, IntPtr pvDestContext, int mshlflags)
{
return HResults.E_NOTIMPL;
}
int IMarshal.UnmarshalInterface(IntPtr pStm, ref Guid riid, out IntPtr ppv)
{
ppv = IntPtr.Zero;
return HResults.E_NOTIMPL;
}
int IMarshal.ReleaseMarshalData(IntPtr pStm)
{
return HResults.E_NOTIMPL;
}
int IMarshal.DisconnectObject(int dwReserved)
{
return HResults.E_NOTIMPL;
}
}
}
......@@ -118,4 +118,23 @@ int IMarshal.DisconnectObject(int dwReserved)
return HResults.E_NOTIMPL;
}
}
[ComImport]
[Guid("00000003-0000-0000-C000-000000000046")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
internal interface IMarshal
{
[PreserveSig]
int GetUnmarshalClass(ref Guid riid, IntPtr pv, int dwDestContext, IntPtr pvDestContext, int mshlflags, out Guid pCid);
[PreserveSig]
int GetMarshalSizeMax(ref Guid riid, IntPtr pv, int dwDestContext, IntPtr pvDestContext, int mshlflags, out int pSize);
[PreserveSig]
int MarshalInterface(IntPtr pStm, ref Guid riid, IntPtr pv, int dwDestContext, IntPtr pvDestContext, int mshlflags);
[PreserveSig]
int UnmarshalInterface(IntPtr pStm, ref Guid riid, out IntPtr ppv);
[PreserveSig]
int ReleaseMarshalData(IntPtr pStm);
[PreserveSig]
int DisconnectObject(int dwReserved);
}
}
<linker>
<assembly fullname="System.Runtime.InteropServices">
<!-- IMarshal is internal and never directly called, but needed by COM -->
<type fullname="System.Runtime.InteropServices.IMarshal" />
</assembly>
</linker>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册