SystemPropertiesImpl.cpp revision 058a831b4157c028dcb920c3898f1d4d426c2301
/** @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.
*
* If you received this file as part of a commercial VirtualBox
* distribution, then only the terms of your commercial VirtualBox
* license agreement apply instead of the previous paragraph.
*/
#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"));
mHWVirtExEnabled = false;
setReady(true);
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.
*/
void SystemProperties::uninit()
{
LogFlowMember (("SystemProperties::uninit()\n"));
AssertReturn (isReady(), (void) 0);
setReady (false);
}
// ISystemProperties properties
/////////////////////////////////////////////////////////////////////////////
{
if (!minRAM)
return E_POINTER;
CHECK_READY();
return S_OK;
}
{
if (!maxRAM)
return E_POINTER;
CHECK_READY();
return S_OK;
}
{
if (!minVRAM)
return E_POINTER;
CHECK_READY();
return S_OK;
}
{
if (!maxVRAM)
return E_POINTER;
CHECK_READY();
return S_OK;
}
{
if (!maxMonitors)
return E_POINTER;
CHECK_READY();
return S_OK;
}
{
if (!maxVDISize)
return E_POINTER;
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;
CHECK_READY();
return S_OK;
}
{
if (!count)
return E_POINTER;
CHECK_READY();
return S_OK;
}
{
if (!count)
return E_POINTER;
CHECK_READY();
return S_OK;
}
{
if (!aMaxBootPosition)
return E_POINTER;
CHECK_READY();
return S_OK;
}
{
if (!aDefaultVDIFolder)
return E_POINTER;
CHECK_READY();
return S_OK;
}
{
CHECK_READY();
return rc;
return mParent->saveSettings();
}
{
if (!aDefaultMachineFolder)
return E_POINTER;
CHECK_READY();
return S_OK;
}
{
CHECK_READY();
return rc;
return mParent->saveSettings();
}
STDMETHODIMP SystemProperties::COMGETTER(RemoteDisplayAuthLibrary) (BSTR *aRemoteDisplayAuthLibrary)
{
return E_POINTER;
CHECK_READY();
return S_OK;
}
STDMETHODIMP SystemProperties::COMSETTER(RemoteDisplayAuthLibrary) (INPTR BSTR aRemoteDisplayAuthLibrary)
{
CHECK_READY();
return rc;
return mParent->saveSettings();
}
{
if (!enabled)
return E_POINTER;
CHECK_READY();
return S_OK;
}
{
CHECK_READY();
return mParent->saveSettings();
}
// public methods only for internal purposes
/////////////////////////////////////////////////////////////////////////////
{
CHECK_READY();
do
{
bstr.asOutParam());
break;
bstr.asOutParam());
break;
bstr.asOutParam());
break;
}
while (0);
return rc;
}
{
CHECK_READY();
// first, delete the entry
if (VBOX_SUCCESS (vrc))
{
}
// then, recreate it
if (mDefaultVDIFolder)
return S_OK;
}
// private methods
/////////////////////////////////////////////////////////////////////////////
{
else
path = "VDI";
// get the full file name
char folder [RTPATH_MAX];
if (VBOX_FAILURE (vrc))
tr ("Cannot set the default VDI folder to '%ls' (%Vrc)"),
return S_OK;
}
{
else
path = "Machines";
// get the full file name
char folder [RTPATH_MAX];
if (VBOX_FAILURE (vrc))
tr ("Cannot set the default machines folder to '%ls' (%Vrc)"),
return S_OK;
}
{
else
path = "VRDPAuth";
return S_OK;
}