diff options
Diffstat (limited to '')
| -rw-r--r-- | src/burn/engine/pseudobundle.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/burn/engine/pseudobundle.cpp b/src/burn/engine/pseudobundle.cpp index 082c4487..8b30ebfc 100644 --- a/src/burn/engine/pseudobundle.cpp +++ b/src/burn/engine/pseudobundle.cpp | |||
| @@ -142,9 +142,8 @@ extern "C" HRESULT PseudoBundleInitializeUpdateBundle( | |||
| 142 | __in_z_opt LPCWSTR wzDownloadSource, | 142 | __in_z_opt LPCWSTR wzDownloadSource, |
| 143 | __in DWORD64 qwSize, | 143 | __in DWORD64 qwSize, |
| 144 | __in_z LPCWSTR wzInstallArguments, | 144 | __in_z LPCWSTR wzInstallArguments, |
| 145 | __in_opt const BYTE* pbHash, | 145 | __in_opt LPCWSTR wzHash |
| 146 | __in const DWORD cbHash | 146 | ) |
| 147 | ) | ||
| 148 | { | 147 | { |
| 149 | HRESULT hr = S_OK; | 148 | HRESULT hr = S_OK; |
| 150 | BURN_PAYLOAD* pPayload = NULL; | 149 | BURN_PAYLOAD* pPayload = NULL; |
| @@ -176,13 +175,20 @@ extern "C" HRESULT PseudoBundleInitializeUpdateBundle( | |||
| 176 | ExitOnFailure(hr, "Failed to copy download source for pseudo bundle."); | 175 | ExitOnFailure(hr, "Failed to copy download source for pseudo bundle."); |
| 177 | } | 176 | } |
| 178 | 177 | ||
| 179 | if (pbHash) | 178 | if (wzHash && *wzHash) |
| 180 | { | 179 | { |
| 180 | BYTE* rgbHash = NULL; | ||
| 181 | DWORD cbHash = 0; | ||
| 182 | |||
| 183 | hr = StrAllocHexDecode(wzHash, &rgbHash, &cbHash); | ||
| 184 | ExitOnFailure(hr, "Failed to decode hash string: %ls.", wzHash); | ||
| 185 | |||
| 181 | pPayload->pbHash = static_cast<BYTE*>(MemAlloc(cbHash, FALSE)); | 186 | pPayload->pbHash = static_cast<BYTE*>(MemAlloc(cbHash, FALSE)); |
| 182 | ExitOnNull(pPayload->pbHash, hr, E_OUTOFMEMORY, "Failed to allocate memory for update bundle payload hash."); | 187 | ExitOnNull(pPayload->pbHash, hr, E_OUTOFMEMORY, "Failed to allocate memory for update bundle payload hash."); |
| 183 | 188 | ||
| 184 | pPayload->cbHash = cbHash; | 189 | pPayload->cbHash = cbHash; |
| 185 | memcpy_s(pPayload->pbHash, pPayload->cbHash, pbHash, cbHash); | 190 | |
| 191 | memcpy_s(pPayload->pbHash, pPayload->cbHash, rgbHash, cbHash); | ||
| 186 | } | 192 | } |
| 187 | 193 | ||
| 188 | pPackage->type = BURN_PACKAGE_TYPE_EXE; | 194 | pPackage->type = BURN_PACKAGE_TYPE_EXE; |
