HardDiskAttachmentImpl.cpp revision 05fb7454f402098331166b59778f1b03d2e7c8c1
/** @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
/////////////////////////////////////////////////////////////////////////////
{
mDeviceNumber = 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 aCtl controller type
* @param aDev device number on the controller
* @param aDirty whether the attachment is initially dirty or not
*/
{
mController = aCtl;
setReady (true);
return S_OK;
}
// IHardDiskAttachment properties
/////////////////////////////////////////////////////////////////////////////
{
if (!aHardDisk)
return E_POINTER;
CHECK_READY();
return S_OK;
}
{
if (!aController)
return E_POINTER;
CHECK_READY();
return S_OK;
}
{
if (!aDeviceNumber)
return E_INVALIDARG;
CHECK_READY();
return S_OK;
}