VirtualBox

source: vbox/trunk/src/VBox/Main/include/ConsoleImpl.h@ 23454

Last change on this file since 23454 was 23419, checked in by vboxsync, 15 years ago

Main/ConsoleImpl: make DVD attachments at runtime work. floppy still untested

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 23.4 KB
Line 
1/* $Id: ConsoleImpl.h 23419 2009-09-29 16:20:29Z vboxsync $ */
2
3/** @file
4 *
5 * VBox Console COM Class definition
6 */
7
8/*
9 * Copyright (C) 2006-2009 Sun Microsystems, Inc.
10 *
11 * This file is part of VirtualBox Open Source Edition (OSE), as
12 * available from http://www.virtualbox.org. This file is free software;
13 * you can redistribute it and/or modify it under the terms of the GNU
14 * General Public License (GPL) as published by the Free Software
15 * Foundation, in version 2 as it comes in the "COPYING" file of the
16 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
17 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
18 *
19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
20 * Clara, CA 95054 USA or visit http://www.sun.com if you need
21 * additional information or have any questions.
22 */
23
24#ifndef ____H_CONSOLEIMPL
25#define ____H_CONSOLEIMPL
26
27#include "VirtualBoxBase.h"
28#include "ProgressImpl.h"
29#include "SchemaDefs.h"
30
31class Guest;
32class Keyboard;
33class Mouse;
34class Display;
35class MachineDebugger;
36class OUSBDevice;
37class RemoteUSBDevice;
38class SharedFolder;
39class RemoteDisplayInfo;
40class AudioSniffer;
41class ConsoleVRDPServer;
42class VMMDev;
43
44#include <VBox/vrdpapi.h>
45#include <VBox/pdmdrv.h>
46#ifdef VBOX_WITH_GUEST_PROPS
47# include <VBox/HostServices/GuestPropertySvc.h> /* For the property notification callback */
48#endif
49
50struct VUSBIRHCONFIG;
51typedef struct VUSBIRHCONFIG *PVUSBIRHCONFIG;
52
53#include <list>
54
55// defines
56///////////////////////////////////////////////////////////////////////////////
57
58/**
59 * Checks the availability of the underlying VM device driver corresponding
60 * to the COM interface (IKeyboard, IMouse, IDisplay, etc.). When the driver is
61 * not available (NULL), sets error info and returns returns E_ACCESSDENIED.
62 * The translatable error message is defined in null context.
63 *
64 * Intended to used only within Console children (i.e. Keyboard, Mouse,
65 * Display, etc.).
66 *
67 * @param drv driver pointer to check (compare it with NULL)
68 */
69#define CHECK_CONSOLE_DRV(drv) \
70 do { \
71 if (!(drv)) \
72 return setError (E_ACCESSDENIED, tr ("The console is not powered up")); \
73 } while (0)
74
75// Console
76///////////////////////////////////////////////////////////////////////////////
77
78/** IConsole implementation class */
79class ATL_NO_VTABLE Console :
80 public VirtualBoxBaseWithChildrenNEXT,
81 public VirtualBoxSupportErrorInfoImpl<Console, IConsole>,
82 public VirtualBoxSupportTranslation<Console>,
83 VBOX_SCRIPTABLE_IMPL(IConsole)
84{
85 Q_OBJECT
86
87public:
88
89 DECLARE_NOT_AGGREGATABLE(Console)
90
91 DECLARE_PROTECT_FINAL_CONSTRUCT()
92
93 BEGIN_COM_MAP(Console)
94 COM_INTERFACE_ENTRY(ISupportErrorInfo)
95 COM_INTERFACE_ENTRY(IConsole)
96 COM_INTERFACE_ENTRY(IDispatch)
97 END_COM_MAP()
98
99 Console();
100 ~Console();
101
102 HRESULT FinalConstruct();
103 void FinalRelease();
104
105 // public initializers/uninitializers for internal purposes only
106 HRESULT init (IMachine *aMachine, IInternalMachineControl *aControl);
107 void uninit();
108
109 // IConsole properties
110 STDMETHOD(COMGETTER(Machine)) (IMachine **aMachine);
111 STDMETHOD(COMGETTER(State)) (MachineState_T *aMachineState);
112 STDMETHOD(COMGETTER(Guest)) (IGuest **aGuest);
113 STDMETHOD(COMGETTER(Keyboard)) (IKeyboard **aKeyboard);
114 STDMETHOD(COMGETTER(Mouse)) (IMouse **aMouse);
115 STDMETHOD(COMGETTER(Display)) (IDisplay **aDisplay);
116 STDMETHOD(COMGETTER(Debugger)) (IMachineDebugger **aDebugger);
117 STDMETHOD(COMGETTER(USBDevices)) (ComSafeArrayOut (IUSBDevice *, aUSBDevices));
118 STDMETHOD(COMGETTER(RemoteUSBDevices)) (ComSafeArrayOut (IHostUSBDevice *, aRemoteUSBDevices));
119 STDMETHOD(COMGETTER(RemoteDisplayInfo)) (IRemoteDisplayInfo **aRemoteDisplayInfo);
120 STDMETHOD(COMGETTER(SharedFolders)) (ComSafeArrayOut (ISharedFolder *, aSharedFolders));
121
122 // IConsole methods
123 STDMETHOD(PowerUp) (IProgress **aProgress);
124 STDMETHOD(PowerUpPaused) (IProgress **aProgress);
125 STDMETHOD(PowerDown) (IProgress **aProgress);
126 STDMETHOD(Reset)();
127 STDMETHOD(Pause)();
128 STDMETHOD(Resume)();
129 STDMETHOD(PowerButton)();
130 STDMETHOD(SleepButton)();
131 STDMETHOD(GetPowerButtonHandled)(BOOL *aHandled);
132 STDMETHOD(GetGuestEnteredACPIMode)(BOOL *aEntered);
133 STDMETHOD(SaveState) (IProgress **aProgress);
134 STDMETHOD(AdoptSavedState) (IN_BSTR aSavedStateFile);
135 STDMETHOD(ForgetSavedState)(BOOL aRemove);
136 STDMETHOD(GetDeviceActivity) (DeviceType_T aDeviceType,
137 DeviceActivity_T *aDeviceActivity);
138 STDMETHOD(AttachUSBDevice) (IN_BSTR aId);
139 STDMETHOD(DetachUSBDevice) (IN_BSTR aId, IUSBDevice **aDevice);
140 STDMETHOD(FindUSBDeviceByAddress) (IN_BSTR aAddress, IUSBDevice **aDevice);
141 STDMETHOD(FindUSBDeviceById) (IN_BSTR aId, IUSBDevice **aDevice);
142 STDMETHOD(CreateSharedFolder) (IN_BSTR aName, IN_BSTR aHostPath, BOOL aWritable);
143 STDMETHOD(RemoveSharedFolder) (IN_BSTR aName);
144 STDMETHOD(TakeSnapshot) (IN_BSTR aName, IN_BSTR aDescription,
145 IProgress **aProgress);
146 STDMETHOD(DiscardSnapshot) (IN_BSTR aId, IProgress **aProgress);
147 STDMETHOD(DiscardCurrentState) (IProgress **aProgress);
148 STDMETHOD(DiscardCurrentSnapshotAndState) (IProgress **aProgress);
149 STDMETHOD(RegisterCallback) (IConsoleCallback *aCallback);
150 STDMETHOD(UnregisterCallback)(IConsoleCallback *aCallback);
151
152 // public methods for internal purposes only
153
154 /*
155 * Note: the following methods do not increase refcount. intended to be
156 * called only by the VM execution thread.
157 */
158
159 Guest *getGuest() const { return mGuest; }
160 Keyboard *getKeyboard() const { return mKeyboard; }
161 Mouse *getMouse() const { return mMouse; }
162 Display *getDisplay() const { return mDisplay; }
163 MachineDebugger *getMachineDebugger() const { return mDebugger; }
164
165 const ComPtr<IMachine> &machine() const { return mMachine; }
166
167 /** Method is called only from ConsoleVRDPServer */
168 IVRDPServer *getVRDPServer() const { return mVRDPServer; }
169
170 ConsoleVRDPServer *consoleVRDPServer() const { return mConsoleVRDPServer; }
171
172 HRESULT updateMachineState (MachineState_T aMachineState);
173
174 // events from IInternalSessionControl
175 HRESULT onNetworkAdapterChange (INetworkAdapter *aNetworkAdapter, BOOL changeAdapter);
176 HRESULT onSerialPortChange (ISerialPort *aSerialPort);
177 HRESULT onParallelPortChange (IParallelPort *aParallelPort);
178 HRESULT onStorageControllerChange ();
179 HRESULT onMediumChange(IMediumAttachment *aMediumAttachment);
180 HRESULT onVRDPServerChange();
181 HRESULT onUSBControllerChange();
182 HRESULT onSharedFolderChange (BOOL aGlobal);
183 HRESULT onUSBDeviceAttach (IUSBDevice *aDevice, IVirtualBoxErrorInfo *aError, ULONG aMaskedIfs);
184 HRESULT onUSBDeviceDetach (IN_BSTR aId, IVirtualBoxErrorInfo *aError);
185 HRESULT getGuestProperty (IN_BSTR aKey, BSTR *aValue, ULONG64 *aTimestamp, BSTR *aFlags);
186 HRESULT setGuestProperty (IN_BSTR aKey, IN_BSTR aValue, IN_BSTR aFlags);
187 HRESULT enumerateGuestProperties (IN_BSTR aPatterns, ComSafeArrayOut(BSTR, aNames), ComSafeArrayOut(BSTR, aValues), ComSafeArrayOut(ULONG64, aTimestamps), ComSafeArrayOut(BSTR, aFlags));
188 VMMDev *getVMMDev() { return mVMMDev; }
189 AudioSniffer *getAudioSniffer () { return mAudioSniffer; }
190
191 int VRDPClientLogon (uint32_t u32ClientId, const char *pszUser, const char *pszPassword, const char *pszDomain);
192 void VRDPClientConnect (uint32_t u32ClientId);
193 void VRDPClientDisconnect (uint32_t u32ClientId, uint32_t fu32Intercepted);
194 void VRDPInterceptAudio (uint32_t u32ClientId);
195 void VRDPInterceptUSB (uint32_t u32ClientId, void **ppvIntercept);
196 void VRDPInterceptClipboard (uint32_t u32ClientId);
197
198 void processRemoteUSBDevices (uint32_t u32ClientId, VRDPUSBDEVICEDESC *pDevList, uint32_t cbDevList);
199
200 // callback callers (partly; for some events console callbacks are notified
201 // directly from IInternalSessionControl event handlers declared above)
202 void onMousePointerShapeChange(bool fVisible, bool fAlpha,
203 uint32_t xHot, uint32_t yHot,
204 uint32_t width, uint32_t height,
205 void *pShape);
206 void onMouseCapabilityChange (BOOL supportsAbsolute, BOOL needsHostCursor);
207 void onStateChange (MachineState_T aMachineState);
208 void onAdditionsStateChange();
209 void onAdditionsOutdated();
210 void onKeyboardLedsChange (bool fNumLock, bool fCapsLock, bool fScrollLock);
211 void onUSBDeviceStateChange (IUSBDevice *aDevice, bool aAttached,
212 IVirtualBoxErrorInfo *aError);
213 void onRuntimeError (BOOL aFatal, IN_BSTR aErrorID, IN_BSTR aMessage);
214 HRESULT onShowWindow (BOOL aCheck, BOOL *aCanShow, ULONG64 *aWinId);
215
216 static const PDMDRVREG DrvStatusReg;
217
218 void reportAuthLibraryError (const char *filename, int rc)
219 {
220 setError (E_FAIL, tr("Could not load the external authentication library '%s' (%Rrc)"), filename, rc);
221 }
222
223 // for VirtualBoxSupportErrorInfoImpl
224 static const wchar_t *getComponentName() { return L"Console"; }
225
226private:
227
228 /**
229 * Base template for AutoVMCaller and SaveVMPtr. Template arguments
230 * have the same meaning as arguments of Console::addVMCaller().
231 */
232 template <bool taQuiet = false, bool taAllowNullVM = false>
233 class AutoVMCallerBase
234 {
235 public:
236 AutoVMCallerBase (Console *aThat) : mThat (aThat), mRC (S_OK)
237 {
238 Assert (aThat);
239 mRC = aThat->addVMCaller (taQuiet, taAllowNullVM);
240 }
241 ~AutoVMCallerBase()
242 {
243 if (SUCCEEDED (mRC))
244 mThat->releaseVMCaller();
245 }
246 /** Decreases the number of callers before the instance is destroyed. */
247 void release()
248 {
249 AssertReturnVoid (SUCCEEDED (mRC));
250 mThat->releaseVMCaller();
251 mRC = E_FAIL;
252 }
253 /** Restores the number of callers after by #release(). #rc() must be
254 * rechecked to ensure the operation succeeded. */
255 void add()
256 {
257 AssertReturnVoid (!SUCCEEDED (mRC));
258 mRC = mThat->addVMCaller (taQuiet, taAllowNullVM);
259 }
260 /** Returns the result of Console::addVMCaller() */
261 HRESULT rc() const { return mRC; }
262 /** Shortcut to SUCCEEDED (rc()) */
263 bool isOk() const { return SUCCEEDED (mRC); }
264 protected:
265 Console *mThat;
266 HRESULT mRC;
267 private:
268 DECLARE_CLS_COPY_CTOR_ASSIGN_NOOP (AutoVMCallerBase)
269 DECLARE_CLS_NEW_DELETE_NOOP (AutoVMCallerBase)
270 };
271
272 /**
273 * Helper class that protects sections of code using the mpVM pointer by
274 * automatically calling addVMCaller() on construction and
275 * releaseVMCaller() on destruction. Intended for Console methods dealing
276 * with mpVM. The usage pattern is:
277 * <code>
278 * AutoVMCaller autoVMCaller (this);
279 * CheckComRCReturnRC (autoVMCaller.rc());
280 * ...
281 * VMR3ReqCall (mpVM, ...
282 * </code>
283 *
284 * @note Temporarily locks the argument for writing.
285 *
286 * @sa SafeVMPtr, SafeVMPtrQuiet
287 */
288 typedef AutoVMCallerBase <false, false> AutoVMCaller;
289
290 /**
291 * Same as AutoVMCaller but doesn't set extended error info on failure.
292 *
293 * @note Temporarily locks the argument for writing.
294 */
295 typedef AutoVMCallerBase <true, false> AutoVMCallerQuiet;
296
297 /**
298 * Same as AutoVMCaller but allows a null VM pointer (to trigger an error
299 * instead of assertion).
300 *
301 * @note Temporarily locks the argument for writing.
302 */
303 typedef AutoVMCallerBase <false, true> AutoVMCallerWeak;
304
305 /**
306 * Same as AutoVMCaller but doesn't set extended error info on failure
307 * and allows a null VM pointer (to trigger an error instead of
308 * assertion).
309 *
310 * @note Temporarily locks the argument for writing.
311 */
312 typedef AutoVMCallerBase <true, true> AutoVMCallerQuietWeak;
313
314 /**
315 * Base template for SaveVMPtr and SaveVMPtrQuiet.
316 */
317 template <bool taQuiet = false>
318 class SafeVMPtrBase : public AutoVMCallerBase <taQuiet, true>
319 {
320 typedef AutoVMCallerBase <taQuiet, true> Base;
321 public:
322 SafeVMPtrBase (Console *aThat) : Base (aThat), mpVM (NULL)
323 {
324 if (SUCCEEDED (Base::mRC))
325 mpVM = aThat->mpVM;
326 }
327 /** Smart SaveVMPtr to PVM cast operator */
328 operator PVM() const { return mpVM; }
329 /** Direct PVM access for printf()-like functions */
330 PVM raw() const { return mpVM; }
331 private:
332 PVM mpVM;
333 DECLARE_CLS_COPY_CTOR_ASSIGN_NOOP (SafeVMPtrBase)
334 DECLARE_CLS_NEW_DELETE_NOOP (SafeVMPtrBase)
335 };
336
337public:
338
339 /**
340 * Helper class that safely manages the Console::mpVM pointer
341 * by calling addVMCaller() on construction and releaseVMCaller() on
342 * destruction. Intended for Console children. The usage pattern is:
343 * <code>
344 * Console::SaveVMPtr pVM (mParent);
345 * CheckComRCReturnRC (pVM.rc());
346 * ...
347 * VMR3ReqCall (pVM, ...
348 * ...
349 * printf ("%p\n", pVM.raw());
350 * </code>
351 *
352 * @note Temporarily locks the argument for writing.
353 *
354 * @sa SafeVMPtrQuiet, AutoVMCaller
355 */
356 typedef SafeVMPtrBase <false> SafeVMPtr;
357
358 /**
359 * A deviation of SaveVMPtr that doesn't set the error info on failure.
360 * Intended for pieces of code that don't need to return the VM access
361 * failure to the caller. The usage pattern is:
362 * <code>
363 * Console::SaveVMPtrQuiet pVM (mParent);
364 * if (pVM.rc())
365 * VMR3ReqCall (pVM, ...
366 * return S_OK;
367 * </code>
368 *
369 * @note Temporarily locks the argument for writing.
370 *
371 * @sa SafeVMPtr, AutoVMCaller
372 */
373 typedef SafeVMPtrBase <true> SafeVMPtrQuiet;
374
375 class SharedFolderData
376 {
377 public:
378 SharedFolderData() {}
379 SharedFolderData(Bstr aHostPath, BOOL aWritable)
380 : mHostPath (aHostPath)
381 , mWritable (aWritable) {}
382 SharedFolderData(const SharedFolderData& aThat)
383 : mHostPath (aThat.mHostPath)
384 , mWritable (aThat.mWritable) {}
385 Bstr mHostPath;
386 BOOL mWritable;
387 };
388 typedef std::map <Bstr, ComObjPtr<SharedFolder> > SharedFolderMap;
389 typedef std::map <Bstr, SharedFolderData> SharedFolderDataMap;
390
391private:
392
393 typedef std::list <ComObjPtr<OUSBDevice> > USBDeviceList;
394 typedef std::list <ComObjPtr<RemoteUSBDevice> > RemoteUSBDeviceList;
395
396 HRESULT addVMCaller (bool aQuiet = false, bool aAllowNullVM = false);
397 void releaseVMCaller();
398
399 HRESULT consoleInitReleaseLog (const ComPtr<IMachine> aMachine);
400
401 HRESULT powerUp (IProgress **aProgress, bool aPaused);
402 HRESULT powerDown (Progress *aProgress = NULL);
403
404 HRESULT callTapSetupApplication(bool isStatic, RTFILE tapFD, Bstr &tapDevice,
405 Bstr &tapSetupApplication);
406#if (defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD)) && !defined(VBOX_WITH_NETFLT)
407 HRESULT attachToTapInterface(INetworkAdapter *networkAdapter);
408 HRESULT detachFromTapInterface(INetworkAdapter *networkAdapter);
409#endif
410 HRESULT powerDownHostInterfaces();
411
412 HRESULT setMachineState(MachineState_T aMachineState, bool aUpdateServer = true);
413 HRESULT setMachineStateLocally(MachineState_T aMachineState)
414 {
415 return setMachineState (aMachineState, false /* aUpdateServer */);
416 }
417
418 HRESULT findSharedFolder (CBSTR aName,
419 ComObjPtr<SharedFolder> &aSharedFolder,
420 bool aSetError = false);
421
422 HRESULT fetchSharedFolders (BOOL aGlobal);
423 bool findOtherSharedFolder (IN_BSTR aName,
424 SharedFolderDataMap::const_iterator &aIt);
425
426 HRESULT createSharedFolder (CBSTR aName, SharedFolderData aData);
427 HRESULT removeSharedFolder (CBSTR aName);
428
429 static DECLCALLBACK(int) configConstructor(PVM pVM, void *pvConsole);
430 static DECLCALLBACK(int) configGuestProperties(void *pvConsole);
431 static int configNetwork(Console *pThis, const char *pszDevice,
432 unsigned uInstance, unsigned uLun,
433 INetworkAdapter *aNetworkAdapter,
434 PCFGMNODE pCfg, PCFGMNODE pLunL0,
435 PCFGMNODE pInst, bool fAttachDetach);
436 static DECLCALLBACK(void) vmstateChangeCallback(PVM aVM, VMSTATE aState,
437 VMSTATE aOldState, void *aUser);
438 static DECLCALLBACK(int) changeDrive (Console *pThis, const char *pszDevice,
439 unsigned uInstance, unsigned uLun,
440 bool fHostDrive, const char *pszPath,
441 const char *pszFormat, bool fPassthrough);
442 const char *controllerTypeToDev(StorageControllerType_T enmCtrlType);
443 HRESULT convertBusPortDeviceToLun(StorageBus_T enmBus, LONG port, LONG device, unsigned &uLun);
444 HRESULT doMediumChange(IMediumAttachment *aMediumAttachment);
445
446#ifdef VBOX_DYNAMIC_NET_ATTACH
447 HRESULT doNetworkAdapterChange (const char *pszDevice, unsigned uInstance,
448 unsigned uLun, INetworkAdapter *aNetworkAdapter);
449 static DECLCALLBACK(int) changeNetworkAttachment (Console *pThis, const char *pszDevice,
450 unsigned uInstance, unsigned uLun,
451 INetworkAdapter *aNetworkAdapter);
452#endif /* VBOX_DYNAMIC_NET_ATTACH */
453
454#ifdef VBOX_WITH_USB
455 HRESULT attachUSBDevice (IUSBDevice *aHostDevice, ULONG aMaskedIfs);
456 HRESULT detachUSBDevice (USBDeviceList::iterator &aIt);
457
458 static DECLCALLBACK(int) usbAttachCallback (Console *that, IUSBDevice *aHostDevice, PCRTUUID aUuid,
459 bool aRemote, const char *aAddress, ULONG aMaskedIfs);
460 static DECLCALLBACK(int) usbDetachCallback (Console *that, USBDeviceList::iterator *aIt, PCRTUUID aUuid);
461#endif
462
463 static DECLCALLBACK(int) fntTakeSnapshotWorker(RTTHREAD Thread, void *pvUser);
464
465 static DECLCALLBACK(int) stateProgressCallback(PVM pVM, unsigned uPercent, void *pvUser);
466
467 static DECLCALLBACK(void) setVMErrorCallback(PVM pVM, void *pvUser, int rc, RT_SRC_POS_DECL,
468 const char *pszFormat, va_list args);
469
470 static DECLCALLBACK(void) setVMRuntimeErrorCallback (PVM pVM, void *pvUser, uint32_t fFatal,
471 const char *pszErrorId,
472 const char *pszFormat, va_list va);
473
474 HRESULT captureUSBDevices (PVM pVM);
475 void detachAllUSBDevices (bool aDone);
476
477 static DECLCALLBACK (int) powerUpThread (RTTHREAD Thread, void *pvUser);
478 static DECLCALLBACK (int) saveStateThread (RTTHREAD Thread, void *pvUser);
479 static DECLCALLBACK (int) powerDownThread (RTTHREAD Thread, void *pvUser);
480
481 static DECLCALLBACK(void *) drvStatus_QueryInterface(PPDMIBASE pInterface, PDMINTERFACE enmInterface);
482 static DECLCALLBACK(void) drvStatus_UnitChanged(PPDMILEDCONNECTORS pInterface, unsigned iLUN);
483 static DECLCALLBACK(void) drvStatus_Destruct(PPDMDRVINS pDrvIns);
484 static DECLCALLBACK(int) drvStatus_Construct(PPDMDRVINS pDrvIns, PCFGMNODE pCfgHandle, uint32_t fFlags);
485
486 int mcAudioRefs;
487 volatile uint32_t mcVRDPClients;
488 uint32_t mu32SingleRDPClientId; /* The id of a connected client in the single connection mode. */
489
490 static const char *sSSMConsoleUnit;
491 static uint32_t sSSMConsoleVer;
492
493 HRESULT loadDataFromSavedState();
494 int loadStateFileExecInternal (PSSMHANDLE pSSM, uint32_t u32Version);
495
496 static DECLCALLBACK(void) saveStateFileExec (PSSMHANDLE pSSM, void *pvUser);
497 static DECLCALLBACK(int) loadStateFileExec (PSSMHANDLE pSSM, void *pvUser, uint32_t uVersion, uint32_t uPass);
498
499#ifdef VBOX_WITH_GUEST_PROPS
500 static DECLCALLBACK(int) doGuestPropNotification (void *pvExtension, uint32_t,
501 void *pvParms, uint32_t cbParms);
502 HRESULT doEnumerateGuestProperties (CBSTR aPatterns,
503 ComSafeArrayOut(BSTR, aNames),
504 ComSafeArrayOut(BSTR, aValues),
505 ComSafeArrayOut(ULONG64, aTimestamps),
506 ComSafeArrayOut(BSTR, aFlags));
507
508 bool enabledGuestPropertiesVRDP (void);
509 void updateGuestPropertiesVRDPLogon (uint32_t u32ClientId, const char *pszUser, const char *pszDomain);
510 void updateGuestPropertiesVRDPDisconnect (uint32_t u32ClientId);
511#endif
512
513 bool mSavedStateDataLoaded : 1;
514
515 const ComPtr<IMachine> mMachine;
516 const ComPtr<IInternalMachineControl> mControl;
517
518 const ComPtr <IVRDPServer> mVRDPServer;
519
520 ConsoleVRDPServer * const mConsoleVRDPServer;
521
522 const ComObjPtr<Guest> mGuest;
523 const ComObjPtr<Keyboard> mKeyboard;
524 const ComObjPtr<Mouse> mMouse;
525 const ComObjPtr<Display> mDisplay;
526 const ComObjPtr<MachineDebugger> mDebugger;
527 const ComObjPtr<RemoteDisplayInfo> mRemoteDisplayInfo;
528
529 USBDeviceList mUSBDevices;
530 RemoteUSBDeviceList mRemoteUSBDevices;
531
532 SharedFolderMap mSharedFolders;
533 SharedFolderDataMap mMachineSharedFolders;
534 SharedFolderDataMap mGlobalSharedFolders;
535
536 /** The VM instance handle. */
537 PVM mpVM;
538 /** Holds the number of "readonly" mpVM callers (users) */
539 uint32_t mVMCallers;
540 /** Semaphore posted when the number of mpVM callers drops to zero */
541 RTSEMEVENT mVMZeroCallersSem;
542 /** true when Console has entered the mpVM destruction phase */
543 bool mVMDestroying : 1;
544 /** true when power down is initiated by vmstateChangeCallback (EMT) */
545 bool mVMPoweredOff : 1;
546
547 /** The current network attachment type in the VM.
548 * This doesn't have to match the network attachment type
549 * maintained in the NetworkAdapter. This is needed to
550 * change the network attachment dynamically.
551 */
552 NetworkAttachmentType_T meAttachmentType[SchemaDefs::NetworkAdapterCount];
553
554 VMMDev * const mVMMDev;
555 AudioSniffer * const mAudioSniffer;
556
557 PPDMLED mapFDLeds[2];
558 PPDMLED mapIDELeds[4];
559 PPDMLED mapSATALeds[30];
560 PPDMLED mapSCSILeds[16];
561 PPDMLED mapNetworkLeds[SchemaDefs::NetworkAdapterCount];
562 PPDMLED mapSharedFolderLed;
563 PPDMLED mapUSBLed[2];
564#if !defined(VBOX_WITH_NETFLT) && (defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD))
565 Utf8Str maTAPDeviceName[8];
566 RTFILE maTapFD[8];
567#endif
568
569 bool mVMStateChangeCallbackDisabled;
570
571 /* Local machine state value */
572 MachineState_T mMachineState;
573
574 typedef std::list <ComPtr<IConsoleCallback> > CallbackList;
575 CallbackList mCallbacks;
576
577 struct
578 {
579 /** OnMousePointerShapeChange() cache */
580 struct
581 {
582 bool valid;
583 bool visible;
584 bool alpha;
585 uint32_t xHot;
586 uint32_t yHot;
587 uint32_t width;
588 uint32_t height;
589 BYTE *shape;
590 size_t shapeSize;
591 }
592 mpsc;
593
594 /** OnMouseCapabilityChange() cache */
595 struct
596 {
597 bool valid;
598 BOOL supportsAbsolute;
599 BOOL needsHostCursor;
600 }
601 mcc;
602
603 /** OnKeyboardLedsChange() cache */
604 struct
605 {
606 bool valid;
607 bool numLock;
608 bool capsLock;
609 bool scrollLock;
610 }
611 klc;
612 }
613 mCallbackData;
614
615 friend struct VMTask;
616};
617
618#endif // ____H_CONSOLEIMPL
619/* vi: set tabstop=4 shiftwidth=4 expandtab: */
Note: See TracBrowser for help on using the repository browser.

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