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

Improve bit fields support #987

Closed
Nuklon opened this issue Jul 6, 2023 · 2 comments · Fixed by #1113 or #1126
Closed

Improve bit fields support #987

Nuklon opened this issue Jul 6, 2023 · 2 comments · Fixed by #1113 or #1126
Assignees
Labels
bug Something isn't working metadata gem A feature of the metadata that cswin32 does not yet utilitze

Comments

@Nuklon
Copy link

Nuklon commented Jul 6, 2023

Actual behavior

This for example:
https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/d3dkmthk/ns-d3dkmthk-_d3dkmt_adaptertype

is generated as:

		[global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.3.18-beta+dc807e7787")]
		internal partial struct D3DKMT_ADAPTERTYPE
		{
			internal _Anonymous_e__Union Anonymous;

			[StructLayout(LayoutKind.Explicit)]
			[global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.3.18-beta+dc807e7787")]
			internal partial struct _Anonymous_e__Union
			{
				[FieldOffset(0)]
				internal _Anonymous_e__Struct Anonymous;

				[FieldOffset(0)]
				internal uint Value;

				[global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.3.18-beta+dc807e7787")]
				internal partial struct _Anonymous_e__Struct
				{
					internal uint _bitfield;
				}
			}
		}

Expected behavior

Generate helpers around Value for RenderSupported, DisplaySupported, etc.

Repro steps

  1. NativeMethods.txt content:
D3DKMT_ADAPTERTYPE

Context

  • CsWin32 version: 0.3.18-beta+dc807e7787
  • Target Framework: net 6.0
  • LangVersion (if explicitly set by project): latest
@Nuklon Nuklon added the bug Something isn't working label Jul 6, 2023
@AArnott AArnott added metadata gem A feature of the metadata that cswin32 does not yet utilitze and removed bug Something isn't working labels Jul 18, 2023
@AArnott
Copy link
Member

AArnott commented Jul 18, 2023

It looks like @mikebattista recently did work in microsoft/win32metadata#1620 to improve this. CsWin32 probably just has to leverage it.

@AArnott AArnott self-assigned this Jan 11, 2024
AArnott added a commit that referenced this issue Jan 12, 2024
AArnott added a commit that referenced this issue Jan 12, 2024
@AArnott AArnott reopened this Jan 16, 2024
@AArnott
Copy link
Member

AArnott commented Jan 16, 2024

Reactivating because there is lots to fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working metadata gem A feature of the metadata that cswin32 does not yet utilitze
Projects
None yet
2 participants