aboutsummaryrefslogtreecommitdiff
path: root/src/engine/externalengine.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/engine/externalengine.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/engine/externalengine.cpp b/src/engine/externalengine.cpp
index 39878c8b..f9a06437 100644
--- a/src/engine/externalengine.cpp
+++ b/src/engine/externalengine.cpp
@@ -276,7 +276,9 @@ HRESULT ExternalEngineSetUpdate(
276 WCHAR wzGuid[39]; 276 WCHAR wzGuid[39];
277 RPC_STATUS rs = RPC_S_OK; 277 RPC_STATUS rs = RPC_S_OK;
278 278
279 ::EnterCriticalSection(&pEngineState->csActive); 279 ::EnterCriticalSection(&pEngineState->userExperience.csEngineActive);
280 hr = UserExperienceEnsureEngineInactive(&pEngineState->userExperience);
281 ExitOnFailure(hr, "Engine is active, cannot change engine state.");
280 282
281 if ((!wzLocalSource || !*wzLocalSource) && (!wzDownloadSource || !*wzDownloadSource)) 283 if ((!wzLocalSource || !*wzLocalSource) && (!wzDownloadSource || !*wzDownloadSource))
282 { 284 {
@@ -332,7 +334,7 @@ HRESULT ExternalEngineSetUpdate(
332 } 334 }
333 335
334LExit: 336LExit:
335 ::LeaveCriticalSection(&pEngineState->csActive); 337 ::LeaveCriticalSection(&pEngineState->userExperience.csEngineActive);
336 338
337 ReleaseStr(sczCommandline); 339 ReleaseStr(sczCommandline);
338 ReleaseStr(sczLocalSource); 340 ReleaseStr(sczLocalSource);
@@ -351,7 +353,7 @@ HRESULT ExternalEngineSetLocalSource(
351 BURN_CONTAINER* pContainer = NULL; 353 BURN_CONTAINER* pContainer = NULL;
352 BURN_PAYLOAD* pPayload = NULL; 354 BURN_PAYLOAD* pPayload = NULL;
353 355
354 ::EnterCriticalSection(&pEngineState->csActive); 356 ::EnterCriticalSection(&pEngineState->userExperience.csEngineActive);
355 hr = UserExperienceEnsureEngineInactive(&pEngineState->userExperience); 357 hr = UserExperienceEnsureEngineInactive(&pEngineState->userExperience);
356 ExitOnFailure(hr, "Engine is active, cannot change engine state."); 358 ExitOnFailure(hr, "Engine is active, cannot change engine state.");
357 359
@@ -387,7 +389,7 @@ HRESULT ExternalEngineSetLocalSource(
387 } 389 }
388 390
389LExit: 391LExit:
390 ::LeaveCriticalSection(&pEngineState->csActive); 392 ::LeaveCriticalSection(&pEngineState->userExperience.csEngineActive);
391 393
392 return hr; 394 return hr;
393} 395}
@@ -406,7 +408,7 @@ HRESULT ExternalEngineSetDownloadSource(
406 BURN_PAYLOAD* pPayload = NULL; 408 BURN_PAYLOAD* pPayload = NULL;
407 DOWNLOAD_SOURCE* pDownloadSource = NULL; 409 DOWNLOAD_SOURCE* pDownloadSource = NULL;
408 410
409 ::EnterCriticalSection(&pEngineState->csActive); 411 ::EnterCriticalSection(&pEngineState->userExperience.csEngineActive);
410 hr = UserExperienceEnsureEngineInactive(&pEngineState->userExperience); 412 hr = UserExperienceEnsureEngineInactive(&pEngineState->userExperience);
411 ExitOnFailure(hr, "Engine is active, cannot change engine state."); 413 ExitOnFailure(hr, "Engine is active, cannot change engine state.");
412 414
@@ -470,7 +472,7 @@ HRESULT ExternalEngineSetDownloadSource(
470 } 472 }
471 473
472LExit: 474LExit:
473 ::LeaveCriticalSection(&pEngineState->csActive); 475 ::LeaveCriticalSection(&pEngineState->userExperience.csEngineActive);
474 476
475 return hr; 477 return hr;
476} 478}
@@ -686,7 +688,7 @@ HRESULT ExternalEngineLaunchApprovedExe(
686 pLaunchApprovedExe = (BURN_LAUNCH_APPROVED_EXE*)MemAlloc(sizeof(BURN_LAUNCH_APPROVED_EXE), TRUE); 688 pLaunchApprovedExe = (BURN_LAUNCH_APPROVED_EXE*)MemAlloc(sizeof(BURN_LAUNCH_APPROVED_EXE), TRUE);
687 ExitOnNull(pLaunchApprovedExe, hr, E_OUTOFMEMORY, "Failed to alloc BURN_LAUNCH_APPROVED_EXE"); 689 ExitOnNull(pLaunchApprovedExe, hr, E_OUTOFMEMORY, "Failed to alloc BURN_LAUNCH_APPROVED_EXE");
688 690
689 ::EnterCriticalSection(&pEngineState->csActive); 691 ::EnterCriticalSection(&pEngineState->userExperience.csEngineActive);
690 fLeaveCriticalSection = TRUE; 692 fLeaveCriticalSection = TRUE;
691 hr = UserExperienceEnsureEngineInactive(&pEngineState->userExperience); 693 hr = UserExperienceEnsureEngineInactive(&pEngineState->userExperience);
692 ExitOnFailure(hr, "Engine is active, cannot change engine state."); 694 ExitOnFailure(hr, "Engine is active, cannot change engine state.");
@@ -699,9 +701,6 @@ HRESULT ExternalEngineLaunchApprovedExe(
699 hr = ApprovedExesFindById(&pEngineState->approvedExes, wzApprovedExeForElevationId, &pApprovedExe); 701 hr = ApprovedExesFindById(&pEngineState->approvedExes, wzApprovedExeForElevationId, &pApprovedExe);
700 ExitOnFailure(hr, "BA requested unknown approved exe with id: %ls", wzApprovedExeForElevationId); 702 ExitOnFailure(hr, "BA requested unknown approved exe with id: %ls", wzApprovedExeForElevationId);
701 703
702 ::LeaveCriticalSection(&pEngineState->csActive);
703 fLeaveCriticalSection = FALSE;
704
705 hr = StrAllocString(&pLaunchApprovedExe->sczId, wzApprovedExeForElevationId, NULL); 704 hr = StrAllocString(&pLaunchApprovedExe->sczId, wzApprovedExeForElevationId, NULL);
706 ExitOnFailure(hr, "Failed to copy the id."); 705 ExitOnFailure(hr, "Failed to copy the id.");
707 706
@@ -723,7 +722,7 @@ HRESULT ExternalEngineLaunchApprovedExe(
723LExit: 722LExit:
724 if (fLeaveCriticalSection) 723 if (fLeaveCriticalSection)
725 { 724 {
726 ::LeaveCriticalSection(&pEngineState->csActive); 725 ::LeaveCriticalSection(&pEngineState->userExperience.csEngineActive);
727 } 726 }
728 727
729 if (FAILED(hr)) 728 if (FAILED(hr))