VirtualBox

Changeset 93533 in vbox for trunk/src


Ignore:
Timestamp:
Feb 1, 2022 2:07:44 PM (3 years ago)
Author:
vboxsync
Message:

Main/Unattended: bugref:9781. Reading and storing image index from the xml metadata.

Location:
trunk/src/VBox/Main
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/UnattendedImpl.h

    r93529 r93533  
    3737struct WIMImage
    3838{
    39     Utf8Str mName;
    40     Utf8Str mVersionMajor;
    41     Utf8Str mVersionMinor;
    42     Utf8Str mVersionBuild;
    43     Utf8Str getNameAndVersion() const;
     39    Utf8Str  mName;
     40    Utf8Str  mVersionMajor;
     41    Utf8Str  mVersionMinor;
     42    Utf8Str  mVersionBuild;
     43    uint32_t mImageIndex;
     44    Utf8Str  getNameAndVersion() const;
    4445};
    4546
  • trunk/src/VBox/Main/src-server/UnattendedImpl.cpp

    r93530 r93533  
    496496        if (!pChild)
    497497            continue;
     498
     499        const char *pszIndex = pChild->findAttributeValue("INDEX");
     500        if (!pszIndex)
     501            pszIndex = pChild->findAttributeValue("index");
     502        if (!pszIndex)
     503            continue;
     504        uint32_t pu32 = 0;
     505        int vrc = RTStrToUInt32Full(pszIndex, 10 /* uBase */, &pu32);
     506
     507        if (!RT_SUCCESS(vrc))
     508            continue;
     509
    498510        const ElementNode *pDisplayDescriptionNode = pChild->findChildElement("DISPLAYNAME");
    499511        if (!pDisplayDescriptionNode)
     
    505517        if (newImage.mName.isEmpty())
    506518            continue;
     519        newImage.mImageIndex = pu32;
    507520        const ElementNode *pVersionElement = pChild->findChildElement("VERSION");
    508521        if (!pVersionElement)
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette