microsoft / microsoft/win32metadata

The friendly overload for `SetEntriesInAcl()` is still not 100% correct.

Open
#2,167 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C++
Stars
1.5k
Forks
149
Avg merge
5d 16h
Merged PRs (30d)
4

Description

Actual behavior

This is a continuation of https://github.com/microsoft/CsWin32/issues/929 whereby the new signature for the friendly overload is internal static unsafe winmdroot.Foundation.WIN32_ERROR SetEntriesInAcl(ReadOnlySpan<winmdroot.Security.Authorization.EXPLICIT_ACCESS_W> pListOfExplicitEntries, winmdroot.Security.ACL? OldAcl, out winmdroot.Security.ACL* NewAcl).

Expected behavior

As the documentation says "A pointer to a variable that receives a pointer to the new ACL. If the function succeeds, you must call the LocalFree function to free the returned buffer.", the NewAcl parameter should be out LocalFreeSafeHandle NewAcl.

This SafeHandle type is already defined and established within CsWin32, there just might be some metadata needed to hook it up.

Repro steps

  1. NativeMethods.txt content:
SetEntriesInAcl
  1. NativeMethods.json content (if present): N/A

  2. Any of your own code that should be shared? N/A

Context
  • CsWin32 version: 0.3.253
  • Win32Metadata version (if explicitly set by project): N/A
  • Target Framework: net472
  • LangVersion (if explicitly set by project): N/A

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the SetEntriesInAcl entry generated from NativeMethods.txt and inspect the metadata that controls its friendly overload and the existing LocalFreeSafeHandle definition. Verify that the generated NewAcl parameter is out LocalFreeSafeHandle rather than an ACL pointer, then reproduce the result with the issue's NativeMethods.txt example and target framework.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.