diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2020-11-17 14:11:30 -0600 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2020-11-17 19:06:00 -0600 |
| commit | 643293e48d176ff78282670512f45b4cf889b0a5 (patch) | |
| tree | 663433bb793e6dfef5d043cea4ba24b6ee3fb03d /src/engine/EngineForApplication.cpp | |
| parent | 4ca0a5b2a8711cae9e60cb4075799bffef4ce75a (diff) | |
| download | wix-643293e48d176ff78282670512f45b4cf889b0a5.tar.gz wix-643293e48d176ff78282670512f45b4cf889b0a5.tar.bz2 wix-643293e48d176ff78282670512f45b4cf889b0a5.zip | |
Allow E_IMPL from BA/bext and check all cbSizes from BA/bext.
Diffstat (limited to 'src/engine/EngineForApplication.cpp')
| -rw-r--r-- | src/engine/EngineForApplication.cpp | 216 |
1 files changed, 139 insertions, 77 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 | { |
