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

"Pointers cannot reference marshaled structures. Use ByRef instead" caused by VariableLengthInlineArray #1218

Open
Nuklon opened this issue Jun 24, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@Nuklon
Copy link

Nuklon commented Jun 24, 2024

Actual behavior

Pointers cannot reference marshaled structures. Use ByRef instead.
Only happens on .NET Framework 472.
If you remove the public global::Windows.Win32.VariableLengthInlineArray<char> HardwareID; field from SP_DRVINFO_DETAIL_DATA_W it works correctly. It worked correctly in CsWin32 0.3.49.

Expected behavior

Work correctly.

Repro steps

  1. NativeMethods.txt content:
SetupDiGetDriverInfoDetail
  1. NativeMethods.json content (if present):
  1. Any of your own code that should be shared?

Context

  • CsWin32 version: 0.3.106
  • Win32Metadata version (if explicitly set by project): 61.0.15-preview
  • Target Framework: net472
@Nuklon Nuklon added the bug Something isn't working label Jun 24, 2024
@Zoraver
Copy link

Zoraver commented Aug 26, 2024

I am running into a similar issue when attempting to call CM_Register_Notification on .NET Framework 4.8 using CsWin32 0.3.106. This does not occur when targeting .NET 8.

@Zoraver
Copy link

Zoraver commented Aug 30, 2024

I believe that this issue is effectively a duplicate of #1184.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants