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

PInvoke000: HLOCAL return type not supported #884

Closed
alexrp opened this issue Mar 15, 2023 · 1 comment · Fixed by #889
Closed

PInvoke000: HLOCAL return type not supported #884

alexrp opened this issue Mar 15, 2023 · 1 comment · Fixed by #889
Labels
bug Something isn't working

Comments

@alexrp
Copy link

alexrp commented Mar 15, 2023

Actual behavior

error PInvoke000: An internal error occurred: Failed while generating extern method: LocalFree. Failed while generating SafeHandle for LocalFree. Return type HLOCAL on release method LocalFree not supported.

This happens when using LocalFree with newer Microsoft.Windows.SDK.Win32Metadata packages. Older packages were fine.

Expected behavior

It should work.

Repro steps

  1. NativeMethods.txt content:
LocalFree
  1. NativeMethods.json content (if present):
{
  "className": "WindowsPInvoke",
  "allowMarshaling": false,
  "wideCharOnly": false,
  "emitSingleFile": true
}

Context

  • CsWin32 version: 0.2.188-beta
  • Win32Metadata version (if explicitly set by project): 45.0.21-preview
  • Target Framework: net7.0
  • LangVersion (if explicitly set by project): latest
@alexrp alexrp added the bug Something isn't working label Mar 15, 2023
@AArnott
Copy link
Member

AArnott commented Mar 15, 2023

Thanks for reporting. It's actually quite common for newer metadata versions to include breaking changes that CsWin32 must accommodate. We can keep this issue active till CsWin32 ships an update that references the new metadata.

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

Successfully merging a pull request may close this issue.

2 participants