aboutsummaryrefslogtreecommitdiff
path: root/src/libs/dutil/WixToolset.DUtil/regutil.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/dutil/WixToolset.DUtil/regutil.cpp')
-rw-r--r--src/libs/dutil/WixToolset.DUtil/regutil.cpp19
1 files changed, 4 insertions, 15 deletions
diff --git a/src/libs/dutil/WixToolset.DUtil/regutil.cpp b/src/libs/dutil/WixToolset.DUtil/regutil.cpp
index f4719466..219a6c11 100644
--- a/src/libs/dutil/WixToolset.DUtil/regutil.cpp
+++ b/src/libs/dutil/WixToolset.DUtil/regutil.cpp
@@ -32,9 +32,6 @@ static PFN_REGDELETEVALUEW vpfnRegDeleteValueW = ::RegDeleteValueW;
32static HMODULE vhAdvApi32Dll = NULL; 32static HMODULE vhAdvApi32Dll = NULL;
33static BOOL vfRegInitialized = FALSE; 33static BOOL vfRegInitialized = FALSE;
34 34
35static REGSAM TranslateKeyBitness(
36 __in REG_KEY_BITNESS kbKeyBitness
37);
38static HRESULT WriteStringToRegistry( 35static HRESULT WriteStringToRegistry(
39 __in HKEY hk, 36 __in HKEY hk,
40 __in_z_opt LPCWSTR wzName, 37 __in_z_opt LPCWSTR wzName,
@@ -135,7 +132,7 @@ DAPI_(HRESULT) RegCreateEx(
135 DWORD er = ERROR_SUCCESS; 132 DWORD er = ERROR_SUCCESS;
136 DWORD dwDisposition; 133 DWORD dwDisposition;
137 134
138 REGSAM samDesired = TranslateKeyBitness(kbKeyBitness); 135 REGSAM samDesired = RegTranslateKeyBitness(kbKeyBitness);
139 er = vpfnRegCreateKeyExW(hkRoot, wzSubKey, 0, NULL, fVolatile ? REG_OPTION_VOLATILE : REG_OPTION_NON_VOLATILE, dwAccess | samDesired, pSecurityAttributes, phk, &dwDisposition); 136 er = vpfnRegCreateKeyExW(hkRoot, wzSubKey, 0, NULL, fVolatile ? REG_OPTION_VOLATILE : REG_OPTION_NON_VOLATILE, dwAccess | samDesired, pSecurityAttributes, phk, &dwDisposition);
140 RegExitOnWin32Error(er, hr, "Failed to create registry key."); 137 RegExitOnWin32Error(er, hr, "Failed to create registry key.");
141 138
@@ -171,7 +168,7 @@ DAPI_(HRESULT) RegOpenEx(
171 HRESULT hr = S_OK; 168 HRESULT hr = S_OK;
172 DWORD er = ERROR_SUCCESS; 169 DWORD er = ERROR_SUCCESS;
173 170
174 REGSAM samDesired = TranslateKeyBitness(kbKeyBitness); 171 REGSAM samDesired = RegTranslateKeyBitness(kbKeyBitness);
175 er = vpfnRegOpenKeyExW(hkRoot, wzSubKey, 0, dwAccess | samDesired, phk); 172 er = vpfnRegOpenKeyExW(hkRoot, wzSubKey, 0, dwAccess | samDesired, phk);
176 if (E_FILENOTFOUND == HRESULT_FROM_WIN32(er)) 173 if (E_FILENOTFOUND == HRESULT_FROM_WIN32(er))
177 { 174 {
@@ -229,7 +226,7 @@ DAPI_(HRESULT) RegDelete(
229 226
230 if (NULL != vpfnRegDeleteKeyExW) 227 if (NULL != vpfnRegDeleteKeyExW)
231 { 228 {
232 REGSAM samDesired = TranslateKeyBitness(kbKeyBitness); 229 REGSAM samDesired = RegTranslateKeyBitness(kbKeyBitness);
233 er = vpfnRegDeleteKeyExW(hkRoot, wzSubKey, samDesired, 0); 230 er = vpfnRegDeleteKeyExW(hkRoot, wzSubKey, samDesired, 0);
234 if (E_FILENOTFOUND == HRESULT_FROM_WIN32(er)) 231 if (E_FILENOTFOUND == HRESULT_FROM_WIN32(er))
235 { 232 {
@@ -912,11 +909,6 @@ LExit:
912 return hr; 909 return hr;
913} 910}
914 911
915/********************************************************************
916RegValueExists - determines whether a named value exists in a
917specified subkey.
918
919*********************************************************************/
920DAPI_(BOOL) RegValueExists( 912DAPI_(BOOL) RegValueExists(
921 __in HKEY hk, 913 __in HKEY hk,
922 __in_z LPCWSTR wzSubKey, 914 __in_z LPCWSTR wzSubKey,
@@ -940,7 +932,7 @@ LExit:
940 return SUCCEEDED(hr); 932 return SUCCEEDED(hr);
941} 933}
942 934
943static REGSAM TranslateKeyBitness( 935DAPI_(REGSAM) RegTranslateKeyBitness(
944 __in REG_KEY_BITNESS kbKeyBitness 936 __in REG_KEY_BITNESS kbKeyBitness
945 ) 937 )
946{ 938{
@@ -948,14 +940,11 @@ static REGSAM TranslateKeyBitness(
948 { 940 {
949 case REG_KEY_32BIT: 941 case REG_KEY_32BIT:
950 return KEY_WOW64_32KEY; 942 return KEY_WOW64_32KEY;
951 break;
952 case REG_KEY_64BIT: 943 case REG_KEY_64BIT:
953 return KEY_WOW64_64KEY; 944 return KEY_WOW64_64KEY;
954 break;
955 case REG_KEY_DEFAULT: 945 case REG_KEY_DEFAULT:
956 default: 946 default:
957 return 0; 947 return 0;
958 break;
959 } 948 }
960} 949}
961 950