HardDiskAttachmentImpl.cpp revision df30dbdfdbce7bc58d1a71d98772953017bc3269
/** @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 (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.
*/
#include "HardDiskAttachmentImpl.h"
#include "HardDiskImpl.h"
#include "Logging.h"
// constructor / destructor
/////////////////////////////////////////////////////////////////////////////
{
mChannel = 0;
mDevice = 0;
return S_OK;
}
void HardDiskAttachment::FinalRelease()
{
}
// public initializer/uninitializer for internal purposes only
/////////////////////////////////////////////////////////////////////////////
/**
* Initializes the hard disk attachment object.
* The initialized object becomes immediately dirty
*
* @param aHD hard disk object
* @param aBus bus type
* @param aChannel channel number
* @param aDevice device number on the channel
* @param aDirty whether the attachment is initially dirty or not
*/
{
if (aBus == StorageBus_IDE)
{
tr ("Invalid IDE channel for hard disk '%ls': %d. "
"IDE channel number must be in range [0,1]"),
tr ("Invalid IDE device slot for hard disk '%ls': %d. "
"IDE device slot number must be in range [0,1] for "
"channel 0 and always 1 for channel 1"),
}
setReady (true);
return S_OK;
}
// IHardDiskAttachment properties
/////////////////////////////////////////////////////////////////////////////
{
if (!aHardDisk)
return E_POINTER;
CHECK_READY();
return S_OK;
}
{
if (!aBus)
return E_POINTER;
CHECK_READY();
return S_OK;
}
{
if (!aChannel)
return E_INVALIDARG;
CHECK_READY();
return S_OK;
}
{
if (!aDevice)
return E_INVALIDARG;
CHECK_READY();
return S_OK;
}