GuestImpl.cpp revision 0a50ec2f1c3c66ef871e0601740af73b32eeb466
/** @file
*
* VirtualBox COM class implementation
*/
/*
* Copyright (C) 2006-2007 innotek GmbH
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License as published by the Free Software Foundation,
* in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
* distribution. VirtualBox OSE is distributed in the hope that it will
* be useful, but WITHOUT ANY WARRANTY of any kind.
*/
#include "GuestImpl.h"
#include "ConsoleImpl.h"
#include "VMMDev.h"
#include "Logging.h"
#include <iprt/cpputils.h>
// defines
/////////////////////////////////////////////////////////////////////////////
// constructor / destructor
/////////////////////////////////////////////////////////////////////////////
{
return S_OK;
}
void Guest::FinalRelease()
{
uninit ();
}
// public methods only for internal purposes
/////////////////////////////////////////////////////////////////////////////
/**
* Initializes the guest object.
*/
{
/* Enclose the state transition NotReady->InInit->Ready */
AutoInitSpan autoInitSpan (this);
/* mData.mAdditionsActive is FALSE */
/* Confirm a successful initialization when it's the case */
/* Default is not to report guest statistics at all */
mStatUpdateInterval = 0;
/* Default is no ballooning */
mMemoryBalloonSize = 0;
return S_OK;
}
/**
* Uninitializes the instance and sets the ready flag to FALSE.
* Called either from FinalRelease() or by the parent when it gets destroyed.
*/
{
LogFlowThisFunc (("\n"));
/* Enclose the state transition Ready->InUninit->NotReady */
AutoUninitSpan autoUninitSpan (this);
if (autoUninitSpan.uninitDone())
return;
}
// IGuest properties
/////////////////////////////////////////////////////////////////////////////
{
if (!aOSTypeId)
return E_POINTER;
AutoCaller autoCaller (this);
AutoReaderLock alock (this);
// redirect the call to IMachine if no additions are installed
return S_OK;
}
{
if (!aAdditionsActive)
return E_POINTER;
AutoCaller autoCaller (this);
AutoReaderLock alock (this);
return S_OK;
}
{
if (!aAdditionsVersion)
return E_POINTER;
AutoCaller autoCaller (this);
AutoReaderLock alock (this);
return S_OK;
}
{
if (!aSupportsSeamless)
return E_POINTER;
AutoCaller autoCaller (this);
AutoReaderLock alock (this);
return S_OK;
}
{
if (!aMemoryBalloonSize)
return E_POINTER;
AutoCaller autoCaller (this);
AutoReaderLock alock (this);
return S_OK;
}
{
AutoCaller autoCaller (this);
AutoReaderLock alock (this);
{
/* forward the information to the VMM device */
if (vmmDev)
}
return ret;
}
{
if (!aUpdateInterval)
return E_POINTER;
AutoCaller autoCaller (this);
AutoReaderLock alock (this);
return S_OK;
}
{
AutoCaller autoCaller (this);
AutoReaderLock alock (this);
return S_OK;
}
{
return E_INVALIDARG;
AutoCaller autoCaller (this);
/* forward the information to the VMM device */
if (vmmDev)
{
if (!aAllowInteractiveLogon)
return S_OK;
}
tr ("VMM device is not available (is the VM running?)"));
}
{
if (!aStatVal)
return E_INVALIDARG;
switch(statistic)
{
*aStatVal = 0;
break;
default:
AssertFailed();
return E_INVALIDARG;
}
return S_OK;
}
{
switch(statistic)
{
break;
default:
AssertFailed();
return E_INVALIDARG;
}
return S_OK;
}
// public methods only for internal purposes
/////////////////////////////////////////////////////////////////////////////
{
AutoCaller autoCaller (this);
/* this implies that Additions are active */
}
{
AutoCaller autoCaller (this);
}