aboutsummaryrefslogtreecommitdiff
path: root/src/burn/engine/search.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/burn/engine/search.cpp')
-rw-r--r--src/burn/engine/search.cpp16
1 files changed, 2 insertions, 14 deletions
diff --git a/src/burn/engine/search.cpp b/src/burn/engine/search.cpp
index 6d5f8d49..4505e1a2 100644
--- a/src/burn/engine/search.cpp
+++ b/src/burn/engine/search.cpp
@@ -836,19 +836,13 @@ static HRESULT RegistrySearchExists(
836 HKEY hKey = NULL; 836 HKEY hKey = NULL;
837 DWORD dwType = 0; 837 DWORD dwType = 0;
838 BOOL fExists = FALSE; 838 BOOL fExists = FALSE;
839 REGSAM samDesired = KEY_QUERY_VALUE;
840
841 if (pSearch->RegistrySearch.fWin64)
842 {
843 samDesired = samDesired | KEY_WOW64_64KEY;
844 }
845 839
846 // format key string 840 // format key string
847 hr = VariableFormatString(pVariables, pSearch->RegistrySearch.sczKey, &sczKey, NULL); 841 hr = VariableFormatString(pVariables, pSearch->RegistrySearch.sczKey, &sczKey, NULL);
848 ExitOnFailure(hr, "Failed to format key string."); 842 ExitOnFailure(hr, "Failed to format key string.");
849 843
850 // open key 844 // open key
851 hr = RegOpen(pSearch->RegistrySearch.hRoot, sczKey, samDesired, &hKey); 845 hr = RegOpenEx(pSearch->RegistrySearch.hRoot, sczKey, KEY_QUERY_VALUE, pSearch->RegistrySearch.fWin64 ? REG_KEY_64BIT : REG_KEY_32BIT, &hKey);
852 if (SUCCEEDED(hr)) 846 if (SUCCEEDED(hr))
853 { 847 {
854 fExists = TRUE; 848 fExists = TRUE;
@@ -922,12 +916,6 @@ static HRESULT RegistrySearchValue(
922 LPBYTE pData = NULL; 916 LPBYTE pData = NULL;
923 DWORD cch = 0; 917 DWORD cch = 0;
924 BURN_VARIANT value = { }; 918 BURN_VARIANT value = { };
925 REGSAM samDesired = KEY_QUERY_VALUE;
926
927 if (pSearch->RegistrySearch.fWin64)
928 {
929 samDesired = samDesired | KEY_WOW64_64KEY;
930 }
931 919
932 // format key string 920 // format key string
933 hr = VariableFormatString(pVariables, pSearch->RegistrySearch.sczKey, &sczKey, NULL); 921 hr = VariableFormatString(pVariables, pSearch->RegistrySearch.sczKey, &sczKey, NULL);
@@ -941,7 +929,7 @@ static HRESULT RegistrySearchValue(
941 } 929 }
942 930
943 // open key 931 // open key
944 hr = RegOpen(pSearch->RegistrySearch.hRoot, sczKey, samDesired, &hKey); 932 hr = RegOpenEx(pSearch->RegistrySearch.hRoot, sczKey, KEY_QUERY_VALUE, pSearch->RegistrySearch.fWin64 ? REG_KEY_64BIT : REG_KEY_32BIT, &hKey);
945 if (E_FILENOTFOUND == hr) 933 if (E_FILENOTFOUND == hr)
946 { 934 {
947 // What if there is a hidden variable in sczKey? 935 // What if there is a hidden variable in sczKey?