1 | /* $Id: HostDriveImpl.h 85935 2020-08-28 16:49:53Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VirtualBox Main - IHostDrive implementation, VBoxSVC.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2013-2019 Oracle Corporation
|
---|
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 | #ifndef MAIN_INCLUDED_HostDriveImpl_h
|
---|
19 | #define MAIN_INCLUDED_HostDriveImpl_h
|
---|
20 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
21 | # pragma once
|
---|
22 | #endif
|
---|
23 |
|
---|
24 | #include "HostDriveWrap.h"
|
---|
25 |
|
---|
26 | class ATL_NO_VTABLE HostDrive
|
---|
27 | : public HostDriveWrap
|
---|
28 | {
|
---|
29 | public:
|
---|
30 | DECLARE_EMPTY_CTOR_DTOR(HostDrive)
|
---|
31 |
|
---|
32 | HRESULT FinalConstruct();
|
---|
33 | void FinalRelease();
|
---|
34 |
|
---|
35 | /** @name Public initializer/uninitializer for internal purposes only.
|
---|
36 | * @{ */
|
---|
37 | HRESULT initFromPathAndModel(const com::Utf8Str &drivePath, const com::Utf8Str &driveModel);
|
---|
38 | void uninit();
|
---|
39 | /** @} */
|
---|
40 |
|
---|
41 | com::Utf8Str i_getDrivePath() { return m.drivePath; }
|
---|
42 |
|
---|
43 | private:
|
---|
44 | /** @name wrapped IHostDrive properties
|
---|
45 | * @{ */
|
---|
46 | virtual HRESULT getPartitioningType(PartitioningType_T *aPartitioningType) RT_OVERRIDE;
|
---|
47 | virtual HRESULT getDrivePath(com::Utf8Str &aDrivePath) RT_OVERRIDE;
|
---|
48 | virtual HRESULT getUuid(com::Guid &aUuid) RT_OVERRIDE;
|
---|
49 | virtual HRESULT getSectorSize(ULONG *aSectorSize) RT_OVERRIDE;
|
---|
50 | virtual HRESULT getSize(LONG64 *aSize) RT_OVERRIDE;
|
---|
51 | virtual HRESULT getModel(com::Utf8Str &aModel) RT_OVERRIDE;
|
---|
52 | virtual HRESULT getPartitions(std::vector<ComPtr<IHostDrivePartition> > &aPartitions) RT_OVERRIDE;
|
---|
53 | /** @} */
|
---|
54 |
|
---|
55 | /** Data. */
|
---|
56 | struct Data
|
---|
57 | {
|
---|
58 | Data() : cbSector(0), cbDisk(0)
|
---|
59 | {
|
---|
60 | }
|
---|
61 |
|
---|
62 | PartitioningType_T partitioningType;
|
---|
63 | com::Utf8Str drivePath;
|
---|
64 | com::Guid uuid;
|
---|
65 | uint32_t cbSector;
|
---|
66 | uint64_t cbDisk;
|
---|
67 | com::Utf8Str model;
|
---|
68 | std::vector<ComPtr<IHostDrivePartition> > partitions;
|
---|
69 | };
|
---|
70 |
|
---|
71 | Data m;
|
---|
72 | };
|
---|
73 |
|
---|
74 | #endif /* !MAIN_INCLUDED_HostDriveImpl_h */
|
---|
75 |
|
---|
76 | /* vi: set tabstop=4 shiftwidth=4 expandtab: */
|
---|