VirtualBox

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

Last change on this file since 13405 was 13377, checked in by vboxsync, 16 years ago

HostServices/GuestProperties: use an HGCM service extension instead of the callback type I added

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