1 | /* $Id: MediumIOImpl.h 74822 2018-10-12 18:40:09Z 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 | #include "VirtualBoxBase.h"
|
---|
23 | #include "AutoCaller.h"
|
---|
24 |
|
---|
25 | class ATL_NO_VTABLE MediumIO :
|
---|
26 | public MediumIOWrap
|
---|
27 | {
|
---|
28 | public:
|
---|
29 | /** @name Dummy/standard constructors and destructors.
|
---|
30 | * @{ */
|
---|
31 | DECLARE_EMPTY_CTOR_DTOR(MediumIO)
|
---|
32 | HRESULT FinalConstruct();
|
---|
33 | void FinalRelease();
|
---|
34 | /** @} */
|
---|
35 |
|
---|
36 | /** @name Initializer & uninitializer.
|
---|
37 | * @{ */
|
---|
38 | HRESULT initForMedium(Medium *pMedium, VirtualBox *pVirtualBox, bool fWritable,
|
---|
39 | com::Utf8Str const &rStrKeyId, com::Utf8Str const &rStrPassword);
|
---|
40 | void uninit();
|
---|
41 | /** @} */
|
---|
42 |
|
---|
43 | private:
|
---|
44 | /** @name Wrapped IMediumIO properties
|
---|
45 | * @{ */
|
---|
46 | HRESULT getMedium(ComPtr<IMedium> &a_rPtrMedium);
|
---|
47 | HRESULT getWritable(BOOL *a_fWritable);
|
---|
48 | HRESULT getExplorer(ComPtr<IVFSExplorer> &a_rPtrExplorer);
|
---|
49 | /** @} */
|
---|
50 |
|
---|
51 | /** @name Wrapped IMediumIO methods
|
---|
52 | * @{ */
|
---|
53 | HRESULT read(LONG64 a_off, ULONG a_cbRead, std::vector<BYTE> &a_rData);
|
---|
54 | HRESULT write(LONG64 a_off, const std::vector<BYTE> &a_rData, ULONG *a_pcbWritten);
|
---|
55 | HRESULT formatFAT(BOOL a_fQuick);
|
---|
56 | HRESULT initializePartitionTable(PartitionTableType_T a_enmFormat, BOOL a_fWholeDiskInOneEntry);
|
---|
57 | HRESULT convertToStream(const com::Utf8Str &aFormat,
|
---|
58 | const std::vector<MediumVariant_T> &aVariant,
|
---|
59 | ULONG aBufferSize,
|
---|
60 | ComPtr<IDataStream> &aStream,
|
---|
61 | ComPtr<IProgress> &aProgress);
|
---|
62 | HRESULT close();
|
---|
63 | /** @} */
|
---|
64 |
|
---|
65 | /** @name Internal workers.
|
---|
66 | * @{ */
|
---|
67 | void i_close();
|
---|
68 | /** @} */
|
---|
69 |
|
---|
70 | struct Data;
|
---|
71 | Data *m;
|
---|
72 |
|
---|
73 | class StreamTask;
|
---|
74 | friend class StreamTask;
|
---|
75 | };
|
---|
76 |
|
---|
77 | #endif
|
---|
78 | /* vi: set tabstop=4 shiftwidth=4 expandtab: */
|
---|
79 |
|
---|