1 | /* $Id: SystemPropertiesImpl.h 93115 2022-01-01 11:31:46Z vboxsync $ */
|
---|
2 |
|
---|
3 | /** @file
|
---|
4 | *
|
---|
5 | * VirtualBox COM class implementation
|
---|
6 | */
|
---|
7 |
|
---|
8 | /*
|
---|
9 | * Copyright (C) 2006-2022 Oracle Corporation
|
---|
10 | *
|
---|
11 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
12 | * available from http://www.virtualbox.org. This file is free software;
|
---|
13 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
14 | * General Public License (GPL) as published by the Free Software
|
---|
15 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
16 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
17 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
18 | */
|
---|
19 |
|
---|
20 | #ifndef MAIN_INCLUDED_SystemPropertiesImpl_h
|
---|
21 | #define MAIN_INCLUDED_SystemPropertiesImpl_h
|
---|
22 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
23 | # pragma once
|
---|
24 | #endif
|
---|
25 |
|
---|
26 | #include "MediumFormatImpl.h"
|
---|
27 | #include "SystemPropertiesWrap.h"
|
---|
28 |
|
---|
29 | class CPUProfile;
|
---|
30 |
|
---|
31 | namespace settings
|
---|
32 | {
|
---|
33 | struct SystemProperties;
|
---|
34 | }
|
---|
35 |
|
---|
36 | class ATL_NO_VTABLE SystemProperties :
|
---|
37 | public SystemPropertiesWrap
|
---|
38 | {
|
---|
39 | public:
|
---|
40 | typedef std::list<ComObjPtr<MediumFormat> > MediumFormatList;
|
---|
41 | typedef std::list<ComObjPtr<CPUProfile> > CPUProfileList_T;
|
---|
42 |
|
---|
43 | DECLARE_COMMON_CLASS_METHODS(SystemProperties)
|
---|
44 |
|
---|
45 | HRESULT FinalConstruct();
|
---|
46 | void FinalRelease();
|
---|
47 |
|
---|
48 | // public initializer/uninitializer for internal purposes only
|
---|
49 | HRESULT init(VirtualBox *aParent);
|
---|
50 | void uninit();
|
---|
51 |
|
---|
52 | // public methods for internal purposes only
|
---|
53 | // (ensure there is a caller and a read lock before calling them!)
|
---|
54 | HRESULT i_loadSettings(const settings::SystemProperties &data);
|
---|
55 | HRESULT i_saveSettings(settings::SystemProperties &data);
|
---|
56 |
|
---|
57 | ComObjPtr<MediumFormat> i_mediumFormat(const Utf8Str &aFormat);
|
---|
58 | ComObjPtr<MediumFormat> i_mediumFormatFromExtension(const Utf8Str &aExt);
|
---|
59 |
|
---|
60 | int i_loadVDPlugin(const char *pszPluginLibrary);
|
---|
61 | int i_unloadVDPlugin(const char *pszPluginLibrary);
|
---|
62 |
|
---|
63 | HRESULT i_getDefaultAdditionsISO(com::Utf8Str &aDefaultAdditionsISO);
|
---|
64 |
|
---|
65 | private:
|
---|
66 |
|
---|
67 | // wrapped ISystemProperties properties
|
---|
68 | HRESULT getMinGuestRAM(ULONG *aMinGuestRAM) RT_OVERRIDE;
|
---|
69 | HRESULT getMaxGuestRAM(ULONG *aMaxGuestRAM) RT_OVERRIDE;
|
---|
70 | HRESULT getMinGuestVRAM(ULONG *aMinGuestVRAM) RT_OVERRIDE;
|
---|
71 | HRESULT getMaxGuestVRAM(ULONG *aMaxGuestVRAM) RT_OVERRIDE;
|
---|
72 | HRESULT getMinGuestCPUCount(ULONG *aMinGuestCPUCount) RT_OVERRIDE;
|
---|
73 | HRESULT getMaxGuestCPUCount(ULONG *aMaxGuestCPUCount) RT_OVERRIDE;
|
---|
74 | HRESULT getMaxGuestMonitors(ULONG *aMaxGuestMonitors) RT_OVERRIDE;
|
---|
75 | HRESULT getInfoVDSize(LONG64 *aInfoVDSize) RT_OVERRIDE;
|
---|
76 | HRESULT getSerialPortCount(ULONG *aSerialPortCount) RT_OVERRIDE;
|
---|
77 | HRESULT getParallelPortCount(ULONG *aParallelPortCount) RT_OVERRIDE;
|
---|
78 | HRESULT getMaxBootPosition(ULONG *aMaxBootPosition) RT_OVERRIDE;
|
---|
79 | HRESULT getRawModeSupported(BOOL *aRawModeSupported) RT_OVERRIDE;
|
---|
80 | HRESULT getExclusiveHwVirt(BOOL *aExclusiveHwVirt) RT_OVERRIDE;
|
---|
81 | HRESULT setExclusiveHwVirt(BOOL aExclusiveHwVirt) RT_OVERRIDE;
|
---|
82 | HRESULT getDefaultMachineFolder(com::Utf8Str &aDefaultMachineFolder) RT_OVERRIDE;
|
---|
83 | HRESULT setDefaultMachineFolder(const com::Utf8Str &aDefaultMachineFolder) RT_OVERRIDE;
|
---|
84 | HRESULT getLoggingLevel(com::Utf8Str &aLoggingLevel) RT_OVERRIDE;
|
---|
85 | HRESULT setLoggingLevel(const com::Utf8Str &aLoggingLevel) RT_OVERRIDE;
|
---|
86 | HRESULT getMediumFormats(std::vector<ComPtr<IMediumFormat> > &aMediumFormats) RT_OVERRIDE;
|
---|
87 | HRESULT getDefaultHardDiskFormat(com::Utf8Str &aDefaultHardDiskFormat) RT_OVERRIDE;
|
---|
88 | HRESULT setDefaultHardDiskFormat(const com::Utf8Str &aDefaultHardDiskFormat) RT_OVERRIDE;
|
---|
89 | HRESULT getFreeDiskSpaceWarning(LONG64 *aFreeDiskSpaceWarning) RT_OVERRIDE;
|
---|
90 | HRESULT setFreeDiskSpaceWarning(LONG64 aFreeDiskSpaceWarning) RT_OVERRIDE;
|
---|
91 | HRESULT getFreeDiskSpacePercentWarning(ULONG *aFreeDiskSpacePercentWarning) RT_OVERRIDE;
|
---|
92 | HRESULT setFreeDiskSpacePercentWarning(ULONG aFreeDiskSpacePercentWarning) RT_OVERRIDE;
|
---|
93 | HRESULT getFreeDiskSpaceError(LONG64 *aFreeDiskSpaceError) RT_OVERRIDE;
|
---|
94 | HRESULT setFreeDiskSpaceError(LONG64 aFreeDiskSpaceError) RT_OVERRIDE;
|
---|
95 | HRESULT getFreeDiskSpacePercentError(ULONG *aFreeDiskSpacePercentError) RT_OVERRIDE;
|
---|
96 | HRESULT setFreeDiskSpacePercentError(ULONG aFreeDiskSpacePercentError) RT_OVERRIDE;
|
---|
97 | HRESULT getVRDEAuthLibrary(com::Utf8Str &aVRDEAuthLibrary) RT_OVERRIDE;
|
---|
98 | HRESULT setVRDEAuthLibrary(const com::Utf8Str &aVRDEAuthLibrary) RT_OVERRIDE;
|
---|
99 | HRESULT getWebServiceAuthLibrary(com::Utf8Str &aWebServiceAuthLibrary) RT_OVERRIDE;
|
---|
100 | HRESULT setWebServiceAuthLibrary(const com::Utf8Str &aWebServiceAuthLibrary) RT_OVERRIDE;
|
---|
101 | HRESULT getDefaultVRDEExtPack(com::Utf8Str &aDefaultVRDEExtPack) RT_OVERRIDE;
|
---|
102 | HRESULT setDefaultVRDEExtPack(const com::Utf8Str &aDefaultVRDEExtPack) RT_OVERRIDE;
|
---|
103 | HRESULT getLogHistoryCount(ULONG *aLogHistoryCount) RT_OVERRIDE;
|
---|
104 | HRESULT setLogHistoryCount(ULONG aLogHistoryCount) RT_OVERRIDE;
|
---|
105 | HRESULT getDefaultAudioDriver(AudioDriverType_T *aDefaultAudioDriver) RT_OVERRIDE;
|
---|
106 | HRESULT getAutostartDatabasePath(com::Utf8Str &aAutostartDatabasePath) RT_OVERRIDE;
|
---|
107 | HRESULT setAutostartDatabasePath(const com::Utf8Str &aAutostartDatabasePath) RT_OVERRIDE;
|
---|
108 | HRESULT getDefaultAdditionsISO(com::Utf8Str &aDefaultAdditionsISO) RT_OVERRIDE;
|
---|
109 | HRESULT setDefaultAdditionsISO(const com::Utf8Str &aDefaultAdditionsISO) RT_OVERRIDE;
|
---|
110 | HRESULT getDefaultFrontend(com::Utf8Str &aDefaultFrontend) RT_OVERRIDE;
|
---|
111 | HRESULT setDefaultFrontend(const com::Utf8Str &aDefaultFrontend) RT_OVERRIDE;
|
---|
112 | HRESULT getScreenShotFormats(std::vector<BitmapFormat_T> &aScreenShotFormats) RT_OVERRIDE;
|
---|
113 | HRESULT getProxyMode(ProxyMode_T *pProxyMode) RT_OVERRIDE;
|
---|
114 | HRESULT setProxyMode(ProxyMode_T aProxyMode) RT_OVERRIDE;
|
---|
115 | HRESULT getProxyURL(com::Utf8Str &aProxyURL) RT_OVERRIDE;
|
---|
116 | HRESULT setProxyURL(const com::Utf8Str &aProxyURL) RT_OVERRIDE;
|
---|
117 | HRESULT getSupportedParavirtProviders(std::vector<ParavirtProvider_T> &aSupportedParavirtProviders) RT_OVERRIDE;
|
---|
118 | HRESULT getSupportedClipboardModes(std::vector<ClipboardMode_T> &aSupportedClipboardModes) RT_OVERRIDE;
|
---|
119 | HRESULT getSupportedDnDModes(std::vector<DnDMode_T> &aSupportedDnDModes) RT_OVERRIDE;
|
---|
120 | HRESULT getSupportedFirmwareTypes(std::vector<FirmwareType_T> &aSupportedFirmwareTypes) RT_OVERRIDE;
|
---|
121 | HRESULT getSupportedPointingHIDTypes(std::vector<PointingHIDType_T> &aSupportedPointingHIDTypes) RT_OVERRIDE;
|
---|
122 | HRESULT getSupportedKeyboardHIDTypes(std::vector<KeyboardHIDType_T> &aSupportedKeyboardHIDTypes) RT_OVERRIDE;
|
---|
123 | HRESULT getSupportedVFSTypes(std::vector<VFSType_T> &aSupportedVFSTypes) RT_OVERRIDE;
|
---|
124 | HRESULT getSupportedImportOptions(std::vector<ImportOptions_T> &aSupportedImportOptions) RT_OVERRIDE;
|
---|
125 | HRESULT getSupportedExportOptions(std::vector<ExportOptions_T> &aSupportedExportOptions) RT_OVERRIDE;
|
---|
126 | HRESULT getSupportedRecordingAudioCodecs(std::vector<RecordingAudioCodec_T> &aSupportedRecordingAudioCodecs) RT_OVERRIDE;
|
---|
127 | HRESULT getSupportedRecordingVideoCodecs(std::vector<RecordingVideoCodec_T> &aSupportedRecordingVideoCodecs) RT_OVERRIDE;
|
---|
128 | HRESULT getSupportedRecordingVSMethods(std::vector<RecordingVideoScalingMethod_T> &aSupportedRecordingVideoScalingMethods) RT_OVERRIDE;
|
---|
129 | HRESULT getSupportedRecordingVRCModes(std::vector<RecordingVideoRateControlMode_T> &aSupportedRecordingVideoRateControlModes) RT_OVERRIDE;
|
---|
130 | HRESULT getSupportedGraphicsControllerTypes(std::vector<GraphicsControllerType_T> &aSupportedGraphicsControllerTypes) RT_OVERRIDE;
|
---|
131 | HRESULT getSupportedCloneOptions(std::vector<CloneOptions_T> &aSupportedCloneOptions) RT_OVERRIDE;
|
---|
132 | HRESULT getSupportedAutostopTypes(std::vector<AutostopType_T> &aSupportedAutostopTypes) RT_OVERRIDE;
|
---|
133 | HRESULT getSupportedVMProcPriorities(std::vector<VMProcPriority_T> &aSupportedVMProcPriorities) RT_OVERRIDE;
|
---|
134 | HRESULT getSupportedNetworkAttachmentTypes(std::vector<NetworkAttachmentType_T> &aSupportedNetworkAttachmentTypes) RT_OVERRIDE;
|
---|
135 | HRESULT getSupportedNetworkAdapterTypes(std::vector<NetworkAdapterType_T> &aSupportedNetworkAdapterTypes) RT_OVERRIDE;
|
---|
136 | HRESULT getSupportedPortModes(std::vector<PortMode_T> &aSupportedPortModes) RT_OVERRIDE;
|
---|
137 | HRESULT getSupportedUartTypes(std::vector<UartType_T> &aSupportedUartTypes) RT_OVERRIDE;
|
---|
138 | HRESULT getSupportedUSBControllerTypes(std::vector<USBControllerType_T> &aSupportedUSBControllerTypes) RT_OVERRIDE;
|
---|
139 | HRESULT getSupportedAudioDriverTypes(std::vector<AudioDriverType_T> &aSupportedAudioDriverTypes) RT_OVERRIDE;
|
---|
140 | HRESULT getSupportedAudioControllerTypes(std::vector<AudioControllerType_T> &aSupportedAudioControllerTypes) RT_OVERRIDE;
|
---|
141 | HRESULT getSupportedStorageBuses(std::vector<StorageBus_T> &aSupportedStorageBuses) RT_OVERRIDE;
|
---|
142 | HRESULT getSupportedStorageControllerTypes(std::vector<StorageControllerType_T> &aSupportedStorageControllerTypes) RT_OVERRIDE;
|
---|
143 | HRESULT getSupportedChipsetTypes(std::vector<ChipsetType_T> &aSupportedChipsetTypes) RT_OVERRIDE;
|
---|
144 | HRESULT getSupportedIommuTypes(std::vector<IommuType_T> &aSupportedIommuTypes) RT_OVERRIDE;
|
---|
145 | HRESULT getSupportedVBoxUpdateTargetTypes(std::vector<VBoxUpdateTarget_T> &aSupportedVBoxUpdateTargetTypes) RT_OVERRIDE;
|
---|
146 | HRESULT getVBoxUpdateEnabled(BOOL *aVBoxUpdateEnabled) RT_OVERRIDE;
|
---|
147 | HRESULT setVBoxUpdateEnabled(BOOL aVBoxUpdateEnabled) RT_OVERRIDE;
|
---|
148 | HRESULT getVBoxUpdateFrequency(ULONG *aVBoxUpdateFrequency) RT_OVERRIDE;
|
---|
149 | HRESULT setVBoxUpdateFrequency(ULONG aVBoxUpdateFrequency) RT_OVERRIDE;
|
---|
150 | HRESULT getVBoxUpdateLastCheckDate(com::Utf8Str &aVBoxUpdateLastCheckDate) RT_OVERRIDE;
|
---|
151 | HRESULT setVBoxUpdateLastCheckDate(const com::Utf8Str &aVBoxUpdateLastCheckDate) RT_OVERRIDE;
|
---|
152 | HRESULT getVBoxUpdateTarget(VBoxUpdateTarget_T *aVBoxUpdateTarget) RT_OVERRIDE;
|
---|
153 | HRESULT setVBoxUpdateTarget(VBoxUpdateTarget_T aVBoxUpdateTarget) RT_OVERRIDE;
|
---|
154 | HRESULT getVBoxUpdateCount(ULONG *aVBoxUpdateCount) RT_OVERRIDE;
|
---|
155 | HRESULT setVBoxUpdateCount(ULONG aVBoxUpdateCount) RT_OVERRIDE;
|
---|
156 | HRESULT getLanguageId(com::Utf8Str &aLanguageId) RT_OVERRIDE;
|
---|
157 | HRESULT setLanguageId(const com::Utf8Str &aLanguageId) RT_OVERRIDE;
|
---|
158 |
|
---|
159 | // wrapped ISystemProperties methods
|
---|
160 | HRESULT getMaxNetworkAdapters(ChipsetType_T aChipset,
|
---|
161 | ULONG *aMaxNetworkAdapters) RT_OVERRIDE;
|
---|
162 | HRESULT getMaxNetworkAdaptersOfType(ChipsetType_T aChipset,
|
---|
163 | NetworkAttachmentType_T aType,
|
---|
164 | ULONG *aMaxNetworkAdapters) RT_OVERRIDE;
|
---|
165 | HRESULT getMaxDevicesPerPortForStorageBus(StorageBus_T aBus,
|
---|
166 | ULONG *aMaxDevicesPerPort) RT_OVERRIDE;
|
---|
167 | HRESULT getMinPortCountForStorageBus(StorageBus_T aBus,
|
---|
168 | ULONG *aMinPortCount) RT_OVERRIDE;
|
---|
169 | HRESULT getMaxPortCountForStorageBus(StorageBus_T aBus,
|
---|
170 | ULONG *aMaxPortCount) RT_OVERRIDE;
|
---|
171 | HRESULT getMaxInstancesOfStorageBus(ChipsetType_T aChipset,
|
---|
172 | StorageBus_T aBus,
|
---|
173 | ULONG *aMaxInstances) RT_OVERRIDE;
|
---|
174 | HRESULT getDeviceTypesForStorageBus(StorageBus_T aBus,
|
---|
175 | std::vector<DeviceType_T> &aDeviceTypes) RT_OVERRIDE;
|
---|
176 | HRESULT getStorageBusForStorageControllerType(StorageControllerType_T aStorageControllerType,
|
---|
177 | StorageBus_T *aStorageBus) RT_OVERRIDE;
|
---|
178 | HRESULT getStorageControllerTypesForStorageBus(StorageBus_T aStorageBus,
|
---|
179 | std::vector<StorageControllerType_T> &aStorageControllerTypes) RT_OVERRIDE;
|
---|
180 | HRESULT getDefaultIoCacheSettingForStorageController(StorageControllerType_T aControllerType,
|
---|
181 | BOOL *aEnabled) RT_OVERRIDE;
|
---|
182 | HRESULT getStorageControllerHotplugCapable(StorageControllerType_T aControllerType,
|
---|
183 | BOOL *aHotplugCapable) RT_OVERRIDE;
|
---|
184 | HRESULT getMaxInstancesOfUSBControllerType(ChipsetType_T aChipset,
|
---|
185 | USBControllerType_T aType,
|
---|
186 | ULONG *aMaxInstances) RT_OVERRIDE;
|
---|
187 | HRESULT getCPUProfiles(CPUArchitecture_T aArchitecture, const com::Utf8Str &aNamePattern,
|
---|
188 | std::vector<ComPtr<ICPUProfile> > &aProfiles) RT_OVERRIDE;
|
---|
189 |
|
---|
190 | HRESULT i_getUserHomeDirectory(Utf8Str &strPath);
|
---|
191 | HRESULT i_setDefaultMachineFolder(const Utf8Str &strPath);
|
---|
192 | HRESULT i_setLoggingLevel(const com::Utf8Str &aLoggingLevel);
|
---|
193 | HRESULT i_setDefaultHardDiskFormat(const com::Utf8Str &aFormat);
|
---|
194 | HRESULT i_setVRDEAuthLibrary(const com::Utf8Str &aPath);
|
---|
195 |
|
---|
196 | HRESULT i_setWebServiceAuthLibrary(const com::Utf8Str &aPath);
|
---|
197 | HRESULT i_setDefaultVRDEExtPack(const com::Utf8Str &aExtPack);
|
---|
198 | HRESULT i_setAutostartDatabasePath(const com::Utf8Str &aPath);
|
---|
199 | HRESULT i_setDefaultAdditionsISO(const com::Utf8Str &aPath);
|
---|
200 | HRESULT i_setDefaultFrontend(const com::Utf8Str &aDefaultFrontend);
|
---|
201 | HRESULT i_setVBoxUpdateLastCheckDate(const com::Utf8Str &aVBoxUpdateLastCheckDate);
|
---|
202 |
|
---|
203 | VirtualBox * const mParent;
|
---|
204 |
|
---|
205 | settings::SystemProperties *m;
|
---|
206 |
|
---|
207 | MediumFormatList m_llMediumFormats;
|
---|
208 |
|
---|
209 | bool m_fLoadedX86CPUProfiles; /**< Set if we've loaded the x86 and AMD64 CPU profiles. */
|
---|
210 | CPUProfileList_T m_llCPUProfiles; /**< List of loaded CPU profiles. */
|
---|
211 |
|
---|
212 | friend class VirtualBox;
|
---|
213 | };
|
---|
214 |
|
---|
215 | #endif /* !MAIN_INCLUDED_SystemPropertiesImpl_h */
|
---|
216 | /* vi: set tabstop=4 shiftwidth=4 expandtab: */
|
---|