Changeset 26067 in vbox for trunk/src/VBox
- Timestamp:
- Jan 27, 2010 1:33:54 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 56994
- Location:
- trunk/src/VBox
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxFB/VBoxFB.cpp
r26034 r26067 9 9 10 10 /* 11 * Copyright (C) 2006-20 09Sun Microsystems, Inc.11 * Copyright (C) 2006-2010 Sun Microsystems, Inc. 12 12 * 13 13 * This file is part of VirtualBox Open Source Edition (OSE), as … … 27 27 #include "Framebuffer.h" 28 28 #include <getopt.h> 29 #include <VBox/version.h> 29 30 #include <VBox/param.h> 30 31 #include <iprt/path.h> … … 210 211 { 211 212 printf("Error: could not instantiate Session object! rc = %08X\n", rc); 213 exit(-1); 214 } 215 216 rc = session->SetFullConsole(true); 217 if (NS_FAILED(rc)) 218 { 219 printf("Error: could not select full VM console! rc = %08X\n", rc); 212 220 exit(-1); 213 221 } … … 545 553 buttonState |= MouseButtonState::MiddleButton; 546 554 mouse->PutMouseEvent(mouseXDelta, mouseYDelta, mouseZDelta, 547 buttonState);555 0, buttonState); 548 556 break; 549 557 } -
trunk/src/VBox/Frontends/VBoxHeadless/VBoxHeadless.cpp
r26034 r26067 6 6 7 7 /* 8 * Copyright (C) 2006-20 09Sun Microsystems, Inc.8 * Copyright (C) 2006-2010 Sun Microsystems, Inc. 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 877 877 Utf8Str(id).raw())); 878 878 879 // make sure we ge a full featured VM console 880 CHECK_ERROR_BREAK(session, COMSETTER(FullConsole)(true)); 881 879 882 // open a session 880 883 CHECK_ERROR_BREAK(virtualBox, OpenSession (session, id)); -
trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp
r26034 r26067 5 5 6 6 /* 7 * Copyright (C) 2006-20 09Sun Microsystems, Inc.7 * Copyright (C) 2006-2010 Sun Microsystems, Inc. 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 1488 1488 AssertReleaseRC(vrc); 1489 1489 1490 rc = session->COMSETTER(FullConsole)(true); 1491 if (FAILED(rc)) 1492 { 1493 com::ErrorInfo info; 1494 if (info.isFullAvailable()) 1495 PrintError("Could not select a full VM console", 1496 info.getText().raw(), info.getComponent().raw()); 1497 goto leave; 1498 } 1490 1499 rc = virtualBox->OpenSession(session, uuidVM.toUtf16()); 1491 1500 if (FAILED(rc)) … … 1495 1504 PrintError("Could not open VirtualBox session", 1496 1505 info.getText().raw(), info.getComponent().raw()); 1497 goto leave;1498 }1499 if (!session)1500 {1501 RTPrintf("Could not open VirtualBox session!\n");1502 1506 goto leave; 1503 1507 } … … 2916 2920 callback.setNull(); 2917 2921 consoleCallback.setNull(); 2918 2922 2919 2923 LogFlow(("Uninitializing COM...\n")); 2920 2924 com::Shutdown(); -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
r26034 r26067 6 6 7 7 /* 8 * Copyright (C) 2008-20 09Sun Microsystems, Inc.8 * Copyright (C) 2008-2010 Sun Microsystems, Inc. 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 2190 2190 * which is already running, @c false to open a new direct 2191 2191 * session. 2192 */ 2193 CSession VBoxGlobal::openSession (const QString &aId, bool aExisting /* = false */) 2192 * @param aFullConsole @c true to create a full console, suitable of running 2193 * a VM, @c false to create a minimal console suitable 2194 * for API clients. Only significant if @a aExisting is 2195 * @false. 2196 */ 2197 CSession VBoxGlobal::openSession (const QString &aId, bool aExisting /* = false */, bool aFullConsole /* = false */) 2194 2198 { 2195 2199 CSession session; … … 2205 2209 else 2206 2210 { 2211 session.SetFullConsole(aFullConsole); 2207 2212 mVBox.OpenSession (session, aId); 2208 2213 CMachine machine = session.GetMachine (); … … 2231 2236 AssertReturn (mValid, false); 2232 2237 2233 CSession session = vboxGlobal().openSession (id );2238 CSession session = vboxGlobal().openSession (id, false, true); 2234 2239 if (session.isNull()) 2235 2240 return false; -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h
r25318 r26067 6 6 7 7 /* 8 * Copyright (C) 2006-20 09Sun Microsystems, Inc.8 * Copyright (C) 2006-2010 Sun Microsystems, Inc. 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 670 670 #endif 671 671 672 CSession openSession (const QString &aId, bool aExisting = false );672 CSession openSession (const QString &aId, bool aExisting = false, bool aFullConsole = false); 673 673 674 674 /** Shortcut to openSession (aId, true). */ -
trunk/src/VBox/Main/ConsoleImpl.cpp
r26030 r26067 5 5 6 6 /* 7 * Copyright (C) 2006-20 09Sun Microsystems, Inc.7 * Copyright (C) 2006-2010 Sun Microsystems, Inc. 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 308 308 ///////////////////////////////////////////////////////////////////////////// 309 309 310 HRESULT Console::init(IMachine *aMachine, IInternalMachineControl *aControl) 310 HRESULT Console::init(IMachine *aMachine, IInternalMachineControl *aControl, 311 bool aFullConsole) 311 312 { 312 313 AssertReturn(aMachine && aControl, E_INVALIDARG); … … 331 332 AssertComRCReturnRC(rc); 332 333 334 if (aFullConsole) 335 { 333 336 #ifdef VBOX_WITH_VRDP 334 rc = mMachine->COMGETTER(VRDPServer)(unconst(mVRDPServer).asOutParam());335 AssertComRCReturnRC(rc);337 rc = mMachine->COMGETTER(VRDPServer)(unconst(mVRDPServer).asOutParam()); 338 AssertComRCReturnRC(rc); 336 339 #endif 337 340 338 /* Create associated child COM objects */ 339 340 unconst(mGuest).createObject(); 341 rc = mGuest->init(this); 342 AssertComRCReturnRC(rc); 343 344 unconst(mKeyboard).createObject(); 345 rc = mKeyboard->init(this); 346 AssertComRCReturnRC(rc); 347 348 unconst(mMouse).createObject(); 349 rc = mMouse->init(this); 350 AssertComRCReturnRC(rc); 351 352 unconst(mDisplay).createObject(); 353 rc = mDisplay->init(this); 354 AssertComRCReturnRC(rc); 355 356 unconst(mRemoteDisplayInfo).createObject(); 357 rc = mRemoteDisplayInfo->init(this); 358 AssertComRCReturnRC(rc); 359 360 /* Grab global and machine shared folder lists */ 361 362 rc = fetchSharedFolders(true /* aGlobal */); 363 AssertComRCReturnRC(rc); 364 rc = fetchSharedFolders(false /* aGlobal */); 365 AssertComRCReturnRC(rc); 366 367 /* Create other child objects */ 368 369 unconst(mConsoleVRDPServer) = new ConsoleVRDPServer(this); 370 AssertReturn(mConsoleVRDPServer, E_FAIL); 341 /* Create associated child COM objects */ 342 343 unconst(mGuest).createObject(); 344 rc = mGuest->init(this); 345 AssertComRCReturnRC(rc); 346 347 unconst(mKeyboard).createObject(); 348 rc = mKeyboard->init(this); 349 AssertComRCReturnRC(rc); 350 351 unconst(mMouse).createObject(); 352 rc = mMouse->init(this); 353 AssertComRCReturnRC(rc); 354 355 unconst(mDisplay).createObject(); 356 rc = mDisplay->init(this); 357 AssertComRCReturnRC(rc); 358 359 unconst(mRemoteDisplayInfo).createObject(); 360 rc = mRemoteDisplayInfo->init(this); 361 AssertComRCReturnRC(rc); 362 363 /* Grab global and machine shared folder lists */ 364 365 rc = fetchSharedFolders(true /* aGlobal */); 366 AssertComRCReturnRC(rc); 367 rc = fetchSharedFolders(false /* aGlobal */); 368 AssertComRCReturnRC(rc); 369 370 /* Create other child objects */ 371 372 unconst(mConsoleVRDPServer) = new ConsoleVRDPServer(this); 373 AssertReturn(mConsoleVRDPServer, E_FAIL); 374 375 unconst(mVMMDev) = new VMMDev(this); 376 AssertReturn(mVMMDev, E_FAIL); 377 378 unconst(mAudioSniffer) = new AudioSniffer(this); 379 AssertReturn(mAudioSniffer, E_FAIL); 380 } 371 381 372 382 mcAudioRefs = 0; 373 383 mcVRDPClients = 0; 374 384 mu32SingleRDPClientId = 0; 375 376 unconst(mVMMDev) = new VMMDev(this);377 AssertReturn(mVMMDev, E_FAIL);378 379 unconst(mAudioSniffer) = new AudioSniffer(this);380 AssertReturn(mAudioSniffer, E_FAIL);381 385 382 386 /* Confirm a successful initialization when it's the case */ -
trunk/src/VBox/Main/SessionImpl.cpp
r25901 r26067 5 5 6 6 /* 7 * Copyright (C) 2006-20 07Sun Microsystems, Inc.7 * Copyright (C) 2006-2010 Sun Microsystems, Inc. 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 89 89 mState = SessionState_Closed; 90 90 mType = SessionType_Null; 91 mFullConsole = false; 91 92 92 93 #if defined(RT_OS_WINDOWS) … … 176 177 } 177 178 179 STDMETHODIMP Session::COMSETTER(FullConsole) (BOOL aFullConsole) 180 { 181 AutoCaller autoCaller(this); 182 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 183 184 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 185 186 AssertReturn(mState == SessionState_Closed, VBOX_E_INVALID_VM_STATE); 187 188 mFullConsole = aFullConsole; 189 return S_OK; 190 } 191 192 STDMETHODIMP Session::COMGETTER(FullConsole) (BOOL *aFullConsole) 193 { 194 CheckComArgOutPointerValid(aFullConsole); 195 196 AutoCaller autoCaller(this); 197 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 198 199 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 200 201 *aFullConsole = mFullConsole; 202 return S_OK; 203 } 204 178 205 STDMETHODIMP Session::COMGETTER(Machine) (IMachine **aMachine) 179 206 { … … 319 346 320 347 rc = mConsole.createObject(); 321 AssertComRCReturn 322 323 rc = mConsole->init (aMachine, mControl);324 AssertComRCReturn 348 AssertComRCReturn(rc, rc); 349 350 rc = mConsole->init(aMachine, mControl, mFullConsole); 351 AssertComRCReturn(rc, rc); 325 352 326 353 rc = grabIPCSemaphore(); -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r25904 r26067 12960 12960 <interface 12961 12961 name="ISession" extends="$dispatched" 12962 uuid=" 12F4DCDB-12B2-4EC1-B7CD-DDD9F6C5BF4D"12962 uuid="37661fa3-385b-4b2b-8b22-93304c45f36e" 12963 12963 wsmap="managed" 12964 12964 > … … 13015 13015 is open within one process, no any other process may open another direct 13016 13016 session for the same machine. This prevents the machine from being changed 13017 by other processes while it is running or while the machine is being configured. 13017 by other processes while it is running or while the machine is being 13018 configured. If the current process is should have a full Console 13019 object with all associated sub-objects, remember to set 13020 <link to="ISession::fullConsole"/> appropriately. 13018 13021 </li> 13019 13022 </ul> … … 13047 13050 SessionType_SessionOpen), otherwise an error will be returned. 13048 13051 </desc> 13052 </attribute> 13053 13054 <attribute name="fullConsole" type="boolean"> 13055 <desc>Defines whether the console object is meant for full VMs, 13056 which have the associated sub-objects, or if it is unnecessary to 13057 create them. Default is @c false.</desc> 13049 13058 </attribute> 13050 13059 -
trunk/src/VBox/Main/include/ConsoleImpl.h
r25966 r26067 5 5 6 6 /* 7 * Copyright (C) 2006-20 09Sun Microsystems, Inc.7 * Copyright (C) 2006-2010 Sun Microsystems, Inc. 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 103 103 104 104 // public initializers/uninitializers for internal purposes only 105 HRESULT init (IMachine *aMachine, IInternalMachineControl *aControl); 105 HRESULT init (IMachine *aMachine, IInternalMachineControl *aControl, 106 bool aFullConsole); 106 107 void uninit(); 107 108 -
trunk/src/VBox/Main/include/SessionImpl.h
r25901 r26067 5 5 6 6 /* 7 * Copyright (C) 2006-20 07Sun Microsystems, Inc.7 * Copyright (C) 2006-2010 Sun Microsystems, Inc. 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 78 78 STDMETHOD(COMGETTER(State)) (SessionState_T *aState); 79 79 STDMETHOD(COMGETTER(Type)) (SessionType_T *aType); 80 STDMETHOD(COMSETTER(FullConsole)) (BOOL aType); 81 STDMETHOD(COMGETTER(FullConsole)) (BOOL *aType); 80 82 STDMETHOD(COMGETTER(Machine)) (IMachine **aMachine); 81 83 STDMETHOD(COMGETTER(Console)) (IConsole **aConsole); … … 122 124 SessionState_T mState; 123 125 SessionType_T mType; 126 bool mFullConsole; 124 127 125 128 ComPtr<IInternalMachineControl> mControl;
Note:
See TracChangeset
for help on using the changeset viewer.