aboutsummaryrefslogtreecommitdiff
path: root/src/burn/engine/approvedexe.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/burn/engine/approvedexe.cpp')
-rw-r--r--src/burn/engine/approvedexe.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/burn/engine/approvedexe.cpp b/src/burn/engine/approvedexe.cpp
index 55518519..e3d51a47 100644
--- a/src/burn/engine/approvedexe.cpp
+++ b/src/burn/engine/approvedexe.cpp
@@ -217,6 +217,7 @@ extern "C" HRESULT ApprovedExesVerifySecureLocation(
217{ 217{
218 HRESULT hr = S_OK; 218 HRESULT hr = S_OK;
219 LPWSTR scz = NULL; 219 LPWSTR scz = NULL;
220 LPWSTR sczSecondary = NULL;
220 221
221 const LPCWSTR vrgSecureFolderVariables[] = { 222 const LPCWSTR vrgSecureFolderVariables[] = {
222 L"ProgramFiles64Folder", 223 L"ProgramFiles64Folder",
@@ -243,10 +244,20 @@ extern "C" HRESULT ApprovedExesVerifySecureLocation(
243 } 244 }
244 245
245 // The problem with using a Variable for the root package cache folder is that it might not have been secured yet. 246 // The problem with using a Variable for the root package cache folder is that it might not have been secured yet.
246 // Getting it through CacheGetRootCompletedPath makes sure it has been secured. 247 // Getting it through CacheGetPerMachineRootCompletedPath makes sure it has been secured.
247 hr = CacheGetRootCompletedPath(TRUE, TRUE, &scz); 248 hr = CacheGetPerMachineRootCompletedPath(&scz, &sczSecondary);
248 ExitOnFailure(hr, "Failed to get the root package cache folder."); 249 ExitOnFailure(hr, "Failed to get the root package cache folder.");
249 250
251 // If the package cache is redirected, hr is S_FALSE.
252 if (S_FALSE == hr)
253 {
254 hr = PathDirectoryContainsPath(sczSecondary, pLaunchApprovedExe->sczExecutablePath);
255 if (S_OK == hr)
256 {
257 ExitFunction();
258 }
259 }
260
250 hr = PathDirectoryContainsPath(scz, pLaunchApprovedExe->sczExecutablePath); 261 hr = PathDirectoryContainsPath(scz, pLaunchApprovedExe->sczExecutablePath);
251 if (S_OK == hr) 262 if (S_OK == hr)
252 { 263 {
@@ -257,6 +268,7 @@ extern "C" HRESULT ApprovedExesVerifySecureLocation(
257 268
258LExit: 269LExit:
259 ReleaseStr(scz); 270 ReleaseStr(scz);
271 ReleaseStr(sczSecondary);
260 272
261 return hr; 273 return hr;
262} 274}