Skip to content

Support [RAIIFree] on output parameters #1078

@AArnott

Description

@AArnott

Actual behavior

Given the following metadata definition of WlanOpenHandle:

public unsafe static extern uint WlanOpenHandle([In] uint dwClientVersion, [Optional][Reserved] void* pReserved, [Out] uint* pdwNegotiatedVersion, [Out][RAIIFree("WlanCloseHandle")] HANDLE* phClientHandle);

CsWin32 generates the following friendly overload:

internal static unsafe uint WlanOpenHandle(uint dwClientVersion, out uint pdwNegotiatedVersion, winmdroot.Foundation.HANDLE* phClientHandle)

Expected behavior

I expect the last parameter to be an out SafeHandle-derived type that calls WlanCloseHandle when released.

Metadata

Metadata

Assignees

No one assigned

    Labels

    metadata gemA feature of the metadata that cswin32 does not yet utilitze

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions