From 9392e8afb43911e39b9a4f4e3d4b7ef3cba92d6b Mon Sep 17 00:00:00 2001 From: jkahrman Date: Thu, 16 Jun 2022 16:59:55 -0400 Subject: [PATCH 1/2] Use correct constant to read 64bit registry https://github.com/perl-libwin32/win32/issues/36 --- Win32.xs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Win32.xs b/Win32.xs index 3166c29..389aa52 100644 --- a/Win32.xs +++ b/Win32.xs @@ -1667,6 +1667,10 @@ XS(w32_GetProcessPrivileges) XSRETURN(1); } +#ifndef RRF_SUBKEY_WOW6464KEY +# define RRF_SUBKEY_WOW6464KEY 0x00010000 +#endif + XS(w32_IsDeveloperModeEnabled) { dXSARGS; @@ -1693,7 +1697,7 @@ XS(w32_IsDeveloperModeEnabled) HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\AppModelUnlock", "AllowDevelopmentWithoutDevLicense", - RRF_RT_REG_DWORD | KEY_WOW64_64KEY, + RRF_RT_REG_DWORD | RRF_SUBKEY_WOW6464KEY, NULL, &val, &val_size From 3444eefbe300dd5bf46d05a02b6b624497464dba Mon Sep 17 00:00:00 2001 From: Tony Cook Date: Mon, 7 Aug 2023 11:09:36 +1000 Subject: [PATCH 2/2] move the preprocessor definitions as requested --- Win32.xs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Win32.xs b/Win32.xs index 389aa52..980e841 100644 --- a/Win32.xs +++ b/Win32.xs @@ -102,6 +102,10 @@ typedef LONG (WINAPI *PFNRegGetValueA)(HKEY, LPCSTR, LPCSTR, DWORD, LPDWORD, PVO # define CSIDL_FLAG_CREATE 0x8000 #endif +#ifndef RRF_SUBKEY_WOW6464KEY +# define RRF_SUBKEY_WOW6464KEY 0x00010000 +#endif + /* Use explicit struct definition because wSuiteMask and * wProductType are not defined in the VC++ 6.0 headers. * WORD type has been replaced by unsigned short because @@ -1667,10 +1671,6 @@ XS(w32_GetProcessPrivileges) XSRETURN(1); } -#ifndef RRF_SUBKEY_WOW6464KEY -# define RRF_SUBKEY_WOW6464KEY 0x00010000 -#endif - XS(w32_IsDeveloperModeEnabled) { dXSARGS;