diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/engine/EngineForApplication.cpp | 216 | ||||
| -rw-r--r-- | src/engine/EngineForExtension.cpp | 97 | ||||
| -rw-r--r-- | src/engine/burnextension.cpp | 24 | ||||
| -rw-r--r-- | src/engine/engine.vcxproj | 2 | ||||
| -rw-r--r-- | src/engine/externalengine.cpp | 30 | ||||
| -rw-r--r-- | src/engine/externalengine.h | 22 | ||||
| -rw-r--r-- | src/engine/precomp.h | 1 | ||||
| -rw-r--r-- | src/engine/userexperience.cpp | 159 |
8 files changed, 372 insertions, 179 deletions
diff --git a/src/engine/EngineForApplication.cpp b/src/engine/EngineForApplication.cpp index 87a0782c..e3ce7670 100644 --- a/src/engine/EngineForApplication.cpp +++ b/src/engine/EngineForApplication.cpp | |||
| @@ -5,31 +5,36 @@ | |||
| 5 | 5 | ||
| 6 | static HRESULT CopyStringToBA( | 6 | static HRESULT CopyStringToBA( |
| 7 | __in LPWSTR wzValue, | 7 | __in LPWSTR wzValue, |
| 8 | __in LPWSTR wzBuffer, | 8 | __in_opt LPWSTR wzBuffer, |
| 9 | __inout DWORD* pcchBuffer | 9 | __inout DWORD* pcchBuffer |
| 10 | ); | 10 | ); |
| 11 | 11 | ||
| 12 | static HRESULT BAEngineGetPackageCount( | 12 | static HRESULT BAEngineGetPackageCount( |
| 13 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, | 13 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, |
| 14 | __in BAENGINE_GETPACKAGECOUNT_ARGS* /*pArgs*/, | 14 | __in const LPVOID pvArgs, |
| 15 | __in BAENGINE_GETPACKAGECOUNT_RESULTS* pResults | 15 | __inout LPVOID pvResults |
| 16 | ) | 16 | ) |
| 17 | { | 17 | { |
| 18 | HRESULT hr = S_OK; | 18 | HRESULT hr = S_OK; |
| 19 | ValidateMessageArgs(hr, pvArgs, BAENGINE_GETPACKAGECOUNT_ARGS, pArgs); | ||
| 20 | ValidateMessageResults(hr, pvResults, BAENGINE_GETPACKAGECOUNT_RESULTS, pResults); | ||
| 19 | DWORD* pcPackages = &pResults->cPackages; | 21 | DWORD* pcPackages = &pResults->cPackages; |
| 20 | 22 | ||
| 21 | *pcPackages = pContext->pEngineState->packages.cPackages; | 23 | *pcPackages = pContext->pEngineState->packages.cPackages; |
| 22 | 24 | ||
| 25 | LExit: | ||
| 23 | return hr; | 26 | return hr; |
| 24 | } | 27 | } |
| 25 | 28 | ||
| 26 | static HRESULT BAEngineGetVariableNumeric( | 29 | static HRESULT BAEngineGetVariableNumeric( |
| 27 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, | 30 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, |
| 28 | __in BAENGINE_GETVARIABLENUMERIC_ARGS* pArgs, | 31 | __in const LPVOID pvArgs, |
| 29 | __in BAENGINE_GETVARIABLENUMERIC_RESULTS* pResults | 32 | __inout LPVOID pvResults |
| 30 | ) | 33 | ) |
| 31 | { | 34 | { |
| 32 | HRESULT hr = S_OK; | 35 | HRESULT hr = S_OK; |
| 36 | ValidateMessageArgs(hr, pvArgs, BAENGINE_GETVARIABLENUMERIC_ARGS, pArgs); | ||
| 37 | ValidateMessageResults(hr, pvResults, BAENGINE_GETVARIABLENUMERIC_RESULTS, pResults); | ||
| 33 | LPCWSTR wzVariable = pArgs->wzVariable; | 38 | LPCWSTR wzVariable = pArgs->wzVariable; |
| 34 | LONGLONG* pllValue = &pResults->llValue; | 39 | LONGLONG* pllValue = &pResults->llValue; |
| 35 | 40 | ||
| @@ -42,17 +47,20 @@ static HRESULT BAEngineGetVariableNumeric( | |||
| 42 | hr = E_INVALIDARG; | 47 | hr = E_INVALIDARG; |
| 43 | } | 48 | } |
| 44 | 49 | ||
| 50 | LExit: | ||
| 45 | return hr; | 51 | return hr; |
| 46 | } | 52 | } |
| 47 | 53 | ||
| 48 | static HRESULT BAEngineGetVariableString( | 54 | static HRESULT BAEngineGetVariableString( |
| 49 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, | 55 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, |
| 50 | __in BAENGINE_GETVARIABLESTRING_ARGS* pArgs, | 56 | __in const LPVOID pvArgs, |
| 51 | __in BAENGINE_GETVARIABLESTRING_RESULTS* pResults | 57 | __inout LPVOID pvResults |
| 52 | ) | 58 | ) |
| 53 | { | 59 | { |
| 54 | HRESULT hr = S_OK; | 60 | HRESULT hr = S_OK; |
| 55 | LPWSTR sczValue = NULL; | 61 | LPWSTR sczValue = NULL; |
| 62 | ValidateMessageArgs(hr, pvArgs, BAENGINE_GETVARIABLESTRING_ARGS, pArgs); | ||
| 63 | ValidateMessageResults(hr, pvResults, BAENGINE_GETVARIABLESTRING_RESULTS, pResults); | ||
| 56 | LPCWSTR wzVariable = pArgs->wzVariable; | 64 | LPCWSTR wzVariable = pArgs->wzVariable; |
| 57 | LPWSTR wzValue = pResults->wzValue; | 65 | LPWSTR wzValue = pResults->wzValue; |
| 58 | DWORD* pcchValue = &pResults->cchValue; | 66 | DWORD* pcchValue = &pResults->cchValue; |
| @@ -70,18 +78,21 @@ static HRESULT BAEngineGetVariableString( | |||
| 70 | hr = E_INVALIDARG; | 78 | hr = E_INVALIDARG; |
| 71 | } | 79 | } |
| 72 | 80 | ||
| 81 | LExit: | ||
| 73 | StrSecureZeroFreeString(sczValue); | 82 | StrSecureZeroFreeString(sczValue); |
| 74 | return hr; | 83 | return hr; |
| 75 | } | 84 | } |
| 76 | 85 | ||
| 77 | static HRESULT BAEngineGetVariableVersion( | 86 | static HRESULT BAEngineGetVariableVersion( |
| 78 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, | 87 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, |
| 79 | __in BAENGINE_GETVARIABLEVERSION_ARGS* pArgs, | 88 | __in const LPVOID pvArgs, |
| 80 | __in BAENGINE_GETVARIABLEVERSION_RESULTS* pResults | 89 | __inout LPVOID pvResults |
| 81 | ) | 90 | ) |
| 82 | { | 91 | { |
| 83 | HRESULT hr = S_OK; | 92 | HRESULT hr = S_OK; |
| 84 | VERUTIL_VERSION* pVersion = NULL; | 93 | VERUTIL_VERSION* pVersion = NULL; |
| 94 | ValidateMessageArgs(hr, pvArgs, BAENGINE_GETVARIABLEVERSION_ARGS, pArgs); | ||
| 95 | ValidateMessageResults(hr, pvResults, BAENGINE_GETVARIABLEVERSION_RESULTS, pResults); | ||
| 85 | LPCWSTR wzVariable = pArgs->wzVariable; | 96 | LPCWSTR wzVariable = pArgs->wzVariable; |
| 86 | LPWSTR wzValue = pResults->wzValue; | 97 | LPWSTR wzValue = pResults->wzValue; |
| 87 | DWORD* pcchValue = &pResults->cchValue; | 98 | DWORD* pcchValue = &pResults->cchValue; |
| @@ -99,6 +110,7 @@ static HRESULT BAEngineGetVariableVersion( | |||
| 99 | hr = E_INVALIDARG; | 110 | hr = E_INVALIDARG; |
| 100 | } | 111 | } |
| 101 | 112 | ||
| 113 | LExit: | ||
| 102 | ReleaseVerutilVersion(pVersion); | 114 | ReleaseVerutilVersion(pVersion); |
| 103 | 115 | ||
| 104 | return hr; | 116 | return hr; |
| @@ -106,12 +118,14 @@ static HRESULT BAEngineGetVariableVersion( | |||
| 106 | 118 | ||
| 107 | static HRESULT BAEngineFormatString( | 119 | static HRESULT BAEngineFormatString( |
| 108 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, | 120 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, |
| 109 | __in BAENGINE_FORMATSTRING_ARGS* pArgs, | 121 | __in const LPVOID pvArgs, |
| 110 | __in BAENGINE_FORMATSTRING_RESULTS* pResults | 122 | __inout LPVOID pvResults |
| 111 | ) | 123 | ) |
| 112 | { | 124 | { |
| 113 | HRESULT hr = S_OK; | 125 | HRESULT hr = S_OK; |
| 114 | LPWSTR sczValue = NULL; | 126 | LPWSTR sczValue = NULL; |
| 127 | ValidateMessageArgs(hr, pvArgs, BAENGINE_FORMATSTRING_ARGS, pArgs); | ||
| 128 | ValidateMessageResults(hr, pvResults, BAENGINE_FORMATSTRING_RESULTS, pResults); | ||
| 115 | LPCWSTR wzIn = pArgs->wzIn; | 129 | LPCWSTR wzIn = pArgs->wzIn; |
| 116 | LPWSTR wzOut = pResults->wzOut; | 130 | LPWSTR wzOut = pResults->wzOut; |
| 117 | DWORD* pcchOut = &pResults->cchOut; | 131 | DWORD* pcchOut = &pResults->cchOut; |
| @@ -129,18 +143,21 @@ static HRESULT BAEngineFormatString( | |||
| 129 | hr = E_INVALIDARG; | 143 | hr = E_INVALIDARG; |
| 130 | } | 144 | } |
| 131 | 145 | ||
| 146 | LExit: | ||
| 132 | StrSecureZeroFreeString(sczValue); | 147 | StrSecureZeroFreeString(sczValue); |
| 133 | return hr; | 148 | return hr; |
| 134 | } | 149 | } |
| 135 | 150 | ||
| 136 | static HRESULT BAEngineEscapeString( | 151 | static HRESULT BAEngineEscapeString( |
| 137 | __in BOOTSTRAPPER_ENGINE_CONTEXT* /*pContext*/, | 152 | __in BOOTSTRAPPER_ENGINE_CONTEXT* /*pContext*/, |
| 138 | __in BAENGINE_ESCAPESTRING_ARGS* pArgs, | 153 | __in const LPVOID pvArgs, |
| 139 | __in BAENGINE_ESCAPESTRING_RESULTS* pResults | 154 | __inout LPVOID pvResults |
| 140 | ) | 155 | ) |
| 141 | { | 156 | { |
| 142 | HRESULT hr = S_OK; | 157 | HRESULT hr = S_OK; |
| 143 | LPWSTR sczValue = NULL; | 158 | LPWSTR sczValue = NULL; |
| 159 | ValidateMessageArgs(hr, pvArgs, BAENGINE_ESCAPESTRING_ARGS, pArgs); | ||
| 160 | ValidateMessageResults(hr, pvResults, BAENGINE_ESCAPESTRING_RESULTS, pResults); | ||
| 144 | LPCWSTR wzIn = pArgs->wzIn; | 161 | LPCWSTR wzIn = pArgs->wzIn; |
| 145 | LPWSTR wzOut = pResults->wzOut; | 162 | LPWSTR wzOut = pResults->wzOut; |
| 146 | DWORD* pcchOut = &pResults->cchOut; | 163 | DWORD* pcchOut = &pResults->cchOut; |
| @@ -158,17 +175,20 @@ static HRESULT BAEngineEscapeString( | |||
| 158 | hr = E_INVALIDARG; | 175 | hr = E_INVALIDARG; |
| 159 | } | 176 | } |
| 160 | 177 | ||
| 178 | LExit: | ||
| 161 | StrSecureZeroFreeString(sczValue); | 179 | StrSecureZeroFreeString(sczValue); |
| 162 | return hr; | 180 | return hr; |
| 163 | } | 181 | } |
| 164 | 182 | ||
| 165 | static HRESULT BAEngineEvaluateCondition( | 183 | static HRESULT BAEngineEvaluateCondition( |
| 166 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, | 184 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, |
| 167 | __in BAENGINE_EVALUATECONDITION_ARGS* pArgs, | 185 | __in const LPVOID pvArgs, |
| 168 | __in BAENGINE_EVALUATECONDITION_RESULTS* pResults | 186 | __inout LPVOID pvResults |
| 169 | ) | 187 | ) |
| 170 | { | 188 | { |
| 171 | HRESULT hr = S_OK; | 189 | HRESULT hr = S_OK; |
| 190 | ValidateMessageArgs(hr, pvArgs, BAENGINE_EVALUATECONDITION_ARGS, pArgs); | ||
| 191 | ValidateMessageResults(hr, pvResults, BAENGINE_EVALUATECONDITION_RESULTS, pResults); | ||
| 172 | LPCWSTR wzCondition = pArgs->wzCondition; | 192 | LPCWSTR wzCondition = pArgs->wzCondition; |
| 173 | BOOL* pf = &pResults->f; | 193 | BOOL* pf = &pResults->f; |
| 174 | 194 | ||
| @@ -181,16 +201,19 @@ static HRESULT BAEngineEvaluateCondition( | |||
| 181 | hr = E_INVALIDARG; | 201 | hr = E_INVALIDARG; |
| 182 | } | 202 | } |
| 183 | 203 | ||
| 204 | LExit: | ||
| 184 | return hr; | 205 | return hr; |
| 185 | } | 206 | } |
| 186 | 207 | ||
| 187 | static HRESULT BAEngineLog( | 208 | static HRESULT BAEngineLog( |
| 188 | __in BOOTSTRAPPER_ENGINE_CONTEXT* /*pContext*/, | 209 | __in BOOTSTRAPPER_ENGINE_CONTEXT* /*pContext*/, |
| 189 | __in BAENGINE_LOG_ARGS* pArgs, | 210 | __in const LPVOID pvArgs, |
| 190 | __in BAENGINE_LOG_RESULTS* /*pResults*/ | 211 | __inout LPVOID pvResults |
| 191 | ) | 212 | ) |
| 192 | { | 213 | { |
| 193 | HRESULT hr = S_OK; | 214 | HRESULT hr = S_OK; |
| 215 | ValidateMessageArgs(hr, pvArgs, BAENGINE_LOG_ARGS, pArgs); | ||
| 216 | ValidateMessageResults(hr, pvResults, BAENGINE_LOG_RESULTS, pResults); | ||
| 194 | REPORT_LEVEL rl = REPORT_NONE; | 217 | REPORT_LEVEL rl = REPORT_NONE; |
| 195 | BOOTSTRAPPER_LOG_LEVEL level = pArgs->level; | 218 | BOOTSTRAPPER_LOG_LEVEL level = pArgs->level; |
| 196 | LPCWSTR wzMessage = pArgs->wzMessage; | 219 | LPCWSTR wzMessage = pArgs->wzMessage; |
| @@ -226,14 +249,16 @@ LExit: | |||
| 226 | 249 | ||
| 227 | static HRESULT BAEngineSendEmbeddedError( | 250 | static HRESULT BAEngineSendEmbeddedError( |
| 228 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, | 251 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, |
| 229 | __in BAENGINE_SENDEMBEDDEDERROR_ARGS* pArgs, | 252 | __in const LPVOID pvArgs, |
| 230 | __in BAENGINE_SENDEMBEDDEDERROR_RESULTS* pResults | 253 | __inout LPVOID pvResults |
| 231 | ) | 254 | ) |
| 232 | { | 255 | { |
| 233 | HRESULT hr = S_OK; | 256 | HRESULT hr = S_OK; |
| 234 | BYTE* pbData = NULL; | 257 | BYTE* pbData = NULL; |
| 235 | DWORD cbData = 0; | 258 | DWORD cbData = 0; |
| 236 | DWORD dwResult = 0; | 259 | DWORD dwResult = 0; |
| 260 | ValidateMessageArgs(hr, pvArgs, BAENGINE_SENDEMBEDDEDERROR_ARGS, pArgs); | ||
| 261 | ValidateMessageResults(hr, pvResults, BAENGINE_SENDEMBEDDEDERROR_RESULTS, pResults); | ||
| 237 | DWORD dwErrorCode = pArgs->dwErrorCode; | 262 | DWORD dwErrorCode = pArgs->dwErrorCode; |
| 238 | LPCWSTR wzMessage = pArgs->wzMessage; | 263 | LPCWSTR wzMessage = pArgs->wzMessage; |
| 239 | DWORD dwUIHint = pArgs->dwUIHint; | 264 | DWORD dwUIHint = pArgs->dwUIHint; |
| @@ -266,14 +291,16 @@ LExit: | |||
| 266 | 291 | ||
| 267 | static HRESULT BAEngineSendEmbeddedProgress( | 292 | static HRESULT BAEngineSendEmbeddedProgress( |
| 268 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, | 293 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, |
| 269 | __in BAENGINE_SENDEMBEDDEDPROGRESS_ARGS* pArgs, | 294 | __in const LPVOID pvArgs, |
| 270 | __in BAENGINE_SENDEMBEDDEDPROGRESS_RESULTS* pResults | 295 | __inout LPVOID pvResults |
| 271 | ) | 296 | ) |
| 272 | { | 297 | { |
| 273 | HRESULT hr = S_OK; | 298 | HRESULT hr = S_OK; |
| 274 | BYTE* pbData = NULL; | 299 | BYTE* pbData = NULL; |
| 275 | DWORD cbData = 0; | 300 | DWORD cbData = 0; |
| 276 | DWORD dwResult = 0; | 301 | DWORD dwResult = 0; |
| 302 | ValidateMessageArgs(hr, pvArgs, BAENGINE_SENDEMBEDDEDPROGRESS_ARGS, pArgs); | ||
| 303 | ValidateMessageResults(hr, pvResults, BAENGINE_SENDEMBEDDEDPROGRESS_RESULTS, pResults); | ||
| 277 | DWORD dwProgressPercentage = pArgs->dwProgressPercentage; | 304 | DWORD dwProgressPercentage = pArgs->dwProgressPercentage; |
| 278 | DWORD dwOverallProgressPercentage = pArgs->dwOverallProgressPercentage; | 305 | DWORD dwOverallProgressPercentage = pArgs->dwOverallProgressPercentage; |
| 279 | int* pnResult = &pResults->nResult; | 306 | int* pnResult = &pResults->nResult; |
| @@ -302,8 +329,8 @@ LExit: | |||
| 302 | 329 | ||
| 303 | static HRESULT BAEngineSetUpdate( | 330 | static HRESULT BAEngineSetUpdate( |
| 304 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, | 331 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, |
| 305 | __in const BAENGINE_SETUPDATE_ARGS* pArgs, | 332 | __in const LPVOID pvArgs, |
| 306 | __in BAENGINE_SETUPDATE_RESULTS* /*pResults*/ | 333 | __inout LPVOID pvResults |
| 307 | ) | 334 | ) |
| 308 | { | 335 | { |
| 309 | HRESULT hr = S_OK; | 336 | HRESULT hr = S_OK; |
| @@ -313,6 +340,8 @@ static HRESULT BAEngineSetUpdate( | |||
| 313 | UUID guid = { }; | 340 | UUID guid = { }; |
| 314 | WCHAR wzGuid[39]; | 341 | WCHAR wzGuid[39]; |
| 315 | RPC_STATUS rs = RPC_S_OK; | 342 | RPC_STATUS rs = RPC_S_OK; |
| 343 | ValidateMessageArgs(hr, pvArgs, BAENGINE_SETUPDATE_ARGS, pArgs); | ||
| 344 | ValidateMessageResults(hr, pvResults, BAENGINE_SETUPDATE_RESULTS, pResults); | ||
| 316 | LPCWSTR wzLocalSource = pArgs->wzLocalSource; | 345 | LPCWSTR wzLocalSource = pArgs->wzLocalSource; |
| 317 | LPCWSTR wzDownloadSource = pArgs->wzDownloadSource; | 346 | LPCWSTR wzDownloadSource = pArgs->wzDownloadSource; |
| 318 | DWORD64 qwSize = pArgs->qwSize; | 347 | DWORD64 qwSize = pArgs->qwSize; |
| @@ -385,13 +414,15 @@ LExit: | |||
| 385 | 414 | ||
| 386 | static HRESULT BAEngineSetLocalSource( | 415 | static HRESULT BAEngineSetLocalSource( |
| 387 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, | 416 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, |
| 388 | __in BAENGINE_SETLOCALSOURCE_ARGS* pArgs, | 417 | __in const LPVOID pvArgs, |
| 389 | __in BAENGINE_SETLOCALSOURCE_RESULTS* /*pResults*/ | 418 | __inout LPVOID pvResults |
| 390 | ) | 419 | ) |
| 391 | { | 420 | { |
| 392 | HRESULT hr = S_OK; | 421 | HRESULT hr = S_OK; |
| 393 | BURN_CONTAINER* pContainer = NULL; | 422 | BURN_CONTAINER* pContainer = NULL; |
| 394 | BURN_PAYLOAD* pPayload = NULL; | 423 | BURN_PAYLOAD* pPayload = NULL; |
| 424 | ValidateMessageArgs(hr, pvArgs, BAENGINE_SETLOCALSOURCE_ARGS, pArgs); | ||
| 425 | ValidateMessageResults(hr, pvResults, BAENGINE_SETLOCALSOURCE_RESULTS, pResults); | ||
| 395 | LPCWSTR wzPackageOrContainerId = pArgs->wzPackageOrContainerId; | 426 | LPCWSTR wzPackageOrContainerId = pArgs->wzPackageOrContainerId; |
| 396 | LPCWSTR wzPayloadId = pArgs->wzPayloadId; | 427 | LPCWSTR wzPayloadId = pArgs->wzPayloadId; |
| 397 | LPCWSTR wzPath = pArgs->wzPath; | 428 | LPCWSTR wzPath = pArgs->wzPath; |
| @@ -438,14 +469,16 @@ LExit: | |||
| 438 | 469 | ||
| 439 | static HRESULT BAEngineSetDownloadSource( | 470 | static HRESULT BAEngineSetDownloadSource( |
| 440 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, | 471 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, |
| 441 | __in BAENGINE_SETDOWNLOADSOURCE_ARGS* pArgs, | 472 | __in const LPVOID pvArgs, |
| 442 | __in BAENGINE_SETDOWNLOADSOURCE_RESULTS* /*pResults*/ | 473 | __inout LPVOID pvResults |
| 443 | ) | 474 | ) |
| 444 | { | 475 | { |
| 445 | HRESULT hr = S_OK; | 476 | HRESULT hr = S_OK; |
| 446 | BURN_CONTAINER* pContainer = NULL; | 477 | BURN_CONTAINER* pContainer = NULL; |
| 447 | BURN_PAYLOAD* pPayload = NULL; | 478 | BURN_PAYLOAD* pPayload = NULL; |
| 448 | DOWNLOAD_SOURCE* pDownloadSource = NULL; | 479 | DOWNLOAD_SOURCE* pDownloadSource = NULL; |
| 480 | ValidateMessageArgs(hr, pvArgs, BAENGINE_SETDOWNLOADSOURCE_ARGS, pArgs); | ||
| 481 | ValidateMessageResults(hr, pvResults, BAENGINE_SETDOWNLOADSOURCE_RESULTS, pResults); | ||
| 449 | LPCWSTR wzPackageOrContainerId = pArgs->wzPackageOrContainerId; | 482 | LPCWSTR wzPackageOrContainerId = pArgs->wzPackageOrContainerId; |
| 450 | LPCWSTR wzPayloadId = pArgs->wzPayloadId; | 483 | LPCWSTR wzPayloadId = pArgs->wzPayloadId; |
| 451 | LPCWSTR wzUrl = pArgs->wzUrl; | 484 | LPCWSTR wzUrl = pArgs->wzUrl; |
| @@ -522,11 +555,13 @@ LExit: | |||
| 522 | 555 | ||
| 523 | static HRESULT BAEngineSetVariableNumeric( | 556 | static HRESULT BAEngineSetVariableNumeric( |
| 524 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, | 557 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, |
| 525 | __in const BAENGINE_SETVARIABLENUMERIC_ARGS* pArgs, | 558 | __in const LPVOID pvArgs, |
| 526 | __in BAENGINE_SETVARIABLENUMERIC_RESULTS* /*pResults*/ | 559 | __inout LPVOID pvResults |
| 527 | ) | 560 | ) |
| 528 | { | 561 | { |
| 529 | HRESULT hr = S_OK; | 562 | HRESULT hr = S_OK; |
| 563 | ValidateMessageArgs(hr, pvArgs, BAENGINE_SETVARIABLENUMERIC_ARGS, pArgs); | ||
| 564 | ValidateMessageResults(hr, pvResults, BAENGINE_SETVARIABLENUMERIC_RESULTS, pResults); | ||
| 530 | LPCWSTR wzVariable = pArgs->wzVariable; | 565 | LPCWSTR wzVariable = pArgs->wzVariable; |
| 531 | LONGLONG llValue = pArgs->llValue; | 566 | LONGLONG llValue = pArgs->llValue; |
| 532 | 567 | ||
| @@ -547,11 +582,13 @@ LExit: | |||
| 547 | 582 | ||
| 548 | static HRESULT BAEngineSetVariableString( | 583 | static HRESULT BAEngineSetVariableString( |
| 549 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, | 584 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, |
| 550 | __in const BAENGINE_SETVARIABLESTRING_ARGS* pArgs, | 585 | __in const LPVOID pvArgs, |
| 551 | __in BAENGINE_SETVARIABLESTRING_RESULTS* /*pResults*/ | 586 | __inout LPVOID pvResults |
| 552 | ) | 587 | ) |
| 553 | { | 588 | { |
| 554 | HRESULT hr = S_OK; | 589 | HRESULT hr = S_OK; |
| 590 | ValidateMessageArgs(hr, pvArgs, BAENGINE_SETVARIABLESTRING_ARGS, pArgs); | ||
| 591 | ValidateMessageResults(hr, pvResults, BAENGINE_SETVARIABLESTRING_RESULTS, pResults); | ||
| 555 | LPCWSTR wzVariable = pArgs->wzVariable; | 592 | LPCWSTR wzVariable = pArgs->wzVariable; |
| 556 | LPCWSTR wzValue = pArgs->wzValue; | 593 | LPCWSTR wzValue = pArgs->wzValue; |
| 557 | 594 | ||
| @@ -572,14 +609,16 @@ LExit: | |||
| 572 | 609 | ||
| 573 | static HRESULT BAEngineSetVariableVersion( | 610 | static HRESULT BAEngineSetVariableVersion( |
| 574 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, | 611 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, |
| 575 | __in const BAENGINE_SETVARIABLEVERSION_ARGS* pArgs, | 612 | __in const LPVOID pvArgs, |
| 576 | __in BAENGINE_SETVARIABLEVERSION_RESULTS* /*pResults*/ | 613 | __inout LPVOID pvResults |
| 577 | ) | 614 | ) |
| 578 | { | 615 | { |
| 579 | HRESULT hr = S_OK; | 616 | HRESULT hr = S_OK; |
| 617 | VERUTIL_VERSION* pVersion = NULL; | ||
| 618 | ValidateMessageArgs(hr, pvArgs, BAENGINE_SETVARIABLEVERSION_ARGS, pArgs); | ||
| 619 | ValidateMessageResults(hr, pvResults, BAENGINE_SETVARIABLEVERSION_RESULTS, pResults); | ||
| 580 | LPCWSTR wzVariable = pArgs->wzVariable; | 620 | LPCWSTR wzVariable = pArgs->wzVariable; |
| 581 | LPCWSTR wzValue = pArgs->wzValue; | 621 | LPCWSTR wzValue = pArgs->wzValue; |
| 582 | VERUTIL_VERSION* pVersion = NULL; | ||
| 583 | 622 | ||
| 584 | if (wzVariable && *wzVariable) | 623 | if (wzVariable && *wzVariable) |
| 585 | { | 624 | { |
| @@ -606,42 +645,52 @@ LExit: | |||
| 606 | 645 | ||
| 607 | static HRESULT BAEngineCloseSplashScreen( | 646 | static HRESULT BAEngineCloseSplashScreen( |
| 608 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, | 647 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, |
| 609 | __in const BAENGINE_CLOSESPLASHSCREEN_ARGS* /*pArgs*/, | 648 | __in const LPVOID pvArgs, |
| 610 | __in BAENGINE_CLOSESPLASHSCREEN_RESULTS* /*pResults*/ | 649 | __inout LPVOID pvResults |
| 611 | ) | 650 | ) |
| 612 | { | 651 | { |
| 652 | HRESULT hr = S_OK; | ||
| 653 | ValidateMessageArgs(hr, pvArgs, BAENGINE_CLOSESPLASHSCREEN_ARGS, pArgs); | ||
| 654 | ValidateMessageResults(hr, pvResults, BAENGINE_CLOSESPLASHSCREEN_RESULTS, pResults); | ||
| 655 | |||
| 613 | // If the splash screen is still around, close it. | 656 | // If the splash screen is still around, close it. |
| 614 | if (::IsWindow(pContext->pEngineState->command.hwndSplashScreen)) | 657 | if (::IsWindow(pContext->pEngineState->command.hwndSplashScreen)) |
| 615 | { | 658 | { |
| 616 | ::PostMessageW(pContext->pEngineState->command.hwndSplashScreen, WM_CLOSE, 0, 0); | 659 | ::PostMessageW(pContext->pEngineState->command.hwndSplashScreen, WM_CLOSE, 0, 0); |
| 617 | } | 660 | } |
| 618 | 661 | ||
| 619 | return S_OK; | 662 | LExit: |
| 663 | return hr; | ||
| 620 | } | 664 | } |
| 621 | 665 | ||
| 622 | static HRESULT BAEngineCompareVersions( | 666 | static HRESULT BAEngineCompareVersions( |
| 623 | __in BOOTSTRAPPER_ENGINE_CONTEXT* /*pContext*/, | 667 | __in BOOTSTRAPPER_ENGINE_CONTEXT* /*pContext*/, |
| 624 | __in const BAENGINE_COMPAREVERSIONS_ARGS* pArgs, | 668 | __in const LPVOID pvArgs, |
| 625 | __in BAENGINE_COMPAREVERSIONS_RESULTS* pResults | 669 | __inout LPVOID pvResults |
| 626 | ) | 670 | ) |
| 627 | { | 671 | { |
| 628 | HRESULT hr = S_OK; | 672 | HRESULT hr = S_OK; |
| 673 | ValidateMessageArgs(hr, pvArgs, BAENGINE_COMPAREVERSIONS_ARGS, pArgs); | ||
| 674 | ValidateMessageResults(hr, pvResults, BAENGINE_COMPAREVERSIONS_RESULTS, pResults); | ||
| 629 | LPCWSTR wzVersion1 = pArgs->wzVersion1; | 675 | LPCWSTR wzVersion1 = pArgs->wzVersion1; |
| 630 | LPCWSTR wzVersion2 = pArgs->wzVersion2; | 676 | LPCWSTR wzVersion2 = pArgs->wzVersion2; |
| 631 | int* pnResult = &pResults->nResult; | 677 | int* pnResult = &pResults->nResult; |
| 632 | 678 | ||
| 633 | hr = VerCompareStringVersions(wzVersion1, wzVersion2, FALSE, pnResult); | 679 | hr = VerCompareStringVersions(wzVersion1, wzVersion2, FALSE, pnResult); |
| 634 | 680 | ||
| 681 | LExit: | ||
| 635 | return hr; | 682 | return hr; |
| 636 | } | 683 | } |
| 637 | 684 | ||
| 638 | static HRESULT BAEngineDetect( | 685 | static HRESULT BAEngineDetect( |
| 639 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, | 686 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, |
| 640 | __in BAENGINE_DETECT_ARGS* pArgs, | 687 | __in const LPVOID pvArgs, |
| 641 | __in BAENGINE_DETECT_RESULTS* /*pResults*/ | 688 | __inout LPVOID pvResults |
| 642 | ) | 689 | ) |
| 643 | { | 690 | { |
| 644 | HRESULT hr = S_OK; | 691 | HRESULT hr = S_OK; |
| 692 | ValidateMessageArgs(hr, pvArgs, BAENGINE_DETECT_ARGS, pArgs); | ||
| 693 | ValidateMessageResults(hr, pvResults, BAENGINE_DETECT_RESULTS, pResults); | ||
| 645 | 694 | ||
| 646 | if (!::PostThreadMessageW(pContext->dwThreadId, WM_BURN_DETECT, 0, reinterpret_cast<LPARAM>(pArgs->hwndParent))) | 695 | if (!::PostThreadMessageW(pContext->dwThreadId, WM_BURN_DETECT, 0, reinterpret_cast<LPARAM>(pArgs->hwndParent))) |
| 647 | { | 696 | { |
| @@ -654,11 +703,13 @@ LExit: | |||
| 654 | 703 | ||
| 655 | static HRESULT BAEnginePlan( | 704 | static HRESULT BAEnginePlan( |
| 656 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, | 705 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, |
| 657 | __in const BAENGINE_PLAN_ARGS* pArgs, | 706 | __in const LPVOID pvArgs, |
| 658 | __in BAENGINE_PLAN_RESULTS* /*pResults*/ | 707 | __inout LPVOID pvResults |
| 659 | ) | 708 | ) |
| 660 | { | 709 | { |
| 661 | HRESULT hr = S_OK; | 710 | HRESULT hr = S_OK; |
| 711 | ValidateMessageArgs(hr, pvArgs, BAENGINE_PLAN_ARGS, pArgs); | ||
| 712 | ValidateMessageResults(hr, pvResults, BAENGINE_PLAN_RESULTS, pResults); | ||
| 662 | BOOTSTRAPPER_ACTION action = pArgs->action; | 713 | BOOTSTRAPPER_ACTION action = pArgs->action; |
| 663 | 714 | ||
| 664 | if (!::PostThreadMessageW(pContext->dwThreadId, WM_BURN_PLAN, 0, action)) | 715 | if (!::PostThreadMessageW(pContext->dwThreadId, WM_BURN_PLAN, 0, action)) |
| @@ -672,11 +723,13 @@ LExit: | |||
| 672 | 723 | ||
| 673 | static HRESULT BAEngineElevate( | 724 | static HRESULT BAEngineElevate( |
| 674 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, | 725 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, |
| 675 | __in const BAENGINE_ELEVATE_ARGS* pArgs, | 726 | __in const LPVOID pvArgs, |
| 676 | __in BAENGINE_ELEVATE_RESULTS* /*pResults*/ | 727 | __inout LPVOID pvResults |
| 677 | ) | 728 | ) |
| 678 | { | 729 | { |
| 679 | HRESULT hr = S_OK; | 730 | HRESULT hr = S_OK; |
| 731 | ValidateMessageArgs(hr, pvArgs, BAENGINE_ELEVATE_ARGS, pArgs); | ||
| 732 | ValidateMessageResults(hr, pvResults, BAENGINE_ELEVATE_RESULTS, pResults); | ||
| 680 | 733 | ||
| 681 | if (INVALID_HANDLE_VALUE != pContext->pEngineState->companionConnection.hPipe) | 734 | if (INVALID_HANDLE_VALUE != pContext->pEngineState->companionConnection.hPipe) |
| 682 | { | 735 | { |
| @@ -693,11 +746,13 @@ LExit: | |||
| 693 | 746 | ||
| 694 | static HRESULT BAEngineApply( | 747 | static HRESULT BAEngineApply( |
| 695 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, | 748 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, |
| 696 | __in const BAENGINE_APPLY_ARGS* pArgs, | 749 | __in const LPVOID pvArgs, |
| 697 | __in BAENGINE_APPLY_RESULTS* /*pResults*/ | 750 | __inout LPVOID pvResults |
| 698 | ) | 751 | ) |
| 699 | { | 752 | { |
| 700 | HRESULT hr = S_OK; | 753 | HRESULT hr = S_OK; |
| 754 | ValidateMessageArgs(hr, pvArgs, BAENGINE_APPLY_ARGS, pArgs); | ||
| 755 | ValidateMessageResults(hr, pvResults, BAENGINE_APPLY_RESULTS, pResults); | ||
| 701 | 756 | ||
| 702 | ExitOnNull(pArgs->hwndParent, hr, E_INVALIDARG, "BA passed NULL hwndParent to Apply."); | 757 | ExitOnNull(pArgs->hwndParent, hr, E_INVALIDARG, "BA passed NULL hwndParent to Apply."); |
| 703 | if (!::IsWindow(pArgs->hwndParent)) | 758 | if (!::IsWindow(pArgs->hwndParent)) |
| @@ -716,11 +771,13 @@ LExit: | |||
| 716 | 771 | ||
| 717 | static HRESULT BAEngineQuit( | 772 | static HRESULT BAEngineQuit( |
| 718 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, | 773 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, |
| 719 | __in const BAENGINE_QUIT_ARGS* pArgs, | 774 | __in const LPVOID pvArgs, |
| 720 | __in BAENGINE_QUIT_RESULTS* /*pResults*/ | 775 | __inout LPVOID pvResults |
| 721 | ) | 776 | ) |
| 722 | { | 777 | { |
| 723 | HRESULT hr = S_OK; | 778 | HRESULT hr = S_OK; |
| 779 | ValidateMessageArgs(hr, pvArgs, BAENGINE_QUIT_ARGS, pArgs); | ||
| 780 | ValidateMessageResults(hr, pvResults, BAENGINE_QUIT_RESULTS, pResults); | ||
| 724 | 781 | ||
| 725 | if (!::PostThreadMessageW(pContext->dwThreadId, WM_BURN_QUIT, static_cast<WPARAM>(pArgs->dwExitCode), 0)) | 782 | if (!::PostThreadMessageW(pContext->dwThreadId, WM_BURN_QUIT, static_cast<WPARAM>(pArgs->dwExitCode), 0)) |
| 726 | { | 783 | { |
| @@ -733,19 +790,24 @@ LExit: | |||
| 733 | 790 | ||
| 734 | static HRESULT BAEngineLaunchApprovedExe( | 791 | static HRESULT BAEngineLaunchApprovedExe( |
| 735 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, | 792 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, |
| 736 | __in const BAENGINE_LAUNCHAPPROVEDEXE_ARGS* pArgs, | 793 | __in const LPVOID pvArgs, |
| 737 | __in BAENGINE_LAUNCHAPPROVEDEXE_RESULTS* /*pResults*/ | 794 | __inout LPVOID pvResults |
| 738 | ) | 795 | ) |
| 739 | { | 796 | { |
| 740 | HRESULT hr = S_OK; | 797 | HRESULT hr = S_OK; |
| 741 | BURN_APPROVED_EXE* pApprovedExe = NULL; | 798 | BURN_APPROVED_EXE* pApprovedExe = NULL; |
| 742 | BOOL fLeaveCriticalSection = FALSE; | 799 | BOOL fLeaveCriticalSection = FALSE; |
| 743 | BURN_LAUNCH_APPROVED_EXE* pLaunchApprovedExe = (BURN_LAUNCH_APPROVED_EXE*)MemAlloc(sizeof(BURN_LAUNCH_APPROVED_EXE), TRUE); | 800 | BURN_LAUNCH_APPROVED_EXE* pLaunchApprovedExe = NULL; |
| 801 | ValidateMessageArgs(hr, pvArgs, BAENGINE_LAUNCHAPPROVEDEXE_ARGS, pArgs); | ||
| 802 | ValidateMessageResults(hr, pvResults, BAENGINE_LAUNCHAPPROVEDEXE_RESULTS, pResults); | ||
| 744 | HWND hwndParent = pArgs->hwndParent; | 803 | HWND hwndParent = pArgs->hwndParent; |
| 745 | LPCWSTR wzApprovedExeForElevationId = pArgs->wzApprovedExeForElevationId; | 804 | LPCWSTR wzApprovedExeForElevationId = pArgs->wzApprovedExeForElevationId; |
| 746 | LPCWSTR wzArguments = pArgs->wzArguments; | 805 | LPCWSTR wzArguments = pArgs->wzArguments; |
| 747 | DWORD dwWaitForInputIdleTimeout = pArgs->dwWaitForInputIdleTimeout; | 806 | DWORD dwWaitForInputIdleTimeout = pArgs->dwWaitForInputIdleTimeout; |
| 748 | 807 | ||
| 808 | pLaunchApprovedExe = (BURN_LAUNCH_APPROVED_EXE*)MemAlloc(sizeof(BURN_LAUNCH_APPROVED_EXE), TRUE); | ||
| 809 | ExitOnNull(pLaunchApprovedExe, hr, E_OUTOFMEMORY, "Failed to alloc BURN_LAUNCH_APPROVED_EXE"); | ||
| 810 | |||
| 749 | ::EnterCriticalSection(&pContext->pEngineState->csActive); | 811 | ::EnterCriticalSection(&pContext->pEngineState->csActive); |
| 750 | fLeaveCriticalSection = TRUE; | 812 | fLeaveCriticalSection = TRUE; |
| 751 | hr = UserExperienceEnsureEngineInactive(&pContext->pEngineState->userExperience); | 813 | hr = UserExperienceEnsureEngineInactive(&pContext->pEngineState->userExperience); |
| @@ -812,76 +874,76 @@ HRESULT WINAPI EngineForApplicationProc( | |||
| 812 | switch (message) | 874 | switch (message) |
| 813 | { | 875 | { |
| 814 | case BOOTSTRAPPER_ENGINE_MESSAGE_GETPACKAGECOUNT: | 876 | case BOOTSTRAPPER_ENGINE_MESSAGE_GETPACKAGECOUNT: |
| 815 | hr = BAEngineGetPackageCount(pContext, reinterpret_cast<BAENGINE_GETPACKAGECOUNT_ARGS*>(pvArgs), reinterpret_cast<BAENGINE_GETPACKAGECOUNT_RESULTS*>(pvResults)); | 877 | hr = BAEngineGetPackageCount(pContext, pvArgs, pvResults); |
| 816 | break; | 878 | break; |
| 817 | case BOOTSTRAPPER_ENGINE_MESSAGE_GETVARIABLENUMERIC: | 879 | case BOOTSTRAPPER_ENGINE_MESSAGE_GETVARIABLENUMERIC: |
| 818 | hr = BAEngineGetVariableNumeric(pContext, reinterpret_cast<BAENGINE_GETVARIABLENUMERIC_ARGS*>(pvArgs), reinterpret_cast<BAENGINE_GETVARIABLENUMERIC_RESULTS*>(pvResults)); | 880 | hr = BAEngineGetVariableNumeric(pContext, pvArgs, pvResults); |
| 819 | break; | 881 | break; |
| 820 | case BOOTSTRAPPER_ENGINE_MESSAGE_GETVARIABLESTRING: | 882 | case BOOTSTRAPPER_ENGINE_MESSAGE_GETVARIABLESTRING: |
| 821 | hr = BAEngineGetVariableString(pContext, reinterpret_cast<BAENGINE_GETVARIABLESTRING_ARGS*>(pvArgs), reinterpret_cast<BAENGINE_GETVARIABLESTRING_RESULTS*>(pvResults)); | 883 | hr = BAEngineGetVariableString(pContext, pvArgs, pvResults); |
| 822 | break; | 884 | break; |
| 823 | case BOOTSTRAPPER_ENGINE_MESSAGE_GETVARIABLEVERSION: | 885 | case BOOTSTRAPPER_ENGINE_MESSAGE_GETVARIABLEVERSION: |
| 824 | hr = BAEngineGetVariableVersion(pContext, reinterpret_cast<BAENGINE_GETVARIABLEVERSION_ARGS*>(pvArgs), reinterpret_cast<BAENGINE_GETVARIABLEVERSION_RESULTS*>(pvResults)); | 886 | hr = BAEngineGetVariableVersion(pContext, pvArgs, pvResults); |
| 825 | break; | 887 | break; |
| 826 | case BOOTSTRAPPER_ENGINE_MESSAGE_FORMATSTRING: | 888 | case BOOTSTRAPPER_ENGINE_MESSAGE_FORMATSTRING: |
| 827 | hr = BAEngineFormatString(pContext, reinterpret_cast<BAENGINE_FORMATSTRING_ARGS*>(pvArgs), reinterpret_cast<BAENGINE_FORMATSTRING_RESULTS*>(pvResults)); | 889 | hr = BAEngineFormatString(pContext, pvArgs, pvResults); |
| 828 | break; | 890 | break; |
| 829 | case BOOTSTRAPPER_ENGINE_MESSAGE_ESCAPESTRING: | 891 | case BOOTSTRAPPER_ENGINE_MESSAGE_ESCAPESTRING: |
| 830 | hr = BAEngineEscapeString(pContext, reinterpret_cast<BAENGINE_ESCAPESTRING_ARGS*>(pvArgs), reinterpret_cast<BAENGINE_ESCAPESTRING_RESULTS*>(pvResults)); | 892 | hr = BAEngineEscapeString(pContext, pvArgs, pvResults); |
| 831 | break; | 893 | break; |
| 832 | case BOOTSTRAPPER_ENGINE_MESSAGE_EVALUATECONDITION: | 894 | case BOOTSTRAPPER_ENGINE_MESSAGE_EVALUATECONDITION: |
| 833 | hr = BAEngineEvaluateCondition(pContext, reinterpret_cast<BAENGINE_EVALUATECONDITION_ARGS*>(pvArgs), reinterpret_cast<BAENGINE_EVALUATECONDITION_RESULTS*>(pvResults)); | 895 | hr = BAEngineEvaluateCondition(pContext, pvArgs, pvResults); |
| 834 | break; | 896 | break; |
| 835 | case BOOTSTRAPPER_ENGINE_MESSAGE_LOG: | 897 | case BOOTSTRAPPER_ENGINE_MESSAGE_LOG: |
| 836 | hr = BAEngineLog(pContext, reinterpret_cast<BAENGINE_LOG_ARGS*>(pvArgs), reinterpret_cast<BAENGINE_LOG_RESULTS*>(pvResults)); | 898 | hr = BAEngineLog(pContext, pvArgs, pvResults); |
| 837 | break; | 899 | break; |
| 838 | case BOOTSTRAPPER_ENGINE_MESSAGE_SENDEMBEDDEDERROR: | 900 | case BOOTSTRAPPER_ENGINE_MESSAGE_SENDEMBEDDEDERROR: |
| 839 | hr = BAEngineSendEmbeddedError(pContext, reinterpret_cast<BAENGINE_SENDEMBEDDEDERROR_ARGS*>(pvArgs), reinterpret_cast<BAENGINE_SENDEMBEDDEDERROR_RESULTS*>(pvResults)); | 901 | hr = BAEngineSendEmbeddedError(pContext, pvArgs, pvResults); |
| 840 | break; | 902 | break; |
| 841 | case BOOTSTRAPPER_ENGINE_MESSAGE_SENDEMBEDDEDPROGRESS: | 903 | case BOOTSTRAPPER_ENGINE_MESSAGE_SENDEMBEDDEDPROGRESS: |
| 842 | hr = BAEngineSendEmbeddedProgress(pContext, reinterpret_cast<BAENGINE_SENDEMBEDDEDPROGRESS_ARGS*>(pvArgs), reinterpret_cast<BAENGINE_SENDEMBEDDEDPROGRESS_RESULTS*>(pvResults)); | 904 | hr = BAEngineSendEmbeddedProgress(pContext, pvArgs, pvResults); |
| 843 | break; | 905 | break; |
| 844 | case BOOTSTRAPPER_ENGINE_MESSAGE_SETUPDATE: | 906 | case BOOTSTRAPPER_ENGINE_MESSAGE_SETUPDATE: |
| 845 | hr = BAEngineSetUpdate(pContext, reinterpret_cast<BAENGINE_SETUPDATE_ARGS*>(pvArgs), reinterpret_cast<BAENGINE_SETUPDATE_RESULTS*>(pvResults)); | 907 | hr = BAEngineSetUpdate(pContext, pvArgs, pvResults); |
| 846 | break; | 908 | break; |
| 847 | case BOOTSTRAPPER_ENGINE_MESSAGE_SETLOCALSOURCE: | 909 | case BOOTSTRAPPER_ENGINE_MESSAGE_SETLOCALSOURCE: |
| 848 | hr = BAEngineSetLocalSource(pContext, reinterpret_cast<BAENGINE_SETLOCALSOURCE_ARGS*>(pvArgs), reinterpret_cast<BAENGINE_SETLOCALSOURCE_RESULTS*>(pvResults)); | 910 | hr = BAEngineSetLocalSource(pContext, pvArgs, pvResults); |
| 849 | break; | 911 | break; |
| 850 | case BOOTSTRAPPER_ENGINE_MESSAGE_SETDOWNLOADSOURCE: | 912 | case BOOTSTRAPPER_ENGINE_MESSAGE_SETDOWNLOADSOURCE: |
| 851 | hr = BAEngineSetDownloadSource(pContext, reinterpret_cast<BAENGINE_SETDOWNLOADSOURCE_ARGS*>(pvArgs), reinterpret_cast<BAENGINE_SETDOWNLOADSOURCE_RESULTS*>(pvResults)); | 913 | hr = BAEngineSetDownloadSource(pContext, pvArgs, pvResults); |
| 852 | break; | 914 | break; |
| 853 | case BOOTSTRAPPER_ENGINE_MESSAGE_SETVARIABLENUMERIC: | 915 | case BOOTSTRAPPER_ENGINE_MESSAGE_SETVARIABLENUMERIC: |
| 854 | hr = BAEngineSetVariableNumeric(pContext, reinterpret_cast<BAENGINE_SETVARIABLENUMERIC_ARGS*>(pvArgs), reinterpret_cast<BAENGINE_SETVARIABLENUMERIC_RESULTS*>(pvResults)); | 916 | hr = BAEngineSetVariableNumeric(pContext, pvArgs, pvResults); |
| 855 | break; | 917 | break; |
| 856 | case BOOTSTRAPPER_ENGINE_MESSAGE_SETVARIABLESTRING: | 918 | case BOOTSTRAPPER_ENGINE_MESSAGE_SETVARIABLESTRING: |
| 857 | hr = BAEngineSetVariableString(pContext, reinterpret_cast<BAENGINE_SETVARIABLESTRING_ARGS*>(pvArgs), reinterpret_cast<BAENGINE_SETVARIABLESTRING_RESULTS*>(pvResults)); | 919 | hr = BAEngineSetVariableString(pContext, pvArgs, pvResults); |
| 858 | break; | 920 | break; |
| 859 | case BOOTSTRAPPER_ENGINE_MESSAGE_SETVARIABLEVERSION: | 921 | case BOOTSTRAPPER_ENGINE_MESSAGE_SETVARIABLEVERSION: |
| 860 | hr = BAEngineSetVariableVersion(pContext, reinterpret_cast<BAENGINE_SETVARIABLEVERSION_ARGS*>(pvArgs), reinterpret_cast<BAENGINE_SETVARIABLEVERSION_RESULTS*>(pvResults)); | 922 | hr = BAEngineSetVariableVersion(pContext, pvArgs, pvResults); |
| 861 | break; | 923 | break; |
| 862 | case BOOTSTRAPPER_ENGINE_MESSAGE_CLOSESPLASHSCREEN: | 924 | case BOOTSTRAPPER_ENGINE_MESSAGE_CLOSESPLASHSCREEN: |
| 863 | hr = BAEngineCloseSplashScreen(pContext, reinterpret_cast<BAENGINE_CLOSESPLASHSCREEN_ARGS*>(pvArgs), reinterpret_cast<BAENGINE_CLOSESPLASHSCREEN_RESULTS*>(pvResults)); | 925 | hr = BAEngineCloseSplashScreen(pContext, pvArgs, pvResults); |
| 864 | break; | 926 | break; |
| 865 | case BOOTSTRAPPER_ENGINE_MESSAGE_DETECT: | 927 | case BOOTSTRAPPER_ENGINE_MESSAGE_DETECT: |
| 866 | hr = BAEngineDetect(pContext, reinterpret_cast<BAENGINE_DETECT_ARGS*>(pvArgs), reinterpret_cast<BAENGINE_DETECT_RESULTS*>(pvResults)); | 928 | hr = BAEngineDetect(pContext, pvArgs, pvResults); |
| 867 | break; | 929 | break; |
| 868 | case BOOTSTRAPPER_ENGINE_MESSAGE_PLAN: | 930 | case BOOTSTRAPPER_ENGINE_MESSAGE_PLAN: |
| 869 | hr = BAEnginePlan(pContext, reinterpret_cast<BAENGINE_PLAN_ARGS*>(pvArgs), reinterpret_cast<BAENGINE_PLAN_RESULTS*>(pvResults)); | 931 | hr = BAEnginePlan(pContext, pvArgs, pvResults); |
| 870 | break; | 932 | break; |
| 871 | case BOOTSTRAPPER_ENGINE_MESSAGE_ELEVATE: | 933 | case BOOTSTRAPPER_ENGINE_MESSAGE_ELEVATE: |
| 872 | hr = BAEngineElevate(pContext, reinterpret_cast<BAENGINE_ELEVATE_ARGS*>(pvArgs), reinterpret_cast<BAENGINE_ELEVATE_RESULTS*>(pvResults)); | 934 | hr = BAEngineElevate(pContext, pvArgs, pvResults); |
| 873 | break; | 935 | break; |
| 874 | case BOOTSTRAPPER_ENGINE_MESSAGE_APPLY: | 936 | case BOOTSTRAPPER_ENGINE_MESSAGE_APPLY: |
| 875 | hr = BAEngineApply(pContext, reinterpret_cast<BAENGINE_APPLY_ARGS*>(pvArgs), reinterpret_cast<BAENGINE_APPLY_RESULTS*>(pvResults)); | 937 | hr = BAEngineApply(pContext, pvArgs, pvResults); |
| 876 | break; | 938 | break; |
| 877 | case BOOTSTRAPPER_ENGINE_MESSAGE_QUIT: | 939 | case BOOTSTRAPPER_ENGINE_MESSAGE_QUIT: |
| 878 | hr = BAEngineQuit(pContext, reinterpret_cast<BAENGINE_QUIT_ARGS*>(pvArgs), reinterpret_cast<BAENGINE_QUIT_RESULTS*>(pvResults)); | 940 | hr = BAEngineQuit(pContext, pvArgs, pvResults); |
| 879 | break; | 941 | break; |
| 880 | case BOOTSTRAPPER_ENGINE_MESSAGE_LAUNCHAPPROVEDEXE: | 942 | case BOOTSTRAPPER_ENGINE_MESSAGE_LAUNCHAPPROVEDEXE: |
| 881 | hr = BAEngineLaunchApprovedExe(pContext, reinterpret_cast<BAENGINE_LAUNCHAPPROVEDEXE_ARGS*>(pvArgs), reinterpret_cast<BAENGINE_LAUNCHAPPROVEDEXE_RESULTS*>(pvResults)); | 943 | hr = BAEngineLaunchApprovedExe(pContext, pvArgs, pvResults); |
| 882 | break; | 944 | break; |
| 883 | case BOOTSTRAPPER_ENGINE_MESSAGE_COMPAREVERSIONS: | 945 | case BOOTSTRAPPER_ENGINE_MESSAGE_COMPAREVERSIONS: |
| 884 | hr = BAEngineCompareVersions(pContext, reinterpret_cast<BAENGINE_COMPAREVERSIONS_ARGS*>(pvArgs), reinterpret_cast<BAENGINE_COMPAREVERSIONS_RESULTS*>(pvResults)); | 946 | hr = BAEngineCompareVersions(pContext, pvArgs, pvResults); |
| 885 | break; | 947 | break; |
| 886 | default: | 948 | default: |
| 887 | hr = E_NOTIMPL; | 949 | hr = E_NOTIMPL; |
| @@ -894,7 +956,7 @@ LExit: | |||
| 894 | 956 | ||
| 895 | static HRESULT CopyStringToBA( | 957 | static HRESULT CopyStringToBA( |
| 896 | __in LPWSTR wzValue, | 958 | __in LPWSTR wzValue, |
| 897 | __in LPWSTR wzBuffer, | 959 | __in_opt LPWSTR wzBuffer, |
| 898 | __inout DWORD* pcchBuffer | 960 | __inout DWORD* pcchBuffer |
| 899 | ) | 961 | ) |
| 900 | { | 962 | { |
diff --git a/src/engine/EngineForExtension.cpp b/src/engine/EngineForExtension.cpp index 585b74a4..29b6a6b3 100644 --- a/src/engine/EngineForExtension.cpp +++ b/src/engine/EngineForExtension.cpp | |||
| @@ -11,12 +11,14 @@ static HRESULT CopyStringToBE( | |||
| 11 | 11 | ||
| 12 | static HRESULT BEEngineEscapeString( | 12 | static HRESULT BEEngineEscapeString( |
| 13 | __in BURN_EXTENSION_ENGINE_CONTEXT* /*pContext*/, | 13 | __in BURN_EXTENSION_ENGINE_CONTEXT* /*pContext*/, |
| 14 | __in BUNDLE_EXTENSION_ENGINE_ESCAPESTRING_ARGS* pArgs, | 14 | __in const LPVOID pvArgs, |
| 15 | __in BUNDLE_EXTENSION_ENGINE_ESCAPESTRING_RESULTS* pResults | 15 | __inout LPVOID pvResults |
| 16 | ) | 16 | ) |
| 17 | { | 17 | { |
| 18 | HRESULT hr = S_OK; | 18 | HRESULT hr = S_OK; |
| 19 | LPWSTR sczValue = NULL; | 19 | LPWSTR sczValue = NULL; |
| 20 | ValidateMessageArgs(hr, pvArgs, BUNDLE_EXTENSION_ENGINE_ESCAPESTRING_ARGS, pArgs); | ||
| 21 | ValidateMessageResults(hr, pvResults, BUNDLE_EXTENSION_ENGINE_ESCAPESTRING_RESULTS, pResults); | ||
| 20 | LPCWSTR wzIn = pArgs->wzIn; | 22 | LPCWSTR wzIn = pArgs->wzIn; |
| 21 | LPWSTR wzOut = pResults->wzOut; | 23 | LPWSTR wzOut = pResults->wzOut; |
| 22 | DWORD* pcchOut = &pResults->cchOut; | 24 | DWORD* pcchOut = &pResults->cchOut; |
| @@ -34,17 +36,20 @@ static HRESULT BEEngineEscapeString( | |||
| 34 | hr = E_INVALIDARG; | 36 | hr = E_INVALIDARG; |
| 35 | } | 37 | } |
| 36 | 38 | ||
| 39 | LExit: | ||
| 37 | StrSecureZeroFreeString(sczValue); | 40 | StrSecureZeroFreeString(sczValue); |
| 38 | return hr; | 41 | return hr; |
| 39 | } | 42 | } |
| 40 | 43 | ||
| 41 | static HRESULT BEEngineEvaluateCondition( | 44 | static HRESULT BEEngineEvaluateCondition( |
| 42 | __in BURN_EXTENSION_ENGINE_CONTEXT* pContext, | 45 | __in BURN_EXTENSION_ENGINE_CONTEXT* pContext, |
| 43 | __in BUNDLE_EXTENSION_ENGINE_EVALUATECONDITION_ARGS* pArgs, | 46 | __in const LPVOID pvArgs, |
| 44 | __in BUNDLE_EXTENSION_ENGINE_EVALUATECONDITION_RESULTS* pResults | 47 | __inout LPVOID pvResults |
| 45 | ) | 48 | ) |
| 46 | { | 49 | { |
| 47 | HRESULT hr = S_OK; | 50 | HRESULT hr = S_OK; |
| 51 | ValidateMessageArgs(hr, pvArgs, BUNDLE_EXTENSION_ENGINE_EVALUATECONDITION_ARGS, pArgs); | ||
| 52 | ValidateMessageResults(hr, pvResults, BUNDLE_EXTENSION_ENGINE_EVALUATECONDITION_RESULTS, pResults); | ||
| 48 | LPCWSTR wzCondition = pArgs->wzCondition; | 53 | LPCWSTR wzCondition = pArgs->wzCondition; |
| 49 | BOOL* pf = &pResults->f; | 54 | BOOL* pf = &pResults->f; |
| 50 | 55 | ||
| @@ -57,17 +62,20 @@ static HRESULT BEEngineEvaluateCondition( | |||
| 57 | hr = E_INVALIDARG; | 62 | hr = E_INVALIDARG; |
| 58 | } | 63 | } |
| 59 | 64 | ||
| 65 | LExit: | ||
| 60 | return hr; | 66 | return hr; |
| 61 | } | 67 | } |
| 62 | 68 | ||
| 63 | static HRESULT BEEngineFormatString( | 69 | static HRESULT BEEngineFormatString( |
| 64 | __in BURN_EXTENSION_ENGINE_CONTEXT* pContext, | 70 | __in BURN_EXTENSION_ENGINE_CONTEXT* pContext, |
| 65 | __in BUNDLE_EXTENSION_ENGINE_FORMATSTRING_ARGS* pArgs, | 71 | __in const LPVOID pvArgs, |
| 66 | __in BUNDLE_EXTENSION_ENGINE_FORMATSTRING_RESULTS* pResults | 72 | __inout LPVOID pvResults |
| 67 | ) | 73 | ) |
| 68 | { | 74 | { |
| 69 | HRESULT hr = S_OK; | 75 | HRESULT hr = S_OK; |
| 70 | LPWSTR sczValue = NULL; | 76 | LPWSTR sczValue = NULL; |
| 77 | ValidateMessageArgs(hr, pvArgs, BUNDLE_EXTENSION_ENGINE_FORMATSTRING_ARGS, pArgs); | ||
| 78 | ValidateMessageResults(hr, pvResults, BUNDLE_EXTENSION_ENGINE_FORMATSTRING_RESULTS, pResults); | ||
| 71 | LPCWSTR wzIn = pArgs->wzIn; | 79 | LPCWSTR wzIn = pArgs->wzIn; |
| 72 | LPWSTR wzOut = pResults->wzOut; | 80 | LPWSTR wzOut = pResults->wzOut; |
| 73 | DWORD* pcchOut = &pResults->cchOut; | 81 | DWORD* pcchOut = &pResults->cchOut; |
| @@ -85,17 +93,20 @@ static HRESULT BEEngineFormatString( | |||
| 85 | hr = E_INVALIDARG; | 93 | hr = E_INVALIDARG; |
| 86 | } | 94 | } |
| 87 | 95 | ||
| 96 | LExit: | ||
| 88 | StrSecureZeroFreeString(sczValue); | 97 | StrSecureZeroFreeString(sczValue); |
| 89 | return hr; | 98 | return hr; |
| 90 | } | 99 | } |
| 91 | 100 | ||
| 92 | static HRESULT BEEngineGetVariableNumeric( | 101 | static HRESULT BEEngineGetVariableNumeric( |
| 93 | __in BURN_EXTENSION_ENGINE_CONTEXT* pContext, | 102 | __in BURN_EXTENSION_ENGINE_CONTEXT* pContext, |
| 94 | __in BUNDLE_EXTENSION_ENGINE_GETVARIABLENUMERIC_ARGS* pArgs, | 103 | __in const LPVOID pvArgs, |
| 95 | __in BUNDLE_EXTENSION_ENGINE_GETVARIABLENUMERIC_RESULTS* pResults | 104 | __inout LPVOID pvResults |
| 96 | ) | 105 | ) |
| 97 | { | 106 | { |
| 98 | HRESULT hr = S_OK; | 107 | HRESULT hr = S_OK; |
| 108 | ValidateMessageArgs(hr, pvArgs, BUNDLE_EXTENSION_ENGINE_GETVARIABLENUMERIC_ARGS, pArgs); | ||
| 109 | ValidateMessageResults(hr, pvResults, BUNDLE_EXTENSION_ENGINE_GETVARIABLENUMERIC_RESULTS, pResults); | ||
| 99 | LPCWSTR wzVariable = pArgs->wzVariable; | 110 | LPCWSTR wzVariable = pArgs->wzVariable; |
| 100 | LONGLONG* pllValue = &pResults->llValue; | 111 | LONGLONG* pllValue = &pResults->llValue; |
| 101 | 112 | ||
| @@ -108,17 +119,20 @@ static HRESULT BEEngineGetVariableNumeric( | |||
| 108 | hr = E_INVALIDARG; | 119 | hr = E_INVALIDARG; |
| 109 | } | 120 | } |
| 110 | 121 | ||
| 122 | LExit: | ||
| 111 | return hr; | 123 | return hr; |
| 112 | } | 124 | } |
| 113 | 125 | ||
| 114 | static HRESULT BEEngineGetVariableString( | 126 | static HRESULT BEEngineGetVariableString( |
| 115 | __in BURN_EXTENSION_ENGINE_CONTEXT* pContext, | 127 | __in BURN_EXTENSION_ENGINE_CONTEXT* pContext, |
| 116 | __in BUNDLE_EXTENSION_ENGINE_GETVARIABLESTRING_ARGS* pArgs, | 128 | __in const LPVOID pvArgs, |
| 117 | __in BUNDLE_EXTENSION_ENGINE_GETVARIABLESTRING_RESULTS* pResults | 129 | __inout LPVOID pvResults |
| 118 | ) | 130 | ) |
| 119 | { | 131 | { |
| 120 | HRESULT hr = S_OK; | 132 | HRESULT hr = S_OK; |
| 121 | LPWSTR sczValue = NULL; | 133 | LPWSTR sczValue = NULL; |
| 134 | ValidateMessageArgs(hr, pvArgs, BUNDLE_EXTENSION_ENGINE_GETVARIABLESTRING_ARGS, pArgs); | ||
| 135 | ValidateMessageResults(hr, pvResults, BUNDLE_EXTENSION_ENGINE_GETVARIABLESTRING_RESULTS, pResults); | ||
| 122 | LPCWSTR wzVariable = pArgs->wzVariable; | 136 | LPCWSTR wzVariable = pArgs->wzVariable; |
| 123 | LPWSTR wzValue = pResults->wzValue; | 137 | LPWSTR wzValue = pResults->wzValue; |
| 124 | DWORD* pcchValue = &pResults->cchValue; | 138 | DWORD* pcchValue = &pResults->cchValue; |
| @@ -136,18 +150,21 @@ static HRESULT BEEngineGetVariableString( | |||
| 136 | hr = E_INVALIDARG; | 150 | hr = E_INVALIDARG; |
| 137 | } | 151 | } |
| 138 | 152 | ||
| 153 | LExit: | ||
| 139 | StrSecureZeroFreeString(sczValue); | 154 | StrSecureZeroFreeString(sczValue); |
| 140 | return hr; | 155 | return hr; |
| 141 | } | 156 | } |
| 142 | 157 | ||
| 143 | static HRESULT BEEngineGetVariableVersion( | 158 | static HRESULT BEEngineGetVariableVersion( |
| 144 | __in BURN_EXTENSION_ENGINE_CONTEXT* pContext, | 159 | __in BURN_EXTENSION_ENGINE_CONTEXT* pContext, |
| 145 | __in BUNDLE_EXTENSION_ENGINE_GETVARIABLEVERSION_ARGS* pArgs, | 160 | __in const LPVOID pvArgs, |
| 146 | __in BUNDLE_EXTENSION_ENGINE_GETVARIABLEVERSION_RESULTS* pResults | 161 | __inout LPVOID pvResults |
| 147 | ) | 162 | ) |
| 148 | { | 163 | { |
| 149 | HRESULT hr = S_OK; | 164 | HRESULT hr = S_OK; |
| 150 | VERUTIL_VERSION* pVersion = NULL; | 165 | VERUTIL_VERSION* pVersion = NULL; |
| 166 | ValidateMessageArgs(hr, pvArgs, BUNDLE_EXTENSION_ENGINE_GETVARIABLEVERSION_ARGS, pArgs); | ||
| 167 | ValidateMessageResults(hr, pvResults, BUNDLE_EXTENSION_ENGINE_GETVARIABLEVERSION_RESULTS, pResults); | ||
| 151 | LPCWSTR wzVariable = pArgs->wzVariable; | 168 | LPCWSTR wzVariable = pArgs->wzVariable; |
| 152 | LPWSTR wzValue = pResults->wzValue; | 169 | LPWSTR wzValue = pResults->wzValue; |
| 153 | DWORD* pcchValue = &pResults->cchValue; | 170 | DWORD* pcchValue = &pResults->cchValue; |
| @@ -165,6 +182,7 @@ static HRESULT BEEngineGetVariableVersion( | |||
| 165 | hr = E_INVALIDARG; | 182 | hr = E_INVALIDARG; |
| 166 | } | 183 | } |
| 167 | 184 | ||
| 185 | LExit: | ||
| 168 | ReleaseVerutilVersion(pVersion); | 186 | ReleaseVerutilVersion(pVersion); |
| 169 | 187 | ||
| 170 | return hr; | 188 | return hr; |
| @@ -172,12 +190,14 @@ static HRESULT BEEngineGetVariableVersion( | |||
| 172 | 190 | ||
| 173 | static HRESULT BEEngineLog( | 191 | static HRESULT BEEngineLog( |
| 174 | __in BURN_EXTENSION_ENGINE_CONTEXT* /*pContext*/, | 192 | __in BURN_EXTENSION_ENGINE_CONTEXT* /*pContext*/, |
| 175 | __in BUNDLE_EXTENSION_ENGINE_LOG_ARGS* pArgs, | 193 | __in const LPVOID pvArgs, |
| 176 | __in BUNDLE_EXTENSION_ENGINE_LOG_RESULTS* /*pResults*/ | 194 | __inout LPVOID pvResults |
| 177 | ) | 195 | ) |
| 178 | { | 196 | { |
| 179 | HRESULT hr = S_OK; | 197 | HRESULT hr = S_OK; |
| 180 | REPORT_LEVEL rl = REPORT_NONE; | 198 | REPORT_LEVEL rl = REPORT_NONE; |
| 199 | ValidateMessageArgs(hr, pvArgs, BUNDLE_EXTENSION_ENGINE_LOG_ARGS, pArgs); | ||
| 200 | ValidateMessageResults(hr, pvResults, BUNDLE_EXTENSION_ENGINE_LOG_RESULTS, pResults); | ||
| 181 | BUNDLE_EXTENSION_LOG_LEVEL level = pArgs->level; | 201 | BUNDLE_EXTENSION_LOG_LEVEL level = pArgs->level; |
| 182 | LPCWSTR wzMessage = pArgs->wzMessage; | 202 | LPCWSTR wzMessage = pArgs->wzMessage; |
| 183 | 203 | ||
| @@ -212,11 +232,13 @@ LExit: | |||
| 212 | 232 | ||
| 213 | static HRESULT BEEngineSetVariableNumeric( | 233 | static HRESULT BEEngineSetVariableNumeric( |
| 214 | __in BURN_EXTENSION_ENGINE_CONTEXT* pContext, | 234 | __in BURN_EXTENSION_ENGINE_CONTEXT* pContext, |
| 215 | __in const BUNDLE_EXTENSION_ENGINE_SETVARIABLENUMERIC_ARGS* pArgs, | 235 | __in const LPVOID pvArgs, |
| 216 | __in BUNDLE_EXTENSION_ENGINE_SETVARIABLENUMERIC_RESULTS* /*pResults*/ | 236 | __inout LPVOID pvResults |
| 217 | ) | 237 | ) |
| 218 | { | 238 | { |
| 219 | HRESULT hr = S_OK; | 239 | HRESULT hr = S_OK; |
| 240 | ValidateMessageArgs(hr, pvArgs, BUNDLE_EXTENSION_ENGINE_SETVARIABLENUMERIC_ARGS, pArgs); | ||
| 241 | ValidateMessageResults(hr, pvResults, BUNDLE_EXTENSION_ENGINE_SETVARIABLENUMERIC_RESULTS, pResults); | ||
| 220 | LPCWSTR wzVariable = pArgs->wzVariable; | 242 | LPCWSTR wzVariable = pArgs->wzVariable; |
| 221 | LONGLONG llValue = pArgs->llValue; | 243 | LONGLONG llValue = pArgs->llValue; |
| 222 | 244 | ||
| @@ -237,11 +259,13 @@ LExit: | |||
| 237 | 259 | ||
| 238 | static HRESULT BEEngineSetVariableString( | 260 | static HRESULT BEEngineSetVariableString( |
| 239 | __in BURN_EXTENSION_ENGINE_CONTEXT* pContext, | 261 | __in BURN_EXTENSION_ENGINE_CONTEXT* pContext, |
| 240 | __in const BUNDLE_EXTENSION_ENGINE_SETVARIABLESTRING_ARGS* pArgs, | 262 | __in const LPVOID pvArgs, |
| 241 | __in BUNDLE_EXTENSION_ENGINE_SETVARIABLESTRING_RESULTS* /*pResults*/ | 263 | __inout LPVOID pvResults |
| 242 | ) | 264 | ) |
| 243 | { | 265 | { |
| 244 | HRESULT hr = S_OK; | 266 | HRESULT hr = S_OK; |
| 267 | ValidateMessageArgs(hr, pvArgs, BUNDLE_EXTENSION_ENGINE_SETVARIABLESTRING_ARGS, pArgs); | ||
| 268 | ValidateMessageResults(hr, pvResults, BUNDLE_EXTENSION_ENGINE_SETVARIABLESTRING_RESULTS, pResults); | ||
| 245 | LPCWSTR wzVariable = pArgs->wzVariable; | 269 | LPCWSTR wzVariable = pArgs->wzVariable; |
| 246 | LPCWSTR wzValue = pArgs->wzValue; | 270 | LPCWSTR wzValue = pArgs->wzValue; |
| 247 | 271 | ||
| @@ -262,14 +286,16 @@ LExit: | |||
| 262 | 286 | ||
| 263 | static HRESULT BEEngineSetVariableVersion( | 287 | static HRESULT BEEngineSetVariableVersion( |
| 264 | __in BURN_EXTENSION_ENGINE_CONTEXT* pContext, | 288 | __in BURN_EXTENSION_ENGINE_CONTEXT* pContext, |
| 265 | __in const BUNDLE_EXTENSION_ENGINE_SETVARIABLEVERSION_ARGS* pArgs, | 289 | __in const LPVOID pvArgs, |
| 266 | __in BUNDLE_EXTENSION_ENGINE_SETVARIABLEVERSION_RESULTS* /*pResults*/ | 290 | __inout LPVOID pvResults |
| 267 | ) | 291 | ) |
| 268 | { | 292 | { |
| 269 | HRESULT hr = S_OK; | 293 | HRESULT hr = S_OK; |
| 294 | VERUTIL_VERSION* pVersion = NULL; | ||
| 295 | ValidateMessageArgs(hr, pvArgs, BUNDLE_EXTENSION_ENGINE_SETVARIABLEVERSION_ARGS, pArgs); | ||
| 296 | ValidateMessageResults(hr, pvResults, BUNDLE_EXTENSION_ENGINE_SETVARIABLEVERSION_RESULTS, pResults); | ||
| 270 | LPCWSTR wzVariable = pArgs->wzVariable; | 297 | LPCWSTR wzVariable = pArgs->wzVariable; |
| 271 | LPCWSTR wzValue = pArgs->wzValue; | 298 | LPCWSTR wzValue = pArgs->wzValue; |
| 272 | VERUTIL_VERSION* pVersion = NULL; | ||
| 273 | 299 | ||
| 274 | if (wzVariable && *wzVariable) | 300 | if (wzVariable && *wzVariable) |
| 275 | { | 301 | { |
| @@ -296,17 +322,20 @@ LExit: | |||
| 296 | 322 | ||
| 297 | static HRESULT BEEngineCompareVersions( | 323 | static HRESULT BEEngineCompareVersions( |
| 298 | __in BURN_EXTENSION_ENGINE_CONTEXT* /*pContext*/, | 324 | __in BURN_EXTENSION_ENGINE_CONTEXT* /*pContext*/, |
| 299 | __in const BUNDLE_EXTENSION_ENGINE_COMPAREVERSIONS_ARGS* pArgs, | 325 | __in const LPVOID pvArgs, |
| 300 | __in BUNDLE_EXTENSION_ENGINE_COMPAREVERSIONS_RESULTS* pResults | 326 | __inout LPVOID pvResults |
| 301 | ) | 327 | ) |
| 302 | { | 328 | { |
| 303 | HRESULT hr = S_OK; | 329 | HRESULT hr = S_OK; |
| 330 | ValidateMessageArgs(hr, pvArgs, BUNDLE_EXTENSION_ENGINE_COMPAREVERSIONS_ARGS, pArgs); | ||
| 331 | ValidateMessageResults(hr, pvResults, BUNDLE_EXTENSION_ENGINE_COMPAREVERSIONS_RESULTS, pResults); | ||
| 304 | LPCWSTR wzVersion1 = pArgs->wzVersion1; | 332 | LPCWSTR wzVersion1 = pArgs->wzVersion1; |
| 305 | LPCWSTR wzVersion2 = pArgs->wzVersion2; | 333 | LPCWSTR wzVersion2 = pArgs->wzVersion2; |
| 306 | int* pnResult = &pResults->nResult; | 334 | int* pnResult = &pResults->nResult; |
| 307 | 335 | ||
| 308 | hr = VerCompareStringVersions(wzVersion1, wzVersion2, FALSE, pnResult); | 336 | hr = VerCompareStringVersions(wzVersion1, wzVersion2, FALSE, pnResult); |
| 309 | 337 | ||
| 338 | LExit: | ||
| 310 | return hr; | 339 | return hr; |
| 311 | } | 340 | } |
| 312 | 341 | ||
| @@ -328,37 +357,37 @@ HRESULT WINAPI EngineForExtensionProc( | |||
| 328 | switch (message) | 357 | switch (message) |
| 329 | { | 358 | { |
| 330 | case BUNDLE_EXTENSION_ENGINE_MESSAGE_ESCAPESTRING: | 359 | case BUNDLE_EXTENSION_ENGINE_MESSAGE_ESCAPESTRING: |
| 331 | hr = BEEngineEscapeString(pContext, reinterpret_cast<BUNDLE_EXTENSION_ENGINE_ESCAPESTRING_ARGS*>(pvArgs), reinterpret_cast<BUNDLE_EXTENSION_ENGINE_ESCAPESTRING_RESULTS*>(pvResults)); | 360 | hr = BEEngineEscapeString(pContext, pvArgs, pvResults); |
| 332 | break; | 361 | break; |
| 333 | case BUNDLE_EXTENSION_ENGINE_MESSAGE_EVALUATECONDITION: | 362 | case BUNDLE_EXTENSION_ENGINE_MESSAGE_EVALUATECONDITION: |
| 334 | hr = BEEngineEvaluateCondition(pContext, reinterpret_cast<BUNDLE_EXTENSION_ENGINE_EVALUATECONDITION_ARGS*>(pvArgs), reinterpret_cast<BUNDLE_EXTENSION_ENGINE_EVALUATECONDITION_RESULTS*>(pvResults)); | 363 | hr = BEEngineEvaluateCondition(pContext, pvArgs, pvResults); |
| 335 | break; | 364 | break; |
| 336 | case BUNDLE_EXTENSION_ENGINE_MESSAGE_FORMATSTRING: | 365 | case BUNDLE_EXTENSION_ENGINE_MESSAGE_FORMATSTRING: |
| 337 | hr = BEEngineFormatString(pContext, reinterpret_cast<BUNDLE_EXTENSION_ENGINE_FORMATSTRING_ARGS*>(pvArgs), reinterpret_cast<BUNDLE_EXTENSION_ENGINE_FORMATSTRING_RESULTS*>(pvResults)); | 366 | hr = BEEngineFormatString(pContext, pvArgs, pvResults); |
| 338 | break; | 367 | break; |
| 339 | case BUNDLE_EXTENSION_ENGINE_MESSAGE_GETVARIABLENUMERIC: | 368 | case BUNDLE_EXTENSION_ENGINE_MESSAGE_GETVARIABLENUMERIC: |
| 340 | hr = BEEngineGetVariableNumeric(pContext, reinterpret_cast<BUNDLE_EXTENSION_ENGINE_GETVARIABLENUMERIC_ARGS*>(pvArgs), reinterpret_cast<BUNDLE_EXTENSION_ENGINE_GETVARIABLENUMERIC_RESULTS*>(pvResults)); | 369 | hr = BEEngineGetVariableNumeric(pContext, pvArgs, pvResults); |
| 341 | break; | 370 | break; |
| 342 | case BUNDLE_EXTENSION_ENGINE_MESSAGE_GETVARIABLESTRING: | 371 | case BUNDLE_EXTENSION_ENGINE_MESSAGE_GETVARIABLESTRING: |
| 343 | hr = BEEngineGetVariableString(pContext, reinterpret_cast<BUNDLE_EXTENSION_ENGINE_GETVARIABLESTRING_ARGS*>(pvArgs), reinterpret_cast<BUNDLE_EXTENSION_ENGINE_GETVARIABLESTRING_RESULTS*>(pvResults)); | 372 | hr = BEEngineGetVariableString(pContext, pvArgs, pvResults); |
| 344 | break; | 373 | break; |
| 345 | case BUNDLE_EXTENSION_ENGINE_MESSAGE_GETVARIABLEVERSION: | 374 | case BUNDLE_EXTENSION_ENGINE_MESSAGE_GETVARIABLEVERSION: |
| 346 | hr = BEEngineGetVariableVersion(pContext, reinterpret_cast<BUNDLE_EXTENSION_ENGINE_GETVARIABLEVERSION_ARGS*>(pvArgs), reinterpret_cast<BUNDLE_EXTENSION_ENGINE_GETVARIABLEVERSION_RESULTS*>(pvResults)); | 375 | hr = BEEngineGetVariableVersion(pContext, pvArgs, pvResults); |
| 347 | break; | 376 | break; |
| 348 | case BUNDLE_EXTENSION_ENGINE_MESSAGE_LOG: | 377 | case BUNDLE_EXTENSION_ENGINE_MESSAGE_LOG: |
| 349 | hr = BEEngineLog(pContext, reinterpret_cast<BUNDLE_EXTENSION_ENGINE_LOG_ARGS*>(pvArgs), reinterpret_cast<BUNDLE_EXTENSION_ENGINE_LOG_RESULTS*>(pvResults)); | 378 | hr = BEEngineLog(pContext, pvArgs, pvResults); |
| 350 | break; | 379 | break; |
| 351 | case BUNDLE_EXTENSION_ENGINE_MESSAGE_SETVARIABLENUMERIC: | 380 | case BUNDLE_EXTENSION_ENGINE_MESSAGE_SETVARIABLENUMERIC: |
| 352 | hr = BEEngineSetVariableNumeric(pContext, reinterpret_cast<BUNDLE_EXTENSION_ENGINE_SETVARIABLENUMERIC_ARGS*>(pvArgs), reinterpret_cast<BUNDLE_EXTENSION_ENGINE_SETVARIABLENUMERIC_RESULTS*>(pvResults)); | 381 | hr = BEEngineSetVariableNumeric(pContext, pvArgs, pvResults); |
| 353 | break; | 382 | break; |
| 354 | case BUNDLE_EXTENSION_ENGINE_MESSAGE_SETVARIABLESTRING: | 383 | case BUNDLE_EXTENSION_ENGINE_MESSAGE_SETVARIABLESTRING: |
| 355 | hr = BEEngineSetVariableString(pContext, reinterpret_cast<BUNDLE_EXTENSION_ENGINE_SETVARIABLESTRING_ARGS*>(pvArgs), reinterpret_cast<BUNDLE_EXTENSION_ENGINE_SETVARIABLESTRING_RESULTS*>(pvResults)); | 384 | hr = BEEngineSetVariableString(pContext, pvArgs, pvResults); |
| 356 | break; | 385 | break; |
| 357 | case BUNDLE_EXTENSION_ENGINE_MESSAGE_SETVARIABLEVERSION: | 386 | case BUNDLE_EXTENSION_ENGINE_MESSAGE_SETVARIABLEVERSION: |
| 358 | hr = BEEngineSetVariableVersion(pContext, reinterpret_cast<BUNDLE_EXTENSION_ENGINE_SETVARIABLEVERSION_ARGS*>(pvArgs), reinterpret_cast<BUNDLE_EXTENSION_ENGINE_SETVARIABLEVERSION_RESULTS*>(pvResults)); | 387 | hr = BEEngineSetVariableVersion(pContext, pvArgs, pvResults); |
| 359 | break; | 388 | break; |
| 360 | case BUNDLE_EXTENSION_ENGINE_MESSAGE_COMPAREVERSIONS: | 389 | case BUNDLE_EXTENSION_ENGINE_MESSAGE_COMPAREVERSIONS: |
| 361 | hr = BEEngineCompareVersions(pContext, reinterpret_cast<BUNDLE_EXTENSION_ENGINE_COMPAREVERSIONS_ARGS*>(pvArgs), reinterpret_cast<BUNDLE_EXTENSION_ENGINE_COMPAREVERSIONS_RESULTS*>(pvResults)); | 390 | hr = BEEngineCompareVersions(pContext, pvArgs, pvResults); |
| 362 | break; | 391 | break; |
| 363 | default: | 392 | default: |
| 364 | hr = E_NOTIMPL; | 393 | hr = E_NOTIMPL; |
diff --git a/src/engine/burnextension.cpp b/src/engine/burnextension.cpp index 157b082f..7568f75e 100644 --- a/src/engine/burnextension.cpp +++ b/src/engine/burnextension.cpp | |||
| @@ -2,6 +2,14 @@ | |||
| 2 | 2 | ||
| 3 | #include "precomp.h" | 3 | #include "precomp.h" |
| 4 | 4 | ||
| 5 | |||
| 6 | static HRESULT SendRequiredBextMessage( | ||
| 7 | __in BURN_EXTENSION* pExtension, | ||
| 8 | __in BUNDLE_EXTENSION_MESSAGE message, | ||
| 9 | __in const LPVOID pvArgs, | ||
| 10 | __inout LPVOID pvResults | ||
| 11 | ); | ||
| 12 | |||
| 5 | // function definitions | 13 | // function definitions |
| 6 | 14 | ||
| 7 | /******************************************************************* | 15 | /******************************************************************* |
| @@ -234,9 +242,23 @@ EXTERN_C BEEAPI BurnExtensionPerformSearch( | |||
| 234 | 242 | ||
| 235 | results.cbSize = sizeof(results); | 243 | results.cbSize = sizeof(results); |
| 236 | 244 | ||
| 237 | hr = pExtension->pfnBurnExtensionProc(BUNDLE_EXTENSION_MESSAGE_SEARCH, &args, &results, pExtension->pvBurnExtensionProcContext); | 245 | hr = SendRequiredBextMessage(pExtension, BUNDLE_EXTENSION_MESSAGE_SEARCH, &args, &results); |
| 238 | ExitOnFailure(hr, "BundleExtension '%ls' Search '%ls' failed.", pExtension->sczId, wzSearchId); | 246 | ExitOnFailure(hr, "BundleExtension '%ls' Search '%ls' failed.", pExtension->sczId, wzSearchId); |
| 239 | 247 | ||
| 240 | LExit: | 248 | LExit: |
| 241 | return hr; | 249 | return hr; |
| 242 | } | 250 | } |
| 251 | |||
| 252 | static HRESULT SendRequiredBextMessage( | ||
| 253 | __in BURN_EXTENSION* pExtension, | ||
| 254 | __in BUNDLE_EXTENSION_MESSAGE message, | ||
| 255 | __in const LPVOID pvArgs, | ||
| 256 | __inout LPVOID pvResults | ||
| 257 | ) | ||
| 258 | { | ||
| 259 | HRESULT hr = S_OK; | ||
| 260 | |||
| 261 | hr = pExtension->pfnBurnExtensionProc(message, pvArgs, pvResults, pExtension->pvBurnExtensionProcContext); | ||
| 262 | |||
| 263 | return hr; | ||
| 264 | } | ||
diff --git a/src/engine/engine.vcxproj b/src/engine/engine.vcxproj index 28085ed4..3624d923 100644 --- a/src/engine/engine.vcxproj +++ b/src/engine/engine.vcxproj | |||
| @@ -51,6 +51,7 @@ | |||
| 51 | <ClCompile Include="embedded.cpp" /> | 51 | <ClCompile Include="embedded.cpp" /> |
| 52 | <ClCompile Include="EngineForApplication.cpp" /> | 52 | <ClCompile Include="EngineForApplication.cpp" /> |
| 53 | <ClCompile Include="EngineForExtension.cpp" /> | 53 | <ClCompile Include="EngineForExtension.cpp" /> |
| 54 | <ClCompile Include="externalengine.cpp" /> | ||
| 54 | <ClCompile Include="cabextract.cpp" /> | 55 | <ClCompile Include="cabextract.cpp" /> |
| 55 | <ClCompile Include="cache.cpp" /> | 56 | <ClCompile Include="cache.cpp" /> |
| 56 | <ClCompile Include="condition.cpp" /> | 57 | <ClCompile Include="condition.cpp" /> |
| @@ -109,6 +110,7 @@ | |||
| 109 | <ClInclude Include="EngineForApplication.h" /> | 110 | <ClInclude Include="EngineForApplication.h" /> |
| 110 | <ClInclude Include="EngineForExtension.h" /> | 111 | <ClInclude Include="EngineForExtension.h" /> |
| 111 | <ClInclude Include="exeengine.h" /> | 112 | <ClInclude Include="exeengine.h" /> |
| 113 | <ClInclude Include="externalengine.h" /> | ||
| 112 | <ClInclude Include="inc\engine.h" /> | 114 | <ClInclude Include="inc\engine.h" /> |
| 113 | <ClInclude Include="logging.h" /> | 115 | <ClInclude Include="logging.h" /> |
| 114 | <ClInclude Include="manifest.h" /> | 116 | <ClInclude Include="manifest.h" /> |
diff --git a/src/engine/externalengine.cpp b/src/engine/externalengine.cpp new file mode 100644 index 00000000..ef4f931d --- /dev/null +++ b/src/engine/externalengine.cpp | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
| 2 | |||
| 3 | #include "precomp.h" | ||
| 4 | |||
| 5 | |||
| 6 | // function definitions | ||
| 7 | |||
| 8 | // TODO: callers need to provide the original size (at the time of first public release) of the struct instead of the current size. | ||
| 9 | HRESULT WINAPI ExternalEngineValidateMessageParameter( | ||
| 10 | __in_opt const LPVOID pv, | ||
| 11 | __in SIZE_T cbSizeOffset, | ||
| 12 | __in DWORD dwMinimumSize | ||
| 13 | ) | ||
| 14 | { | ||
| 15 | HRESULT hr = S_OK; | ||
| 16 | |||
| 17 | if (!pv) | ||
| 18 | { | ||
| 19 | ExitFunction1(hr = E_INVALIDARG); | ||
| 20 | } | ||
| 21 | |||
| 22 | DWORD cbSize = *(DWORD*)((BYTE*)pv + cbSizeOffset); | ||
| 23 | if (dwMinimumSize < cbSize) | ||
| 24 | { | ||
| 25 | ExitFunction1(hr = E_INVALIDARG); | ||
| 26 | } | ||
| 27 | |||
| 28 | LExit: | ||
| 29 | return hr; | ||
| 30 | } | ||
diff --git a/src/engine/externalengine.h b/src/engine/externalengine.h new file mode 100644 index 00000000..7910b224 --- /dev/null +++ b/src/engine/externalengine.h | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | #pragma once | ||
| 2 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
| 3 | |||
| 4 | |||
| 5 | #define ValidateMessageParameter(x, pv, type) { x = ExternalEngineValidateMessageParameter(pv, offsetof(type, cbSize), sizeof(type)); if (FAILED(x)) { goto LExit; }} | ||
| 6 | #define ValidateMessageArgs(x, pv, type, identifier) ValidateMessageParameter(x, pv, type); const type* identifier = reinterpret_cast<type*>(pv); UNREFERENCED_PARAMETER(identifier) | ||
| 7 | #define ValidateMessageResults(x, pv, type, identifier) ValidateMessageParameter(x, pv, type); type* identifier = reinterpret_cast<type*>(pv); UNREFERENCED_PARAMETER(identifier) | ||
| 8 | |||
| 9 | |||
| 10 | #if defined(__cplusplus) | ||
| 11 | extern "C" { | ||
| 12 | #endif | ||
| 13 | |||
| 14 | HRESULT WINAPI ExternalEngineValidateMessageParameter( | ||
| 15 | __in_opt const LPVOID pv, | ||
| 16 | __in SIZE_T cbSizeOffset, | ||
| 17 | __in DWORD dwMinimumSize | ||
| 18 | ); | ||
| 19 | |||
| 20 | #if defined(__cplusplus) | ||
| 21 | } | ||
| 22 | #endif | ||
diff --git a/src/engine/precomp.h b/src/engine/precomp.h index 2bceab58..a8a656d1 100644 --- a/src/engine/precomp.h +++ b/src/engine/precomp.h | |||
| @@ -100,6 +100,7 @@ | |||
| 100 | #include "bitsengine.h" | 100 | #include "bitsengine.h" |
| 101 | #include "netfxchainer.h" | 101 | #include "netfxchainer.h" |
| 102 | 102 | ||
| 103 | #include "externalengine.h" | ||
| 103 | #include "EngineForApplication.h" | 104 | #include "EngineForApplication.h" |
| 104 | #include "EngineForExtension.h" | 105 | #include "EngineForExtension.h" |
| 105 | #include "engine.messages.h" | 106 | #include "engine.messages.h" |
diff --git a/src/engine/userexperience.cpp b/src/engine/userexperience.cpp index b5bdc623..ce1662b8 100644 --- a/src/engine/userexperience.cpp +++ b/src/engine/userexperience.cpp | |||
| @@ -17,6 +17,13 @@ static HRESULT FilterExecuteResult( | |||
| 17 | __in LPCWSTR sczEventName | 17 | __in LPCWSTR sczEventName |
| 18 | ); | 18 | ); |
| 19 | 19 | ||
| 20 | static HRESULT SendBAMessage( | ||
| 21 | __in BURN_USER_EXPERIENCE* pUserExperience, | ||
| 22 | __in BOOTSTRAPPER_APPLICATION_MESSAGE message, | ||
| 23 | __in const LPVOID pvArgs, | ||
| 24 | __inout LPVOID pvResults | ||
| 25 | ); | ||
| 26 | |||
| 20 | 27 | ||
| 21 | // function definitions | 28 | // function definitions |
| 22 | 29 | ||
| @@ -97,7 +104,7 @@ extern "C" HRESULT UserExperienceLoad( | |||
| 97 | args.pCommand = pCommand; | 104 | args.pCommand = pCommand; |
| 98 | args.pfnBootstrapperEngineProc = EngineForApplicationProc; | 105 | args.pfnBootstrapperEngineProc = EngineForApplicationProc; |
| 99 | args.pvBootstrapperEngineProcContext = pEngineContext; | 106 | args.pvBootstrapperEngineProcContext = pEngineContext; |
| 100 | args.qwEngineAPIVersion = MAKEQWORDVERSION(2020, 8, 31, 0); | 107 | args.qwEngineAPIVersion = MAKEQWORDVERSION(2020, 11, 17, 0); |
| 101 | 108 | ||
| 102 | results.cbSize = sizeof(BOOTSTRAPPER_CREATE_RESULTS); | 109 | results.cbSize = sizeof(BOOTSTRAPPER_CREATE_RESULTS); |
| 103 | 110 | ||
| @@ -308,7 +315,7 @@ EXTERN_C BAAPI UserExperienceOnApplyBegin( | |||
| 308 | 315 | ||
| 309 | results.cbSize = sizeof(results); | 316 | results.cbSize = sizeof(results); |
| 310 | 317 | ||
| 311 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONAPPLYBEGIN, &args, &results, pUserExperience->pvBAProcContext); | 318 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONAPPLYBEGIN, &args, &results); |
| 312 | ExitOnFailure(hr, "BA OnApplyBegin failed."); | 319 | ExitOnFailure(hr, "BA OnApplyBegin failed."); |
| 313 | 320 | ||
| 314 | if (results.fCancel) | 321 | if (results.fCancel) |
| @@ -339,7 +346,7 @@ EXTERN_C BAAPI UserExperienceOnApplyComplete( | |||
| 339 | results.cbSize = sizeof(results); | 346 | results.cbSize = sizeof(results); |
| 340 | results.action = *pAction; | 347 | results.action = *pAction; |
| 341 | 348 | ||
| 342 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONAPPLYCOMPLETE, &args, &results, pUserExperience->pvBAProcContext); | 349 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONAPPLYCOMPLETE, &args, &results); |
| 343 | ExitOnFailure(hr, "BA OnApplyComplete failed."); | 350 | ExitOnFailure(hr, "BA OnApplyComplete failed."); |
| 344 | 351 | ||
| 345 | *pAction = results.action; | 352 | *pAction = results.action; |
| @@ -362,7 +369,7 @@ EXTERN_C BAAPI UserExperienceOnBeginMsiTransactionBegin( | |||
| 362 | 369 | ||
| 363 | results.cbSize = sizeof(results); | 370 | results.cbSize = sizeof(results); |
| 364 | 371 | ||
| 365 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONBEGINMSITRANSACTIONBEGIN, &args, &results, pUserExperience->pvBAProcContext); | 372 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONBEGINMSITRANSACTIONBEGIN, &args, &results); |
| 366 | ExitOnFailure(hr, "BA OnBeginMsiTransactionBegin failed."); | 373 | ExitOnFailure(hr, "BA OnBeginMsiTransactionBegin failed."); |
| 367 | 374 | ||
| 368 | if (results.fCancel) | 375 | if (results.fCancel) |
| @@ -390,7 +397,7 @@ EXTERN_C BAAPI UserExperienceOnBeginMsiTransactionComplete( | |||
| 390 | 397 | ||
| 391 | results.cbSize = sizeof(results); | 398 | results.cbSize = sizeof(results); |
| 392 | 399 | ||
| 393 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONBEGINMSITRANSACTIONCOMPLETE, &args, &results, pUserExperience->pvBAProcContext); | 400 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONBEGINMSITRANSACTIONCOMPLETE, &args, &results); |
| 394 | ExitOnFailure(hr, "BA OnBeginMsiTransactionComplete failed."); | 401 | ExitOnFailure(hr, "BA OnBeginMsiTransactionComplete failed."); |
| 395 | 402 | ||
| 396 | LExit: | 403 | LExit: |
| @@ -417,7 +424,7 @@ EXTERN_C BAAPI UserExperienceOnCacheAcquireBegin( | |||
| 417 | 424 | ||
| 418 | results.cbSize = sizeof(results); | 425 | results.cbSize = sizeof(results); |
| 419 | 426 | ||
| 420 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEACQUIREBEGIN, &args, &results, pUserExperience->pvBAProcContext); | 427 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEACQUIREBEGIN, &args, &results); |
| 421 | ExitOnFailure(hr, "BA OnCacheAcquireBegin failed."); | 428 | ExitOnFailure(hr, "BA OnCacheAcquireBegin failed."); |
| 422 | 429 | ||
| 423 | if (results.fCancel) | 430 | if (results.fCancel) |
| @@ -450,7 +457,7 @@ EXTERN_C BAAPI UserExperienceOnCacheAcquireComplete( | |||
| 450 | results.cbSize = sizeof(results); | 457 | results.cbSize = sizeof(results); |
| 451 | results.action = args.recommendation; | 458 | results.action = args.recommendation; |
| 452 | 459 | ||
| 453 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEACQUIRECOMPLETE, &args, &results, pUserExperience->pvBAProcContext); | 460 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEACQUIRECOMPLETE, &args, &results); |
| 454 | ExitOnFailure(hr, "BA OnCacheAcquireComplete failed."); | 461 | ExitOnFailure(hr, "BA OnCacheAcquireComplete failed."); |
| 455 | 462 | ||
| 456 | if (FAILED(hrStatus)) | 463 | if (FAILED(hrStatus)) |
| @@ -484,7 +491,7 @@ EXTERN_C BAAPI UserExperienceOnCacheAcquireProgress( | |||
| 484 | 491 | ||
| 485 | results.cbSize = sizeof(results); | 492 | results.cbSize = sizeof(results); |
| 486 | 493 | ||
| 487 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEACQUIREPROGRESS, &args, &results, pUserExperience->pvBAProcContext); | 494 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEACQUIREPROGRESS, &args, &results); |
| 488 | ExitOnFailure(hr, "BA OnCacheAcquireProgress failed."); | 495 | ExitOnFailure(hr, "BA OnCacheAcquireProgress failed."); |
| 489 | 496 | ||
| 490 | if (results.fCancel) | 497 | if (results.fCancel) |
| @@ -508,7 +515,7 @@ EXTERN_C BAAPI UserExperienceOnCacheBegin( | |||
| 508 | 515 | ||
| 509 | results.cbSize = sizeof(results); | 516 | results.cbSize = sizeof(results); |
| 510 | 517 | ||
| 511 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEBEGIN, &args, &results, pUserExperience->pvBAProcContext); | 518 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEBEGIN, &args, &results); |
| 512 | ExitOnFailure(hr, "BA OnCacheBegin failed."); | 519 | ExitOnFailure(hr, "BA OnCacheBegin failed."); |
| 513 | 520 | ||
| 514 | if (results.fCancel) | 521 | if (results.fCancel) |
| @@ -534,7 +541,7 @@ EXTERN_C BAAPI UserExperienceOnCacheComplete( | |||
| 534 | 541 | ||
| 535 | results.cbSize = sizeof(results); | 542 | results.cbSize = sizeof(results); |
| 536 | 543 | ||
| 537 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHECOMPLETE, &args, &results, pUserExperience->pvBAProcContext); | 544 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHECOMPLETE, &args, &results); |
| 538 | ExitOnFailure(hr, "BA OnCacheComplete failed."); | 545 | ExitOnFailure(hr, "BA OnCacheComplete failed."); |
| 539 | 546 | ||
| 540 | LExit: | 547 | LExit: |
| @@ -559,7 +566,7 @@ EXTERN_C BAAPI UserExperienceOnCachePackageBegin( | |||
| 559 | 566 | ||
| 560 | results.cbSize = sizeof(results); | 567 | results.cbSize = sizeof(results); |
| 561 | 568 | ||
| 562 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEPACKAGEBEGIN, &args, &results, pUserExperience->pvBAProcContext); | 569 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEPACKAGEBEGIN, &args, &results); |
| 563 | ExitOnFailure(hr, "BA OnCachePackageBegin failed."); | 570 | ExitOnFailure(hr, "BA OnCachePackageBegin failed."); |
| 564 | 571 | ||
| 565 | if (results.fCancel) | 572 | if (results.fCancel) |
| @@ -590,7 +597,7 @@ EXTERN_C BAAPI UserExperienceOnCachePackageComplete( | |||
| 590 | results.cbSize = sizeof(results); | 597 | results.cbSize = sizeof(results); |
| 591 | results.action = *pAction; | 598 | results.action = *pAction; |
| 592 | 599 | ||
| 593 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEPACKAGECOMPLETE, &args, &results, pUserExperience->pvBAProcContext); | 600 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEPACKAGECOMPLETE, &args, &results); |
| 594 | ExitOnFailure(hr, "BA OnCachePackageComplete failed."); | 601 | ExitOnFailure(hr, "BA OnCachePackageComplete failed."); |
| 595 | 602 | ||
| 596 | if (FAILED(hrStatus)) | 603 | if (FAILED(hrStatus)) |
| @@ -618,7 +625,7 @@ EXTERN_C BAAPI UserExperienceOnCacheVerifyBegin( | |||
| 618 | 625 | ||
| 619 | results.cbSize = sizeof(results); | 626 | results.cbSize = sizeof(results); |
| 620 | 627 | ||
| 621 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEVERIFYBEGIN, &args, &results, pUserExperience->pvBAProcContext); | 628 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEVERIFYBEGIN, &args, &results); |
| 622 | ExitOnFailure(hr, "BA OnCacheVerifyBegin failed."); | 629 | ExitOnFailure(hr, "BA OnCacheVerifyBegin failed."); |
| 623 | 630 | ||
| 624 | if (results.fCancel) | 631 | if (results.fCancel) |
| @@ -651,7 +658,7 @@ EXTERN_C BAAPI UserExperienceOnCacheVerifyComplete( | |||
| 651 | results.cbSize = sizeof(results); | 658 | results.cbSize = sizeof(results); |
| 652 | results.action = *pAction; | 659 | results.action = *pAction; |
| 653 | 660 | ||
| 654 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEVERIFYCOMPLETE, &args, &results, pUserExperience->pvBAProcContext); | 661 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEVERIFYCOMPLETE, &args, &results); |
| 655 | ExitOnFailure(hr, "BA OnCacheVerifyComplete failed."); | 662 | ExitOnFailure(hr, "BA OnCacheVerifyComplete failed."); |
| 656 | 663 | ||
| 657 | if (FAILED(hrStatus)) | 664 | if (FAILED(hrStatus)) |
| @@ -677,7 +684,7 @@ EXTERN_C BAAPI UserExperienceOnCommitMsiTransactionBegin( | |||
| 677 | 684 | ||
| 678 | results.cbSize = sizeof(results); | 685 | results.cbSize = sizeof(results); |
| 679 | 686 | ||
| 680 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONCOMMITMSITRANSACTIONBEGIN, &args, &results, pUserExperience->pvBAProcContext); | 687 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCOMMITMSITRANSACTIONBEGIN, &args, &results); |
| 681 | ExitOnFailure(hr, "BA OnCommitMsiTransactionBegin failed."); | 688 | ExitOnFailure(hr, "BA OnCommitMsiTransactionBegin failed."); |
| 682 | 689 | ||
| 683 | if (results.fCancel) | 690 | if (results.fCancel) |
| @@ -705,7 +712,7 @@ EXTERN_C BAAPI UserExperienceOnCommitMsiTransactionComplete( | |||
| 705 | 712 | ||
| 706 | results.cbSize = sizeof(results); | 713 | results.cbSize = sizeof(results); |
| 707 | 714 | ||
| 708 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONCOMMITMSITRANSACTIONCOMPLETE, &args, &results, pUserExperience->pvBAProcContext); | 715 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCOMMITMSITRANSACTIONCOMPLETE, &args, &results); |
| 709 | ExitOnFailure(hr, "BA OnCommitMsiTransactionComplete failed."); | 716 | ExitOnFailure(hr, "BA OnCommitMsiTransactionComplete failed."); |
| 710 | 717 | ||
| 711 | LExit: | 718 | LExit: |
| @@ -728,7 +735,7 @@ EXTERN_C BAAPI UserExperienceOnDetectBegin( | |||
| 728 | 735 | ||
| 729 | results.cbSize = sizeof(results); | 736 | results.cbSize = sizeof(results); |
| 730 | 737 | ||
| 731 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTBEGIN, &args, &results, pUserExperience->pvBAProcContext); | 738 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTBEGIN, &args, &results); |
| 732 | ExitOnFailure(hr, "BA OnDetectBegin failed."); | 739 | ExitOnFailure(hr, "BA OnDetectBegin failed."); |
| 733 | 740 | ||
| 734 | if (results.fCancel) | 741 | if (results.fCancel) |
| @@ -758,7 +765,7 @@ EXTERN_C BAAPI UserExperienceOnDetectCompatibleMsiPackage( | |||
| 758 | 765 | ||
| 759 | results.cbSize = sizeof(results); | 766 | results.cbSize = sizeof(results); |
| 760 | 767 | ||
| 761 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTCOMPATIBLEMSIPACKAGE, &args, &results, pUserExperience->pvBAProcContext); | 768 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTCOMPATIBLEMSIPACKAGE, &args, &results); |
| 762 | ExitOnFailure(hr, "BA OnDetectCompatibleMsiPackage failed."); | 769 | ExitOnFailure(hr, "BA OnDetectCompatibleMsiPackage failed."); |
| 763 | 770 | ||
| 764 | if (results.fCancel) | 771 | if (results.fCancel) |
| @@ -784,7 +791,7 @@ EXTERN_C BAAPI UserExperienceOnDetectComplete( | |||
| 784 | 791 | ||
| 785 | results.cbSize = sizeof(results); | 792 | results.cbSize = sizeof(results); |
| 786 | 793 | ||
| 787 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTCOMPLETE, &args, &results, pUserExperience->pvBAProcContext); | 794 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTCOMPLETE, &args, &results); |
| 788 | ExitOnFailure(hr, "BA OnDetectComplete failed."); | 795 | ExitOnFailure(hr, "BA OnDetectComplete failed."); |
| 789 | 796 | ||
| 790 | LExit: | 797 | LExit: |
| @@ -815,7 +822,7 @@ EXTERN_C BAAPI UserExperienceOnDetectForwardCompatibleBundle( | |||
| 815 | results.cbSize = sizeof(results); | 822 | results.cbSize = sizeof(results); |
| 816 | results.fIgnoreBundle = *pfIgnoreBundle; | 823 | results.fIgnoreBundle = *pfIgnoreBundle; |
| 817 | 824 | ||
| 818 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTFORWARDCOMPATIBLEBUNDLE, &args, &results, pUserExperience->pvBAProcContext); | 825 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTFORWARDCOMPATIBLEBUNDLE, &args, &results); |
| 819 | ExitOnFailure(hr, "BA OnDetectForwardCompatibleBundle failed."); | 826 | ExitOnFailure(hr, "BA OnDetectForwardCompatibleBundle failed."); |
| 820 | 827 | ||
| 821 | if (results.fCancel) | 828 | if (results.fCancel) |
| @@ -846,7 +853,7 @@ EXTERN_C BAAPI UserExperienceOnDetectMsiFeature( | |||
| 846 | 853 | ||
| 847 | results.cbSize = sizeof(results); | 854 | results.cbSize = sizeof(results); |
| 848 | 855 | ||
| 849 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTMSIFEATURE, &args, &results, pUserExperience->pvBAProcContext); | 856 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTMSIFEATURE, &args, &results); |
| 850 | ExitOnFailure(hr, "BA OnDetectMsiFeature failed."); | 857 | ExitOnFailure(hr, "BA OnDetectMsiFeature failed."); |
| 851 | 858 | ||
| 852 | if (results.fCancel) | 859 | if (results.fCancel) |
| @@ -872,7 +879,7 @@ EXTERN_C BAAPI UserExperienceOnDetectPackageBegin( | |||
| 872 | 879 | ||
| 873 | results.cbSize = sizeof(results); | 880 | results.cbSize = sizeof(results); |
| 874 | 881 | ||
| 875 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTPACKAGEBEGIN, &args, &results, pUserExperience->pvBAProcContext); | 882 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTPACKAGEBEGIN, &args, &results); |
| 876 | ExitOnFailure(hr, "BA OnDetectPackageBegin failed."); | 883 | ExitOnFailure(hr, "BA OnDetectPackageBegin failed."); |
| 877 | 884 | ||
| 878 | if (results.fCancel) | 885 | if (results.fCancel) |
| @@ -902,7 +909,7 @@ EXTERN_C BAAPI UserExperienceOnDetectPackageComplete( | |||
| 902 | 909 | ||
| 903 | results.cbSize = sizeof(results); | 910 | results.cbSize = sizeof(results); |
| 904 | 911 | ||
| 905 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTPACKAGECOMPLETE, &args, &results, pUserExperience->pvBAProcContext); | 912 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTPACKAGECOMPLETE, &args, &results); |
| 906 | ExitOnFailure(hr, "BA OnDetectPackageComplete failed."); | 913 | ExitOnFailure(hr, "BA OnDetectPackageComplete failed."); |
| 907 | 914 | ||
| 908 | LExit: | 915 | LExit: |
| @@ -933,7 +940,7 @@ EXTERN_C BAAPI UserExperienceOnDetectRelatedBundle( | |||
| 933 | 940 | ||
| 934 | results.cbSize = sizeof(results); | 941 | results.cbSize = sizeof(results); |
| 935 | 942 | ||
| 936 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTRELATEDBUNDLE, &args, &results, pUserExperience->pvBAProcContext); | 943 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTRELATEDBUNDLE, &args, &results); |
| 937 | ExitOnFailure(hr, "BA OnDetectRelatedBundle failed."); | 944 | ExitOnFailure(hr, "BA OnDetectRelatedBundle failed."); |
| 938 | 945 | ||
| 939 | if (results.fCancel) | 946 | if (results.fCancel) |
| @@ -969,7 +976,7 @@ EXTERN_C BAAPI UserExperienceOnDetectRelatedMsiPackage( | |||
| 969 | 976 | ||
| 970 | results.cbSize = sizeof(results); | 977 | results.cbSize = sizeof(results); |
| 971 | 978 | ||
| 972 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTRELATEDMSIPACKAGE, &args, &results, pUserExperience->pvBAProcContext); | 979 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTRELATEDMSIPACKAGE, &args, &results); |
| 973 | ExitOnFailure(hr, "BA OnDetectRelatedMsiPackage failed."); | 980 | ExitOnFailure(hr, "BA OnDetectRelatedMsiPackage failed."); |
| 974 | 981 | ||
| 975 | if (results.fCancel) | 982 | if (results.fCancel) |
| @@ -999,7 +1006,7 @@ EXTERN_C BAAPI UserExperienceOnDetectTargetMsiPackage( | |||
| 999 | 1006 | ||
| 1000 | results.cbSize = sizeof(results); | 1007 | results.cbSize = sizeof(results); |
| 1001 | 1008 | ||
| 1002 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTTARGETMSIPACKAGE, &args, &results, pUserExperience->pvBAProcContext); | 1009 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTTARGETMSIPACKAGE, &args, &results); |
| 1003 | ExitOnFailure(hr, "BA OnDetectTargetMsiPackage failed."); | 1010 | ExitOnFailure(hr, "BA OnDetectTargetMsiPackage failed."); |
| 1004 | 1011 | ||
| 1005 | if (results.fCancel) | 1012 | if (results.fCancel) |
| @@ -1039,7 +1046,7 @@ EXTERN_C BAAPI UserExperienceOnDetectUpdate( | |||
| 1039 | results.cbSize = sizeof(results); | 1046 | results.cbSize = sizeof(results); |
| 1040 | results.fStopProcessingUpdates = *pfStopProcessingUpdates; | 1047 | results.fStopProcessingUpdates = *pfStopProcessingUpdates; |
| 1041 | 1048 | ||
| 1042 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTUPDATE, &args, &results, pUserExperience->pvBAProcContext); | 1049 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTUPDATE, &args, &results); |
| 1043 | ExitOnFailure(hr, "BA OnDetectUpdate failed."); | 1050 | ExitOnFailure(hr, "BA OnDetectUpdate failed."); |
| 1044 | 1051 | ||
| 1045 | if (results.fCancel) | 1052 | if (results.fCancel) |
| @@ -1068,7 +1075,7 @@ EXTERN_C BAAPI UserExperienceOnDetectUpdateBegin( | |||
| 1068 | results.cbSize = sizeof(results); | 1075 | results.cbSize = sizeof(results); |
| 1069 | results.fSkip = *pfSkip; | 1076 | results.fSkip = *pfSkip; |
| 1070 | 1077 | ||
| 1071 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTUPDATEBEGIN, &args, &results, pUserExperience->pvBAProcContext); | 1078 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTUPDATEBEGIN, &args, &results); |
| 1072 | ExitOnFailure(hr, "BA OnDetectUpdateBegin failed."); | 1079 | ExitOnFailure(hr, "BA OnDetectUpdateBegin failed."); |
| 1073 | 1080 | ||
| 1074 | if (results.fCancel) | 1081 | if (results.fCancel) |
| @@ -1097,7 +1104,7 @@ EXTERN_C BAAPI UserExperienceOnDetectUpdateComplete( | |||
| 1097 | results.cbSize = sizeof(results); | 1104 | results.cbSize = sizeof(results); |
| 1098 | results.fIgnoreError = *pfIgnoreError; | 1105 | results.fIgnoreError = *pfIgnoreError; |
| 1099 | 1106 | ||
| 1100 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTUPDATECOMPLETE, &args, &results, pUserExperience->pvBAProcContext); | 1107 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTUPDATECOMPLETE, &args, &results); |
| 1101 | ExitOnFailure(hr, "BA OnDetectUpdateComplete failed."); | 1108 | ExitOnFailure(hr, "BA OnDetectUpdateComplete failed."); |
| 1102 | 1109 | ||
| 1103 | if (FAILED(hrStatus)) | 1110 | if (FAILED(hrStatus)) |
| @@ -1121,7 +1128,7 @@ EXTERN_C BAAPI UserExperienceOnElevateBegin( | |||
| 1121 | 1128 | ||
| 1122 | results.cbSize = sizeof(results); | 1129 | results.cbSize = sizeof(results); |
| 1123 | 1130 | ||
| 1124 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONELEVATEBEGIN, &args, &results, pUserExperience->pvBAProcContext); | 1131 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONELEVATEBEGIN, &args, &results); |
| 1125 | ExitOnFailure(hr, "BA OnElevateBegin failed."); | 1132 | ExitOnFailure(hr, "BA OnElevateBegin failed."); |
| 1126 | 1133 | ||
| 1127 | if (results.fCancel) | 1134 | if (results.fCancel) |
| @@ -1147,7 +1154,7 @@ EXTERN_C BAAPI UserExperienceOnElevateComplete( | |||
| 1147 | 1154 | ||
| 1148 | results.cbSize = sizeof(results); | 1155 | results.cbSize = sizeof(results); |
| 1149 | 1156 | ||
| 1150 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONELEVATECOMPLETE, &args, &results, pUserExperience->pvBAProcContext); | 1157 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONELEVATECOMPLETE, &args, &results); |
| 1151 | ExitOnFailure(hr, "BA OnElevateComplete failed."); | 1158 | ExitOnFailure(hr, "BA OnElevateComplete failed."); |
| 1152 | 1159 | ||
| 1153 | LExit: | 1160 | LExit: |
| @@ -1183,7 +1190,7 @@ EXTERN_C BAAPI UserExperienceOnError( | |||
| 1183 | results.cbSize = sizeof(results); | 1190 | results.cbSize = sizeof(results); |
| 1184 | results.nResult = *pnResult; | 1191 | results.nResult = *pnResult; |
| 1185 | 1192 | ||
| 1186 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONERROR, &args, &results, pUserExperience->pvBAProcContext); | 1193 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONERROR, &args, &results); |
| 1187 | ExitOnFailure(hr, "BA OnError failed."); | 1194 | ExitOnFailure(hr, "BA OnError failed."); |
| 1188 | 1195 | ||
| 1189 | *pnResult = results.nResult; | 1196 | *pnResult = results.nResult; |
| @@ -1206,7 +1213,7 @@ EXTERN_C BAAPI UserExperienceOnExecuteBegin( | |||
| 1206 | 1213 | ||
| 1207 | results.cbSize = sizeof(results); | 1214 | results.cbSize = sizeof(results); |
| 1208 | 1215 | ||
| 1209 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONEXECUTEBEGIN, &args, &results, pUserExperience->pvBAProcContext); | 1216 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONEXECUTEBEGIN, &args, &results); |
| 1210 | ExitOnFailure(hr, "BA OnExecuteBegin failed."); | 1217 | ExitOnFailure(hr, "BA OnExecuteBegin failed."); |
| 1211 | 1218 | ||
| 1212 | if (results.fCancel) | 1219 | if (results.fCancel) |
| @@ -1232,7 +1239,7 @@ EXTERN_C BAAPI UserExperienceOnExecuteComplete( | |||
| 1232 | 1239 | ||
| 1233 | results.cbSize = sizeof(results); | 1240 | results.cbSize = sizeof(results); |
| 1234 | 1241 | ||
| 1235 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONEXECUTECOMPLETE, &args, &results, pUserExperience->pvBAProcContext); | 1242 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONEXECUTECOMPLETE, &args, &results); |
| 1236 | ExitOnFailure(hr, "BA OnExecuteComplete failed."); | 1243 | ExitOnFailure(hr, "BA OnExecuteComplete failed."); |
| 1237 | 1244 | ||
| 1238 | LExit: | 1245 | LExit: |
| @@ -1260,7 +1267,7 @@ EXTERN_C BAAPI UserExperienceOnExecuteFilesInUse( | |||
| 1260 | results.cbSize = sizeof(results); | 1267 | results.cbSize = sizeof(results); |
| 1261 | results.nResult = *pnResult; | 1268 | results.nResult = *pnResult; |
| 1262 | 1269 | ||
| 1263 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONEXECUTEFILESINUSE, &args, &results, pUserExperience->pvBAProcContext); | 1270 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONEXECUTEFILESINUSE, &args, &results); |
| 1264 | ExitOnFailure(hr, "BA OnExecuteFilesInUse failed."); | 1271 | ExitOnFailure(hr, "BA OnExecuteFilesInUse failed."); |
| 1265 | 1272 | ||
| 1266 | *pnResult = results.nResult; | 1273 | *pnResult = results.nResult; |
| @@ -1296,7 +1303,7 @@ EXTERN_C BAAPI UserExperienceOnExecuteMsiMessage( | |||
| 1296 | results.cbSize = sizeof(results); | 1303 | results.cbSize = sizeof(results); |
| 1297 | results.nResult = *pnResult; | 1304 | results.nResult = *pnResult; |
| 1298 | 1305 | ||
| 1299 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONEXECUTEMSIMESSAGE, &args, &results, pUserExperience->pvBAProcContext); | 1306 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONEXECUTEMSIMESSAGE, &args, &results); |
| 1300 | ExitOnFailure(hr, "BA OnExecuteMsiMessage failed."); | 1307 | ExitOnFailure(hr, "BA OnExecuteMsiMessage failed."); |
| 1301 | 1308 | ||
| 1302 | *pnResult = results.nResult; | 1309 | *pnResult = results.nResult; |
| @@ -1327,7 +1334,7 @@ EXTERN_C BAAPI UserExperienceOnExecutePackageBegin( | |||
| 1327 | 1334 | ||
| 1328 | results.cbSize = sizeof(results); | 1335 | results.cbSize = sizeof(results); |
| 1329 | 1336 | ||
| 1330 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONEXECUTEPACKAGEBEGIN, &args, &results, pUserExperience->pvBAProcContext); | 1337 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONEXECUTEPACKAGEBEGIN, &args, &results); |
| 1331 | ExitOnFailure(hr, "BA OnExecutePackageBegin failed."); | 1338 | ExitOnFailure(hr, "BA OnExecutePackageBegin failed."); |
| 1332 | 1339 | ||
| 1333 | if (results.fCancel) | 1340 | if (results.fCancel) |
| @@ -1360,7 +1367,7 @@ EXTERN_C BAAPI UserExperienceOnExecutePackageComplete( | |||
| 1360 | results.cbSize = sizeof(results); | 1367 | results.cbSize = sizeof(results); |
| 1361 | results.action = *pAction; | 1368 | results.action = *pAction; |
| 1362 | 1369 | ||
| 1363 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONEXECUTEPACKAGECOMPLETE, &args, &results, pUserExperience->pvBAProcContext); | 1370 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONEXECUTEPACKAGECOMPLETE, &args, &results); |
| 1364 | ExitOnFailure(hr, "BA OnExecutePackageComplete failed."); | 1371 | ExitOnFailure(hr, "BA OnExecutePackageComplete failed."); |
| 1365 | 1372 | ||
| 1366 | *pAction = results.action; | 1373 | *pAction = results.action; |
| @@ -1385,7 +1392,7 @@ EXTERN_C BAAPI UserExperienceOnExecutePatchTarget( | |||
| 1385 | 1392 | ||
| 1386 | results.cbSize = sizeof(results); | 1393 | results.cbSize = sizeof(results); |
| 1387 | 1394 | ||
| 1388 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONEXECUTEPATCHTARGET, &args, &results, pUserExperience->pvBAProcContext); | 1395 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONEXECUTEPATCHTARGET, &args, &results); |
| 1389 | ExitOnFailure(hr, "BA OnExecutePatchTarget failed."); | 1396 | ExitOnFailure(hr, "BA OnExecutePatchTarget failed."); |
| 1390 | 1397 | ||
| 1391 | if (results.fCancel) | 1398 | if (results.fCancel) |
| @@ -1416,7 +1423,7 @@ EXTERN_C BAAPI UserExperienceOnExecuteProgress( | |||
| 1416 | 1423 | ||
| 1417 | results.cbSize = sizeof(results); | 1424 | results.cbSize = sizeof(results); |
| 1418 | 1425 | ||
| 1419 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONEXECUTEPROGRESS, &args, &results, pUserExperience->pvBAProcContext); | 1426 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONEXECUTEPROGRESS, &args, &results); |
| 1420 | ExitOnFailure(hr, "BA OnExecuteProgress failed."); | 1427 | ExitOnFailure(hr, "BA OnExecuteProgress failed."); |
| 1421 | 1428 | ||
| 1422 | LExit: | 1429 | LExit: |
| @@ -1447,7 +1454,7 @@ EXTERN_C BAAPI UserExperienceOnLaunchApprovedExeBegin( | |||
| 1447 | 1454 | ||
| 1448 | results.cbSize = sizeof(results); | 1455 | results.cbSize = sizeof(results); |
| 1449 | 1456 | ||
| 1450 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONLAUNCHAPPROVEDEXEBEGIN, &args, &results, pUserExperience->pvBAProcContext); | 1457 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONLAUNCHAPPROVEDEXEBEGIN, &args, &results); |
| 1451 | ExitOnFailure(hr, "BA OnLaunchApprovedExeBegin failed."); | 1458 | ExitOnFailure(hr, "BA OnLaunchApprovedExeBegin failed."); |
| 1452 | 1459 | ||
| 1453 | if (results.fCancel) | 1460 | if (results.fCancel) |
| @@ -1475,7 +1482,7 @@ EXTERN_C BAAPI UserExperienceOnLaunchApprovedExeComplete( | |||
| 1475 | 1482 | ||
| 1476 | results.cbSize = sizeof(results); | 1483 | results.cbSize = sizeof(results); |
| 1477 | 1484 | ||
| 1478 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONLAUNCHAPPROVEDEXECOMPLETE, &args, &results, pUserExperience->pvBAProcContext); | 1485 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONLAUNCHAPPROVEDEXECOMPLETE, &args, &results); |
| 1479 | ExitOnFailure(hr, "BA OnLaunchApprovedExeComplete failed."); | 1486 | ExitOnFailure(hr, "BA OnLaunchApprovedExeComplete failed."); |
| 1480 | 1487 | ||
| 1481 | LExit: | 1488 | LExit: |
| @@ -1494,7 +1501,7 @@ EXTERN_C BAAPI UserExperienceOnPauseAUBegin( | |||
| 1494 | 1501 | ||
| 1495 | results.cbSize = sizeof(results); | 1502 | results.cbSize = sizeof(results); |
| 1496 | 1503 | ||
| 1497 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONPAUSEAUTOMATICUPDATESBEGIN, &args, &results, pUserExperience->pvBAProcContext); | 1504 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPAUSEAUTOMATICUPDATESBEGIN, &args, &results); |
| 1498 | ExitOnFailure(hr, "BA OnPauseAUBegin failed."); | 1505 | ExitOnFailure(hr, "BA OnPauseAUBegin failed."); |
| 1499 | 1506 | ||
| 1500 | LExit: | 1507 | LExit: |
| @@ -1515,7 +1522,7 @@ EXTERN_C BAAPI UserExperienceOnPauseAUComplete( | |||
| 1515 | 1522 | ||
| 1516 | results.cbSize = sizeof(results); | 1523 | results.cbSize = sizeof(results); |
| 1517 | 1524 | ||
| 1518 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONPAUSEAUTOMATICUPDATESCOMPLETE, &args, &results, pUserExperience->pvBAProcContext); | 1525 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPAUSEAUTOMATICUPDATESCOMPLETE, &args, &results); |
| 1519 | ExitOnFailure(hr, "BA OnPauseAUComplete failed."); | 1526 | ExitOnFailure(hr, "BA OnPauseAUComplete failed."); |
| 1520 | 1527 | ||
| 1521 | LExit: | 1528 | LExit: |
| @@ -1536,7 +1543,7 @@ EXTERN_C BAAPI UserExperienceOnPlanBegin( | |||
| 1536 | 1543 | ||
| 1537 | results.cbSize = sizeof(results); | 1544 | results.cbSize = sizeof(results); |
| 1538 | 1545 | ||
| 1539 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANBEGIN, &args, &results, pUserExperience->pvBAProcContext); | 1546 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANBEGIN, &args, &results); |
| 1540 | ExitOnFailure(hr, "BA OnPlanBegin failed."); | 1547 | ExitOnFailure(hr, "BA OnPlanBegin failed."); |
| 1541 | 1548 | ||
| 1542 | if (results.fCancel) | 1549 | if (results.fCancel) |
| @@ -1569,7 +1576,7 @@ EXTERN_C BAAPI UserExperienceOnPlanCompatibleMsiPackageBegin( | |||
| 1569 | results.cbSize = sizeof(results); | 1576 | results.cbSize = sizeof(results); |
| 1570 | results.requestedState = *pRequestedState; | 1577 | results.requestedState = *pRequestedState; |
| 1571 | 1578 | ||
| 1572 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANCOMPATIBLEMSIPACKAGEBEGIN, &args, &results, pUserExperience->pvBAProcContext); | 1579 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANCOMPATIBLEMSIPACKAGEBEGIN, &args, &results); |
| 1573 | ExitOnFailure(hr, "BA OnPlanCompatibleMsiPackageBegin failed."); | 1580 | ExitOnFailure(hr, "BA OnPlanCompatibleMsiPackageBegin failed."); |
| 1574 | 1581 | ||
| 1575 | if (results.fCancel) | 1582 | if (results.fCancel) |
| @@ -1608,7 +1615,7 @@ EXTERN_C BAAPI UserExperienceOnPlanCompatibleMsiPackageComplete( | |||
| 1608 | 1615 | ||
| 1609 | results.cbSize = sizeof(results); | 1616 | results.cbSize = sizeof(results); |
| 1610 | 1617 | ||
| 1611 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANCOMPATIBLEMSIPACKAGECOMPLETE, &args, &results, pUserExperience->pvBAProcContext); | 1618 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANCOMPATIBLEMSIPACKAGECOMPLETE, &args, &results); |
| 1612 | ExitOnFailure(hr, "BA OnPlanCompatibleMsiPackageComplete failed."); | 1619 | ExitOnFailure(hr, "BA OnPlanCompatibleMsiPackageComplete failed."); |
| 1613 | 1620 | ||
| 1614 | LExit: | 1621 | LExit: |
| @@ -1634,7 +1641,7 @@ EXTERN_C BAAPI UserExperienceOnPlanMsiFeature( | |||
| 1634 | results.cbSize = sizeof(results); | 1641 | results.cbSize = sizeof(results); |
| 1635 | results.requestedState = *pRequestedState; | 1642 | results.requestedState = *pRequestedState; |
| 1636 | 1643 | ||
| 1637 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANMSIFEATURE, &args, &results, pUserExperience->pvBAProcContext); | 1644 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANMSIFEATURE, &args, &results); |
| 1638 | ExitOnFailure(hr, "BA OnPlanMsiFeature failed."); | 1645 | ExitOnFailure(hr, "BA OnPlanMsiFeature failed."); |
| 1639 | 1646 | ||
| 1640 | if (results.fCancel) | 1647 | if (results.fCancel) |
| @@ -1661,7 +1668,7 @@ EXTERN_C BAAPI UserExperienceOnPlanComplete( | |||
| 1661 | 1668 | ||
| 1662 | results.cbSize = sizeof(results); | 1669 | results.cbSize = sizeof(results); |
| 1663 | 1670 | ||
| 1664 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANCOMPLETE, &args, &results, pUserExperience->pvBAProcContext); | 1671 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANCOMPLETE, &args, &results); |
| 1665 | ExitOnFailure(hr, "BA OnPlanComplete failed."); | 1672 | ExitOnFailure(hr, "BA OnPlanComplete failed."); |
| 1666 | 1673 | ||
| 1667 | LExit: | 1674 | LExit: |
| @@ -1692,7 +1699,7 @@ EXTERN_C BAAPI UserExperienceOnPlanMsiPackage( | |||
| 1692 | results.uiLevel = *pUiLevel; | 1699 | results.uiLevel = *pUiLevel; |
| 1693 | results.fDisableExternalUiHandler = *pfDisableExternalUiHandler; | 1700 | results.fDisableExternalUiHandler = *pfDisableExternalUiHandler; |
| 1694 | 1701 | ||
| 1695 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANMSIPACKAGE, &args, &results, pUserExperience->pvBAProcContext); | 1702 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANMSIPACKAGE, &args, &results); |
| 1696 | ExitOnFailure(hr, "BA OnPlanMsiPackage failed."); | 1703 | ExitOnFailure(hr, "BA OnPlanMsiPackage failed."); |
| 1697 | 1704 | ||
| 1698 | if (results.fCancel) | 1705 | if (results.fCancel) |
| @@ -1724,7 +1731,7 @@ EXTERN_C BAAPI UserExperienceOnPlanPackageBegin( | |||
| 1724 | results.cbSize = sizeof(results); | 1731 | results.cbSize = sizeof(results); |
| 1725 | results.requestedState = *pRequestedState; | 1732 | results.requestedState = *pRequestedState; |
| 1726 | 1733 | ||
| 1727 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANPACKAGEBEGIN, &args, &results, pUserExperience->pvBAProcContext); | 1734 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANPACKAGEBEGIN, &args, &results); |
| 1728 | ExitOnFailure(hr, "BA OnPlanPackageBegin failed."); | 1735 | ExitOnFailure(hr, "BA OnPlanPackageBegin failed."); |
| 1729 | 1736 | ||
| 1730 | if (results.fCancel) | 1737 | if (results.fCancel) |
| @@ -1761,7 +1768,7 @@ EXTERN_C BAAPI UserExperienceOnPlanPackageComplete( | |||
| 1761 | 1768 | ||
| 1762 | results.cbSize = sizeof(results); | 1769 | results.cbSize = sizeof(results); |
| 1763 | 1770 | ||
| 1764 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANPACKAGECOMPLETE, &args, &results, pUserExperience->pvBAProcContext); | 1771 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANPACKAGECOMPLETE, &args, &results); |
| 1765 | ExitOnFailure(hr, "BA OnPlanPackageComplete failed."); | 1772 | ExitOnFailure(hr, "BA OnPlanPackageComplete failed."); |
| 1766 | 1773 | ||
| 1767 | LExit: | 1774 | LExit: |
| @@ -1785,7 +1792,7 @@ EXTERN_C BAAPI UserExperienceOnPlanRelatedBundle( | |||
| 1785 | results.cbSize = sizeof(results); | 1792 | results.cbSize = sizeof(results); |
| 1786 | results.requestedState = *pRequestedState; | 1793 | results.requestedState = *pRequestedState; |
| 1787 | 1794 | ||
| 1788 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANRELATEDBUNDLE, &args, &results, pUserExperience->pvBAProcContext); | 1795 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANRELATEDBUNDLE, &args, &results); |
| 1789 | ExitOnFailure(hr, "BA OnPlanRelatedBundle failed."); | 1796 | ExitOnFailure(hr, "BA OnPlanRelatedBundle failed."); |
| 1790 | 1797 | ||
| 1791 | if (results.fCancel) | 1798 | if (results.fCancel) |
| @@ -1817,7 +1824,7 @@ EXTERN_C BAAPI UserExperienceOnPlanTargetMsiPackage( | |||
| 1817 | results.cbSize = sizeof(results); | 1824 | results.cbSize = sizeof(results); |
| 1818 | results.requestedState = *pRequestedState; | 1825 | results.requestedState = *pRequestedState; |
| 1819 | 1826 | ||
| 1820 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANTARGETMSIPACKAGE, &args, &results, pUserExperience->pvBAProcContext); | 1827 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANTARGETMSIPACKAGE, &args, &results); |
| 1821 | ExitOnFailure(hr, "BA OnPlanTargetMsiPackage failed."); | 1828 | ExitOnFailure(hr, "BA OnPlanTargetMsiPackage failed."); |
| 1822 | 1829 | ||
| 1823 | if (results.fCancel) | 1830 | if (results.fCancel) |
| @@ -1847,7 +1854,7 @@ EXTERN_C BAAPI UserExperienceOnProgress( | |||
| 1847 | 1854 | ||
| 1848 | results.cbSize = sizeof(results); | 1855 | results.cbSize = sizeof(results); |
| 1849 | 1856 | ||
| 1850 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONPROGRESS, &args, &results, pUserExperience->pvBAProcContext); | 1857 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPROGRESS, &args, &results); |
| 1851 | hr = FilterExecuteResult(pUserExperience, hr, fRollback, results.fCancel, L"OnProgress"); | 1858 | hr = FilterExecuteResult(pUserExperience, hr, fRollback, results.fCancel, L"OnProgress"); |
| 1852 | 1859 | ||
| 1853 | return hr; | 1860 | return hr; |
| @@ -1865,7 +1872,7 @@ EXTERN_C BAAPI UserExperienceOnRegisterBegin( | |||
| 1865 | 1872 | ||
| 1866 | results.cbSize = sizeof(results); | 1873 | results.cbSize = sizeof(results); |
| 1867 | 1874 | ||
| 1868 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONREGISTERBEGIN, &args, &results, pUserExperience->pvBAProcContext); | 1875 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONREGISTERBEGIN, &args, &results); |
| 1869 | ExitOnFailure(hr, "BA OnRegisterBegin failed."); | 1876 | ExitOnFailure(hr, "BA OnRegisterBegin failed."); |
| 1870 | 1877 | ||
| 1871 | if (results.fCancel) | 1878 | if (results.fCancel) |
| @@ -1891,7 +1898,7 @@ EXTERN_C BAAPI UserExperienceOnRegisterComplete( | |||
| 1891 | 1898 | ||
| 1892 | results.cbSize = sizeof(results); | 1899 | results.cbSize = sizeof(results); |
| 1893 | 1900 | ||
| 1894 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONREGISTERCOMPLETE, &args, &results, pUserExperience->pvBAProcContext); | 1901 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONREGISTERCOMPLETE, &args, &results); |
| 1895 | ExitOnFailure(hr, "BA OnRegisterComplete failed."); | 1902 | ExitOnFailure(hr, "BA OnRegisterComplete failed."); |
| 1896 | 1903 | ||
| 1897 | LExit: | 1904 | LExit: |
| @@ -1921,7 +1928,7 @@ EXTERN_C BAAPI UserExperienceOnResolveSource( | |||
| 1921 | results.cbSize = sizeof(results); | 1928 | results.cbSize = sizeof(results); |
| 1922 | results.action = *pAction; | 1929 | results.action = *pAction; |
| 1923 | 1930 | ||
| 1924 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONRESOLVESOURCE, &args, &results, pUserExperience->pvBAProcContext); | 1931 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONRESOLVESOURCE, &args, &results); |
| 1925 | ExitOnFailure(hr, "BA OnResolveSource failed."); | 1932 | ExitOnFailure(hr, "BA OnResolveSource failed."); |
| 1926 | 1933 | ||
| 1927 | if (results.fCancel) | 1934 | if (results.fCancel) |
| @@ -1951,7 +1958,7 @@ EXTERN_C BAAPI UserExperienceOnRollbackMsiTransactionBegin( | |||
| 1951 | 1958 | ||
| 1952 | results.cbSize = sizeof(results); | 1959 | results.cbSize = sizeof(results); |
| 1953 | 1960 | ||
| 1954 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONROLLBACKMSITRANSACTIONBEGIN, &args, &results, pUserExperience->pvBAProcContext); | 1961 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONROLLBACKMSITRANSACTIONBEGIN, &args, &results); |
| 1955 | ExitOnFailure(hr, "BA OnRollbackMsiTransactionBegin failed."); | 1962 | ExitOnFailure(hr, "BA OnRollbackMsiTransactionBegin failed."); |
| 1956 | 1963 | ||
| 1957 | LExit: | 1964 | LExit: |
| @@ -1974,7 +1981,7 @@ EXTERN_C BAAPI UserExperienceOnRollbackMsiTransactionComplete( | |||
| 1974 | 1981 | ||
| 1975 | results.cbSize = sizeof(results); | 1982 | results.cbSize = sizeof(results); |
| 1976 | 1983 | ||
| 1977 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONROLLBACKMSITRANSACTIONCOMPLETE, &args, &results, pUserExperience->pvBAProcContext); | 1984 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONROLLBACKMSITRANSACTIONCOMPLETE, &args, &results); |
| 1978 | ExitOnFailure(hr, "BA OnRollbackMsiTransactionComplete failed."); | 1985 | ExitOnFailure(hr, "BA OnRollbackMsiTransactionComplete failed."); |
| 1979 | 1986 | ||
| 1980 | LExit: | 1987 | LExit: |
| @@ -1995,7 +2002,7 @@ EXTERN_C BAAPI UserExperienceOnShutdown( | |||
| 1995 | results.cbSize = sizeof(results); | 2002 | results.cbSize = sizeof(results); |
| 1996 | results.action = *pAction; | 2003 | results.action = *pAction; |
| 1997 | 2004 | ||
| 1998 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONSHUTDOWN, &args, &results, pUserExperience->pvBAProcContext); | 2005 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONSHUTDOWN, &args, &results); |
| 1999 | ExitOnFailure(hr, "BA OnShutdown failed."); | 2006 | ExitOnFailure(hr, "BA OnShutdown failed."); |
| 2000 | 2007 | ||
| 2001 | *pAction = results.action; | 2008 | *pAction = results.action; |
| @@ -2016,7 +2023,7 @@ EXTERN_C BAAPI UserExperienceOnStartup( | |||
| 2016 | 2023 | ||
| 2017 | results.cbSize = sizeof(results); | 2024 | results.cbSize = sizeof(results); |
| 2018 | 2025 | ||
| 2019 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONSTARTUP, &args, &results, pUserExperience->pvBAProcContext); | 2026 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONSTARTUP, &args, &results); |
| 2020 | ExitOnFailure(hr, "BA OnStartup failed."); | 2027 | ExitOnFailure(hr, "BA OnStartup failed."); |
| 2021 | 2028 | ||
| 2022 | LExit: | 2029 | LExit: |
| @@ -2035,7 +2042,7 @@ EXTERN_C BAAPI UserExperienceOnSystemRestorePointBegin( | |||
| 2035 | 2042 | ||
| 2036 | results.cbSize = sizeof(results); | 2043 | results.cbSize = sizeof(results); |
| 2037 | 2044 | ||
| 2038 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONSYSTEMRESTOREPOINTBEGIN, &args, &results, pUserExperience->pvBAProcContext); | 2045 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONSYSTEMRESTOREPOINTBEGIN, &args, &results); |
| 2039 | ExitOnFailure(hr, "BA OnSystemRestorePointBegin failed."); | 2046 | ExitOnFailure(hr, "BA OnSystemRestorePointBegin failed."); |
| 2040 | 2047 | ||
| 2041 | LExit: | 2048 | LExit: |
| @@ -2056,7 +2063,7 @@ EXTERN_C BAAPI UserExperienceOnSystemRestorePointComplete( | |||
| 2056 | 2063 | ||
| 2057 | results.cbSize = sizeof(results); | 2064 | results.cbSize = sizeof(results); |
| 2058 | 2065 | ||
| 2059 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONSYSTEMRESTOREPOINTCOMPLETE, &args, &results, pUserExperience->pvBAProcContext); | 2066 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONSYSTEMRESTOREPOINTCOMPLETE, &args, &results); |
| 2060 | ExitOnFailure(hr, "BA OnSystemRestorePointComplete failed."); | 2067 | ExitOnFailure(hr, "BA OnSystemRestorePointComplete failed."); |
| 2061 | 2068 | ||
| 2062 | LExit: | 2069 | LExit: |
| @@ -2079,7 +2086,7 @@ EXTERN_C BAAPI UserExperienceOnSystemShutdown( | |||
| 2079 | results.cbSize = sizeof(results); | 2086 | results.cbSize = sizeof(results); |
| 2080 | results.fCancel = *pfCancel; | 2087 | results.fCancel = *pfCancel; |
| 2081 | 2088 | ||
| 2082 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONSYSTEMSHUTDOWN, &args, &results, pUserExperience->pvBAProcContext); | 2089 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONSYSTEMSHUTDOWN, &args, &results); |
| 2083 | ExitOnFailure(hr, "BA OnSystemShutdown failed."); | 2090 | ExitOnFailure(hr, "BA OnSystemShutdown failed."); |
| 2084 | 2091 | ||
| 2085 | *pfCancel = results.fCancel; | 2092 | *pfCancel = results.fCancel; |
| @@ -2100,7 +2107,7 @@ EXTERN_C BAAPI UserExperienceOnUnregisterBegin( | |||
| 2100 | 2107 | ||
| 2101 | results.cbSize = sizeof(results); | 2108 | results.cbSize = sizeof(results); |
| 2102 | 2109 | ||
| 2103 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONUNREGISTERBEGIN, &args, &results, pUserExperience->pvBAProcContext); | 2110 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONUNREGISTERBEGIN, &args, &results); |
| 2104 | ExitOnFailure(hr, "BA OnUnregisterBegin failed."); | 2111 | ExitOnFailure(hr, "BA OnUnregisterBegin failed."); |
| 2105 | 2112 | ||
| 2106 | if (results.fCancel) | 2113 | if (results.fCancel) |
| @@ -2126,7 +2133,7 @@ EXTERN_C BAAPI UserExperienceOnUnregisterComplete( | |||
| 2126 | 2133 | ||
| 2127 | results.cbSize = sizeof(results); | 2134 | results.cbSize = sizeof(results); |
| 2128 | 2135 | ||
| 2129 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONUNREGISTERCOMPLETE, &args, &results, pUserExperience->pvBAProcContext); | 2136 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONUNREGISTERCOMPLETE, &args, &results); |
| 2130 | ExitOnFailure(hr, "BA OnUnregisterComplete failed."); | 2137 | ExitOnFailure(hr, "BA OnUnregisterComplete failed."); |
| 2131 | 2138 | ||
| 2132 | LExit: | 2139 | LExit: |
| @@ -2389,3 +2396,21 @@ static HRESULT FilterExecuteResult( | |||
| 2389 | LExit: | 2396 | LExit: |
| 2390 | return hr; | 2397 | return hr; |
| 2391 | } | 2398 | } |
| 2399 | |||
| 2400 | static HRESULT SendBAMessage( | ||
| 2401 | __in BURN_USER_EXPERIENCE* pUserExperience, | ||
| 2402 | __in BOOTSTRAPPER_APPLICATION_MESSAGE message, | ||
| 2403 | __in const LPVOID pvArgs, | ||
| 2404 | __inout LPVOID pvResults | ||
| 2405 | ) | ||
| 2406 | { | ||
| 2407 | HRESULT hr = S_OK; | ||
| 2408 | |||
| 2409 | hr = pUserExperience->pfnBAProc(message, pvArgs, pvResults, pUserExperience->pvBAProcContext); | ||
| 2410 | if (hr == E_NOTIMPL) | ||
| 2411 | { | ||
| 2412 | hr = S_OK; | ||
| 2413 | } | ||
| 2414 | |||
| 2415 | return hr; | ||
| 2416 | } | ||
