VirtualBox

Changeset 93534 in vbox for trunk/src


Ignore:
Timestamp:
Feb 1, 2022 4:46:52 PM (3 years ago)
Author:
vboxsync
Message:

Main/Unattended: bugref:9781. Adding an atribute to IUnattended for image indices.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r93531 r93534  
    46744674  <interface
    46754675    name="IUnattended" extends="$unknown"
    4676     uuid="6f89464f-7193-426c-a41f-522e8e537fa0"
     4676    uuid="6f89464f-7193-426c-a41f-522e4e537fa0"
    46774677    wsmap="managed"
    46784678    reservedMethods="4" reservedAttributes="16"
     
    48964896    <attribute name="imageIndex" type="unsigned long">
    48974897      <desc>
    4898         The image index on installation CD/DVD used to install.
     4898        The image index on installation CD/DVD used to install. This index should be
     4899        one of the indices of <link to="IUnattended::detectedImageIndices"/>.
    48994900
    49004901        Used only with Windows installation CD/DVD:
     
    50055006      </desc>
    50065007    </attribute>
    5007 
    50085008    <attribute name="detectedImageNames" type="wstring" readonly="yes" safearray="yes">
    50095009      <desc>
    5010         A list of names of the images detected from install.wim file of a Windows ISO.
     5010        A list of names of the images detected from install.wim file of a Windows ISO. This
     5011        array is parallel to <link to="IUnattended::detectedImageIndices"/>.
     5012      </desc>
     5013    </attribute>
     5014    <attribute name="detectedImageIndices" type="unsigned long" readonly="yes" safearray="yes">
     5015      <desc>
     5016        A list of names of the images detected from install.wim file of a Windows ISO. This array
     5017        is parallel to <link to="IUnattended::detectedImageNames"/>. <link to="IUnattended::imageIndex"/>
     5018        should be one of these indices.
    50115019      </desc>
    50125020    </attribute>
  • trunk/src/VBox/Main/include/UnattendedImpl.h

    r93533 r93534  
    224224    HRESULT getDetectedOSHints(com::Utf8Str &aDetectedOSHints);
    225225    HRESULT getDetectedImageNames(std::vector<com::Utf8Str> &aDetectedImageNames);
     226    HRESULT getDetectedImageIndices(std::vector<uint32_t> &aDetectedImageIndices);
    226227    //internal functions
    227228
  • trunk/src/VBox/Main/src-server/UnattendedImpl.cpp

    r93533 r93534  
    517517        if (newImage.mName.isEmpty())
    518518            continue;
     519
    519520        newImage.mImageIndex = pu32;
    520521        const ElementNode *pVersionElement = pChild->findChildElement("VERSION");
     
    30773078    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    30783079    AssertReturn(mpInstaller == NULL, setErrorBoth(E_FAIL, VERR_WRONG_ORDER, tr("Cannot change after prepare() has been called")));
    3079     AssertReturn(index < mDetectedImages.size(), setErrorBoth(E_FAIL, VERR_OUT_OF_RANGE, tr("Image index is larger than the number of detected images")));
    3080     midxImage = index;
    3081     return S_OK;
     3080    /* Set midxImage only if mDetectedImages includes an image with an index equal to @param index. */
     3081    for (size_t i = 0; i < mDetectedImages.size(); ++i)
     3082    {
     3083        if (mDetectedImages[i].mImageIndex == index)
     3084        {
     3085                midxImage = index;
     3086                return S_OK;
     3087        }
     3088    }
     3089    return VERR_INVALID_PARAMETER;
    30823090}
    30833091
     
    32333241}
    32343242
     3243HRESULT Unattended::getDetectedImageIndices(std::vector<uint32_t> &aDetectedImageIndices)
     3244{
     3245    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     3246    aDetectedImageIndices.clear();
     3247    for (size_t i = 0; i < mDetectedImages.size(); ++i)
     3248        aDetectedImageIndices.push_back(mDetectedImages[i].mImageIndex);
     3249    return S_OK;
     3250}
     3251
    32353252/*
    32363253 * Getters that the installer and script classes can use.
  • trunk/src/VBox/Main/testcase/tstUnattendedScript.cpp

    r93532 r93534  
    445445}
    446446
     447HRESULT Unattended::getDetectedImageIndices(std::vector<uint32_t> &aDetectedImageIndices)
     448{
     449    RT_NOREF(aDetectedImageIndices);
     450    return E_NOTIMPL;
     451}
     452
    447453/*
    448454 * Getters that the installer and script classes can use.
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