Changeset 31008 in vbox for trunk/src/VBox/Frontends/VBoxHeadless
- Timestamp:
- Jul 22, 2010 3:24:27 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 63924
- Location:
- trunk/src/VBox/Frontends/VBoxHeadless
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxHeadless/VBoxHeadless.cpp
r30871 r31008 803 803 } 804 804 805 ComPtr<IMachine> m; 806 805 807 /* find ID by name */ 806 808 if (id.isEmpty()) 807 809 { 808 ComPtr <IMachine> m;809 810 rc = virtualBox->FindMachine(Bstr(name), m.asOutParam()); 810 811 if (FAILED(rc)) … … 823 824 824 825 // open a session 825 CHECK_ERROR_BREAK( virtualBox, OpenSession(session, id));826 CHECK_ERROR_BREAK(m, LockForSession(session, false /* fPermitShared */, NULL)); 826 827 fSessionOpened = true; 827 828 828 829 /* get the console */ 829 ComPtr 830 ComPtr<IConsole> console; 830 831 CHECK_ERROR_BREAK(session, COMGETTER(Console)(console.asOutParam())); 831 832 832 /* get the m achine */833 ComPtr 833 /* get the mutable machine */ 834 ComPtr<IMachine> machine; 834 835 CHECK_ERROR_BREAK(console, COMGETTER(Machine)(machine.asOutParam())); 835 836 836 ComPtr 837 ComPtr<IDisplay> display; 837 838 CHECK_ERROR_BREAK(console, COMGETTER(Display)(display.asOutParam())); 838 839 -
trunk/src/VBox/Frontends/VBoxHeadless/testcase/tstHeadless.cpp
r30681 r31008 112 112 EventQueue eventQ; 113 113 114 ComPtr <IMachine> m; 115 114 116 // 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")) 123 120 { 124 121 ComPtr <IProgress> progress; 125 122 RTPrintf ("Opening a new (remote) session...\n"); 126 CHECK_ERROR_BREAK ( virtualBox,127 OpenRemoteSession (session, id, Bstr("vrdp"),128 123 CHECK_ERROR_BREAK (m, 124 LaunchVMProcess(session, Bstr("vrdp"), 125 NULL, progress.asOutParam())); 129 126 130 127 RTPrintf ("Waiting for the remote session to open...\n"); … … 153 150 { 154 151 RTPrintf ("Opening an existing session...\n"); 155 CHECK_ERROR_BREAK (virtualBox, OpenExistingSession (session, id));152 CHECK_ERROR_BREAK(m, LockForSession(session, true /* fPermitShared */, NULL)); 156 153 157 154 ComPtr <IConsole> console; 158 CHECK_ERROR_BREAK (session, COMGETTER (Console)(console.asOutParam()));155 CHECK_ERROR_BREAK(session, COMGETTER(Console)(console.asOutParam())); 159 156 160 157 if (!strcmp (operation, "off"))
Note:
See TracChangeset
for help on using the changeset viewer.