VirtualBox

Changeset 93577 in vbox


Ignore:
Timestamp:
Feb 3, 2022 12:35:45 PM (3 years ago)
Author:
vboxsync
Message:

Main/Unattended: The image version is inside the WINDOWS element, not directly under IMAGE. Pick up SPBUILD and combine them all into a single version string. Be stricter with the image index parsing (via getAttributeValue override). Catch alloc exceptions. bugref:9781

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/formats/wim.h

    r93493 r93577  
    6262    /** 0x10 - The uncompressed original size.
    6363     * @note This is signed in the specficiation...  */
    64     uint64_t        cbOrginal;
     64    uint64_t        cbOriginal;
    6565} RESHDRDISKSHORT;
    6666AssertCompileSize(RESHDRDISKSHORT, 0x18);
  • trunk/src/VBox/Main/src-server/UnattendedImpl.cpp

    r93575 r93577  
    503503 *         <DISPLAYNAME>Windows 10 Home</DISPLAYNAME>
    504504 *         <WINDOWS>
     505 *             <ARCH>NN</ARCH>
    505506 *             <VERSION>
    506507 *                 ...
     
    558559            if (pVersionElement)
    559560                parseVersionElement(pVersionElement, newImage);
     561
     562            /* The ARCH element contains a number from the
     563               PROCESSOR_ARCHITECTURE_XXX set of defines in winnt.h: */
     564            static const char * const s_apszArchs[] =
     565            {
     566                /* PROCESSOR_ARCHITECTURE_INTEL         / [0]  = */ "x86",
     567                /* PROCESSOR_ARCHITECTURE_MIPS          / [1]  = */ "mips",
     568                /* PROCESSOR_ARCHITECTURE_ALPHA         / [2]  = */ "alpha",
     569                /* PROCESSOR_ARCHITECTURE_PPC           / [3]  = */ "ppc",
     570                /* PROCESSOR_ARCHITECTURE_SHX           / [4]  = */ "shx",
     571                /* PROCESSOR_ARCHITECTURE_ARM           / [5]  = */ "arm32",
     572                /* PROCESSOR_ARCHITECTURE_IA64          / [6]  = */ "ia64",
     573                /* PROCESSOR_ARCHITECTURE_ALPHA64       / [7]  = */ "alpha64",
     574                /* PROCESSOR_ARCHITECTURE_MSIL          / [8]  = */ "msil",
     575                /* PROCESSOR_ARCHITECTURE_AMD64         / [9]  = */ "x64",
     576                /* PROCESSOR_ARCHITECTURE_IA32_ON_WIN64 / [10] = */ "x86-on-x64",
     577                /* PROCESSOR_ARCHITECTURE_NEUTRAL       / [11] = */ "noarch",
     578                /* PROCESSOR_ARCHITECTURE_ARM64         / [12] = */ "arm64",
     579                /* PROCESSOR_ARCHITECTURE_ARM32_ON_WIN64/ [13] = */ "arm32-on-arm64",
     580                /* PROCESSOR_ARCHITECTURE_IA32_ON_ARM64 / [14] = */ "x86-on-arm32",
     581            };
     582            const ElementNode *pElmArch = pElmWindows->findChildElement("ARCH");
     583            if (!pElmArch)
     584                pElmArch = pElmWindows->findChildElement("arch");
     585            if (!pElmArch)
     586                pElmArch = pElmWindows->findChildElement("Arch");
     587            if (pElmArch)
     588            {
     589                const char *pszValue = pElmArch->getValue();
     590                if (pszValue && *pszValue)
     591                {
     592                    uint32_t uArch;
     593                    int vrc = RTStrToUInt32Ex(pszValue, NULL, 10 /*uBase*/, &uArch);
     594                    if (RT_SUCCESS(vrc) && vrc != VWRN_NUMBER_TOO_BIG && vrc != VWRN_NEGATIVE_UNSIGNED)
     595                    {
     596
     597                    }
     598                }
     599            }
    560600        }
    561601
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