VirtualBox

Changeset 80828 in vbox


Ignore:
Timestamp:
Sep 16, 2019 2:05:09 PM (5 years ago)
Author:
vboxsync
Message:

Main/Guest*: Create enviornment blocks with RTENV_CREATE_F_ALLOW_EQUAL_FIRST_IN_VAR for windows guests.

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

Legend:

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

    r79285 r80828  
    8383        : m_hEnv(NIL_RTENV)
    8484        , m_cRefs(1)
     85        , m_fFlags(0)
    8586    { }
    8687
     
    362363     * @throws HRESULT
    363364     */
    364     GuestEnvironmentBase(const GuestEnvironmentBase &rThat, bool fChangeRecord)
     365    GuestEnvironmentBase(const GuestEnvironmentBase &rThat, bool fChangeRecord, uint32_t fFlags = 0)
    365366        : m_hEnv(NIL_RTENV)
    366367        , m_cRefs(1)
     368        , m_fFlags(fFlags)
    367369    {
    368370        int rc = cloneCommon(rThat, fChangeRecord);
     
    394396                /* Need to type convert it. */
    395397                if (fChangeRecord)
    396                     rc = RTEnvCreateChangeRecord(&hNewEnv);
     398                    rc = RTEnvCreateChangeRecordEx(&hNewEnv, rThat.m_fFlags);
    397399                else
    398                     rc = RTEnvCreate(&hNewEnv);
     400                    rc = RTEnvCreateEx(&hNewEnv, rThat.m_fFlags);
    399401                if (RT_SUCCESS(rc))
    400402                {
     
    412414             */
    413415            if (fChangeRecord)
    414                 rc = RTEnvCreateChangeRecord(&hNewEnv);
     416                rc = RTEnvCreateChangeRecordEx(&hNewEnv, rThat.m_fFlags);
    415417            else
    416                 rc = RTEnvCreate(&hNewEnv);
     418                rc = RTEnvCreateEx(&hNewEnv, rThat.m_fFlags);
    417419        }
    418420        if (RT_SUCCESS(rc))
     
    420422            RTEnvDestroy(m_hEnv);
    421423            m_hEnv = hNewEnv;
     424            m_fFlags = rThat.m_fFlags;
    422425        }
    423426        return rc;
     
    429432    /** Reference counter. */
    430433    uint32_t volatile   m_cRefs;
     434    /** RTENV_CREATE_F_XXX. */
     435    uint32_t            m_fFlags;
    431436};
    432437
     
    470475     * Initialize this as a normal environment block.
    471476     * @returns IPRT status code.
    472      */
    473     int initNormal(void)
     477     * @param   fFlags      RTENV_CREATE_F_XXX
     478     */
     479    int initNormal(uint32_t fFlags)
    474480    {
    475481        AssertReturn(m_hEnv == NIL_RTENV, VERR_WRONG_ORDER);
    476         return RTEnvCreate(&m_hEnv);
     482        m_fFlags = fFlags;
     483        return RTEnvCreateEx(&m_hEnv, fFlags);
    477484    }
    478485
     
    494501    GuestEnvironment &operator=(const GuestEnvironmentBase &rThat)
    495502    {
    496         int rc = cloneCommon(rThat, true /*fChangeRecord*/);
     503        int rc = copy(rThat);
    497504        if (RT_FAILURE(rc))
    498505            throw (Global::vboxStatusCodeToCOM(rc));
     
    550557     * Initialize this as a environment change record.
    551558     * @returns IPRT status code.
    552      */
    553     int initChangeRecord(void)
     559     * @param   fFlags      RTENV_CREATE_F_XXX
     560     */
     561    int initChangeRecord(uint32_t fFlags)
    554562    {
    555563        AssertReturn(m_hEnv == NIL_RTENV, VERR_WRONG_ORDER);
    556         return RTEnvCreateChangeRecord(&m_hEnv);
     564        m_fFlags = fFlags;
     565        return RTEnvCreateChangeRecordEx(&m_hEnv, fFlags);
    557566    }
    558567
     
    574583    GuestEnvironmentChanges &operator=(const GuestEnvironmentBase &rThat)
    575584    {
    576         int rc = cloneCommon(rThat, true /*fChangeRecord*/);
     585        int rc = copy(rThat);
    577586        if (RT_FAILURE(rc))
    578587            throw (Global::vboxStatusCodeToCOM(rc));
  • trunk/src/VBox/Main/include/GuestImpl.h

    r80654 r80828  
    106106    uint32_t    i_getAdditionsRevision(void) { return mData.mAdditionsRevision; }
    107107    uint32_t    i_getAdditionsVersion(void) { return mData.mAdditionsVersionFull; }
    108     VBOXOSTYPE  i_getGuestOSType(void) { return mData.mOSType; }
     108    VBOXOSTYPE  i_getGuestOSType(void) const { return mData.mOSType; }
     109    /** Checks if the guest OS type is part of the windows NT family.  */
     110    bool        i_isGuestInWindowsNtFamily(void) const
     111    {
     112        return mData.mOSType < VBOXOSTYPE_OS2 && mData.mOSType >= VBOXOSTYPE_WinNT;
     113    }
    109114#ifdef VBOX_WITH_GUEST_CONTROL
    110115    int         i_dispatchToSession(PVBOXGUESTCTRLHOSTCBCTX pCtxCb, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb);
  • trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp

    r79188 r80828  
    230230    if (RT_SUCCESS(rc))
    231231    {
    232         rc = mData.mEnvironmentChanges.initChangeRecord();
     232        rc = mData.mEnvironmentChanges.initChangeRecord(pGuest->i_isGuestInWindowsNtFamily()
     233                                                        ? RTENV_CREATE_F_ALLOW_EQUAL_FIRST_IN_VAR : 0);
    233234        if (RT_SUCCESS(rc))
    234235        {
     
    18361837                if (pBaseEnv)
    18371838                {
    1838                     int vrc = pBaseEnv->initNormal();
     1839                    int vrc = pBaseEnv->initNormal(Guest.i_isGuestInWindowsNtFamily() ? RTENV_CREATE_F_ALLOW_EQUAL_FIRST_IN_VAR : 0);
    18391840                    if (RT_SUCCESS(vrc))
    18401841                        vrc = pBaseEnv->copyUtf8Block(pszzEnvBlock, cbEnvBlock);
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