| 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 | // internal function declarations |
| 7 | |
| 8 | |
| 9 | // function definitions |
| 10 | |
| 11 | extern "C" HRESULT UpdateParseFromXml( |
| 12 | __in BURN_UPDATE* pUpdate, |
| 13 | __in IXMLDOMNode* pixnBundle |
| 14 | ) |
| 15 | { |
| 16 | HRESULT hr = S_OK; |
| 17 | IXMLDOMNode* pixnUpdateNode = NULL; |
| 18 | |
| 19 | hr = XmlSelectSingleNode(pixnBundle, L"Update", &pixnUpdateNode); |
| 20 | if (S_FALSE == hr) |
| 21 | { |
| 22 | ExitFunction1(hr = S_OK); |
| 23 | } |
| 24 | ExitOnFailure(hr, "Failed to select Bundle/Update node."); |
| 25 | |
| 26 | // @Location |
| 27 | hr = XmlGetAttributeEx(pixnUpdateNode, L"Location", &pUpdate->sczUpdateSource); |
| 28 | ExitOnFailure(hr, "Failed to get Update@Location."); |
| 29 | |
| 30 | LExit: |
| 31 | ReleaseObject(pixnUpdateNode); |
| 32 | |
| 33 | return hr; |
| 34 | } |
| 35 | |
| 36 | extern "C" void UpdateUninitialize( |
| 37 | __in BURN_UPDATE* pUpdate |
| 38 | ) |
| 39 | { |
| 40 | PackageUninitialize(&pUpdate->package); |
| 41 | |
| 42 | ReleaseStr(pUpdate->sczAuthorizationHeader); |
| 43 | ReleaseStr(pUpdate->sczUpdateSource); |
| 44 | memset(pUpdate, 0, sizeof(BURN_UPDATE)); |
| 45 | } |