VirtualBox

Ignore:
Timestamp:
May 1, 2015 7:37:46 PM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
99961
Message:

Main: Environment cleanup in the guest control area. The GuestEnvironment class implementation has been replaced by one based on IPRT's RTEnv API and it has been changed into a way of recording environment changes, thus renamed to GuestEnvironmentChanges.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/GuestProcessImpl.cpp

    r55540 r55588  
    304304
    305305    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    306     mData.mProcess.mEnvironment.CopyTo(aEnvironment);
     306    mData.mProcess.mEnvironment.queryPutEnvArray(&aEnvironment);
    307307    return S_OK;
    308308#endif /* VBOX_WITH_GUEST_CONTROL */
     
    10541054
    10551055    /* Prepare environment. */
    1056     void *pvEnv = NULL;
    1057     size_t cbEnv = 0;
     1056    size_t  cbEnvBlock;
     1057    char   *pszzEnvBlock;
    10581058    if (RT_SUCCESS(vrc))
    1059         vrc = mData.mProcess.mEnvironment.BuildEnvironmentBlock(&pvEnv, &cbEnv, NULL /* cEnv */);
     1059        vrc = mData.mProcess.mEnvironment.queryUtf8Block(&pszzEnvBlock, &cbEnvBlock);
    10601060
    10611061    if (RT_SUCCESS(vrc))
     
    10651065        int i = 0;
    10661066        paParms[i++].setUInt32(pEvent->ContextID());
    1067         paParms[i++].setPointer((void*)mData.mProcess.mExecutable.c_str(),
    1068                                 (ULONG)mData.mProcess.mExecutable.length() + 1);
     1067        paParms[i++].setCppString(mData.mProcess.mExecutable);
    10691068        paParms[i++].setUInt32(mData.mProcess.mFlags);
    10701069        paParms[i++].setUInt32((uint32_t)mData.mProcess.mArguments.size());
    1071         paParms[i++].setPointer((void*)pszArgs, (uint32_t)cbArgs);
    1072         paParms[i++].setUInt32((uint32_t)mData.mProcess.mEnvironment.Size());
    1073         paParms[i++].setUInt32((uint32_t)cbEnv);
    1074         paParms[i++].setPointer((void*)pvEnv, (uint32_t)cbEnv);
     1070        paParms[i++].setPointer(pszArgs, (uint32_t)cbArgs);
     1071        paParms[i++].setUInt32(mData.mProcess.mEnvironment.count());
     1072        paParms[i++].setUInt32((uint32_t)cbEnvBlock);
     1073        paParms[i++].setPointer(pszzEnvBlock, (uint32_t)cbEnvBlock);
    10751074        if (uProtocol < 2)
    10761075        {
     
    10781077             * call. In newer protocols these credentials are part of the opened guest
    10791078             * session, so not needed anymore here. */
    1080             paParms[i++].setPointer((void*)sessionCreds.mUser.c_str(), (ULONG)sessionCreds.mUser.length() + 1);
    1081             paParms[i++].setPointer((void*)sessionCreds.mPassword.c_str(), (ULONG)sessionCreds.mPassword.length() + 1);
     1079            paParms[i++].setCppString(sessionCreds.mUser);
     1080            paParms[i++].setCppString(sessionCreds.mPassword);
    10821081        }
    10831082        /*
     
    10981097            paParms[i++].setUInt32(1);
    10991098            /* The actual CPU affinity blocks. */
    1100             paParms[i++].setPointer((void*)&mData.mProcess.mAffinity, sizeof(mData.mProcess.mAffinity));
     1099            paParms[i++].setPointer((void *)&mData.mProcess.mAffinity, sizeof(mData.mProcess.mAffinity));
    11011100        }
    11021101
     
    11091108            AssertRC(rc2);
    11101109        }
    1111     }
    1112 
    1113     GuestEnvironment::FreeEnvironmentBlock(pvEnv);
     1110
     1111        mData.mProcess.mEnvironment.freeUtf8Block(pszzEnvBlock);
     1112    }
     1113
    11141114    if (pszArgs)
    11151115        RTStrFree(pszArgs);
Note: See TracChangeset for help on using the changeset viewer.

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