VirtualBox

source: vbox/trunk/src/VBox/Main/HostNetworkInterfaceImpl.cpp@ 8083

Last change on this file since 8083 was 8083, checked in by vboxsync, 16 years ago

Main: Renamed AutoLock => AutoWriteLock; AutoReaderLock => AutoReadLock.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.2 KB
Line 
1/** @file
2 *
3 * VirtualBox COM class implementation
4 */
5
6/*
7 * Copyright (C) 2006-2007 innotek 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 (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18#include "HostNetworkInterfaceImpl.h"
19
20// constructor / destructor
21/////////////////////////////////////////////////////////////////////////////
22
23HostNetworkInterface::HostNetworkInterface()
24{
25}
26
27HostNetworkInterface::~HostNetworkInterface()
28{
29}
30
31// public initializer/uninitializer for internal purposes only
32/////////////////////////////////////////////////////////////////////////////
33
34/**
35 * Initializes the host object.
36 *
37 * @returns COM result indicator
38 * @param interfaceName name of the network interface
39 */
40HRESULT HostNetworkInterface::init (Bstr interfaceName, Guid guid)
41{
42 ComAssertRet (interfaceName, E_INVALIDARG);
43 ComAssertRet (!guid.isEmpty(), E_INVALIDARG);
44
45 AutoWriteLock alock (this);
46 mInterfaceName = interfaceName;
47 mGuid = guid;
48 setReady(true);
49 return S_OK;
50}
51
52// IHostNetworkInterface properties
53/////////////////////////////////////////////////////////////////////////////
54
55/**
56 * Returns the name of the host network interface.
57 *
58 * @returns COM status code
59 * @param interfaceName address of result pointer
60 */
61STDMETHODIMP HostNetworkInterface::COMGETTER(Name) (BSTR *interfaceName)
62{
63 if (!interfaceName)
64 return E_POINTER;
65 AutoWriteLock alock (this);
66 CHECK_READY();
67 mInterfaceName.cloneTo(interfaceName);
68 return S_OK;
69}
70
71/**
72 * Returns the GUID of the host network interface.
73 *
74 * @returns COM status code
75 * @param guid address of result pointer
76 */
77STDMETHODIMP HostNetworkInterface::COMGETTER(Id) (GUIDPARAMOUT guid)
78{
79 if (!guid)
80 return E_POINTER;
81 AutoWriteLock alock (this);
82 CHECK_READY();
83 mGuid.cloneTo(guid);
84 return S_OK;
85}
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use