Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Members in COM structs should be public #723

Closed
JeremyKuhne opened this issue Oct 13, 2022 · 0 comments · Fixed by #726
Closed

Members in COM structs should be public #723

JeremyKuhne opened this issue Oct 13, 2022 · 0 comments · Fixed by #726
Assignees
Labels
enhancement New feature or request partner

Comments

@JeremyKuhne
Copy link
Member

Currently the COM structs generate members internal:

[Guid("00000000-0000-0000-C000-000000000046")]
[global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.2.84-beta+43c3f6d060")]
internal unsafe partial struct IUnknown
{
	/// <inheritdoc cref="QueryInterface(global::System.Guid*, void**)"/>
	internal unsafe winmdroot.Foundation.HRESULT QueryInterface(in global::System.Guid riid, out void* ppvObject)
	{

If the members are public it allows applying interfaces (notably the nested interface definitions) to the struct, which can allow constraining generic helpers to things like IUnknown.Interface if we (or CsWin32) apply it to the COM structs.

[Guid("00000000-0000-0000-C000-000000000046")]
[global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.2.84-beta+43c3f6d060")]
internal unsafe partial struct IUnknown : IUnkown.Interface
{
	/// <inheritdoc cref="QueryInterface(global::System.Guid*, void**)"/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request partner
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants