summaryrefslogtreecommitdiff
path: root/src/burn/engine/externalengine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/burn/engine/externalengine.cpp')
-rw-r--r--src/burn/engine/externalengine.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/burn/engine/externalengine.cpp b/src/burn/engine/externalengine.cpp
index 16977395..e18b9486 100644
--- a/src/burn/engine/externalengine.cpp
+++ b/src/burn/engine/externalengine.cpp
@@ -269,8 +269,7 @@ HRESULT ExternalEngineSetUpdate(
269 __in_z_opt LPCWSTR wzDownloadSource, 269 __in_z_opt LPCWSTR wzDownloadSource,
270 __in const DWORD64 qwSize, 270 __in const DWORD64 qwSize,
271 __in const BOOTSTRAPPER_UPDATE_HASH_TYPE hashType, 271 __in const BOOTSTRAPPER_UPDATE_HASH_TYPE hashType,
272 __in_opt const BYTE* rgbHash, 272 __in_opt LPCWSTR wzHash
273 __in const DWORD cbHash
274 ) 273 )
275{ 274{
276 HRESULT hr = S_OK; 275 HRESULT hr = S_OK;
@@ -293,11 +292,11 @@ HRESULT ExternalEngineSetUpdate(
293 292
294 if (!fRemove) 293 if (!fRemove)
295 { 294 {
296 if (BOOTSTRAPPER_UPDATE_HASH_TYPE_NONE == hashType && (0 != cbHash || rgbHash)) 295 if (BOOTSTRAPPER_UPDATE_HASH_TYPE_NONE == hashType && wzHash && *wzHash)
297 { 296 {
298 ExitFunction1(hr = E_INVALIDARG); 297 ExitFunction1(hr = E_INVALIDARG);
299 } 298 }
300 else if (BOOTSTRAPPER_UPDATE_HASH_TYPE_SHA512 == hashType && (SHA512_HASH_LEN != cbHash || !rgbHash)) 299 else if (BOOTSTRAPPER_UPDATE_HASH_TYPE_SHA512 == hashType && (!wzHash || !*wzHash || SHA512_HASH_LEN != lstrlenW(wzHash)))
301 { 300 {
302 ExitFunction1(hr = E_INVALIDARG); 301 ExitFunction1(hr = E_INVALIDARG);
303 } 302 }
@@ -335,7 +334,7 @@ HRESULT ExternalEngineSetUpdate(
335 wzLocalSource = sczFilePath; 334 wzLocalSource = sczFilePath;
336 } 335 }
337 336
338 hr = PseudoBundleInitializeUpdateBundle(&pEngineState->update.package, wzGuid, pEngineState->registration.sczId, sczFilePath, wzLocalSource, wzDownloadSource, qwSize, sczCommandline, rgbHash, cbHash); 337 hr = PseudoBundleInitializeUpdateBundle(&pEngineState->update.package, wzGuid, pEngineState->registration.sczId, sczFilePath, wzLocalSource, wzDownloadSource, qwSize, sczCommandline, wzHash);
339 ExitOnFailure(hr, "Failed to set update bundle."); 338 ExitOnFailure(hr, "Failed to set update bundle.");
340 339
341 pEngineState->update.fUpdateAvailable = TRUE; 340 pEngineState->update.fUpdateAvailable = TRUE;