1 | /* $Id: VirtualBoxImpl.h 94660 2022-04-21 08:38:34Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VirtualBox COM class implementation
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006-2022 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_VirtualBoxImpl_h
|
---|
19 | #define MAIN_INCLUDED_VirtualBoxImpl_h
|
---|
20 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
21 | # pragma once
|
---|
22 | #endif
|
---|
23 |
|
---|
24 | #include "VirtualBoxBase.h"
|
---|
25 | #include "objectslist.h"
|
---|
26 | #include "VirtualBoxWrap.h"
|
---|
27 |
|
---|
28 | #ifdef RT_OS_WINDOWS
|
---|
29 | # include "win/resource.h"
|
---|
30 | #endif
|
---|
31 |
|
---|
32 | //#ifdef DEBUG_bird
|
---|
33 | //# define VBOXSVC_WITH_CLIENT_WATCHER
|
---|
34 | //#endif
|
---|
35 |
|
---|
36 | namespace com
|
---|
37 | {
|
---|
38 | class Event;
|
---|
39 | class EventQueue;
|
---|
40 | }
|
---|
41 |
|
---|
42 | class SessionMachine;
|
---|
43 | class GuestOSType;
|
---|
44 | class Progress;
|
---|
45 | class Host;
|
---|
46 | class SystemProperties;
|
---|
47 | class DHCPServer;
|
---|
48 | class PerformanceCollector;
|
---|
49 | class CloudProviderManager;
|
---|
50 | #ifdef VBOX_WITH_EXTPACK
|
---|
51 | class ExtPackManager;
|
---|
52 | #endif
|
---|
53 | class AutostartDb;
|
---|
54 | class NATNetwork;
|
---|
55 | #ifdef VBOX_WITH_CLOUD_NET
|
---|
56 | class CloudNetwork;
|
---|
57 | #endif /* VBOX_WITH_CLOUD_NET */
|
---|
58 |
|
---|
59 |
|
---|
60 | typedef std::list<ComObjPtr<SessionMachine> > SessionMachinesList;
|
---|
61 |
|
---|
62 | #ifdef RT_OS_WINDOWS
|
---|
63 | class SVCHlpClient;
|
---|
64 | #endif
|
---|
65 |
|
---|
66 | namespace settings
|
---|
67 | {
|
---|
68 | class MainConfigFile;
|
---|
69 | struct MediaRegistry;
|
---|
70 | }
|
---|
71 |
|
---|
72 |
|
---|
73 | #if defined(VBOX_WITH_SDS) && !defined(VBOX_WITH_XPCOM)
|
---|
74 | class VirtualBoxClassFactory; /* See ../src-server/win/svcmain.cpp */
|
---|
75 | #endif
|
---|
76 |
|
---|
77 | class ATL_NO_VTABLE VirtualBox :
|
---|
78 | public VirtualBoxWrap
|
---|
79 | #ifdef RT_OS_WINDOWS
|
---|
80 | , public ATL::CComCoClass<VirtualBox, &CLSID_VirtualBox>
|
---|
81 | #endif
|
---|
82 | {
|
---|
83 |
|
---|
84 | public:
|
---|
85 |
|
---|
86 | typedef std::list<ComPtr<IInternalSessionControl> > InternalControlList;
|
---|
87 | typedef ObjectsList<Machine> MachinesOList;
|
---|
88 |
|
---|
89 | #if 0 /* obsoleted by AsyncEvent */
|
---|
90 | class CallbackEvent;
|
---|
91 | friend class CallbackEvent;
|
---|
92 | #endif
|
---|
93 | class AsyncEvent;
|
---|
94 | friend class AsyncEvent;
|
---|
95 |
|
---|
96 | #ifndef VBOX_WITH_XPCOM
|
---|
97 | # ifdef VBOX_WITH_SDS
|
---|
98 | DECLARE_CLASSFACTORY_EX(VirtualBoxClassFactory)
|
---|
99 | # else
|
---|
100 | DECLARE_CLASSFACTORY_SINGLETON(VirtualBox)
|
---|
101 | # endif
|
---|
102 | #endif
|
---|
103 |
|
---|
104 | // Do not use any ATL registry support.
|
---|
105 | //DECLARE_REGISTRY_RESOURCEID(IDR_VIRTUALBOX)
|
---|
106 |
|
---|
107 | // Kind of redundant (VirtualBoxWrap declares itself not aggregatable and
|
---|
108 | // CComCoClass<VirtualBox, &CLSID_VirtualBox> as aggregatable, the former
|
---|
109 | // is the first inheritance), but the C++ multiple inheritance rules and
|
---|
110 | // the class factory in svcmain.cpp needs this to disambiguate.
|
---|
111 | DECLARE_NOT_AGGREGATABLE(VirtualBox)
|
---|
112 |
|
---|
113 | // to postpone generation of the default ctor/dtor
|
---|
114 | DECLARE_COMMON_CLASS_METHODS(VirtualBox)
|
---|
115 |
|
---|
116 | HRESULT FinalConstruct();
|
---|
117 | void FinalRelease();
|
---|
118 |
|
---|
119 | // public initializer/uninitializer for internal purposes only
|
---|
120 | HRESULT init();
|
---|
121 | HRESULT initMachines();
|
---|
122 | HRESULT initMedia(const Guid &uuidMachineRegistry,
|
---|
123 | const settings::MediaRegistry &mediaRegistry,
|
---|
124 | const Utf8Str &strMachineFolder);
|
---|
125 | void uninit();
|
---|
126 |
|
---|
127 | // public methods only for internal purposes
|
---|
128 |
|
---|
129 | /**
|
---|
130 | * Override of the default locking class to be used for validating lock
|
---|
131 | * order with the standard member lock handle.
|
---|
132 | */
|
---|
133 | virtual VBoxLockingClass getLockingClass() const
|
---|
134 | {
|
---|
135 | return LOCKCLASS_VIRTUALBOXOBJECT;
|
---|
136 | }
|
---|
137 |
|
---|
138 | #ifdef DEBUG
|
---|
139 | void i_dumpAllBackRefs();
|
---|
140 | #endif
|
---|
141 |
|
---|
142 | HRESULT i_postEvent(Event *event);
|
---|
143 |
|
---|
144 | HRESULT i_addProgress(IProgress *aProgress);
|
---|
145 | HRESULT i_removeProgress(IN_GUID aId);
|
---|
146 |
|
---|
147 | #ifdef RT_OS_WINDOWS
|
---|
148 | typedef DECLCALLBACKPTR(HRESULT, SVCHelperClientFunc,(SVCHlpClient *aClient, Progress *aProgress, void *aUser, int *aVrc));
|
---|
149 | HRESULT i_startSVCHelperClient(bool aPrivileged,
|
---|
150 | SVCHelperClientFunc aFunc,
|
---|
151 | void *aUser, Progress *aProgress);
|
---|
152 | #endif
|
---|
153 |
|
---|
154 | void i_addProcessToReap(RTPROCESS pid);
|
---|
155 | void i_updateClientWatcher();
|
---|
156 |
|
---|
157 | int i_loadVDPlugin(const char *pszPluginLibrary);
|
---|
158 | int i_unloadVDPlugin(const char *pszPluginLibrary);
|
---|
159 |
|
---|
160 | void i_onMediumRegistered(const Guid &aMediumId, const DeviceType_T aDevType, BOOL aRegistered);
|
---|
161 | void i_onMediumConfigChanged(IMedium *aMedium);
|
---|
162 | void i_onMediumChanged(IMediumAttachment* aMediumAttachment);
|
---|
163 | void i_onStorageControllerChanged(const Guid &aMachineId, const com::Utf8Str &aControllerName);
|
---|
164 | void i_onStorageDeviceChanged(IMediumAttachment* aStorageDevice, BOOL fRemoved, BOOL fSilent);
|
---|
165 | void i_onMachineStateChanged(const Guid &aId, MachineState_T aState);
|
---|
166 | void i_onMachineDataChanged(const Guid &aId, BOOL aTemporary = FALSE);
|
---|
167 | BOOL i_onExtraDataCanChange(const Guid &aId, const Utf8Str &aKey, const Utf8Str &aValue, Bstr &aError);
|
---|
168 | void i_onExtraDataChanged(const Guid &aId, const Utf8Str &aKey, const Utf8Str &aValue);
|
---|
169 | void i_onMachineRegistered(const Guid &aId, BOOL aRegistered);
|
---|
170 | void i_onSessionStateChanged(const Guid &aId, SessionState_T aState);
|
---|
171 |
|
---|
172 | void i_onSnapshotTaken(const Guid &aMachineId, const Guid &aSnapshotId);
|
---|
173 | void i_onSnapshotDeleted(const Guid &aMachineId, const Guid &aSnapshotId);
|
---|
174 | void i_onSnapshotRestored(const Guid &aMachineId, const Guid &aSnapshotId);
|
---|
175 | void i_onSnapshotChanged(const Guid &aMachineId, const Guid &aSnapshotId);
|
---|
176 |
|
---|
177 | void i_onGuestPropertyChanged(const Guid &aMachineId, const Utf8Str &aName, const Utf8Str &aValue, const Utf8Str &aFlags,
|
---|
178 | const BOOL fWasDeleted);
|
---|
179 | void i_onNatRedirectChanged(const Guid &aMachineId, ULONG ulSlot, bool fRemove, const Utf8Str &aName,
|
---|
180 | NATProtocol_T aProto, const Utf8Str &aHostIp, uint16_t aHostPort,
|
---|
181 | const Utf8Str &aGuestIp, uint16_t aGuestPort);
|
---|
182 | void i_onNATNetworkChanged(const Utf8Str &aNetworkName);
|
---|
183 | void i_onNATNetworkStartStop(const Utf8Str &aNetworkName, BOOL aStart);
|
---|
184 | void i_onNATNetworkSetting(const Utf8Str &aNetworkName, BOOL aEnabled, const Utf8Str &aNetwork,
|
---|
185 | const Utf8Str &aGateway, BOOL aAdvertiseDefaultIpv6RouteEnabled,
|
---|
186 | BOOL fNeedDhcpServer);
|
---|
187 | void i_onNATNetworkPortForward(const Utf8Str &aNetworkName, BOOL create, BOOL fIpv6,
|
---|
188 | const Utf8Str &aRuleName, NATProtocol_T proto,
|
---|
189 | const Utf8Str &aHostIp, LONG aHostPort,
|
---|
190 | const Utf8Str &aGuestIp, LONG aGuestPort);
|
---|
191 | void i_onHostNameResolutionConfigurationChange();
|
---|
192 |
|
---|
193 | int i_natNetworkRefInc(const Utf8Str &aNetworkName);
|
---|
194 | int i_natNetworkRefDec(const Utf8Str &aNetworkName);
|
---|
195 |
|
---|
196 | RWLockHandle *i_getNatNetLock() const;
|
---|
197 | bool i_isNatNetStarted(const Utf8Str &aNetworkName) const;
|
---|
198 |
|
---|
199 | void i_onCloudProviderListChanged(BOOL aRegistered);
|
---|
200 | void i_onCloudProviderRegistered(const Utf8Str &aProviderId, BOOL aRegistered);
|
---|
201 | void i_onCloudProviderUninstall(const Utf8Str &aProviderId);
|
---|
202 |
|
---|
203 | void i_onProgressCreated(const Guid &aId, BOOL aCreated);
|
---|
204 |
|
---|
205 | void i_onLanguageChanged(const Utf8Str &aLanguageId);
|
---|
206 |
|
---|
207 | #ifdef VBOX_WITH_CLOUD_NET
|
---|
208 | HRESULT i_findCloudNetworkByName(const com::Utf8Str &aNetworkName,
|
---|
209 | ComObjPtr<CloudNetwork> *aNetwork = NULL);
|
---|
210 | HRESULT i_getEventSource(ComPtr<IEventSource>& aSource);
|
---|
211 | #endif /* VBOX_WITH_CLOUD_NET */
|
---|
212 |
|
---|
213 | ComObjPtr<GuestOSType> i_getUnknownOSType();
|
---|
214 |
|
---|
215 | void i_getOpenedMachines(SessionMachinesList &aMachines,
|
---|
216 | InternalControlList *aControls = NULL);
|
---|
217 | MachinesOList &i_getMachinesList();
|
---|
218 |
|
---|
219 | HRESULT i_findMachine(const Guid &aId,
|
---|
220 | bool fPermitInaccessible,
|
---|
221 | bool aSetError,
|
---|
222 | ComObjPtr<Machine> *aMachine = NULL);
|
---|
223 |
|
---|
224 | HRESULT i_findMachineByName(const Utf8Str &aName,
|
---|
225 | bool aSetError,
|
---|
226 | ComObjPtr<Machine> *aMachine = NULL);
|
---|
227 |
|
---|
228 | HRESULT i_validateMachineGroup(const com::Utf8Str &aGroup, bool fPrimary);
|
---|
229 | HRESULT i_convertMachineGroups(const std::vector<com::Utf8Str> aMachineGroups, StringsList *pllMachineGroups);
|
---|
230 |
|
---|
231 | HRESULT i_findHardDiskById(const Guid &id,
|
---|
232 | bool aSetError,
|
---|
233 | ComObjPtr<Medium> *aHardDisk = NULL);
|
---|
234 | HRESULT i_findHardDiskByLocation(const Utf8Str &strLocation,
|
---|
235 | bool aSetError,
|
---|
236 | ComObjPtr<Medium> *aHardDisk = NULL);
|
---|
237 | HRESULT i_findDVDOrFloppyImage(DeviceType_T mediumType,
|
---|
238 | const Guid *aId,
|
---|
239 | const Utf8Str &aLocation,
|
---|
240 | bool aSetError,
|
---|
241 | ComObjPtr<Medium> *aImage = NULL);
|
---|
242 | HRESULT i_findRemoveableMedium(DeviceType_T mediumType,
|
---|
243 | const Guid &uuid,
|
---|
244 | bool fRefresh,
|
---|
245 | bool aSetError,
|
---|
246 | ComObjPtr<Medium> &pMedium);
|
---|
247 |
|
---|
248 | HRESULT i_findGuestOSType(const Utf8Str &strOSType,
|
---|
249 | ComObjPtr<GuestOSType> &guestOSType);
|
---|
250 |
|
---|
251 | const Guid &i_getGlobalRegistryId() const;
|
---|
252 |
|
---|
253 | const ComObjPtr<Host> &i_host() const;
|
---|
254 | SystemProperties *i_getSystemProperties() const;
|
---|
255 | CloudProviderManager *i_getCloudProviderManager() const;
|
---|
256 | #ifdef VBOX_WITH_EXTPACK
|
---|
257 | ExtPackManager *i_getExtPackManager() const;
|
---|
258 | #endif
|
---|
259 | #ifdef VBOX_WITH_RESOURCE_USAGE_API
|
---|
260 | const ComObjPtr<PerformanceCollector> &i_performanceCollector() const;
|
---|
261 | #endif /* VBOX_WITH_RESOURCE_USAGE_API */
|
---|
262 |
|
---|
263 | void i_getDefaultMachineFolder(Utf8Str &str) const;
|
---|
264 | void i_getDefaultHardDiskFormat(Utf8Str &str) const;
|
---|
265 |
|
---|
266 | /** Returns the VirtualBox home directory */
|
---|
267 | const Utf8Str &i_homeDir() const;
|
---|
268 | int i_calculateFullPath(const Utf8Str &strPath, Utf8Str &aResult);
|
---|
269 | void i_copyPathRelativeToConfig(const Utf8Str &strSource, Utf8Str &strTarget);
|
---|
270 | HRESULT i_registerMedium(const ComObjPtr<Medium> &pMedium, ComObjPtr<Medium> *ppMedium,
|
---|
271 | AutoWriteLock &mediaTreeLock, bool fCalledFromMediumInit = false);
|
---|
272 | HRESULT i_unregisterMedium(Medium *pMedium);
|
---|
273 | HRESULT i_unregisterMachineMedia(const Guid &id);
|
---|
274 | HRESULT i_unregisterMachine(Machine *pMachine, CleanupMode_T aCleanupMode, const Guid &id);
|
---|
275 | void i_rememberMachineNameChangeForMedia(const Utf8Str &strOldConfigDir,
|
---|
276 | const Utf8Str &strNewConfigDir);
|
---|
277 | void i_saveMediaRegistry(settings::MediaRegistry &mediaRegistry,
|
---|
278 | const Guid &uuidRegistry,
|
---|
279 | const Utf8Str &strMachineFolder);
|
---|
280 | HRESULT i_saveSettings();
|
---|
281 | void i_markRegistryModified(const Guid &uuid);
|
---|
282 | void i_unmarkRegistryModified(const Guid &uuid);
|
---|
283 | void i_saveModifiedRegistries();
|
---|
284 | static const com::Utf8Str &i_getVersionNormalized();
|
---|
285 | static HRESULT i_ensureFilePathExists(const Utf8Str &strFileName, bool fCreate);
|
---|
286 | const Utf8Str& i_settingsFilePath();
|
---|
287 | AutostartDb* i_getAutostartDb() const;
|
---|
288 | RWLockHandle& i_getMachinesListLockHandle();
|
---|
289 | RWLockHandle& i_getMediaTreeLockHandle();
|
---|
290 | int i_encryptSetting(const Utf8Str &aPlaintext, Utf8Str *aCiphertext);
|
---|
291 | int i_decryptSetting(Utf8Str *aPlaintext, const Utf8Str &aCiphertext);
|
---|
292 | void i_storeSettingsKey(const Utf8Str &aKey);
|
---|
293 | bool i_isMediaUuidInUse(const Guid &aId, DeviceType_T deviceType);
|
---|
294 |
|
---|
295 |
|
---|
296 |
|
---|
297 | private:
|
---|
298 | class ClientWatcher;
|
---|
299 |
|
---|
300 | // wrapped IVirtualBox properties
|
---|
301 | HRESULT getVersion(com::Utf8Str &aVersion);
|
---|
302 | HRESULT getVersionNormalized(com::Utf8Str &aVersionNormalized);
|
---|
303 | HRESULT getRevision(ULONG *aRevision);
|
---|
304 | HRESULT getPackageType(com::Utf8Str &aPackageType);
|
---|
305 | HRESULT getAPIVersion(com::Utf8Str &aAPIVersion);
|
---|
306 | HRESULT getAPIRevision(LONG64 *aAPIRevision);
|
---|
307 | HRESULT getHomeFolder(com::Utf8Str &aHomeFolder);
|
---|
308 | HRESULT getSettingsFilePath(com::Utf8Str &aSettingsFilePath);
|
---|
309 | HRESULT getHost(ComPtr<IHost> &aHost);
|
---|
310 | HRESULT getSystemProperties(ComPtr<ISystemProperties> &aSystemProperties);
|
---|
311 | HRESULT getMachines(std::vector<ComPtr<IMachine> > &aMachines);
|
---|
312 | HRESULT getMachineGroups(std::vector<com::Utf8Str> &aMachineGroups);
|
---|
313 | HRESULT getHardDisks(std::vector<ComPtr<IMedium> > &aHardDisks);
|
---|
314 | HRESULT getDVDImages(std::vector<ComPtr<IMedium> > &aDVDImages);
|
---|
315 | HRESULT getFloppyImages(std::vector<ComPtr<IMedium> > &aFloppyImages);
|
---|
316 | HRESULT getProgressOperations(std::vector<ComPtr<IProgress> > &aProgressOperations);
|
---|
317 | HRESULT getGuestOSTypes(std::vector<ComPtr<IGuestOSType> > &aGuestOSTypes);
|
---|
318 | HRESULT getSharedFolders(std::vector<ComPtr<ISharedFolder> > &aSharedFolders);
|
---|
319 | HRESULT getPerformanceCollector(ComPtr<IPerformanceCollector> &aPerformanceCollector);
|
---|
320 | HRESULT getDHCPServers(std::vector<ComPtr<IDHCPServer> > &aDHCPServers);
|
---|
321 | HRESULT getNATNetworks(std::vector<ComPtr<INATNetwork> > &aNATNetworks);
|
---|
322 | HRESULT getEventSource(ComPtr<IEventSource> &aEventSource);
|
---|
323 | HRESULT getExtensionPackManager(ComPtr<IExtPackManager> &aExtensionPackManager);
|
---|
324 | HRESULT getHostOnlyNetworks(std::vector<ComPtr<IHostOnlyNetwork> > &aHostOnlyNetworks);
|
---|
325 | HRESULT getInternalNetworks(std::vector<com::Utf8Str> &aInternalNetworks);
|
---|
326 | HRESULT getGenericNetworkDrivers(std::vector<com::Utf8Str> &aGenericNetworkDrivers);
|
---|
327 | HRESULT getCloudNetworks(std::vector<ComPtr<ICloudNetwork> > &aCloudNetworks);
|
---|
328 | HRESULT getCloudProviderManager(ComPtr<ICloudProviderManager> &aCloudProviderManager);
|
---|
329 |
|
---|
330 | // wrapped IVirtualBox methods
|
---|
331 | HRESULT composeMachineFilename(const com::Utf8Str &aName,
|
---|
332 | const com::Utf8Str &aGroup,
|
---|
333 | const com::Utf8Str &aCreateFlags,
|
---|
334 | const com::Utf8Str &aBaseFolder,
|
---|
335 | com::Utf8Str &aFile);
|
---|
336 | HRESULT createMachine(const com::Utf8Str &aSettingsFile,
|
---|
337 | const com::Utf8Str &aName,
|
---|
338 | const std::vector<com::Utf8Str> &aGroups,
|
---|
339 | const com::Utf8Str &aOsTypeId,
|
---|
340 | const com::Utf8Str &aFlags,
|
---|
341 | const com::Utf8Str &aCipher,
|
---|
342 | const com::Utf8Str &aPasswordId,
|
---|
343 | const com::Utf8Str &aPassword,
|
---|
344 | ComPtr<IMachine> &aMachine);
|
---|
345 | HRESULT openMachine(const com::Utf8Str &aSettingsFile,
|
---|
346 | const com::Utf8Str &aPassword,
|
---|
347 | ComPtr<IMachine> &aMachine);
|
---|
348 | HRESULT registerMachine(const ComPtr<IMachine> &aMachine);
|
---|
349 | HRESULT findMachine(const com::Utf8Str &aNameOrId,
|
---|
350 | ComPtr<IMachine> &aMachine);
|
---|
351 | HRESULT getMachinesByGroups(const std::vector<com::Utf8Str> &aGroups,
|
---|
352 | std::vector<ComPtr<IMachine> > &aMachines);
|
---|
353 | HRESULT getMachineStates(const std::vector<ComPtr<IMachine> > &aMachines,
|
---|
354 | std::vector<MachineState_T> &aStates);
|
---|
355 | HRESULT createAppliance(ComPtr<IAppliance> &aAppliance);
|
---|
356 | HRESULT createUnattendedInstaller(ComPtr<IUnattended> &aUnattended);
|
---|
357 | HRESULT createMedium(const com::Utf8Str &aFormat,
|
---|
358 | const com::Utf8Str &aLocation,
|
---|
359 | AccessMode_T aAccessMode,
|
---|
360 | DeviceType_T aDeviceType,
|
---|
361 | ComPtr<IMedium> &aMedium);
|
---|
362 | HRESULT openMedium(const com::Utf8Str &aLocation,
|
---|
363 | DeviceType_T aDeviceType,
|
---|
364 | AccessMode_T aAccessMode,
|
---|
365 | BOOL aForceNewUuid,
|
---|
366 | ComPtr<IMedium> &aMedium);
|
---|
367 | HRESULT getGuestOSType(const com::Utf8Str &aId,
|
---|
368 | ComPtr<IGuestOSType> &aType);
|
---|
369 | HRESULT createSharedFolder(const com::Utf8Str &aName,
|
---|
370 | const com::Utf8Str &aHostPath,
|
---|
371 | BOOL aWritable,
|
---|
372 | BOOL aAutomount,
|
---|
373 | const com::Utf8Str &aAutoMountPoint);
|
---|
374 | HRESULT removeSharedFolder(const com::Utf8Str &aName);
|
---|
375 | HRESULT getExtraDataKeys(std::vector<com::Utf8Str> &aKeys);
|
---|
376 | HRESULT getExtraData(const com::Utf8Str &aKey,
|
---|
377 | com::Utf8Str &aValue);
|
---|
378 | HRESULT setExtraData(const com::Utf8Str &aKey,
|
---|
379 | const com::Utf8Str &aValue);
|
---|
380 | HRESULT setSettingsSecret(const com::Utf8Str &aPassword);
|
---|
381 | HRESULT createDHCPServer(const com::Utf8Str &aName,
|
---|
382 | ComPtr<IDHCPServer> &aServer);
|
---|
383 | HRESULT findDHCPServerByNetworkName(const com::Utf8Str &aName,
|
---|
384 | ComPtr<IDHCPServer> &aServer);
|
---|
385 | HRESULT removeDHCPServer(const ComPtr<IDHCPServer> &aServer);
|
---|
386 | HRESULT createNATNetwork(const com::Utf8Str &aNetworkName,
|
---|
387 | ComPtr<INATNetwork> &aNetwork);
|
---|
388 | HRESULT findNATNetworkByName(const com::Utf8Str &aNetworkName,
|
---|
389 | ComPtr<INATNetwork> &aNetwork);
|
---|
390 | HRESULT removeNATNetwork(const ComPtr<INATNetwork> &aNetwork);
|
---|
391 | HRESULT createHostOnlyNetwork(const com::Utf8Str &aNetworkName,
|
---|
392 | ComPtr<IHostOnlyNetwork> &aNetwork);
|
---|
393 | HRESULT findHostOnlyNetworkByName(const com::Utf8Str &aNetworkName,
|
---|
394 | ComPtr<IHostOnlyNetwork> &aNetwork);
|
---|
395 | HRESULT findHostOnlyNetworkById(const com::Guid &aId,
|
---|
396 | ComPtr<IHostOnlyNetwork> &aNetwork);
|
---|
397 | HRESULT removeHostOnlyNetwork(const ComPtr<IHostOnlyNetwork> &aNetwork);
|
---|
398 | HRESULT createCloudNetwork(const com::Utf8Str &aNetworkName,
|
---|
399 | ComPtr<ICloudNetwork> &aNetwork);
|
---|
400 | HRESULT findCloudNetworkByName(const com::Utf8Str &aNetworkName,
|
---|
401 | ComPtr<ICloudNetwork> &aNetwork);
|
---|
402 | HRESULT removeCloudNetwork(const ComPtr<ICloudNetwork> &aNetwork);
|
---|
403 | HRESULT checkFirmwarePresent(FirmwareType_T aFirmwareType,
|
---|
404 | const com::Utf8Str &aVersion,
|
---|
405 | com::Utf8Str &aUrl,
|
---|
406 | com::Utf8Str &aFile,
|
---|
407 | BOOL *aResult);
|
---|
408 | HRESULT findProgressById(const com::Guid &aId,
|
---|
409 | ComPtr<IProgress> &aProgressObject);
|
---|
410 |
|
---|
411 | static HRESULT i_setErrorStaticBoth(HRESULT aResultCode, int vrc, const char *aText, ...)
|
---|
412 | {
|
---|
413 | va_list va;
|
---|
414 | va_start (va, aText);
|
---|
415 | HRESULT hrc = setErrorInternalV(aResultCode, getStaticClassIID(), getStaticComponentName(), aText, va, false, true, vrc);
|
---|
416 | va_end(va);
|
---|
417 | return hrc;
|
---|
418 | }
|
---|
419 |
|
---|
420 | HRESULT i_registerMachine(Machine *aMachine);
|
---|
421 | HRESULT i_registerDHCPServer(DHCPServer *aDHCPServer,
|
---|
422 | bool aSaveRegistry = true);
|
---|
423 | HRESULT i_unregisterDHCPServer(DHCPServer *aDHCPServer);
|
---|
424 | HRESULT i_registerNATNetwork(NATNetwork *aNATNetwork,
|
---|
425 | bool aSaveRegistry = true);
|
---|
426 | HRESULT i_unregisterNATNetwork(NATNetwork *aNATNetwork,
|
---|
427 | bool aSaveRegistry = true);
|
---|
428 | HRESULT i_checkMediaForConflicts(const Guid &aId,
|
---|
429 | const Utf8Str &aLocation,
|
---|
430 | Utf8Str &aConflictType,
|
---|
431 | ComObjPtr<Medium> *pDupMedium);
|
---|
432 | int i_decryptSettings();
|
---|
433 | int i_decryptMediumSettings(Medium *pMedium);
|
---|
434 | int i_decryptSettingBytes(uint8_t *aPlaintext,
|
---|
435 | const uint8_t *aCiphertext,
|
---|
436 | size_t aCiphertextSize) const;
|
---|
437 | int i_encryptSettingBytes(const uint8_t *aPlaintext,
|
---|
438 | uint8_t *aCiphertext,
|
---|
439 | size_t aPlaintextSize,
|
---|
440 | size_t aCiphertextSize) const;
|
---|
441 | void i_reportDriverVersions(void);
|
---|
442 |
|
---|
443 | struct Data; // opaque data structure, defined in VirtualBoxImpl.cpp
|
---|
444 |
|
---|
445 | Data *m;
|
---|
446 |
|
---|
447 | /* static variables (defined in VirtualBoxImpl.cpp) */
|
---|
448 | static com::Utf8Str sVersion;
|
---|
449 | static com::Utf8Str sVersionNormalized;
|
---|
450 | static ULONG sRevision;
|
---|
451 | static com::Utf8Str sPackageType;
|
---|
452 | static com::Utf8Str sAPIVersion;
|
---|
453 | static std::map<com::Utf8Str, int> sNatNetworkNameToRefCount;
|
---|
454 | static RWLockHandle* spMtxNatNetworkNameToRefCountLock;
|
---|
455 |
|
---|
456 | static DECLCALLBACK(int) AsyncEventHandler(RTTHREAD thread, void *pvUser);
|
---|
457 |
|
---|
458 | #ifdef RT_OS_WINDOWS
|
---|
459 | friend class StartSVCHelperClientData;
|
---|
460 | static void i_SVCHelperClientThreadTask(StartSVCHelperClientData *pTask);
|
---|
461 | #endif
|
---|
462 |
|
---|
463 | #if defined(RT_OS_WINDOWS) && defined(VBOXSVC_WITH_CLIENT_WATCHER)
|
---|
464 | protected:
|
---|
465 | void i_callHook(const char *a_pszFunction) RT_OVERRIDE;
|
---|
466 | bool i_watchClientProcess(RTPROCESS a_pidClient, const char *a_pszFunction);
|
---|
467 | public:
|
---|
468 | static void i_logCaller(const char *a_pszFormat, ...);
|
---|
469 | private:
|
---|
470 |
|
---|
471 | #endif
|
---|
472 | };
|
---|
473 |
|
---|
474 | ////////////////////////////////////////////////////////////////////////////////
|
---|
475 |
|
---|
476 | #endif /* !MAIN_INCLUDED_VirtualBoxImpl_h */
|
---|
477 |
|
---|