IUnknown is also valid for IClassFactory (#89540)
authorAaron Robinson <arobins@microsoft.com>
Thu, 27 Jul 2023 04:08:48 +0000 (21:08 -0700)
committerGitHub <noreply@github.com>
Thu, 27 Jul 2023 04:08:48 +0000 (21:08 -0700)
src/coreclr/System.Private.CoreLib/src/Internal/Runtime/InteropServices/ComActivator.cs

index bc06bf4..6d2fff2 100644 (file)
@@ -123,7 +123,8 @@ namespace Internal.Runtime.InteropServices
                 throw new NotSupportedException(SR.NotSupported_COM);
             }
 
-            if (cxt.InterfaceId != typeof(IClassFactory).GUID
+            if (cxt.InterfaceId != Marshal.IID_IUnknown
+                && cxt.InterfaceId != typeof(IClassFactory).GUID
                 && cxt.InterfaceId != typeof(IClassFactory2).GUID)
             {
                 throw new NotSupportedException();