VirtualBox

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

Last change on this file since 13243 was 13165, checked in by vboxsync, 16 years ago

Main: use the HGCM guest property change notification interface and do some clean ups

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 21.3 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(Reset)();
133 STDMETHOD(Pause)();
134 STDMETHOD(Resume)();
135 STDMETHOD(PowerButton)();
136 STDMETHOD(SleepButton)();
137 STDMETHOD(GetPowerButtonHandled)(BOOL *aHandled);
138 STDMETHOD(GetGuestEnteredACPIMode)(BOOL *aEntered);
139 STDMETHOD(SaveState) (IProgress **aProgress);
140 STDMETHOD(AdoptSavedState) (INPTR BSTR aSavedStateFile);
141 STDMETHOD(DiscardSavedState)();
142 STDMETHOD(GetDeviceActivity) (DeviceType_T aDeviceType,
143 DeviceActivity_T *aDeviceActivity);
144 STDMETHOD(AttachUSBDevice) (INPTR GUIDPARAM aId);
145 STDMETHOD(DetachUSBDevice) (INPTR GUIDPARAM aId, IUSBDevice **aDevice);
146 STDMETHOD(CreateSharedFolder) (INPTR BSTR aName, INPTR BSTR aHostPath, BOOL aWritable);
147 STDMETHOD(RemoveSharedFolder) (INPTR BSTR aName);
148 STDMETHOD(TakeSnapshot) (INPTR BSTR aName, INPTR BSTR aDescription,
149 IProgress **aProgress);
150 STDMETHOD(DiscardSnapshot) (INPTR GUIDPARAM aId, IProgress **aProgress);
151 STDMETHOD(DiscardCurrentState) (IProgress **aProgress);
152 STDMETHOD(DiscardCurrentSnapshotAndState) (IProgress **aProgress);
153 STDMETHOD(RegisterCallback) (IConsoleCallback *aCallback);
154 STDMETHOD(UnregisterCallback)(IConsoleCallback *aCallback);
155
156 // public methods for internal purposes only
157
158 /*
159 * Note: the following methods do not increase refcount. intended to be
160 * called only by the VM execution thread.
161 */
162
163 Guest *getGuest() { return mGuest; }
164 Keyboard *getKeyboard() { return mKeyboard; }
165 Mouse *getMouse() { return mMouse; }
166 Display *getDisplay() { return mDisplay; }
167 MachineDebugger *getMachineDebugger() { return mDebugger; }
168
169 const ComPtr <IMachine> &machine() { return mMachine; }
170
171 /** Method is called only from ConsoleVRDPServer */
172 IVRDPServer *getVRDPServer() { return mVRDPServer; }
173
174 ConsoleVRDPServer *consoleVRDPServer() { return mConsoleVRDPServer; }
175
176 HRESULT updateMachineState (MachineState_T aMachineState);
177
178 // events from IInternalSessionControl
179 HRESULT onDVDDriveChange();
180 HRESULT onFloppyDriveChange();
181 HRESULT onNetworkAdapterChange (INetworkAdapter *aNetworkAdapter);
182 HRESULT onSerialPortChange (ISerialPort *aSerialPort);
183 HRESULT onParallelPortChange (IParallelPort *aParallelPort);
184 HRESULT onVRDPServerChange();
185 HRESULT onUSBControllerChange();
186 HRESULT onSharedFolderChange (BOOL aGlobal);
187 HRESULT onUSBDeviceAttach (IUSBDevice *aDevice, IVirtualBoxErrorInfo *aError, ULONG aMaskedIfs);
188 HRESULT onUSBDeviceDetach (INPTR GUIDPARAM aId, IVirtualBoxErrorInfo *aError);
189 HRESULT getGuestProperty (INPTR BSTR aKey, BSTR *aValue, ULONG64 *aTimestamp, BSTR *aFlags);
190 HRESULT setGuestProperty (INPTR BSTR aKey, INPTR BSTR aValue, INPTR BSTR aFlags);
191 HRESULT enumerateGuestProperties (INPTR BSTR aPatterns, ComSafeArrayOut(BSTR, aNames), ComSafeArrayOut(BSTR, aValues), ComSafeArrayOut(ULONG64, aTimestamps), ComSafeArrayOut(BSTR, aFlags));
192 VMMDev *getVMMDev() { return mVMMDev; }
193 AudioSniffer *getAudioSniffer () { return mAudioSniffer; }
194
195 int VRDPClientLogon (uint32_t u32ClientId, const char *pszUser, const char *pszPassword, const char *pszDomain);
196 void VRDPClientConnect (uint32_t u32ClientId);
197 void VRDPClientDisconnect (uint32_t u32ClientId, uint32_t fu32Intercepted);
198 void VRDPInterceptAudio (uint32_t u32ClientId);
199 void VRDPInterceptUSB (uint32_t u32ClientId, void **ppvIntercept);
200 void VRDPInterceptClipboard (uint32_t u32ClientId);
201
202 void processRemoteUSBDevices (uint32_t u32ClientId, VRDPUSBDEVICEDESC *pDevList, uint32_t cbDevList);
203
204 // callback callers (partly; for some events console callbacks are notified
205 // directly from IInternalSessionControl event handlers declared above)
206 void onMousePointerShapeChange(bool fVisible, bool fAlpha,
207 uint32_t xHot, uint32_t yHot,
208 uint32_t width, uint32_t height,
209 void *pShape);
210 void onMouseCapabilityChange (BOOL supportsAbsolute, BOOL needsHostCursor);
211 void onStateChange (MachineState_T aMachineState);
212 void onAdditionsStateChange();
213 void onAdditionsOutdated();
214 void onKeyboardLedsChange (bool fNumLock, bool fCapsLock, bool fScrollLock);
215 void onUSBDeviceStateChange (IUSBDevice *aDevice, bool aAttached,
216 IVirtualBoxErrorInfo *aError);
217 void onRuntimeError (BOOL aFatal, INPTR BSTR aErrorID, INPTR BSTR aMessage);
218 HRESULT onShowWindow (BOOL aCheck, BOOL *aCanShow, ULONG64 *aWinId);
219
220 static const PDMDRVREG DrvStatusReg;
221
222 void reportAuthLibraryError (const char *filename, int rc)
223 {
224 setError (E_FAIL, tr("Could not load the external authentication library '%s' (%Vrc)"), filename, rc);
225 }
226
227 // for VirtualBoxSupportErrorInfoImpl
228 static const wchar_t *getComponentName() { return L"Console"; }
229
230private:
231
232 /**
233 * Base template for AutoVMCaller and SaveVMPtr. Template arguments
234 * have the same meaning as arguments of Console::addVMCaller().
235 */
236 template <bool taQuiet = false, bool taAllowNullVM = false>
237 class AutoVMCallerBase
238 {
239 public:
240 AutoVMCallerBase (Console *aThat) : mThat (aThat), mRC (S_OK)
241 {
242 Assert (aThat);
243 mRC = aThat->addVMCaller (taQuiet, taAllowNullVM);
244 }
245 ~AutoVMCallerBase()
246 {
247 if (SUCCEEDED (mRC))
248 mThat->releaseVMCaller();
249 }
250 /** Decreases the number of callers before the instance is destroyed. */
251 void release()
252 {
253 AssertReturnVoid (SUCCEEDED (mRC));
254 mThat->releaseVMCaller();
255 mRC = E_FAIL;
256 }
257 /** Restores the number of callers after by #release(). #rc() must be
258 * rechecked to ensure the operation succeeded. */
259 void add()
260 {
261 AssertReturnVoid (!SUCCEEDED (mRC));
262 mRC = mThat->addVMCaller (taQuiet, taAllowNullVM);
263 }
264 /** Returns the result of Console::addVMCaller() */
265 HRESULT rc() const { return mRC; }
266 /** Shortcut to SUCCEEDED (rc()) */
267 bool isOk() const { return SUCCEEDED (mRC); }
268 protected:
269 Console *mThat;
270 HRESULT mRC;
271 private:
272 DECLARE_CLS_COPY_CTOR_ASSIGN_NOOP (AutoVMCallerBase)
273 DECLARE_CLS_NEW_DELETE_NOOP (AutoVMCallerBase)
274 };
275
276 /**
277 * Helper class that protects sections of code using the mpVM pointer by
278 * automatically calling addVMCaller() on construction and
279 * releaseVMCaller() on destruction. Intended for Console methods dealing
280 * with mpVM. The usage pattern is:
281 * <code>
282 * AutoVMCaller autoVMCaller (this);
283 * CheckComRCReturnRC (autoVMCaller.rc());
284 * ...
285 * VMR3ReqCall (mpVM, ...
286 * </code>
287 *
288 * @note Temporarily locks the argument for writing.
289 *
290 * @sa SafeVMPtr, SafeVMPtrQuiet
291 */
292 typedef AutoVMCallerBase <false, false> AutoVMCaller;
293
294 /**
295 * Same as AutoVMCaller but doesn't set extended error info on failure.
296 *
297 * @note Temporarily locks the argument for writing.
298 */
299 typedef AutoVMCallerBase <true, false> AutoVMCallerQuiet;
300
301 /**
302 * Same as AutoVMCaller but allows a null VM pointer (to trigger an error
303 * instead of assertion).
304 *
305 * @note Temporarily locks the argument for writing.
306 */
307 typedef AutoVMCallerBase <false, true> AutoVMCallerWeak;
308
309 /**
310 * Same as AutoVMCaller but doesn't set extended error info on failure
311 * and allows a null VM pointer (to trigger an error instead of
312 * assertion).
313 *
314 * @note Temporarily locks the argument for writing.
315 */
316 typedef AutoVMCallerBase <true, true> AutoVMCallerQuietWeak;
317
318 /**
319 * Base template for SaveVMPtr and SaveVMPtrQuiet.
320 */
321 template <bool taQuiet = false>
322 class SafeVMPtrBase : public AutoVMCallerBase <taQuiet, true>
323 {
324 typedef AutoVMCallerBase <taQuiet, true> Base;
325 public:
326 SafeVMPtrBase (Console *aThat) : Base (aThat), mpVM (NULL)
327 {
328 if (SUCCEEDED (Base::mRC))
329 mpVM = aThat->mpVM;
330 }
331 /** Smart SaveVMPtr to PVM cast operator */
332 operator PVM() const { return mpVM; }
333 /** Direct PVM access for printf()-like functions */
334 PVM raw() const { return mpVM; }
335 private:
336 PVM mpVM;
337 DECLARE_CLS_COPY_CTOR_ASSIGN_NOOP (SafeVMPtrBase)
338 DECLARE_CLS_NEW_DELETE_NOOP (SafeVMPtrBase)
339 };
340
341public:
342
343 /**
344 * Helper class that safely manages the Console::mpVM pointer
345 * by calling addVMCaller() on construction and releaseVMCaller() on
346 * destruction. Intended for Console children. The usage pattern is:
347 * <code>
348 * Console::SaveVMPtr pVM (mParent);
349 * CheckComRCReturnRC (pVM.rc());
350 * ...
351 * VMR3ReqCall (pVM, ...
352 * ...
353 * printf ("%p\n", pVM.raw());
354 * </code>
355 *
356 * @note Temporarily locks the argument for writing.
357 *
358 * @sa SafeVMPtrQuiet, AutoVMCaller
359 */
360 typedef SafeVMPtrBase <false> SafeVMPtr;
361
362 /**
363 * A deviation of SaveVMPtr that doesn't set the error info on failure.
364 * Intenede for pieces of code that don't need to return the VM access
365 * failure to the caller. The usage pattern is:
366 * <code>
367 * Console::SaveVMPtrQuiet pVM (mParent);
368 * if (pVM.rc())
369 * VMR3ReqCall (pVM, ...
370 * return S_OK;
371 * </code>
372 *
373 * @note Temporarily locks the argument for writing.
374 *
375 * @sa SafeVMPtr, AutoVMCaller
376 */
377 typedef SafeVMPtrBase <true> SafeVMPtrQuiet;
378
379 class SharedFolderData
380 {
381 public:
382 SharedFolderData() {}
383 SharedFolderData(Bstr aHostPath, BOOL aWritable)
384 : mHostPath (aHostPath)
385 , mWritable (aWritable) {}
386 SharedFolderData(const SharedFolderData& aThat)
387 : mHostPath (aThat.mHostPath)
388 , mWritable (aThat.mWritable) {}
389 Bstr mHostPath;
390 BOOL mWritable;
391 };
392 typedef std::map <Bstr, ComObjPtr <SharedFolder> > SharedFolderMap;
393 typedef std::map <Bstr, SharedFolderData> SharedFolderDataMap;
394
395private:
396
397 typedef std::list <ComObjPtr <OUSBDevice> > USBDeviceList;
398 typedef std::list <ComObjPtr <RemoteUSBDevice> > RemoteUSBDeviceList;
399
400 HRESULT addVMCaller (bool aQuiet = false, bool aAllowNullVM = false);
401 void releaseVMCaller();
402
403 HRESULT consoleInitReleaseLog (const ComPtr <IMachine> aMachine);
404
405 HRESULT powerUpCommon (IProgress **aProgress, bool aPaused);
406 HRESULT powerDown();
407
408 HRESULT callTapSetupApplication(bool isStatic, RTFILE tapFD, Bstr &tapDevice,
409 Bstr &tapSetupApplication);
410 HRESULT attachToHostInterface(INetworkAdapter *networkAdapter);
411 HRESULT detachFromHostInterface(INetworkAdapter *networkAdapter);
412 HRESULT powerDownHostInterfaces();
413
414 HRESULT setMachineState (MachineState_T aMachineState, bool aUpdateServer = true);
415 HRESULT setMachineStateLocally (MachineState_T aMachineState)
416 {
417 return setMachineState (aMachineState, false /* aUpdateServer */);
418 }
419
420 HRESULT findSharedFolder (const BSTR aName,
421 ComObjPtr <SharedFolder> &aSharedFolder,
422 bool aSetError = false);
423
424 HRESULT fetchSharedFolders (BOOL aGlobal);
425 bool findOtherSharedFolder (INPTR BSTR aName,
426 SharedFolderDataMap::const_iterator &aIt);
427
428 HRESULT createSharedFolder (INPTR BSTR aName, SharedFolderData aData);
429 HRESULT removeSharedFolder (INPTR BSTR aName);
430
431 static DECLCALLBACK(int) configConstructor(PVM pVM, void *pvConsole);
432 static DECLCALLBACK(void) vmstateChangeCallback(PVM aVM, VMSTATE aState,
433 VMSTATE aOldState, void *aUser);
434 HRESULT doDriveChange (const char *pszDevice, unsigned uInstance,
435 unsigned uLun, DriveState_T eState,
436 DriveState_T *peState, const char *pszPath,
437 bool fPassthrough);
438 static DECLCALLBACK(int) changeDrive (Console *pThis, const char *pszDevice,
439 unsigned uInstance, unsigned uLun,
440 DriveState_T eState, DriveState_T *peState,
441 const char *pszPath, bool fPassthrough);
442
443#ifdef VBOX_WITH_USB
444 HRESULT attachUSBDevice (IUSBDevice *aHostDevice, ULONG aMaskedIfs);
445 HRESULT detachUSBDevice (USBDeviceList::iterator &aIt);
446
447 static DECLCALLBACK(int)
448 usbAttachCallback (Console *that, IUSBDevice *aHostDevice, PCRTUUID aUuid,
449 bool aRemote, const char *aAddress, ULONG aMaskedIfs);
450 static DECLCALLBACK(int)
451 usbDetachCallback (Console *that, USBDeviceList::iterator *aIt, PCRTUUID aUuid);
452#endif
453
454 static DECLCALLBACK (int)
455 stateProgressCallback (PVM pVM, unsigned uPercent, void *pvUser);
456
457 static DECLCALLBACK(void)
458 setVMErrorCallback (PVM pVM, void *pvUser, int rc, RT_SRC_POS_DECL,
459 const char *pszFormat, va_list args);
460
461 static DECLCALLBACK(void)
462 setVMRuntimeErrorCallback (PVM pVM, void *pvUser, bool fFatal,
463 const char *pszErrorID,
464 const char *pszFormat, va_list args);
465
466 HRESULT captureUSBDevices (PVM pVM);
467 void detachAllUSBDevices (bool aDone);
468
469 static DECLCALLBACK (int) powerUpThread (RTTHREAD Thread, void *pvUser);
470 static DECLCALLBACK (int) saveStateThread (RTTHREAD Thread, void *pvUser);
471 static DECLCALLBACK (int) powerDownThread (RTTHREAD Thread, void *pvUser);
472
473 static DECLCALLBACK(void *) drvStatus_QueryInterface(PPDMIBASE pInterface, PDMINTERFACE enmInterface);
474 static DECLCALLBACK(void) drvStatus_UnitChanged(PPDMILEDCONNECTORS pInterface, unsigned iLUN);
475 static DECLCALLBACK(void) drvStatus_Destruct(PPDMDRVINS pDrvIns);
476 static DECLCALLBACK(int) drvStatus_Construct(PPDMDRVINS pDrvIns, PCFGMNODE pCfgHandle);
477
478 int mcAudioRefs;
479 volatile uint32_t mcVRDPClients;
480 uint32_t mu32SingleRDPClientId; /* The id of a connected client in the single connection mode. */
481
482 static const char *sSSMConsoleUnit;
483 static uint32_t sSSMConsoleVer;
484
485 HRESULT loadDataFromSavedState();
486
487 static DECLCALLBACK(void) saveStateFileExec (PSSMHANDLE pSSM, void *pvUser);
488 static DECLCALLBACK(int) loadStateFileExec (PSSMHANDLE pSSM, void *pvUser, uint32_t u32Version);
489
490#ifdef VBOX_WITH_GUEST_PROPS
491 static DECLCALLBACK(void) doGuestPropNotification (PVBOXHGCMCALLBACKHDR pHeader);
492#endif
493
494 bool mSavedStateDataLoaded : 1;
495
496 const ComPtr <IMachine> mMachine;
497 const ComPtr <IInternalMachineControl> mControl;
498
499 const ComPtr <IVRDPServer> mVRDPServer;
500 const ComPtr <IDVDDrive> mDVDDrive;
501 const ComPtr <IFloppyDrive> mFloppyDrive;
502
503 ConsoleVRDPServer * const mConsoleVRDPServer;
504
505 const ComObjPtr <Guest> mGuest;
506 const ComObjPtr <Keyboard> mKeyboard;
507 const ComObjPtr <Mouse> mMouse;
508 const ComObjPtr <Display> mDisplay;
509 const ComObjPtr <MachineDebugger> mDebugger;
510 const ComObjPtr <RemoteDisplayInfo> mRemoteDisplayInfo;
511
512 USBDeviceList mUSBDevices;
513 RemoteUSBDeviceList mRemoteUSBDevices;
514
515 SharedFolderMap mSharedFolders;
516 SharedFolderDataMap mMachineSharedFolders;
517 SharedFolderDataMap mGlobalSharedFolders;
518
519 /** The VM instance handle. */
520 PVM mpVM;
521 /** Holds the number of "readonly" mpVM callers (users) */
522 uint32_t mVMCallers;
523 /** Semaphore posted when the number of mpVM callers drops to zero */
524 RTSEMEVENT mVMZeroCallersSem;
525 /** true when Console has entered the mpVM destruction phase */
526 bool mVMDestroying : 1;
527
528 /** The current DVD drive state in the VM.
529 * This does not have to match the state maintained in the DVD. */
530 DriveState_T meDVDState;
531 /** The current Floppy drive state in the VM.
532 * This does not have to match the state maintained in the Floppy. */
533 DriveState_T meFloppyState;
534
535 VMMDev * const mVMMDev;
536 AudioSniffer * const mAudioSniffer;
537
538 PPDMLED mapFDLeds[2];
539 PPDMLED mapIDELeds[4];
540 PPDMLED mapSATALeds[30];
541 PPDMLED mapNetworkLeds[8];
542 PPDMLED mapSharedFolderLed;
543 PPDMLED mapUSBLed[2];
544#ifdef VBOX_WITH_UNIXY_TAP_NETWORKING
545 Utf8Str maTAPDeviceName[8];
546 RTFILE maTapFD[8];
547#endif
548
549 bool mVMStateChangeCallbackDisabled;
550
551 /* Local machine state value */
552 MachineState_T mMachineState;
553
554 typedef std::list <ComPtr <IConsoleCallback> > CallbackList;
555 CallbackList mCallbacks;
556
557 struct
558 {
559 /** OnMousePointerShapeChange() cache */
560 struct
561 {
562 bool valid;
563 bool visible;
564 bool alpha;
565 uint32_t xHot;
566 uint32_t yHot;
567 uint32_t width;
568 uint32_t height;
569 BYTE *shape;
570 size_t shapeSize;
571 }
572 mpsc;
573
574 /** OnMouseCapabilityChange() cache */
575 struct
576 {
577 bool valid;
578 BOOL supportsAbsolute;
579 BOOL needsHostCursor;
580 }
581 mcc;
582
583 /** OnKeyboardLedsChange() cache */
584 struct
585 {
586 bool valid;
587 bool numLock;
588 bool capsLock;
589 bool scrollLock;
590 }
591 klc;
592 }
593 mCallbackData;
594
595 friend struct VMTask;
596};
597
598#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