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

OFNOTIFY metadata should be unified #1299

Closed
JeremyKuhne opened this issue Oct 8, 2022 · 2 comments
Closed

OFNOTIFY metadata should be unified #1299

JeremyKuhne opened this issue Oct 8, 2022 · 2 comments
Assignees
Labels

Comments

@JeremyKuhne
Copy link
Member

Currently we have:

[SupportedArchitecture(Architecture.X64 | Architecture.Arm64)]
public struct OFNOTIFYW
{
	public NMHDR hdr;
	public unsafe OPENFILENAMEW* lpOFN;
	public PWSTR pszFile;
}

[StructLayout(LayoutKind.Sequential, Pack = 1)]
[SupportedArchitecture(Windows.Win32.Interop.Architecture.X86)]
public struct OFNOTIFYW
{
	public NMHDR hdr;
	public unsafe OPENFILENAMEW* lpOFN;
	public PWSTR pszFile;
}

public struct NMHDR
{
	public HWND hwndFrom;
	public UIntPtr idFrom;
	public uint code;
}

Packing of 1 doesn't actually change the layout as there are no field gaps on 32 bit. Same goes for OFNOTIFYA, OFNOTIFYEXA, and OFNOTIFYEXW. This is preventing Windows Forms from consuming this type (through CSWin32) for our build (which is AnyCPU).

@mikebattista
Copy link
Collaborator

Related issue #613.

@mikebattista
Copy link
Collaborator

See #1300 (comment).

@mikebattista mikebattista closed this as not planned Won't fix, can't repro, duplicate, stale Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants