diff options
Diffstat (limited to 'src/engine/mspengine.cpp')
| -rw-r--r-- | src/engine/mspengine.cpp | 36 |
1 files changed, 25 insertions, 11 deletions
diff --git a/src/engine/mspengine.cpp b/src/engine/mspengine.cpp index 7f591d82..f742ecef 100644 --- a/src/engine/mspengine.cpp +++ b/src/engine/mspengine.cpp | |||
| @@ -279,12 +279,32 @@ LExit: | |||
| 279 | return hr; | 279 | return hr; |
| 280 | } | 280 | } |
| 281 | 281 | ||
| 282 | extern "C" HRESULT MspEnginePlanInitializePackage( | ||
| 283 | __in BURN_PACKAGE* pPackage, | ||
| 284 | __in BURN_USER_EXPERIENCE* pUserExperience | ||
| 285 | ) | ||
| 286 | { | ||
| 287 | HRESULT hr = S_OK; | ||
| 288 | |||
| 289 | for (DWORD i = 0; i < pPackage->Msp.cTargetProductCodes; ++i) | ||
| 290 | { | ||
| 291 | BURN_MSPTARGETPRODUCT* pTargetProduct = pPackage->Msp.rgTargetProducts + i; | ||
| 292 | |||
| 293 | pTargetProduct->requested = pPackage->requested; | ||
| 294 | |||
| 295 | hr = UserExperienceOnPlanPatchTarget(pUserExperience, pPackage->sczId, pTargetProduct->wzTargetProductCode, &pTargetProduct->requested); | ||
| 296 | ExitOnRootFailure(hr, "BA aborted plan patch target."); | ||
| 297 | } | ||
| 298 | |||
| 299 | LExit: | ||
| 300 | return hr; | ||
| 301 | } | ||
| 302 | |||
| 282 | // | 303 | // |
| 283 | // PlanCalculate - calculates the execute and rollback state for the requested package state. | 304 | // PlanCalculate - calculates the execute and rollback state for the requested package state. |
| 284 | // | 305 | // |
| 285 | extern "C" HRESULT MspEnginePlanCalculatePackage( | 306 | extern "C" HRESULT MspEnginePlanCalculatePackage( |
| 286 | __in BURN_PACKAGE* pPackage, | 307 | __in BURN_PACKAGE* pPackage, |
| 287 | __in BURN_USER_EXPERIENCE* pUserExperience, | ||
| 288 | __in BOOL fInsideMsiTransaction, | 308 | __in BOOL fInsideMsiTransaction, |
| 289 | __out BOOL* pfBARequestedCache | 309 | __out BOOL* pfBARequestedCache |
| 290 | ) | 310 | ) |
| @@ -296,18 +316,14 @@ extern "C" HRESULT MspEnginePlanCalculatePackage( | |||
| 296 | { | 316 | { |
| 297 | BURN_MSPTARGETPRODUCT* pTargetProduct = pPackage->Msp.rgTargetProducts + i; | 317 | BURN_MSPTARGETPRODUCT* pTargetProduct = pPackage->Msp.rgTargetProducts + i; |
| 298 | 318 | ||
| 299 | BOOTSTRAPPER_REQUEST_STATE requested = pPackage->requested; | ||
| 300 | BOOTSTRAPPER_ACTION_STATE execute = BOOTSTRAPPER_ACTION_STATE_NONE; | 319 | BOOTSTRAPPER_ACTION_STATE execute = BOOTSTRAPPER_ACTION_STATE_NONE; |
| 301 | BOOTSTRAPPER_ACTION_STATE rollback = BOOTSTRAPPER_ACTION_STATE_NONE; | 320 | BOOTSTRAPPER_ACTION_STATE rollback = BOOTSTRAPPER_ACTION_STATE_NONE; |
| 302 | 321 | ||
| 303 | hr = UserExperienceOnPlanPatchTarget(pUserExperience, pPackage->sczId, pTargetProduct->wzTargetProductCode, &requested); | ||
| 304 | ExitOnRootFailure(hr, "BA aborted plan patch target."); | ||
| 305 | |||
| 306 | // Calculate the execute action. | 322 | // Calculate the execute action. |
| 307 | switch (pTargetProduct->patchPackageState) | 323 | switch (pTargetProduct->patchPackageState) |
| 308 | { | 324 | { |
| 309 | case BOOTSTRAPPER_PACKAGE_STATE_PRESENT: | 325 | case BOOTSTRAPPER_PACKAGE_STATE_PRESENT: |
| 310 | switch (requested) | 326 | switch (pTargetProduct->requested) |
| 311 | { | 327 | { |
| 312 | case BOOTSTRAPPER_REQUEST_STATE_REPAIR: | 328 | case BOOTSTRAPPER_REQUEST_STATE_REPAIR: |
| 313 | execute = BOOTSTRAPPER_ACTION_STATE_REPAIR; | 329 | execute = BOOTSTRAPPER_ACTION_STATE_REPAIR; |
| @@ -329,7 +345,7 @@ extern "C" HRESULT MspEnginePlanCalculatePackage( | |||
| 329 | break; | 345 | break; |
| 330 | 346 | ||
| 331 | case BOOTSTRAPPER_PACKAGE_STATE_ABSENT: | 347 | case BOOTSTRAPPER_PACKAGE_STATE_ABSENT: |
| 332 | switch (requested) | 348 | switch (pTargetProduct->requested) |
| 333 | { | 349 | { |
| 334 | case BOOTSTRAPPER_REQUEST_STATE_PRESENT: __fallthrough; | 350 | case BOOTSTRAPPER_REQUEST_STATE_PRESENT: __fallthrough; |
| 335 | case BOOTSTRAPPER_REQUEST_STATE_REPAIR: | 351 | case BOOTSTRAPPER_REQUEST_STATE_REPAIR: |
| @@ -354,7 +370,7 @@ extern "C" HRESULT MspEnginePlanCalculatePackage( | |||
| 354 | switch (pPackage->currentState) | 370 | switch (pPackage->currentState) |
| 355 | { | 371 | { |
| 356 | case BOOTSTRAPPER_PACKAGE_STATE_PRESENT: | 372 | case BOOTSTRAPPER_PACKAGE_STATE_PRESENT: |
| 357 | switch (requested) | 373 | switch (pTargetProduct->requested) |
| 358 | { | 374 | { |
| 359 | case BOOTSTRAPPER_REQUEST_STATE_FORCE_ABSENT: __fallthrough; | 375 | case BOOTSTRAPPER_REQUEST_STATE_FORCE_ABSENT: __fallthrough; |
| 360 | case BOOTSTRAPPER_REQUEST_STATE_ABSENT: | 376 | case BOOTSTRAPPER_REQUEST_STATE_ABSENT: |
| @@ -369,7 +385,7 @@ extern "C" HRESULT MspEnginePlanCalculatePackage( | |||
| 369 | 385 | ||
| 370 | case BOOTSTRAPPER_PACKAGE_STATE_ABSENT: __fallthrough; | 386 | case BOOTSTRAPPER_PACKAGE_STATE_ABSENT: __fallthrough; |
| 371 | case BOOTSTRAPPER_PACKAGE_STATE_CACHED: | 387 | case BOOTSTRAPPER_PACKAGE_STATE_CACHED: |
| 372 | switch (requested) | 388 | switch (pTargetProduct->requested) |
| 373 | { | 389 | { |
| 374 | case BOOTSTRAPPER_REQUEST_STATE_PRESENT: __fallthrough; | 390 | case BOOTSTRAPPER_REQUEST_STATE_PRESENT: __fallthrough; |
| 375 | case BOOTSTRAPPER_REQUEST_STATE_REPAIR: | 391 | case BOOTSTRAPPER_REQUEST_STATE_REPAIR: |
| @@ -408,8 +424,6 @@ extern "C" HRESULT MspEnginePlanCalculatePackage( | |||
| 408 | *pfBARequestedCache = fBARequestedCache; | 424 | *pfBARequestedCache = fBARequestedCache; |
| 409 | } | 425 | } |
| 410 | 426 | ||
| 411 | LExit: | ||
| 412 | |||
| 413 | return hr; | 427 | return hr; |
| 414 | } | 428 | } |
| 415 | 429 | ||
