Skip to content

Accept raw REGSAM access masks in open/create key helpers#641

Draft
benhillis wants to merge 1 commit into
microsoft:masterfrom
benhillis:reg-regsam-access
Draft

Accept raw REGSAM access masks in open/create key helpers#641
benhillis wants to merge 1 commit into
microsoft:masterfrom
benhillis:reg-regsam-access

Conversation

@benhillis

Copy link
Copy Markdown
Member

Adds an access_mask type accepted by the open/create key helpers, implicitly constructible from key_access or a raw REGSAM, so callers can pass custom access rights. Includes Catch2 [registry] tests (and compile-time static_asserts) passing in normal & noexcept configs. Part of enabling WSL to drop its in-house registry helper in favor of wil::reg.

Introduce wil::reg::access_mask, a thin type implicitly constructible
from either a named key_access value or a raw REGSAM mask. The open_*_key
and create_*_key helpers now take access_mask instead of key_access, so
callers can pass arbitrary access rights (e.g. KEY_QUERY_VALUE,
KEY_READ | KEY_WOW64_64KEY) while existing key_access call sites continue
to compile unchanged.

get_access_flags now delegates to access_mask to keep a single mapping.
Adds RegistryTests coverage for raw-mask open/create.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant