Skip to content

Safe overload of FwpmEngineOpen0 projects handle as SafeFileHandle despite no relation to file APIs #2172

@DoctorKrolic

Description

@DoctorKrolic

Actual behavior

The last parameter of native overload of FwpmEngineOpen0 is HANLE*. In the friendly overload it turns into out SafeFileHandle. Why file handle? This API has nothing to do with files and file-specific IsAsync API of that handle type throws cause the underlying handle is not a file handle in the first place.

Expected behavior

It doesn't seem like there is an existing non-abstract handle type that CsWin32 can use. Thus I believe it should emit its own SafeHANDLE class

Repro steps

  1. NativeMethods.txt content:
FwpmEngineOpen0

Context

  • CsWin32 version: 0.3.257
  • Win32Metadata version (if explicitly set by project): N/A
  • Target Framework: net10.0
  • LangVersion (if explicitly set by project): N/A

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