Skip to content

PInvoke000: HLOCAL return type not supported #884

@alexrp

Description

@alexrp

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions