Skip to content

Commit 797274b

Browse files
IUnknown is also valid for IClassFactory (#89540)
1 parent 055a9f1 commit 797274b

File tree

1 file changed

+2
-1
lines changed
  • src/coreclr/System.Private.CoreLib/src/Internal/Runtime/InteropServices

1 file changed

+2
-1
lines changed

src/coreclr/System.Private.CoreLib/src/Internal/Runtime/InteropServices/ComActivator.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ private static object GetClassFactoryForType(ComActivationContext cxt)
123123
throw new NotSupportedException(SR.NotSupported_COM);
124124
}
125125

126-
if (cxt.InterfaceId != typeof(IClassFactory).GUID
126+
if (cxt.InterfaceId != Marshal.IID_IUnknown
127+
&& cxt.InterfaceId != typeof(IClassFactory).GUID
127128
&& cxt.InterfaceId != typeof(IClassFactory2).GUID)
128129
{
129130
throw new NotSupportedException();

0 commit comments

Comments
 (0)