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

Win32::IsDeveloperModeEnabled() doesn't work in 32bit Perl #36

Open
jkahrman opened this issue Jun 16, 2022 · 0 comments · May be fixed by #39
Open

Win32::IsDeveloperModeEnabled() doesn't work in 32bit Perl #36

jkahrman opened this issue Jun 16, 2022 · 0 comments · May be fixed by #39

Comments

@jkahrman
Copy link

From a 32bit process, Win32::IsDeveloperModeEnabled() can't see the 64bit registry key where the developer mode setting is stored. It's using a wrong (similarly named) constant to set the dwFlags argument

win32/Win32.xs

Lines 1692 to 1700 in 39daf7c

status = pfnRegGetValueA(
HKEY_LOCAL_MACHINE,
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\AppModelUnlock",
"AllowDevelopmentWithoutDevLicense",
RRF_RT_REG_DWORD | KEY_WOW64_64KEY,
NULL,
&val,
&val_size
);

KEY_WOW64_64KEY is a "Registry Access Right" constant defined in winnt.h as 0x0100 - https://docs.microsoft.com/en-us/windows/win32/sysinfo/registry-key-security-and-access-rights

The correct constant to use is RRF_SUBKEY_WOW6464KEY which is defined in winreg.h as
0x00010000 - https://docs.microsoft.com/en-us/windows/win32/api/winreg/nf-winreg-reggetvaluea#RRF_SUBKEY_WOW6464KEY

Note: The RRF_SUBKEY_WOW6464KEY constant is only defined in the Windows 10 SDK, and I'm building Perl with the 8.1 SDK, and then running that binary on Windows 10 machines.

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 a pull request may close this issue.

1 participant