- 
                Notifications
    You must be signed in to change notification settings 
- Fork 114
Closed
Labels
Description
Actual behavior
When generating IPicture we get the following errors in the latest build:
Windows.Win32.IPicture.g.cs(87,36): error CS0082: Type 'IPicture' already reserves a member called 'set_hPal' with the same parameter types
Windows.Win32.IPicture.g.cs(379,37): error CS0082: Type 'IPicture.Interface' already reserves a member called 'set_hPal' with the same parameter types
It's generating the following:
winmdroot.System.Ole.OLE_HANDLE hPal
{
    get
    {
        fixed (IPicture* pThis = &this)
        {
            winmdroot.System.Ole.OLE_HANDLE __result;
            ((delegate *unmanaged [Stdcall]<IPicture*,winmdroot.System.Ole.OLE_HANDLE* ,winmdroot.Foundation.HRESULT>)lpVtbl[4])(pThis, &__result).ThrowOnFailure();
            return __result;
        }
    }
}It isn't doing [PreserveSig], while the setter is. Maybe something to do with the introduction of OLE_HANDLE?
Expected behavior
All methods are [PreserveSig] when "allowMarshalling" is false.
Repro steps
- NativeMethods.txtcontent:
IPicture
- NativeMethods.jsoncontent:
{
  "$schema": "https://aka.ms/CsWin32.schema.json",
  "allowMarshaling": false,
  "useSafeHandles": false
}Context
- CsWin32 version: 0.2.123-beta
- Target Framework: net8.0