VirtualBox

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

Last change on this file since 4044 was 4041, checked in by vboxsync, 17 years ago

Main: Shared Folders (#2130):

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