VirtualBox

Changeset 31008 in vbox for trunk/src/VBox/Frontends/VBoxSDL


Ignore:
Timestamp:
Jul 22, 2010 3:24:27 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
63924
Message:

Main: reorganize session APIs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp

    r30871 r31008  
    13161316    const CLSID sessionID = CLSID_Session;
    13171317
     1318    ComPtr<IMachine> pMachine;
     1319
    13181320    rc = virtualBox.createLocalObject(CLSID_VirtualBox);
    13191321    if (FAILED(rc))
     
    13391341    if (vmName && uuidVM.isEmpty())
    13401342    {
    1341         ComPtr<IMachine> aMachine;
    13421343        Bstr  bstrVMName = vmName;
    1343         rc = virtualBox->FindMachine(bstrVMName, aMachine.asOutParam());
    1344         if ((rc == S_OK) && aMachine)
     1344        rc = virtualBox->FindMachine(bstrVMName, pMachine.asOutParam());
     1345        if ((rc == S_OK) && pMachine)
    13451346        {
    13461347            Bstr id;
    1347             aMachine->COMGETTER(Id)(id.asOutParam());
     1348            pMachine->COMGETTER(Id)(id.asOutParam());
    13481349            uuidVM = Guid(id);
    13491350        }
     
    13641365    AssertReleaseRC(vrc);
    13651366
    1366     rc = virtualBox->OpenSession(session, uuidVM.toUtf16());
     1367    rc = pMachine->LockForSession(session, false /* fPermitShared */, NULL);
    13671368    if (FAILED(rc))
    13681369    {
     
    13791380    }
    13801381    sessionOpened = true;
    1381     // get the VM we're dealing with
     1382    // get the mutable VM we're dealing with
    13821383    session->COMGETTER(Machine)(gMachine.asOutParam());
    13831384    if (!gMachine)
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