From a5b86b987bb5a6fbcdb191bbe8b51a621140b4e6 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Sat, 26 Dec 2020 22:15:06 -0500 Subject: Fix code analysis warnings. --- src/engine/apply.cpp | 11 +++++++++-- src/engine/apply.h | 2 +- src/engine/cabextract.cpp | 2 +- src/engine/core.cpp | 2 +- src/engine/elevation.cpp | 4 ++-- 5 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/engine/apply.cpp b/src/engine/apply.cpp index c5d27277..8e5099d9 100644 --- a/src/engine/apply.cpp +++ b/src/engine/apply.cpp @@ -291,10 +291,12 @@ extern "C" void ApplyReset( extern "C" HRESULT ApplyLock( __in BOOL /*fPerMachine*/, - __out HANDLE* /*phLock*/ + __out HANDLE* phLock ) { HRESULT hr = S_OK; + *phLock = NULL; + #if 0 // eventually figure out the correct way to support this. In its current form, embedded bundles (including related bundles) are hosed. DWORD er = ERROR_SUCCESS; HANDLE hLock = NULL; @@ -459,6 +461,8 @@ extern "C" HRESULT ApplyCache( DWORD iPackageStartAction = BURN_PLAN_INVALID_ACTION_INDEX; DWORD iPackageCompleteAction = BURN_PLAN_INVALID_ACTION_INDEX; + *pfRollback = FALSE; + hr = UserExperienceOnCacheBegin(pUX); ExitOnRootFailure(hr, "BA aborted cache."); @@ -732,7 +736,7 @@ extern "C" HRESULT ApplyExecute( __in BURN_ENGINE_STATE* pEngineState, __in_opt HANDLE hCacheThread, __inout DWORD* pcOverallProgressTicks, - __out BOOL* pfKeepRegistration, + __inout BOOL* pfKeepRegistration, __out BOOL* pfRollback, __out BOOL* pfSuspend, __out BOOTSTRAPPER_APPLY_RESTART* pRestart @@ -749,6 +753,9 @@ extern "C" HRESULT ApplyExecute( context.cExecutePackagesTotal = pEngineState->plan.cExecutePackagesTotal; context.pcOverallProgressTicks = pcOverallProgressTicks; + *pfRollback = FALSE; + *pfSuspend = FALSE; + // Send execute begin to BA. hr = UserExperienceOnExecuteBegin(&pEngineState->userExperience, pEngineState->plan.cExecutePackagesTotal); ExitOnRootFailure(hr, "BA aborted execute begin."); diff --git a/src/engine/apply.h b/src/engine/apply.h index b717251e..00e1fceb 100644 --- a/src/engine/apply.h +++ b/src/engine/apply.h @@ -89,7 +89,7 @@ HRESULT ApplyExecute( __in BURN_ENGINE_STATE* pEngineState, __in_opt HANDLE hCacheThread, __inout DWORD* pcOverallProgressTicks, - __out BOOL* pfKeepRegistration, + __inout BOOL* pfKeepRegistration, __out BOOL* pfRollback, __out BOOL* pfSuspend, __out BOOTSTRAPPER_APPLY_RESTART* pRestart diff --git a/src/engine/cabextract.cpp b/src/engine/cabextract.cpp index 04c2c6ec..5a02ff8a 100644 --- a/src/engine/cabextract.cpp +++ b/src/engine/cabextract.cpp @@ -543,7 +543,7 @@ static INT_PTR CopyFileCallback( // copy stream name hr = StrAllocStringAnsi(pContext->Cabinet.psczStreamName, pFDINotify->psz1, 0, CP_UTF8); - ExitOnFailure(hr, "Failed to copy stream name: %ls", pFDINotify->psz1); + ExitOnFailure(hr, "Failed to copy stream name: %hs", pFDINotify->psz1); // set operation complete event if (!::SetEvent(pContext->Cabinet.hOperationCompleteEvent)) diff --git a/src/engine/core.cpp b/src/engine/core.cpp index 028dc1cc..d157d3b3 100644 --- a/src/engine/core.cpp +++ b/src/engine/core.cpp @@ -36,7 +36,7 @@ static HRESULT ParseCommandLine( __out_z LPWSTR* psczSanitizedCommandLine ); static HRESULT ParsePipeConnection( - __in LPWSTR* rgArgs, + __in_ecount(3) LPWSTR* rgArgs, __in BURN_PIPE_CONNECTION* pConnection ); static HRESULT DetectPackage( diff --git a/src/engine/elevation.cpp b/src/engine/elevation.cpp index 94418dc3..fc53b1f8 100644 --- a/src/engine/elevation.cpp +++ b/src/engine/elevation.cpp @@ -107,7 +107,7 @@ static HRESULT ProcessApplyInitializeMessages( ); static HRESULT ProcessGenericExecuteMessages( __in BURN_PIPE_MESSAGE* pMsg, - __in_opt LPVOID pvContext, + __in LPVOID pvContext, __out DWORD* pdwResult ); static HRESULT ProcessMsiPackageMessages( @@ -1425,7 +1425,7 @@ LExit: static HRESULT ProcessGenericExecuteMessages( __in BURN_PIPE_MESSAGE* pMsg, - __in_opt LPVOID pvContext, + __in LPVOID pvContext, __out DWORD* pdwResult ) { -- cgit v1.2.3-55-g6feb