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

NativeAOT can't marshal SAFEARRAY #41

Closed
RERASER opened this issue Dec 2, 2024 · 4 comments · Fixed by #42
Closed

NativeAOT can't marshal SAFEARRAY #41

RERASER opened this issue Dec 2, 2024 · 4 comments · Fixed by #42

Comments

@RERASER
Copy link

RERASER commented Dec 2, 2024

When I tested my code with NativeAOT, it threw an exception saying, 'Method '[WmiLight]WmiLight.NativeMethods.GetNames(native int, string[]&)' requires marshalling that is not yet supported by this compiler.'
We need to manually marshal the SAFEARRAY to the native method.

@MartinKuschnik
Copy link
Owner

Hi @RERASER,

thank you for reporting this bug! It seems to have been around for quite some time. Apparently, the GetPropertyNames method hasn't been used much in combination with NativeAOT.

Fortunately, the fix should be relatively straightforward. I expect to be able to provide a solution later today.

@MartinKuschnik MartinKuschnik linked a pull request Dec 3, 2024 that will close this issue
@MartinKuschnik
Copy link
Owner

Version 6.9.0 should resolve this issue. Please let us know if it works as expected.

@MartinKuschnik
Copy link
Owner

@RERASER Works?

@RERASER
Copy link
Author

RERASER commented Dec 6, 2024

Sorry for the late response. It works. Thanks for your work again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants