Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wil/resource.h conditionally enables unique_key using different logic than winreg.h #470

Open
ChrisGuzak opened this issue Aug 28, 2024 · 0 comments

Comments

@ChrisGuzak
Copy link
Member

The support for wil::unique_hkey in wil/resource.h is conditionally enabled based on WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) here.

This is out of sync with what protects RegCloseKey() and HKEY. See line 237 in winreg.h in the Windows SDK.

#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM | WINAPI_PARTITION_GAMES)

This means if you don't build with WINAPI_FAMILY defined as WINAPI_FAMILY_DESKTOP_APP you don't get wil::uniquey_hkey.

This caused problems for a shared library that wil::unique_hkey that needs to be consumed by UWP style apps.

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

No branches or pull requests

1 participant