Skip to content

Commit b9df364

Browse files
authored
Move COM source generator APIs to System.Runtime.InteropServices.dll (#84329)
1 parent 18e9c66 commit b9df364

26 files changed

+559
-117
lines changed

src/libraries/NetCoreAppLibrary.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@
183183
</NetCoreAppLibraryNoReference>
184184
<!-- List .NETCoreApp shared framework generator project names below. -->
185185
<NetCoreAppLibraryGenerator>
186+
ComInterfaceGenerator;
186187
LibraryImportGenerator;
187188
JSImportGenerator;
188189
Microsoft.Interop.SourceGeneration;

src/libraries/System.Runtime.InteropServices/System.Runtime.InteropServices.sln

Lines changed: 354 additions & 64 deletions
Large diffs are not rendered by default.

src/libraries/System.Runtime.InteropServices/ref/System.Runtime.InteropServices.cs

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,144 @@ public enum TYMED
323323
TYMED_ENHMF = 64,
324324
}
325325
}
326+
namespace System.Runtime.InteropServices.Marshalling
327+
{
328+
[System.AttributeUsageAttribute(System.AttributeTargets.Class, Inherited = false)]
329+
[System.CLSCompliantAttribute(false)]
330+
public sealed partial class ComExposedClassAttribute<T> : System.Attribute, System.Runtime.InteropServices.Marshalling.IComExposedDetails where T : System.Runtime.InteropServices.Marshalling.IComExposedClass
331+
{
332+
public ComExposedClassAttribute() { }
333+
public unsafe System.Runtime.InteropServices.ComWrappers.ComInterfaceEntry* GetComInterfaceEntries(out int count) { throw null; }
334+
}
335+
public sealed partial class ComObject : System.Runtime.InteropServices.IDynamicInterfaceCastable, System.Runtime.InteropServices.Marshalling.IUnmanagedVirtualMethodTableProvider
336+
{
337+
internal ComObject() { }
338+
public void FinalRelease() { }
339+
~ComObject() { }
340+
System.RuntimeTypeHandle System.Runtime.InteropServices.IDynamicInterfaceCastable.GetInterfaceImplementation(System.RuntimeTypeHandle interfaceType) { throw null; }
341+
bool System.Runtime.InteropServices.IDynamicInterfaceCastable.IsInterfaceImplemented(System.RuntimeTypeHandle interfaceType, bool throwIfNotImplemented) { throw null; }
342+
System.Runtime.InteropServices.Marshalling.VirtualMethodTableInfo System.Runtime.InteropServices.Marshalling.IUnmanagedVirtualMethodTableProvider.GetVirtualMethodTableInfoForKey(System.Type type) { throw null; }
343+
}
344+
[System.Runtime.InteropServices.Marshalling.CustomMarshallerAttribute(typeof(System.Exception), System.Runtime.InteropServices.Marshalling.MarshalMode.UnmanagedToManagedOut, typeof(System.Runtime.InteropServices.Marshalling.ExceptionAsDefaultMarshaller<>))]
345+
public static partial class ExceptionAsDefaultMarshaller<T> where T : struct
346+
{
347+
public static T ConvertToUnmanaged(System.Exception e) { throw null; }
348+
}
349+
[System.Runtime.InteropServices.Marshalling.CustomMarshallerAttribute(typeof(System.Exception), System.Runtime.InteropServices.Marshalling.MarshalMode.UnmanagedToManagedOut, typeof(System.Runtime.InteropServices.Marshalling.ExceptionAsHResultMarshaller<>))]
350+
public static partial class ExceptionAsHResultMarshaller<T> where T : struct
351+
{
352+
public static T ConvertToUnmanaged(System.Exception e) { throw null; }
353+
}
354+
[System.Runtime.InteropServices.Marshalling.CustomMarshallerAttribute(typeof(System.Exception), System.Runtime.InteropServices.Marshalling.MarshalMode.UnmanagedToManagedOut, typeof(System.Runtime.InteropServices.Marshalling.ExceptionAsNaNMarshaller<>))]
355+
public static partial class ExceptionAsNaNMarshaller<T> where T : struct
356+
{
357+
public static T ConvertToUnmanaged(System.Exception e) { throw null; }
358+
}
359+
[System.Runtime.InteropServices.Marshalling.CustomMarshallerAttribute(typeof(System.Exception), System.Runtime.InteropServices.Marshalling.MarshalMode.UnmanagedToManagedOut, typeof(System.Runtime.InteropServices.Marshalling.ExceptionAsVoidMarshaller))]
360+
public static partial class ExceptionAsVoidMarshaller
361+
{
362+
public static void ConvertToUnmanaged(System.Exception e) { }
363+
}
364+
[System.AttributeUsageAttribute(System.AttributeTargets.Class)]
365+
public sealed partial class GeneratedComClassAttribute : System.Attribute
366+
{
367+
public GeneratedComClassAttribute() { }
368+
}
369+
[System.AttributeUsageAttribute(System.AttributeTargets.Interface)]
370+
public partial class GeneratedComInterfaceAttribute : System.Attribute
371+
{
372+
public GeneratedComInterfaceAttribute() { }
373+
}
374+
[System.CLSCompliantAttribute(false)]
375+
public partial interface IComExposedClass
376+
{
377+
unsafe static abstract System.Runtime.InteropServices.ComWrappers.ComInterfaceEntry* GetComInterfaceEntries(out int count);
378+
}
379+
[System.CLSCompliantAttribute(false)]
380+
public partial interface IComExposedDetails
381+
{
382+
unsafe System.Runtime.InteropServices.ComWrappers.ComInterfaceEntry* GetComInterfaceEntries(out int count);
383+
}
384+
[System.CLSCompliantAttribute(false)]
385+
public partial interface IIUnknownCacheStrategy
386+
{
387+
void Clear(System.Runtime.InteropServices.Marshalling.IIUnknownStrategy unknownStrategy);
388+
unsafe System.Runtime.InteropServices.Marshalling.IIUnknownCacheStrategy.TableInfo ConstructTableInfo(System.RuntimeTypeHandle handle, System.Runtime.InteropServices.Marshalling.IIUnknownDerivedDetails interfaceDetails, void* ptr);
389+
bool TryGetTableInfo(System.RuntimeTypeHandle handle, out System.Runtime.InteropServices.Marshalling.IIUnknownCacheStrategy.TableInfo info);
390+
bool TrySetTableInfo(System.RuntimeTypeHandle handle, System.Runtime.InteropServices.Marshalling.IIUnknownCacheStrategy.TableInfo info);
391+
public readonly partial struct TableInfo
392+
{
393+
private readonly object _dummy;
394+
private readonly int _dummyPrimitive;
395+
public System.RuntimeTypeHandle ManagedType { get { throw null; } init { } }
396+
public unsafe void** Table { get { throw null; } init { } }
397+
public unsafe void* ThisPtr { get { throw null; } init { } }
398+
}
399+
}
400+
[System.CLSCompliantAttribute(false)]
401+
public partial interface IIUnknownDerivedDetails
402+
{
403+
System.Guid Iid { get; }
404+
System.Type Implementation { get; }
405+
unsafe void** ManagedVirtualMethodTable { get; }
406+
}
407+
[System.CLSCompliantAttribute(false)]
408+
public partial interface IIUnknownInterfaceDetailsStrategy
409+
{
410+
System.Runtime.InteropServices.Marshalling.IComExposedDetails? GetComExposedTypeDetails(System.RuntimeTypeHandle type);
411+
System.Runtime.InteropServices.Marshalling.IIUnknownDerivedDetails? GetIUnknownDerivedDetails(System.RuntimeTypeHandle type);
412+
}
413+
[System.CLSCompliantAttribute(false)]
414+
public partial interface IIUnknownInterfaceType
415+
{
416+
static abstract System.Guid Iid { get; }
417+
unsafe static abstract void** ManagedVirtualMethodTable { get; }
418+
}
419+
[System.CLSCompliantAttribute(false)]
420+
public partial interface IIUnknownStrategy
421+
{
422+
unsafe void* CreateInstancePointer(void* unknown);
423+
unsafe int QueryInterface(void* instancePtr, in System.Guid iid, out void* ppObj);
424+
unsafe int Release(void* instancePtr);
425+
}
426+
[System.AttributeUsageAttribute(System.AttributeTargets.Interface, Inherited = false)]
427+
[System.CLSCompliantAttribute(false)]
428+
public partial class IUnknownDerivedAttribute<T, TImpl> : System.Attribute, System.Runtime.InteropServices.Marshalling.IIUnknownDerivedDetails where T : System.Runtime.InteropServices.Marshalling.IIUnknownInterfaceType
429+
{
430+
public IUnknownDerivedAttribute() { }
431+
public System.Guid Iid { get { throw null; } }
432+
public System.Type Implementation { get { throw null; } }
433+
public unsafe void** ManagedVirtualMethodTable { get { throw null; } }
434+
}
435+
[System.CLSCompliantAttribute(false)]
436+
public partial interface IUnmanagedVirtualMethodTableProvider
437+
{
438+
System.Runtime.InteropServices.Marshalling.VirtualMethodTableInfo GetVirtualMethodTableInfoForKey(System.Type type);
439+
}
440+
[System.CLSCompliantAttribute(false)]
441+
public partial class StrategyBasedComWrappers : System.Runtime.InteropServices.ComWrappers
442+
{
443+
public StrategyBasedComWrappers() { }
444+
public static System.Runtime.InteropServices.Marshalling.IIUnknownInterfaceDetailsStrategy DefaultIUnknownInterfaceDetailsStrategy { get { throw null; } }
445+
public static System.Runtime.InteropServices.Marshalling.IIUnknownStrategy DefaultIUnknownStrategy { get { throw null; } }
446+
protected unsafe sealed override System.Runtime.InteropServices.ComWrappers.ComInterfaceEntry* ComputeVtables(object obj, System.Runtime.InteropServices.CreateComInterfaceFlags flags, out int count) { throw null; }
447+
protected virtual System.Runtime.InteropServices.Marshalling.IIUnknownCacheStrategy CreateCacheStrategy() { throw null; }
448+
protected static System.Runtime.InteropServices.Marshalling.IIUnknownCacheStrategy CreateDefaultCacheStrategy() { throw null; }
449+
protected sealed override object CreateObject(nint externalComObject, System.Runtime.InteropServices.CreateObjectFlags flags) { throw null; }
450+
protected virtual System.Runtime.InteropServices.Marshalling.IIUnknownInterfaceDetailsStrategy GetOrCreateInterfaceDetailsStrategy() { throw null; }
451+
protected virtual System.Runtime.InteropServices.Marshalling.IIUnknownStrategy GetOrCreateIUnknownStrategy() { throw null; }
452+
protected sealed override void ReleaseObjects(System.Collections.IEnumerable objects) { }
453+
}
454+
[System.CLSCompliantAttribute(false)]
455+
public readonly partial struct VirtualMethodTableInfo
456+
{
457+
private readonly int _dummyPrimitive;
458+
public unsafe VirtualMethodTableInfo(void* thisPointer, void** virtualMethodTable) { throw null; }
459+
public unsafe void* ThisPointer { get { throw null; } }
460+
public unsafe void** VirtualMethodTable { get { throw null; } }
461+
public unsafe void Deconstruct(out void* thisPointer, out void** virtualMethodTable) { throw null; }
462+
}
463+
}
326464
namespace System.Security
327465
{
328466
public static partial class SecureStringMarshal

src/libraries/System.Runtime.InteropServices/src/System.Runtime.InteropServices.csproj

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,28 @@
3131
<Compile Include="System\Runtime\InteropServices\HandleCollector.cs" />
3232
<Compile Include="System\Runtime\InteropServices\ImportedFromTypeLibAttribute.cs" />
3333
<Compile Include="System\Runtime\InteropServices\ManagedToNativeComInteropStubAttribute.cs" />
34+
<Compile Include="System\Runtime\InteropServices\Marshalling\ComExposedClassAttribute.cs" />
35+
<Compile Include="System\Runtime\InteropServices\Marshalling\ComObject.cs" />
36+
<Compile Include="System\Runtime\InteropServices\Marshalling\DefaultCaching.cs" />
37+
<Compile Include="System\Runtime\InteropServices\Marshalling\DefaultIUnknownInterfaceDetailsStrategy.cs" />
38+
<Compile Include="System\Runtime\InteropServices\Marshalling\ExceptionAsDefaultMarshaller.cs" />
39+
<Compile Include="System\Runtime\InteropServices\Marshalling\ExceptionAsHResultMarshaller.cs" />
40+
<Compile Include="System\Runtime\InteropServices\Marshalling\ExceptionAsNaNMarshaller.cs" />
41+
<Compile Include="System\Runtime\InteropServices\Marshalling\ExceptionAsVoidMarshaller.cs" />
42+
<Compile Include="System\Runtime\InteropServices\Marshalling\FreeThreadedStrategy.cs" />
43+
<Compile Include="System\Runtime\InteropServices\Marshalling\GeneratedComClassAttribute.cs" />
44+
<Compile Include="System\Runtime\InteropServices\Marshalling\GeneratedComInterfaceAttribute.cs" />
45+
<Compile Include="System\Runtime\InteropServices\Marshalling\IComExposedClass.cs" />
46+
<Compile Include="System\Runtime\InteropServices\Marshalling\IComExposedDetails.cs" />
47+
<Compile Include="System\Runtime\InteropServices\Marshalling\IIUnknownCacheStrategy.cs" />
48+
<Compile Include="System\Runtime\InteropServices\Marshalling\IIUnknownDerivedDetails.cs" />
49+
<Compile Include="System\Runtime\InteropServices\Marshalling\IIUnknownInterfaceDetailsStrategy.cs" />
50+
<Compile Include="System\Runtime\InteropServices\Marshalling\IIUnknownInterfaceType.cs" />
51+
<Compile Include="System\Runtime\InteropServices\Marshalling\IIUnknownStrategy.cs" />
52+
<Compile Include="System\Runtime\InteropServices\Marshalling\IUnknownDerivedAttribute.cs" />
53+
<Compile Include="System\Runtime\InteropServices\Marshalling\IUnmanagedVirtualMethodTableProvider.cs" />
54+
<Compile Include="System\Runtime\InteropServices\Marshalling\StrategyBasedComWrappers.cs" />
55+
<Compile Include="System\Runtime\InteropServices\Marshalling\VirtualMethodTableInfo.cs" />
3456
<Compile Include="System\Runtime\InteropServices\PrimaryInteropAssemblyAttribute.cs" />
3557
<Compile Include="System\Runtime\InteropServices\RegistrationClassContext.cs" />
3658
<Compile Include="System\Runtime\InteropServices\RegistrationConnectionType.cs" />
@@ -49,6 +71,7 @@
4971

5072
<ItemGroup>
5173
<ProjectReference Include="$(CoreLibProject)" />
74+
<ProjectReference Include="$(LibrariesProjectRoot)System.Collections.Concurrent\src\System.Collections.Concurrent.csproj" />
5275
</ItemGroup>
5376

5477
</Project>

src/libraries/System.Runtime.InteropServices/tests/Ancillary.Interop/ComExposedClassAttribute.cs renamed to src/libraries/System.Runtime.InteropServices/src/System/Runtime/InteropServices/Marshalling/ComExposedClassAttribute.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
using System;
5-
using System.Collections.Generic;
6-
using System.Linq;
7-
using System.Text;
8-
using System.Threading.Tasks;
9-
104
namespace System.Runtime.InteropServices.Marshalling
115
{
126
/// <summary>
137
/// An attribute to mark this class as a type whose instances should be exposed to COM.
148
/// </summary>
159
/// <typeparam name="T">The type that provides information about how to expose the attributed type to COM.</typeparam>
1610
[AttributeUsage(AttributeTargets.Class, Inherited = false)]
11+
[CLSCompliant(false)]
1712
public sealed class ComExposedClassAttribute<T> : Attribute, IComExposedDetails
1813
where T : IComExposedClass
1914
{

src/libraries/System.Runtime.InteropServices/tests/Ancillary.Interop/ComObject.cs renamed to src/libraries/System.Runtime.InteropServices/src/System/Runtime/InteropServices/Marshalling/ComObject.cs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,23 @@ internal ComObject(IIUnknownInterfaceDetailsStrategy interfaceDetailsStrategy, I
5151
/// </summary>
5252
private IIUnknownCacheStrategy CacheStrategy { get; }
5353

54+
internal bool UniqueInstance { get; init; }
55+
5456
/// <summary>
55-
/// Returns an IDisposable that can be used to perform a final release
56-
/// on this COM object wrapper.
57+
/// Releases all references owned by this ComObject if it is a unique instance.
5758
/// </summary>
5859
/// <remarks>
59-
/// This property will only be non-null if the ComObject was created using
60+
/// This method does nothing if the ComObject was not created with
6061
/// CreateObjectFlags.UniqueInstance.
6162
/// </remarks>
62-
public IDisposable? FinalRelease { get; internal init; }
63+
public void FinalRelease()
64+
{
65+
if (UniqueInstance)
66+
{
67+
CacheStrategy.Clear(IUnknownStrategy);
68+
IUnknownStrategy.Release(_instancePointer);
69+
}
70+
}
6371

6472
/// <inheritdoc />
6573
RuntimeTypeHandle IDynamicInterfaceCastable.GetInterfaceImplementation(RuntimeTypeHandle interfaceType)

src/libraries/System.Runtime.InteropServices/tests/Ancillary.Interop/ExceptionAsDefaultMarshaller.cs renamed to src/libraries/System.Runtime.InteropServices/src/System/Runtime/InteropServices/Marshalling/ExceptionAsDefaultMarshaller.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
using System;
5-
using System.Collections.Generic;
6-
using System.Linq;
7-
using System.Numerics;
8-
using System.Text;
9-
using System.Threading.Tasks;
10-
114
namespace System.Runtime.InteropServices.Marshalling
125
{
136
/// <summary>

src/libraries/System.Runtime.InteropServices/tests/Ancillary.Interop/ExceptionAsHResultMarshaller.cs renamed to src/libraries/System.Runtime.InteropServices/src/System/Runtime/InteropServices/Marshalling/ExceptionAsHResultMarshaller.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
using System;
5-
using System.Collections.Generic;
6-
using System.Linq;
74
using System.Numerics;
8-
using System.Text;
9-
using System.Threading.Tasks;
105

116
// This type is only needed for the VTable source generator or to provide abstract concepts that the COM generator would use under the hood.
127
// These are types that we can exclude from the API proposals and either inline into the generated code, provide as file-scoped types, or not provide publicly (indicated by comments on each type).

src/libraries/System.Runtime.InteropServices/tests/Ancillary.Interop/ExceptionAsNaNMarshaller.cs renamed to src/libraries/System.Runtime.InteropServices/src/System/Runtime/InteropServices/Marshalling/ExceptionAsNaNMarshaller.cs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,23 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
using System;
5-
using System.Collections.Generic;
6-
using System.Linq;
74
using System.Numerics;
8-
using System.Text;
9-
using System.Threading.Tasks;
105

116
namespace System.Runtime.InteropServices.Marshalling
127
{
138
/// <summary>
14-
/// Converts all exceptions to <see cref="T.NaN"/>.
9+
/// Converts all exceptions to <see cref="IFloatingPointIeee754{T}.NaN"/>.
1510
/// </summary>
1611
/// <typeparam name="T">The unmanaged type to return the <c>NaN</c> value for.</typeparam>
1712
[CustomMarshaller(typeof(Exception), MarshalMode.UnmanagedToManagedOut, typeof(ExceptionAsNaNMarshaller<>))]
1813
public static class ExceptionAsNaNMarshaller<T>
1914
where T : unmanaged, IFloatingPointIeee754<T>
2015
{
2116
/// <summary>
22-
/// Convert the exception to <see cref="T.NaN"/>.
17+
/// Convert the exception to <see cref="IFloatingPointIeee754{T}.NaN"/>.
2318
/// </summary>
2419
/// <param name="e">The exception</param>
25-
/// <returns><see cref="T.NaN"/>.</returns>
20+
/// <returns><see cref="IFloatingPointIeee754{T}.NaN"/>.</returns>
2621
public static T ConvertToUnmanaged(Exception e)
2722
{
2823
// Use GetHRForException to ensure the runtime sets up the IErrorInfo object

src/libraries/System.Runtime.InteropServices/tests/Ancillary.Interop/ExceptionAsVoidMarshaller.cs renamed to src/libraries/System.Runtime.InteropServices/src/System/Runtime/InteropServices/Marshalling/ExceptionAsVoidMarshaller.cs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
using System;
5-
using System.Collections.Generic;
6-
using System.Linq;
7-
using System.Numerics;
8-
using System.Text;
9-
using System.Threading.Tasks;
10-
114
namespace System.Runtime.InteropServices.Marshalling
125
{
136
/// <summary>
147
/// Marshaller that swallows the exception.
158
/// </summary>
9+
#pragma warning disable SYSLIB1057 // Marshaller type does not have the required shape
10+
// This marshaller has 'void' as the unmanaged type,
11+
// which is technically invalid but is the correct type for this case.
12+
// This scenario is specially handled for exception marshalling to make this work.
1613
[CustomMarshaller(typeof(Exception), MarshalMode.UnmanagedToManagedOut, typeof(ExceptionAsVoidMarshaller))]
14+
#pragma warning restore SYSLIB1057 // Marshaller type does not have the required shape
1715
public static class ExceptionAsVoidMarshaller
1816
{
1917
/// <summary>

src/libraries/System.Runtime.InteropServices/tests/Ancillary.Interop/GeneratedComClassAttribute.cs renamed to src/libraries/System.Runtime.InteropServices/src/System/Runtime/InteropServices/Marshalling/GeneratedComClassAttribute.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
using System;
5-
64
namespace System.Runtime.InteropServices.Marshalling
75
{
86
[AttributeUsage(AttributeTargets.Class)]

src/libraries/System.Runtime.InteropServices/tests/Ancillary.Interop/IComExposedClass.cs renamed to src/libraries/System.Runtime.InteropServices/src/System/Runtime/InteropServices/Marshalling/IComExposedClass.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ namespace System.Runtime.InteropServices.Marshalling
66
/// <summary>
77
/// Type level information for managed class types exposed to COM.
88
/// </summary>
9+
[CLSCompliant(false)]
910
public unsafe interface IComExposedClass
1011
{
1112
/// <summary>

src/libraries/System.Runtime.InteropServices/tests/Ancillary.Interop/IComExposedDetails.cs renamed to src/libraries/System.Runtime.InteropServices/src/System/Runtime/InteropServices/Marshalling/IComExposedDetails.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
using System;
54
using System.Reflection;
65

76
namespace System.Runtime.InteropServices.Marshalling
87
{
98
/// <summary>
109
/// Details about a managed class type exposed to COM.
1110
/// </summary>
11+
[CLSCompliant(false)]
1212
public unsafe interface IComExposedDetails
1313
{
1414
/// <summary>

src/libraries/System.Runtime.InteropServices/tests/Ancillary.Interop/IIUnknownCacheStrategy.cs renamed to src/libraries/System.Runtime.InteropServices/src/System/Runtime/InteropServices/Marshalling/IIUnknownCacheStrategy.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ namespace System.Runtime.InteropServices.Marshalling
99
/// <summary>
1010
/// Unmanaged virtual method table look up strategy.
1111
/// </summary>
12+
[CLSCompliant(false)]
1213
public unsafe interface IIUnknownCacheStrategy
1314
{
1415
public readonly struct TableInfo
@@ -22,9 +23,9 @@ public readonly struct TableInfo
2223
/// Construct a <see cref="TableInfo"/> instance.
2324
/// </summary>
2425
/// <param name="handle">RuntimeTypeHandle instance</param>
26+
/// <param name="interfaceDetails">An <see cref="IIUnknownDerivedDetails"/> instance</param>
2527
/// <param name="ptr">Pointer to the instance to query</param>
26-
/// <param name="info">A <see cref="TableInfo"/> instance</param>
27-
/// <returns>True if success, otherwise false.</returns>
28+
/// <returns>The constructed <see cref="TableInfo"/> instance for the provided information.</returns>
2829
TableInfo ConstructTableInfo(RuntimeTypeHandle handle, IIUnknownDerivedDetails interfaceDetails, void* ptr);
2930

3031
/// <summary>

0 commit comments

Comments
 (0)