VirtualBox

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/VBoxHeadless/testcase/tstHeadless.cpp

    r30681 r31008  
    112112        EventQueue eventQ;
    113113
     114        ComPtr <IMachine> m;
     115
    114116        // find ID by name
    115         Bstr id;
    116         {
    117             ComPtr <IMachine> m;
    118             CHECK_ERROR_BREAK (virtualBox, FindMachine (Bstr (name), m.asOutParam()));
    119             CHECK_ERROR_BREAK (m, COMGETTER(Id) (id.asOutParam()));
    120         }
    121 
    122         if (!strcmp (operation, "on"))
     117        CHECK_ERROR_BREAK(virtualBox, FindMachine(Bstr(name), m.asOutParam()));
     118
     119        if (!strcmp(operation, "on"))
    123120        {
    124121            ComPtr <IProgress> progress;
    125122            RTPrintf ("Opening a new (remote) session...\n");
    126             CHECK_ERROR_BREAK (virtualBox,
    127                                OpenRemoteSession (session, id, Bstr ("vrdp"),
    128                                                   NULL, progress.asOutParam()));
     123            CHECK_ERROR_BREAK (m,
     124                               LaunchVMProcess(session, Bstr("vrdp"),
     125                                               NULL, progress.asOutParam()));
    129126
    130127            RTPrintf ("Waiting for the remote session to open...\n");
     
    153150        {
    154151            RTPrintf ("Opening an existing session...\n");
    155             CHECK_ERROR_BREAK (virtualBox, OpenExistingSession (session, id));
     152            CHECK_ERROR_BREAK(m, LockForSession(session, true /* fPermitShared */, NULL));
    156153
    157154            ComPtr <IConsole> console;
    158             CHECK_ERROR_BREAK (session, COMGETTER (Console) (console.asOutParam()));
     155            CHECK_ERROR_BREAK(session, COMGETTER(Console)(console.asOutParam()));
    159156
    160157            if (!strcmp (operation, "off"))
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