1 | /* $Id: MediumIOImpl.h 72948 2018-07-07 16:20:42Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VirtualBox COM class implementation - MediumIO.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2018 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 ____H_MEDIUMIOIMPL
|
---|
19 | #define ____H_MEDIUMIOIMPL
|
---|
20 |
|
---|
21 | #include "MediumIOWrap.h"
|
---|
22 |
|
---|
23 | class ATL_NO_VTABLE MediumIO :
|
---|
24 | public MediumIOWrap
|
---|
25 | {
|
---|
26 | public:
|
---|
27 | /** @name Dummy/standard constructors and destructors.
|
---|
28 | * @{ */
|
---|
29 | DECLARE_EMPTY_CTOR_DTOR(MediumIO)
|
---|
30 | HRESULT FinalConstruct();
|
---|
31 | void FinalRelease();
|
---|
32 | /** @} */
|
---|
33 |
|
---|
34 | /** @name Initializer & uninitializer.
|
---|
35 | * @{ */
|
---|
36 | HRESULT initForMedium(Medium *pMedium, bool fWritable, com::Utf8Str const &rStrKeyId, com::Utf8Str const &rStrPassword);
|
---|
37 | void uninit();
|
---|
38 | /** @} */
|
---|
39 |
|
---|
40 | private:
|
---|
41 | /** @name Wrapped IMediumIO properties
|
---|
42 | * @{ */
|
---|
43 | HRESULT getMedium(ComPtr<IMedium> &a_rPtrMedium);
|
---|
44 | HRESULT getWritable(BOOL *a_fWritable);
|
---|
45 | HRESULT getExplorer(ComPtr<IVFSExplorer> &a_rPtrExplorer);
|
---|
46 | /** @} */
|
---|
47 |
|
---|
48 | /** @name Wrapped IMediumIO methods
|
---|
49 | * @{ */
|
---|
50 | HRESULT read(LONG64 a_off, ULONG a_cbRead, std::vector<BYTE> &a_rData);
|
---|
51 | HRESULT write(LONG64 a_off, const std::vector<BYTE> &a_rData, ULONG *a_pcbWritten);
|
---|
52 | HRESULT formatFAT(BOOL a_fQuick);
|
---|
53 | HRESULT initializePartitionTable(PartitionTableType_T a_enmFormat, BOOL a_fWholeDiskInOneEntry);
|
---|
54 | HRESULT close();
|
---|
55 | /** @} */
|
---|
56 |
|
---|
57 | /** @name Internal workers.
|
---|
58 | * @{ */
|
---|
59 | void i_close();
|
---|
60 | /** @} */
|
---|
61 |
|
---|
62 | struct Data;
|
---|
63 | Data *m;
|
---|
64 | };
|
---|
65 |
|
---|
66 | #endif
|
---|
67 | /* vi: set tabstop=4 shiftwidth=4 expandtab: */
|
---|
68 |
|
---|