Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3223,6 +3223,9 @@
<data name="RuntimeWrappedException" xml:space="preserve">
<value>An object that does not derive from System.Exception has been wrapped in a RuntimeWrappedException.</value>
</data>
<data name="StandardOleMarshalObjectGetMarshalerFailed" xml:space="preserve">
<value>Failed to get marshaler for IID {0}.</value>
</data>
<data name="Security_CannotReadFileData" xml:space="preserve">
<value>The time zone ID '{0}' was found on the local computer, but the application does not have permission to read the file.</value>
</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,7 @@
<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" />
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be in the Windows-specific block.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You also need to move the linker directives in src\libraries\System.Runtime.InteropServices\src\ILLinkTrim.xml . Otherwise, this will be broken.

We do not seem to have any tests for this, so the fact that it is broken will be noticed only the change hits WinForms/WPF repos that depend on this type. Could you please get this fixed asap?

<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\InteropServices\InAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\InteropServices\InterfaceTypeAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\InteropServices\InvalidComObjectException.cs" />
Expand Down Expand Up @@ -1527,6 +1528,9 @@
<Compile Include="$(CommonPath)Interop\Windows\Ole32\Interop.CoCreateGuid.cs">
<Link>Common\Interop\Windows\Ole32\Interop.CoCreateGuid.cs</Link>
</Compile>
<Compile Include="$(CommonPath)\Interop\Windows\Ole32\Interop.CoGetStandardMarshal.cs">
<Link>Common\Interop\Windows\Ole32\Interop.CoGetStandardMarshal.cs</Link>
</Compile>
<Compile Include="$(CommonPath)Interop\Windows\Secur32\Interop.GetUserNameExW.cs">
<Link>Common\Interop\Windows\Secur32\Interop.GetUserNameExW.cs</Link>
</Compile>
Expand Down Expand Up @@ -1583,6 +1587,7 @@
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\Loader\LibraryNameVariation.Windows.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\MemoryFailPoint.Windows.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\InteropServices\Marshal.Windows.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\InteropServices\StandardOleMarshalObject.Windows.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\Versioning\VersioningHelper.Windows.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Security\SecureString.Windows.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Threading\Thread.Windows.cs" />
Expand Down Expand Up @@ -1794,6 +1799,7 @@
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\Loader\LibraryNameVariation.Unix.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\MemoryFailPoint.Unix.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\InteropServices\Marshal.Unix.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\InteropServices\StandardOleMarshalObject.Unix.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\Versioning\VersioningHelper.Unix.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Security\SecureString.Unix.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Threading\Thread.Unix.cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// 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 class StandardOleMarshalObject : MarshalByRefObject, IMarshal
{
protected StandardOleMarshalObject()
{
}

int IMarshal.GetUnmarshalClass(ref Guid riid, IntPtr pv, int dwDestContext, IntPtr pvDestContext, int mshlflags, out Guid pCid)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None of these implementation methods are needed. IMarshal is internal interface used just for COM; and COM is not supported on Unix.

This should be just a dummy type with just a constructor.

{
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;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,4 @@
<data name="InvalidOperation_NoDispIdAttribute" xml:space="preserve">
<value>Event invocation for COM objects requires event to be attributed with DispIdAttribute.</value>
</data>
<data name="StandardOleMarshalObjectGetMarshalerFailed" xml:space="preserve">
<value>Failed to get marshaler for IID {0}.</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,10 @@
<AssemblyName>System.Runtime.InteropServices</AssemblyName>
<OutputType>Library</OutputType>
<IsPartialFacadeAssembly>true</IsPartialFacadeAssembly>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Nullable>enable</Nullable>
<TargetFrameworks>$(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix</TargetFrameworks>
<TargetFrameworks>$(NetCoreAppCurrent)</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(CommonPath)System\HResults.cs"
Link="Common\System\HResults.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Interop.Libraries.cs"
Link="Common\Interop\Interop.Libraries.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Ole32\Interop.CoGetStandardMarshal.cs"
Link="Common\Interop\Windows\Ole32\Interop.CoGetStandardMarshal.cs" />
<Compile Include="System\Runtime\CompilerServices\IDispatchConstantAttribute.cs" />
<Compile Include="System\Runtime\CompilerServices\IUnknownConstantAttribute.cs" />
<Compile Include="System\Runtime\InteropServices\ComTypes\ADVF.cs" />
Expand All @@ -39,14 +32,12 @@
<Compile Include="System\Runtime\InteropServices\HandleCollector.cs" />
<Compile Include="System\Runtime\InteropServices\IDispatchImplAttribute.cs" />
<Compile Include="System\Runtime\InteropServices\IDispatchImplType.cs" />
<Compile Include="System\Runtime\InteropServices\IMarshal.cs" />
<Compile Include="System\Runtime\InteropServices\ImportedFromTypeLibAttribute.cs" />
<Compile Include="System\Runtime\InteropServices\ManagedToNativeComInteropStubAttribute.cs" />
<Compile Include="System\Runtime\InteropServices\PrimaryInteropAssemblyAttribute.cs" />
<Compile Include="System\Runtime\InteropServices\RegistrationClassContext.cs" />
<Compile Include="System\Runtime\InteropServices\RegistrationConnectionType.cs" />
<Compile Include="System\Runtime\InteropServices\RuntimeEnvironment.cs" />
<Compile Include="System\Runtime\InteropServices\StandardOleMarshalObject.cs" />
<Compile Include="System\Runtime\InteropServices\SetWin32ContextInIDispatchAttribute.cs" />
<Compile Include="System\Runtime\InteropServices\TypeLibFuncAttribute.cs" />
<Compile Include="System\Runtime\InteropServices\TypeLibFuncFlags.cs" />
Expand All @@ -60,6 +51,5 @@
</ItemGroup>
<ItemGroup>
<ReferenceFromRuntime Include="System.Private.CoreLib" />
<ProjectReference Include="..\..\System.Runtime.Extensions\src\System.Runtime.Extensions.csproj" />
</ItemGroup>
</Project>