Skip to content

PInvoke.CoRegisterClassObject not working in a NativeAOT, PackagedCom, ExeServer situation #1670

@catmanjan

Description

@catmanjan

I am calling PInvoke.CoRegisterClassObject for COM interop purposes.

My classes were never instantiated by the caller, so I tried defining my own import and it worked:

[LibraryImport("OLE32")]
[PreserveSig]
private static partial int CoRegisterClassObject(in Guid rclsid, nint pUnk, uint dwClsContext, uint flags, out uint lpdwRegister);

Is there some way I can instruct cswin32 to generate it in this working format? I'm not exactly sure what it is that is not making it work

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions