Description
It seems like there's no warning from the COM generator when declaring a P/Invoke returning a COM object through an interface that's using ComInterfaceOptions.ManagedObjectWrapper, despite the fact the marshalling will never possibly work.
cc. @jkoritzinsky
Reproduction Steps
Paste the following code and build:
public static partial class DXGI1_3
{
[LibraryImport("dxgi")]
public static partial void CreateDXGIFactory2(uint flags, in Guid riid, out IDXGIFactory6 ppFactory);
}
[Guid("C1B6694F-FF09-44A9-B03C-77900A0A1D17")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
[GeneratedComInterface(Options = ComInterfaceOptions.ManagedObjectWrapper)]
public partial interface IDXGIFactory6
{
}
Expected behavior
Some warning on the [LibraryImport] parameter, saying the interface is using invalid marshalling options.
Actual behavior
No warning, but the generated code will just never work.
Description
It seems like there's no warning from the COM generator when declaring a P/Invoke returning a COM object through an interface that's using
ComInterfaceOptions.ManagedObjectWrapper, despite the fact the marshalling will never possibly work.cc. @jkoritzinsky
Reproduction Steps
Paste the following code and build:
Expected behavior
Some warning on the
[LibraryImport]parameter, saying the interface is using invalid marshalling options.Actual behavior
No warning, but the generated code will just never work.