aboutsummaryrefslogtreecommitdiff
path: root/src/burn/engine/update.cpp
blob: 70cb8a8d593a6179506dbfb35e04250b85f73902 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// 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.

#include "precomp.h"


// internal function declarations


// function definitions

extern "C" HRESULT UpdateParseFromXml(
    __in BURN_UPDATE* pUpdate,
    __in IXMLDOMNode* pixnBundle
    )
{
    HRESULT hr = S_OK;
    IXMLDOMNode* pixnUpdateNode = NULL;

    hr = XmlSelectSingleNode(pixnBundle, L"Update", &pixnUpdateNode);
    if (S_FALSE == hr)
    {
        ExitFunction1(hr = S_OK);
    }
    ExitOnFailure(hr, "Failed to select Bundle/Update node.");

    // @Location
    hr = XmlGetAttributeEx(pixnUpdateNode, L"Location", &pUpdate->sczUpdateSource);
    ExitOnFailure(hr, "Failed to get Update@Location.");

LExit:
    ReleaseObject(pixnUpdateNode);

    return hr;
}

extern "C" void UpdateUninitialize(
    __in BURN_UPDATE* pUpdate
    )
{
    PackageUninitialize(&pUpdate->package);

    ReleaseStr(pUpdate->sczAuthorizationHeader);
    ReleaseStr(pUpdate->sczUpdateSource);
    memset(pUpdate, 0, sizeof(BURN_UPDATE));
}