aboutsummaryrefslogtreecommitdiff
path: root/src/engine/condition.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/condition.cpp')
-rw-r--r--src/engine/condition.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/engine/condition.cpp b/src/engine/condition.cpp
index 224eb0da..d6038b34 100644
--- a/src/engine/condition.cpp
+++ b/src/engine/condition.cpp
@@ -432,6 +432,7 @@ static HRESULT ParseOperand(
432 ) 432 )
433{ 433{
434 HRESULT hr = S_OK; 434 HRESULT hr = S_OK;
435 LPWSTR sczFormatted = NULL;
435 436
436 // Symbols don't encrypt their value, so can access the value directly. 437 // Symbols don't encrypt their value, so can access the value directly.
437 switch (pContext->NextSymbol.Type) 438 switch (pContext->NextSymbol.Type)
@@ -451,9 +452,11 @@ static HRESULT ParseOperand(
451 452
452 if (BURN_VARIANT_TYPE_FORMATTED == pOperand->Value.Type) 453 if (BURN_VARIANT_TYPE_FORMATTED == pOperand->Value.Type)
453 { 454 {
454 // TODO: actually format the value? 455 hr = VariableGetFormatted(pContext->pVariables, pContext->NextSymbol.Value.sczValue, &sczFormatted, &pOperand->fHidden);
455 hr = BVariantChangeType(&pOperand->Value, BURN_VARIANT_TYPE_STRING); 456 ExitOnRootFailure(hr, "Failed to format variable '%ls' for condition '%ls'", pContext->NextSymbol.Value.sczValue, pContext->wzCondition);
456 ExitOnRootFailure(hr, "Failed to change variable '%ls' type for condition '%ls'", pContext->NextSymbol.Value.sczValue, pContext->wzCondition); 457
458 hr = BVariantSetString(&pOperand->Value, sczFormatted, 0, FALSE);
459 ExitOnRootFailure(hr, "Failed to store formatted value for variable '%ls' for condition '%ls'", pContext->NextSymbol.Value.sczValue, pContext->wzCondition);
457 } 460 }
458 break; 461 break;
459 462
@@ -477,6 +480,8 @@ static HRESULT ParseOperand(
477 ExitOnFailure(hr, "Failed to read next symbol."); 480 ExitOnFailure(hr, "Failed to read next symbol.");
478 481
479LExit: 482LExit:
483 StrSecureZeroFreeString(sczFormatted);
484
480 return hr; 485 return hr;
481} 486}
482 487