VirtualBox

source: vbox/trunk/src/VBox/Main/HostDVDDriveImpl.cpp@ 2917

Last change on this file since 2917 was 2917, checked in by vboxsync, 17 years ago

Updated the host DVD code on Linux to use hal for device detection

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.7 KB
Line 
1/** @file
2 *
3 * VirtualBox COM class implementation
4 */
5
6/*
7 * Copyright (C) 2006 InnoTek Systemberatung GmbH
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License as published by the Free Software Foundation,
13 * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
14 * distribution. VirtualBox OSE is distributed in the hope that it will
15 * be useful, but WITHOUT ANY WARRANTY of any kind.
16 *
17 * If you received this file as part of a commercial VirtualBox
18 * distribution, then only the terms of your commercial VirtualBox
19 * license agreement apply instead of the previous paragraph.
20 */
21
22#include "HostDVDDriveImpl.h"
23
24// constructor / destructor
25/////////////////////////////////////////////////////////////////////////////
26
27HostDVDDrive::HostDVDDrive()
28{
29}
30
31HostDVDDrive::~HostDVDDrive()
32{
33}
34
35// public initializer/uninitializer for internal purposes only
36/////////////////////////////////////////////////////////////////////////////
37
38/**
39 * Initializes the host object.
40 *
41 * @returns COM result indicator
42 * @param driveName name of the drive
43 */
44HRESULT HostDVDDrive::init (INPTR BSTR driveName)
45{
46 ComAssertRet (driveName, E_INVALIDARG);
47
48 AutoLock lock(this);
49 mDriveName = driveName;
50 setReady(true);
51 return S_OK;
52}
53
54/**
55 * Initializes the host object.
56 *
57 * @returns COM result indicator
58 * @param driveName name of the drive
59 * @param driveDescription human readable description of the drive
60 */
61HRESULT HostDVDDrive::init (INPTR BSTR driveName, INPTR BSTR driveDescription)
62{
63 ComAssertRet (driveName, E_INVALIDARG);
64 ComAssertRet (driveDescription, E_INVALIDARG);
65
66 AutoLock lock(this);
67 mDriveName = driveName;
68 mDriveDescription = driveDescription;
69 setReady(true);
70 return S_OK;
71}
72
73// IHostDVDDrive properties
74/////////////////////////////////////////////////////////////////////////////
75
76/**
77 * Returns the name of the host drive
78 *
79 * @returns COM status code
80 * @param driveName address of result pointer
81 */
82STDMETHODIMP HostDVDDrive::COMGETTER(Name) (BSTR *driveName)
83{
84 if (!driveName)
85 return E_POINTER;
86 AutoLock lock(this);
87 CHECK_READY();
88 mDriveName.cloneTo(driveName);
89 return S_OK;
90}
91
92/**
93 * Returns the description of the host drive
94 *
95 * @returns COM status code
96 * @param driveDescription address of result pointer
97 */
98STDMETHODIMP HostDVDDrive::COMGETTER(Description) (BSTR *driveDescription)
99{
100 if (!driveDescription)
101 return E_POINTER;
102 AutoLock lock(this);
103 CHECK_READY();
104 mDriveDescription.cloneTo(driveDescription);
105 return S_OK;
106}
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette