Skip to content

Add open_current_user_key registry helpers#639

Draft
benhillis wants to merge 1 commit into
microsoft:masterfrom
benhillis:reg-open-current-user
Draft

Add open_current_user_key registry helpers#639
benhillis wants to merge 1 commit into
microsoft:masterfrom
benhillis:reg-open-current-user

Conversation

@benhillis

Copy link
Copy Markdown
Member

Adds wil::reg::open_current_user_key[_nothrow] and the shared-key variants, wrapping RegOpenCurrentUser. Includes Catch2 [registry] tests (read/write through the hive and read-only enforcement via a directly-written read-only handle) passing in normal & noexcept configs. Part of enabling WSL to drop its in-house registry helper in favor of wil::reg.

Add wil::reg::open_current_user_key[_nothrow] (and shared_hkey variants
gated on __WIL_WINREG_STL) wrapping RegOpenCurrentUser, which resolves
the HKEY_CURRENT_USER subtree for the user the calling thread is
impersonating rather than the process user.

Follows the existing nothrow-core plus throwing-wrapper pattern and adds
RegistryTests coverage.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@benhillis benhillis force-pushed the reg-open-current-user branch from 37eecae to 82e496a Compare June 12, 2026 15:44
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