SystemPropertiesImpl.cpp revision dcea3eadf1ecc8f4ac868185a05a63be42a199e4
/** @file
*
* VirtualBox COM class implementation
*/
/*
* Copyright (C) 2006-2007 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()
{
if (isReady())
uninit ();
}
// public methods only for internal purposes
/////////////////////////////////////////////////////////////////////////////
/**
* Initializes the system information object.
*
* @returns COM result indicator
*/
{
LogFlowMember (("SystemProperties::init()\n"));
AutoWriteLock alock (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 (VBOX_SUCCESS (vrc))
{
for (unsigned i = 0; i < cEntries; ++ i)
{
}
}
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()
{
LogFlowMember (("SystemProperties::uninit()\n"));
AutoWriteLock alock (this);
AssertReturn (isReady(), (void) 0);
setReady (false);
}
// ISystemProperties properties
/////////////////////////////////////////////////////////////////////////////
{
if (!minRAM)
return E_POINTER;
AutoWriteLock alock (this);
CHECK_READY();
return S_OK;
}
{
if (!maxRAM)
return E_POINTER;
AutoWriteLock alock (this);
CHECK_READY();
return S_OK;
}
{
if (!minVRAM)
return E_POINTER;
AutoWriteLock alock (this);
CHECK_READY();
return S_OK;
}
{
if (!maxVRAM)
return E_POINTER;
AutoWriteLock alock (this);
CHECK_READY();
return S_OK;
}
{
if (!maxMonitors)
return E_POINTER;
AutoWriteLock alock (this);
CHECK_READY();
return S_OK;
}
{
if (!maxVDISize)
return E_POINTER;
AutoWriteLock alock (this);
CHECK_READY();
/** 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. */
return S_OK;
}
{
if (!count)
return E_POINTER;
AutoWriteLock alock (this);
CHECK_READY();
return S_OK;
}
{
if (!count)
return E_POINTER;
AutoWriteLock alock (this);
CHECK_READY();
return S_OK;
}
{
if (!count)
return E_POINTER;
AutoWriteLock alock (this);
CHECK_READY();
return S_OK;
}
{
if (!aMaxBootPosition)
return E_POINTER;
AutoWriteLock alock (this);
CHECK_READY();
return S_OK;
}
{
if (!aDefaultMachineFolder)
return E_POINTER;
AutoWriteLock alock (this);
CHECK_READY();
return S_OK;
}
{
AutoWriteLock alock (this);
CHECK_READY();
return rc;
return mParent->saveSettings();
}
{
if (!aDefaultHardDiskFolder)
return E_POINTER;
AutoWriteLock alock (this);
CHECK_READY();
return S_OK;
}
{
AutoWriteLock alock (this);
CHECK_READY();
return rc;
return mParent->saveSettings();
}
{
return E_POINTER;
AutoWriteLock alock (this);
CHECK_READY();
return S_OK;
}
STDMETHODIMP SystemProperties::COMGETTER(RemoteDisplayAuthLibrary) (BSTR *aRemoteDisplayAuthLibrary)
{
return E_POINTER;
AutoWriteLock alock (this);
CHECK_READY();
return S_OK;
}
STDMETHODIMP SystemProperties::COMSETTER(RemoteDisplayAuthLibrary) (INPTR BSTR aRemoteDisplayAuthLibrary)
{
AutoWriteLock alock (this);
CHECK_READY();
return rc;
return mParent->saveSettings();
}
{
if (!aWebServiceAuthLibrary)
return E_POINTER;
AutoWriteLock alock (this);
CHECK_READY();
return S_OK;
}
{
AutoWriteLock alock (this);
CHECK_READY();
return rc;
return mParent->saveSettings();
}
{
if (!enabled)
return E_POINTER;
AutoWriteLock alock (this);
CHECK_READY();
return S_OK;
}
{
AutoWriteLock alock (this);
CHECK_READY();
return mParent->saveSettings();
}
{
if (!count)
return E_POINTER;
AutoWriteLock alock (this);
CHECK_READY();
return S_OK;
}
{
AutoWriteLock alock (this);
CHECK_READY();
return mParent->saveSettings();
}
// public methods only for internal purposes
/////////////////////////////////////////////////////////////////////////////
{
using namespace settings;
AutoWriteLock alock (this);
CHECK_READY();
/* Note: not <BOOL> because Win32 defines BOOL as int */
return S_OK;
}
{
using namespace settings;
AutoWriteLock alock (this);
CHECK_READY();
/* first, delete the entry */
if (!properties.isNull())
properties.zap();
/* then, recreate it */
return S_OK;
}
// private methods
/////////////////////////////////////////////////////////////////////////////
{
else
path = "Machines";
/* get the full file name */
if (VBOX_FAILURE (vrc))
tr ("Invalid default machine folder '%ls' (%Vrc)"),
return S_OK;
}
{
else
path = "HardDisks";
/* get the full file name */
if (VBOX_FAILURE (vrc))
tr ("Invalid default hard disk folder '%ls' (%Vrc)"),
return S_OK;
}
{
else
path = "VRDPAuth";
return S_OK;
}
{
else
path = "VRDPAuth";
return S_OK;
}