SystemPropertiesImpl.cpp revision 16ab6cda9bc53bc791284d26da448bbccb11b7ff
/* $Id$ */
/** @file
*
* VirtualBox COM class implementation
*/
/*
* Copyright (C) 2006-2008 Sun Microsystems, Inc.
*
* 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 (GPL) 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.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
* Clara, CA 95054 USA or visit http://www.sun.com if you need
* additional information or have any questions.
*/
#include "SystemPropertiesImpl.h"
#include "VirtualBoxImpl.h"
#include "MachineImpl.h"
#include "Logging.h"
// generated header
#include "SchemaDefs.h"
// defines
/////////////////////////////////////////////////////////////////////////////
// constructor / destructor
/////////////////////////////////////////////////////////////////////////////
{
return S_OK;
}
void SystemProperties::FinalRelease()
{
uninit ();
}
// public methods only for internal purposes
/////////////////////////////////////////////////////////////////////////////
/**
* Initializes the system information object.
*
* @returns COM result indicator
*/
{
/* Enclose the state transition NotReady->InInit->Ready */
AutoInitSpan autoInitSpan (this);
mHWVirtExEnabled = false;
mLogHistoryCount = 3;
/* Fetch info of all available hd backends. */
/// @todo NEWMEDIA VDBackendInfo needs to be improved to let us enumerate
/// any number of backends
/// @todo We currently leak memory because it's not actually clear what to
/// free in structures returned by VDBackendInfo. Must be fixed ASAP!
unsigned cEntries;
if (RT_SUCCESS (vrc))
{
for (unsigned i = 0; i < cEntries; ++ i)
{
}
}
/* Confirm a successful initialization */
return rc;
}
/**
* Uninitializes the instance and sets the ready flag to FALSE.
* Called either from FinalRelease() or by the parent when it gets destroyed.
*/
void SystemProperties::uninit()
{
LogFlowThisFunc (("\n"));
/* Enclose the state transition Ready->InUninit->NotReady */
AutoUninitSpan autoUninitSpan (this);
if (autoUninitSpan.uninitDone())
return;
}
// ISystemProperties properties
/////////////////////////////////////////////////////////////////////////////
{
if (!minRAM)
return E_POINTER;
AutoCaller autoCaller (this);
/* no need to lock, this is const */
return S_OK;
}
{
if (!maxRAM)
return E_POINTER;
AutoCaller autoCaller (this);
/* no need to lock, this is const */
return S_OK;
}
{
if (!minVRAM)
return E_POINTER;
AutoCaller autoCaller (this);
/* no need to lock, this is const */
return S_OK;
}
{
if (!maxVRAM)
return E_POINTER;
AutoCaller autoCaller (this);
/* no need to lock, this is const */
return S_OK;
}
{
if (!maxMonitors)
return E_POINTER;
AutoCaller autoCaller (this);
/* no need to lock, this is const */
return S_OK;
}
{
if (!maxVDISize)
return E_POINTER;
AutoCaller autoCaller (this);
/** The BIOS supports currently 32 bit LBA numbers (implementing the full
* 48 bit range is in theory trivial, but the crappy compiler makes things
* more difficult). This translates to almost 2 TBytes (to be on the safe
* side, the reported limit is 1 MiByte less than that, as the total number
* of sectors should fit in 32 bits, too), which should bei enough for
* the moment. The virtual ATA disks support complete LBA48 (although for
* example iSCSI is also currently limited to 32 bit LBA), so the
* theoretical maximum disk size is 128 PiByte. The user interface cannot
* cope with this in a reasonable way yet. */
/* no need to lock, this is const */
return S_OK;
}
{
if (!count)
return E_POINTER;
AutoCaller autoCaller (this);
/* no need to lock, this is const */
return S_OK;
}
{
if (!count)
return E_POINTER;
AutoCaller autoCaller (this);
/* no need to lock, this is const */
return S_OK;
}
{
if (!count)
return E_POINTER;
AutoCaller autoCaller (this);
/* no need to lock, this is const */
return S_OK;
}
{
AutoCaller autoCaller (this);
/* no need to lock, this is const */
return S_OK;
}
{
AutoCaller autoCaller (this);
AutoReadLock alock (this);
return S_OK;
}
{
AutoCaller autoCaller (this);
/* VirtualBox::saveSettings() needs a write lock */
return rc;
}
{
AutoCaller autoCaller (this);
AutoReadLock alock (this);
return S_OK;
}
{
AutoCaller autoCaller (this);
/* VirtualBox::saveSettings() needs a write lock */
return rc;
}
{
return E_POINTER;
AutoCaller autoCaller (this);
AutoReadLock alock (this);
return S_OK;
}
{
AutoCaller autoCaller (this);
AutoReadLock alock (this);
return S_OK;
}
{
AutoCaller autoCaller (this);
/* VirtualBox::saveSettings() needs a write lock */
return rc;
}
STDMETHODIMP SystemProperties::COMGETTER(RemoteDisplayAuthLibrary) (BSTR *aRemoteDisplayAuthLibrary)
{
AutoCaller autoCaller (this);
AutoReadLock alock (this);
return S_OK;
}
STDMETHODIMP SystemProperties::COMSETTER(RemoteDisplayAuthLibrary) (INPTR BSTR aRemoteDisplayAuthLibrary)
{
AutoCaller autoCaller (this);
/* VirtualBox::saveSettings() needs a write lock */
return rc;
}
{
AutoCaller autoCaller (this);
AutoReadLock alock (this);
return S_OK;
}
{
AutoCaller autoCaller (this);
/* VirtualBox::saveSettings() needs a write lock */
return rc;
}
{
if (!enabled)
return E_POINTER;
AutoCaller autoCaller (this);
AutoReadLock alock (this);
return S_OK;
}
{
AutoCaller autoCaller (this);
/* VirtualBox::saveSettings() needs a write lock */
return rc;
}
{
if (!count)
return E_POINTER;
AutoCaller autoCaller (this);
AutoReadLock alock (this);
return S_OK;
}
{
AutoCaller autoCaller (this);
/* VirtualBox::saveSettings() needs a write lock */
return rc;
}
// public methods only for internal purposes
/////////////////////////////////////////////////////////////////////////////
{
using namespace settings;
AutoCaller autoCaller (this);
AutoWriteLock alock (this);
/* Note: not <BOOL> because Win32 defines BOOL as int */
return S_OK;
}
{
using namespace settings;
AutoCaller autoCaller (this);
AutoReadLock alock (this);
/* first, delete the entry */
if (!properties.isNull())
properties.zap();
/* then, recreate it */
return S_OK;
}
/**
* Rerurns a hard disk format object corresponding to the given format
* identifier or null if no such format.
*
* @param aFormat Format identifier.
*
* @return ComObjPtr<HardDiskFormat>
*/
{
AutoCaller autoCaller (this);
AutoReadLock alock (this);
{
/* HardDiskFormat is all const, no need to lock */
{
break;
}
}
return format;
}
// private methods
/////////////////////////////////////////////////////////////////////////////
{
else
path = "Machines";
/* get the full file name */
if (RT_FAILURE (vrc))
tr ("Invalid default machine folder '%ls' (%Rrc)"),
return S_OK;
}
{
else
path = "HardDisks";
/* get the full file name */
if (RT_FAILURE (vrc))
tr ("Invalid default hard disk folder '%ls' (%Rrc)"),
return S_OK;
}
{
else
mDefaultHardDiskFormat = "VDI";
return S_OK;
}
{
else
mRemoteDisplayAuthLibrary = "VRDPAuth";
return S_OK;
}
{
else
mWebServiceAuthLibrary = "VRDPAuth";
return S_OK;
}
/* vi: set tabstop=4 shiftwidth=4 expandtab: */