diff options
Diffstat (limited to 'src/burn/engine')
-rw-r--r-- | src/burn/engine/cache.cpp | 19 | ||||
-rw-r--r-- | src/burn/engine/precomp.h | 1 |
2 files changed, 17 insertions, 3 deletions
diff --git a/src/burn/engine/cache.cpp b/src/burn/engine/cache.cpp index 7fca8cc7..5eacb20d 100644 --- a/src/burn/engine/cache.cpp +++ b/src/burn/engine/cache.cpp | |||
@@ -1389,6 +1389,8 @@ static HRESULT CalculatePotentialBaseWorkingFolders( | |||
1389 | Assert(!pCache->rgsczPotentialBaseWorkingFolders && !pCache->cPotentialBaseWorkingFolders); | 1389 | Assert(!pCache->rgsczPotentialBaseWorkingFolders && !pCache->cPotentialBaseWorkingFolders); |
1390 | HRESULT hr = S_OK; | 1390 | HRESULT hr = S_OK; |
1391 | LPWSTR sczTemp = NULL; | 1391 | LPWSTR sczTemp = NULL; |
1392 | LPWSTR sczPolicy = NULL; | ||
1393 | BOOL fNeedsExpansion = FALSE; | ||
1392 | 1394 | ||
1393 | hr = MemEnsureArraySize(reinterpret_cast<LPVOID*>(&pCache->rgsczPotentialBaseWorkingFolders), 6, sizeof(LPWSTR), 6); | 1395 | hr = MemEnsureArraySize(reinterpret_cast<LPVOID*>(&pCache->rgsczPotentialBaseWorkingFolders), 6, sizeof(LPWSTR), 6); |
1394 | ExitOnFailure(hr, "Failed to initialize array."); | 1396 | ExitOnFailure(hr, "Failed to initialize array."); |
@@ -1408,12 +1410,22 @@ static HRESULT CalculatePotentialBaseWorkingFolders( | |||
1408 | // but only use it if elevated because it should be secured against non-admin users. | 1410 | // but only use it if elevated because it should be secured against non-admin users. |
1409 | if (pInternalCommand->fInitiallyElevated) | 1411 | if (pInternalCommand->fInitiallyElevated) |
1410 | { | 1412 | { |
1411 | hr = PolcReadString(POLICY_BURN_REGISTRY_PATH, L"EngineWorkingDirectory", NULL, &sczTemp); | 1413 | hr = PolcReadUnexpandedString(POLICY_BURN_REGISTRY_PATH, L"EngineWorkingDirectory", NULL, &fNeedsExpansion, &sczPolicy); |
1412 | ExitOnFailure(hr, "Failed to read EngineWorkingDirectory policy directory."); | 1414 | ExitOnFailure(hr, "Failed to read EngineWorkingDirectory policy directory."); |
1413 | 1415 | ||
1414 | if (sczTemp) | 1416 | if (S_FALSE != hr) |
1415 | { | 1417 | { |
1416 | // PolcReadString is supposed to automatically expand REG_EXPAND_SZ values. | 1418 | if (fNeedsExpansion) |
1419 | { | ||
1420 | hr = EnvExpandEnvironmentStringsForUser(NULL, sczPolicy, &sczTemp, NULL); | ||
1421 | ExitOnFailure(hr, "Failed to expand EngineWorkingDirectory policy directory."); | ||
1422 | } | ||
1423 | else | ||
1424 | { | ||
1425 | sczTemp = sczPolicy; | ||
1426 | sczPolicy = NULL; | ||
1427 | } | ||
1428 | |||
1417 | pCache->rgsczPotentialBaseWorkingFolders[pCache->cPotentialBaseWorkingFolders] = sczTemp; | 1429 | pCache->rgsczPotentialBaseWorkingFolders[pCache->cPotentialBaseWorkingFolders] = sczTemp; |
1418 | sczTemp = NULL; | 1430 | sczTemp = NULL; |
1419 | ++pCache->cPotentialBaseWorkingFolders; | 1431 | ++pCache->cPotentialBaseWorkingFolders; |
@@ -1438,6 +1450,7 @@ static HRESULT CalculatePotentialBaseWorkingFolders( | |||
1438 | 1450 | ||
1439 | LExit: | 1451 | LExit: |
1440 | ReleaseStr(sczTemp); | 1452 | ReleaseStr(sczTemp); |
1453 | ReleaseStr(sczPolicy); | ||
1441 | 1454 | ||
1442 | return hr; | 1455 | return hr; |
1443 | } | 1456 | } |
diff --git a/src/burn/engine/precomp.h b/src/burn/engine/precomp.h index 19a6d48b..bc7046f6 100644 --- a/src/burn/engine/precomp.h +++ b/src/burn/engine/precomp.h | |||
@@ -31,6 +31,7 @@ | |||
31 | #include <certutil.h> | 31 | #include <certutil.h> |
32 | #include <cryputil.h> | 32 | #include <cryputil.h> |
33 | #include <dirutil.h> | 33 | #include <dirutil.h> |
34 | #include <envutil.h> | ||
34 | #include <fileutil.h> | 35 | #include <fileutil.h> |
35 | #include <guidutil.h> | 36 | #include <guidutil.h> |
36 | #include <logutil.h> | 37 | #include <logutil.h> |