Skip to content

Commit 4ca605a

Browse files
committed
PR feedback
1 parent a796341 commit 4ca605a

File tree

3 files changed

+27
-3
lines changed

3 files changed

+27
-3
lines changed

src/libraries/System.Private.CoreLib/src/ILLink/ILLink.Substitutions.Shared.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,14 @@
1818
<type fullname="System.Threading.Tasks.Task" feature="System.Diagnostics.Debugger.IsSupported" featurevalue="false">
1919
<field name="s_asyncDebuggingEnabled" value="false" initialize="false" />
2020
</type>
21-
<type fullname="System.Type" feature="System.Runtime.InteropServices.Marshal.IsComSupported" featurevalue="false">
21+
</assembly>
22+
<assembly fullname="System.Private.CoreLib" feature="System.Runtime.InteropServices.Marshal.IsComSupported" featurevalue="false">
23+
<type fullname="System.Type" >
2224
<method signature="System.Boolean get_IsCOMObject()" body="stub" value="false" />
2325
</type>
26+
<type fullname="System.Runtime.InteropServices.Marshal">
27+
<method signature="System.Boolean IsComObject(System.Object)" body="stub" value="false" />
28+
<method signature="System.Boolean IsTypeVisibleFromCom(System.Type)" body="stub" value="false" />
29+
</type>
2430
</assembly>
2531
</linker>

src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.NoCom.cs

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,24 @@ public static object GetUniqueObjectForIUnknown(IntPtr unknown)
195195
throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop);
196196
}
197197

198-
public static bool IsComObject(object o) => false;
198+
public static bool IsComObject(object o)
199+
{
200+
if (o is null)
201+
{
202+
throw new ArgumentNullException(nameof(o));
203+
}
204+
205+
return false;
206+
}
199207

200-
public static bool IsTypeVisibleFromCom(Type t) => false;
208+
public static bool IsTypeVisibleFromCom(Type t)
209+
{
210+
if (t is null)
211+
{
212+
throw new ArgumentNullException(nameof(t));
213+
}
214+
return false;
215+
}
201216

202217
internal static bool IsComSupported => false;
203218

src/mono/netcore/System.Private.CoreLib/src/System/RuntimeType.Mono.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2377,6 +2377,9 @@ public override Guid GUID
23772377
{
23782378
get
23792379
{
2380+
if (!Marshal.IsComSupported)
2381+
return Guid.Empty;
2382+
23802383
object[] att = GetCustomAttributes(typeof(System.Runtime.InteropServices.GuidAttribute), true);
23812384
if (att.Length == 0)
23822385
return Guid.Empty;

0 commit comments

Comments
 (0)