1 | /* $Id: VirtualBoxImpl.h 85121 2020-07-08 19:33:26Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VirtualBox COM class implementation
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006-2020 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 | #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
|
---|
78 | struct SharedClipboardAreaData;
|
---|
79 | #endif
|
---|
80 |
|
---|
81 | class ATL_NO_VTABLE VirtualBox :
|
---|
82 | public VirtualBoxWrap
|
---|
83 | #ifdef RT_OS_WINDOWS
|
---|
84 | , public ATL::CComCoClass<VirtualBox, &CLSID_VirtualBox>
|
---|
85 | #endif
|
---|
86 | {
|
---|
87 |
|
---|
88 | public:
|
---|
89 |
|
---|
90 | typedef std::list<ComPtr<IInternalSessionControl> > InternalControlList;
|
---|
91 | typedef ObjectsList<Machine> MachinesOList;
|
---|
92 |
|
---|
93 | class CallbackEvent;
|
---|
94 | friend class CallbackEvent;
|
---|
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_EMPTY_CTOR_DTOR(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, const 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, const BOOL fRemoved, const BOOL fSilent);
|
---|
165 | void i_onMachineStateChange(const Guid &aId, MachineState_T aState);
|
---|
166 | void i_onMachineDataChange(const Guid &aId, BOOL aTemporary = FALSE);
|
---|
167 | BOOL i_onExtraDataCanChange(const Guid &aId, IN_BSTR aKey, IN_BSTR aValue,
|
---|
168 | Bstr &aError);
|
---|
169 | void i_onExtraDataChange(const Guid &aId, IN_BSTR aKey, IN_BSTR aValue);
|
---|
170 | void i_onMachineRegistered(const Guid &aId, BOOL aRegistered);
|
---|
171 | void i_onSessionStateChange(const Guid &aId, SessionState_T aState);
|
---|
172 |
|
---|
173 | void i_onSnapshotTaken(const Guid &aMachineId, const Guid &aSnapshotId);
|
---|
174 | void i_onSnapshotDeleted(const Guid &aMachineId, const Guid &aSnapshotId);
|
---|
175 | void i_onSnapshotRestored(const Guid &aMachineId, const Guid &aSnapshotId);
|
---|
176 | void i_onSnapshotChange(const Guid &aMachineId, const Guid &aSnapshotId);
|
---|
177 |
|
---|
178 | #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
|
---|
179 | int i_clipboardAreaCreate(ULONG uAreaID, uint32_t fFlags, SharedClipboardAreaData **ppAreaData);
|
---|
180 | int i_clipboardAreaDestroy(SharedClipboardAreaData *pAreaData);
|
---|
181 |
|
---|
182 | HRESULT i_onClipboardAreaRegister(const std::vector<com::Utf8Str> &aParms, ULONG *aID);
|
---|
183 | HRESULT i_onClipboardAreaUnregister(ULONG aID);
|
---|
184 | HRESULT i_onClipboardAreaAttach(ULONG aID);
|
---|
185 | HRESULT i_onClipboardAreaDetach(ULONG aID);
|
---|
186 | ULONG i_onClipboardAreaGetMostRecent(void);
|
---|
187 | ULONG i_onClipboardAreaGetRefCount(ULONG aID);
|
---|
188 | #endif /* VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS */
|
---|
189 |
|
---|
190 | void i_onGuestPropertyChange(const Guid &aMachineId, IN_BSTR aName, IN_BSTR aValue,
|
---|
191 | IN_BSTR aFlags);
|
---|
192 | void i_onNatRedirectChange(const Guid &aMachineId, ULONG ulSlot, bool fRemove, IN_BSTR aName,
|
---|
193 | NATProtocol_T aProto, IN_BSTR aHostIp, uint16_t aHostPort,
|
---|
194 | IN_BSTR aGuestIp, uint16_t aGuestPort);
|
---|
195 | void i_onNATNetworkChange(IN_BSTR aNetworkName);
|
---|
196 | void i_onNATNetworkStartStop(IN_BSTR aNetworkName, BOOL aStart);
|
---|
197 | void i_onNATNetworkSetting(IN_BSTR aNetworkName, BOOL aEnabled, IN_BSTR aNetwork,
|
---|
198 | IN_BSTR aGateway, BOOL aAdvertiseDefaultIpv6RouteEnabled,
|
---|
199 | BOOL fNeedDhcpServer);
|
---|
200 | void i_onNATNetworkPortForward(IN_BSTR aNetworkName, BOOL create, BOOL fIpv6,
|
---|
201 | IN_BSTR aRuleName, NATProtocol_T proto,
|
---|
202 | IN_BSTR aHostIp, LONG aHostPort,
|
---|
203 | IN_BSTR aGuestIp, LONG aGuestPort);
|
---|
204 | void i_onHostNameResolutionConfigurationChange();
|
---|
205 |
|
---|
206 | int i_natNetworkRefInc(const Utf8Str &aNetworkName);
|
---|
207 | int i_natNetworkRefDec(const Utf8Str &aNetworkName);
|
---|
208 |
|
---|
209 | #ifdef VBOX_WITH_CLOUD_NET
|
---|
210 | HRESULT i_findCloudNetworkByName(const com::Utf8Str &aNetworkName,
|
---|
211 | ComObjPtr<CloudNetwork> *aNetwork = NULL);
|
---|
212 | HRESULT i_getEventSource(ComPtr<IEventSource>& aSource);
|
---|
213 | #endif /* VBOX_WITH_CLOUD_NET */
|
---|
214 |
|
---|
215 | ComObjPtr<GuestOSType> i_getUnknownOSType();
|
---|
216 |
|
---|
217 | void i_getOpenedMachines(SessionMachinesList &aMachines,
|
---|
218 | InternalControlList *aControls = NULL);
|
---|
219 | MachinesOList &i_getMachinesList();
|
---|
220 |
|
---|
221 | HRESULT i_findMachine(const Guid &aId,
|
---|
222 | bool fPermitInaccessible,
|
---|
223 | bool aSetError,
|
---|
224 | ComObjPtr<Machine> *aMachine = NULL);
|
---|
225 |
|
---|
226 | HRESULT i_findMachineByName(const Utf8Str &aName,
|
---|
227 | bool aSetError,
|
---|
228 | ComObjPtr<Machine> *aMachine = NULL);
|
---|
229 |
|
---|
230 | HRESULT i_validateMachineGroup(const com::Utf8Str &aGroup, bool fPrimary);
|
---|
231 | HRESULT i_convertMachineGroups(const std::vector<com::Utf8Str> aMachineGroups, StringsList *pllMachineGroups);
|
---|
232 |
|
---|
233 | HRESULT i_findHardDiskById(const Guid &id,
|
---|
234 | bool aSetError,
|
---|
235 | ComObjPtr<Medium> *aHardDisk = NULL);
|
---|
236 | HRESULT i_findHardDiskByLocation(const Utf8Str &strLocation,
|
---|
237 | bool aSetError,
|
---|
238 | ComObjPtr<Medium> *aHardDisk = NULL);
|
---|
239 | HRESULT i_findDVDOrFloppyImage(DeviceType_T mediumType,
|
---|
240 | const Guid *aId,
|
---|
241 | const Utf8Str &aLocation,
|
---|
242 | bool aSetError,
|
---|
243 | ComObjPtr<Medium> *aImage = NULL);
|
---|
244 | HRESULT i_findRemoveableMedium(DeviceType_T mediumType,
|
---|
245 | const Guid &uuid,
|
---|
246 | bool fRefresh,
|
---|
247 | bool aSetError,
|
---|
248 | ComObjPtr<Medium> &pMedium);
|
---|
249 |
|
---|
250 | HRESULT i_findGuestOSType(const Utf8Str &strOSType,
|
---|
251 | ComObjPtr<GuestOSType> &guestOSType);
|
---|
252 |
|
---|
253 | const Guid &i_getGlobalRegistryId() const;
|
---|
254 |
|
---|
255 | const ComObjPtr<Host> &i_host() const;
|
---|
256 | SystemProperties *i_getSystemProperties() const;
|
---|
257 | CloudProviderManager *i_getCloudProviderManager() const;
|
---|
258 | #ifdef VBOX_WITH_EXTPACK
|
---|
259 | ExtPackManager *i_getExtPackManager() const;
|
---|
260 | #endif
|
---|
261 | #ifdef VBOX_WITH_RESOURCE_USAGE_API
|
---|
262 | const ComObjPtr<PerformanceCollector> &i_performanceCollector() const;
|
---|
263 | #endif /* VBOX_WITH_RESOURCE_USAGE_API */
|
---|
264 |
|
---|
265 | void i_getDefaultMachineFolder(Utf8Str &str) const;
|
---|
266 | void i_getDefaultHardDiskFormat(Utf8Str &str) const;
|
---|
267 |
|
---|
268 | /** Returns the VirtualBox home directory */
|
---|
269 | const Utf8Str &i_homeDir() const;
|
---|
270 | int i_calculateFullPath(const Utf8Str &strPath, Utf8Str &aResult);
|
---|
271 | void i_copyPathRelativeToConfig(const Utf8Str &strSource, Utf8Str &strTarget);
|
---|
272 | HRESULT i_registerMedium(const ComObjPtr<Medium> &pMedium, ComObjPtr<Medium> *ppMedium,
|
---|
273 | AutoWriteLock &mediaTreeLock);
|
---|
274 | HRESULT i_unregisterMedium(Medium *pMedium);
|
---|
275 | void i_pushMediumToListWithChildren(MediaList &llMedia, Medium *pMedium);
|
---|
276 | HRESULT i_unregisterMachineMedia(const Guid &id);
|
---|
277 | HRESULT i_unregisterMachine(Machine *pMachine, const Guid &id);
|
---|
278 | void i_rememberMachineNameChangeForMedia(const Utf8Str &strOldConfigDir,
|
---|
279 | const Utf8Str &strNewConfigDir);
|
---|
280 | void i_saveMediaRegistry(settings::MediaRegistry &mediaRegistry,
|
---|
281 | const Guid &uuidRegistry,
|
---|
282 | const Utf8Str &strMachineFolder);
|
---|
283 | HRESULT i_saveSettings();
|
---|
284 | void i_markRegistryModified(const Guid &uuid);
|
---|
285 | void i_unmarkRegistryModified(const Guid &uuid);
|
---|
286 | void i_saveModifiedRegistries();
|
---|
287 | static const com::Utf8Str &i_getVersionNormalized();
|
---|
288 | static HRESULT i_ensureFilePathExists(const Utf8Str &strFileName, bool fCreate);
|
---|
289 | const Utf8Str& i_settingsFilePath();
|
---|
290 | AutostartDb* i_getAutostartDb() const;
|
---|
291 | RWLockHandle& i_getMachinesListLockHandle();
|
---|
292 | RWLockHandle& i_getMediaTreeLockHandle();
|
---|
293 | int i_encryptSetting(const Utf8Str &aPlaintext, Utf8Str *aCiphertext);
|
---|
294 | int i_decryptSetting(Utf8Str *aPlaintext, const Utf8Str &aCiphertext);
|
---|
295 | void i_storeSettingsKey(const Utf8Str &aKey);
|
---|
296 | bool i_isMediaUuidInUse(const Guid &aId, DeviceType_T deviceType);
|
---|
297 |
|
---|
298 |
|
---|
299 |
|
---|
300 | private:
|
---|
301 | class ClientWatcher;
|
---|
302 |
|
---|
303 | // wrapped IVirtualBox properties
|
---|
304 | HRESULT getVersion(com::Utf8Str &aVersion);
|
---|
305 | HRESULT getVersionNormalized(com::Utf8Str &aVersionNormalized);
|
---|
306 | HRESULT getRevision(ULONG *aRevision);
|
---|
307 | HRESULT getPackageType(com::Utf8Str &aPackageType);
|
---|
308 | HRESULT getAPIVersion(com::Utf8Str &aAPIVersion);
|
---|
309 | HRESULT getAPIRevision(LONG64 *aAPIRevision);
|
---|
310 | HRESULT getHomeFolder(com::Utf8Str &aHomeFolder);
|
---|
311 | HRESULT getSettingsFilePath(com::Utf8Str &aSettingsFilePath);
|
---|
312 | HRESULT getHost(ComPtr<IHost> &aHost);
|
---|
313 | HRESULT getSystemProperties(ComPtr<ISystemProperties> &aSystemProperties);
|
---|
314 | HRESULT getMachines(std::vector<ComPtr<IMachine> > &aMachines);
|
---|
315 | HRESULT getMachineGroups(std::vector<com::Utf8Str> &aMachineGroups);
|
---|
316 | HRESULT getHardDisks(std::vector<ComPtr<IMedium> > &aHardDisks);
|
---|
317 | HRESULT getDVDImages(std::vector<ComPtr<IMedium> > &aDVDImages);
|
---|
318 | HRESULT getFloppyImages(std::vector<ComPtr<IMedium> > &aFloppyImages);
|
---|
319 | HRESULT getProgressOperations(std::vector<ComPtr<IProgress> > &aProgressOperations);
|
---|
320 | HRESULT getGuestOSTypes(std::vector<ComPtr<IGuestOSType> > &aGuestOSTypes);
|
---|
321 | HRESULT getSharedFolders(std::vector<ComPtr<ISharedFolder> > &aSharedFolders);
|
---|
322 | HRESULT getPerformanceCollector(ComPtr<IPerformanceCollector> &aPerformanceCollector);
|
---|
323 | HRESULT getDHCPServers(std::vector<ComPtr<IDHCPServer> > &aDHCPServers);
|
---|
324 | HRESULT getNATNetworks(std::vector<ComPtr<INATNetwork> > &aNATNetworks);
|
---|
325 | HRESULT getEventSource(ComPtr<IEventSource> &aEventSource);
|
---|
326 | HRESULT getExtensionPackManager(ComPtr<IExtPackManager> &aExtensionPackManager);
|
---|
327 | HRESULT getInternalNetworks(std::vector<com::Utf8Str> &aInternalNetworks);
|
---|
328 | HRESULT getGenericNetworkDrivers(std::vector<com::Utf8Str> &aGenericNetworkDrivers);
|
---|
329 | HRESULT getCloudNetworks(std::vector<ComPtr<ICloudNetwork> > &aCloudNetworks);
|
---|
330 | HRESULT getCloudProviderManager(ComPtr<ICloudProviderManager> &aCloudProviderManager);
|
---|
331 |
|
---|
332 | // wrapped IVirtualBox methods
|
---|
333 | HRESULT composeMachineFilename(const com::Utf8Str &aName,
|
---|
334 | const com::Utf8Str &aGroup,
|
---|
335 | const com::Utf8Str &aCreateFlags,
|
---|
336 | const com::Utf8Str &aBaseFolder,
|
---|
337 | com::Utf8Str &aFile);
|
---|
338 | HRESULT createMachine(const com::Utf8Str &aSettingsFile,
|
---|
339 | const com::Utf8Str &aName,
|
---|
340 | const std::vector<com::Utf8Str> &aGroups,
|
---|
341 | const com::Utf8Str &aOsTypeId,
|
---|
342 | const com::Utf8Str &aFlags,
|
---|
343 | ComPtr<IMachine> &aMachine);
|
---|
344 | HRESULT openMachine(const com::Utf8Str &aSettingsFile,
|
---|
345 | ComPtr<IMachine> &aMachine);
|
---|
346 | HRESULT registerMachine(const ComPtr<IMachine> &aMachine);
|
---|
347 | HRESULT findMachine(const com::Utf8Str &aNameOrId,
|
---|
348 | ComPtr<IMachine> &aMachine);
|
---|
349 | HRESULT getMachinesByGroups(const std::vector<com::Utf8Str> &aGroups,
|
---|
350 | std::vector<ComPtr<IMachine> > &aMachines);
|
---|
351 | HRESULT getMachineStates(const std::vector<ComPtr<IMachine> > &aMachines,
|
---|
352 | std::vector<MachineState_T> &aStates);
|
---|
353 | HRESULT createAppliance(ComPtr<IAppliance> &aAppliance);
|
---|
354 | HRESULT createUnattendedInstaller(ComPtr<IUnattended> &aUnattended);
|
---|
355 | HRESULT createMedium(const com::Utf8Str &aFormat,
|
---|
356 | const com::Utf8Str &aLocation,
|
---|
357 | AccessMode_T aAccessMode,
|
---|
358 | DeviceType_T aDeviceType,
|
---|
359 | ComPtr<IMedium> &aMedium);
|
---|
360 | HRESULT openMedium(const com::Utf8Str &aLocation,
|
---|
361 | DeviceType_T aDeviceType,
|
---|
362 | AccessMode_T aAccessMode,
|
---|
363 | BOOL aForceNewUuid,
|
---|
364 | ComPtr<IMedium> &aMedium);
|
---|
365 | HRESULT getGuestOSType(const com::Utf8Str &aId,
|
---|
366 | ComPtr<IGuestOSType> &aType);
|
---|
367 | HRESULT createSharedFolder(const com::Utf8Str &aName,
|
---|
368 | const com::Utf8Str &aHostPath,
|
---|
369 | BOOL aWritable,
|
---|
370 | BOOL aAutomount,
|
---|
371 | const com::Utf8Str &aAutoMountPoint);
|
---|
372 | HRESULT removeSharedFolder(const com::Utf8Str &aName);
|
---|
373 | HRESULT getExtraDataKeys(std::vector<com::Utf8Str> &aKeys);
|
---|
374 | HRESULT getExtraData(const com::Utf8Str &aKey,
|
---|
375 | com::Utf8Str &aValue);
|
---|
376 | HRESULT setExtraData(const com::Utf8Str &aKey,
|
---|
377 | const com::Utf8Str &aValue);
|
---|
378 | HRESULT setSettingsSecret(const com::Utf8Str &aPassword);
|
---|
379 | HRESULT createDHCPServer(const com::Utf8Str &aName,
|
---|
380 | ComPtr<IDHCPServer> &aServer);
|
---|
381 | HRESULT findDHCPServerByNetworkName(const com::Utf8Str &aName,
|
---|
382 | ComPtr<IDHCPServer> &aServer);
|
---|
383 | HRESULT removeDHCPServer(const ComPtr<IDHCPServer> &aServer);
|
---|
384 | HRESULT createNATNetwork(const com::Utf8Str &aNetworkName,
|
---|
385 | ComPtr<INATNetwork> &aNetwork);
|
---|
386 | HRESULT findNATNetworkByName(const com::Utf8Str &aNetworkName,
|
---|
387 | ComPtr<INATNetwork> &aNetwork);
|
---|
388 | HRESULT removeNATNetwork(const ComPtr<INATNetwork> &aNetwork);
|
---|
389 | HRESULT createCloudNetwork(const com::Utf8Str &aNetworkName,
|
---|
390 | ComPtr<ICloudNetwork> &aNetwork);
|
---|
391 | HRESULT findCloudNetworkByName(const com::Utf8Str &aNetworkName,
|
---|
392 | ComPtr<ICloudNetwork> &aNetwork);
|
---|
393 | HRESULT removeCloudNetwork(const ComPtr<ICloudNetwork> &aNetwork);
|
---|
394 | HRESULT checkFirmwarePresent(FirmwareType_T aFirmwareType,
|
---|
395 | const com::Utf8Str &aVersion,
|
---|
396 | com::Utf8Str &aUrl,
|
---|
397 | com::Utf8Str &aFile,
|
---|
398 | BOOL *aResult);
|
---|
399 |
|
---|
400 | static HRESULT i_setErrorStaticBoth(HRESULT aResultCode, int vrc, const Utf8Str &aText)
|
---|
401 | {
|
---|
402 | return setErrorInternal(aResultCode, getStaticClassIID(), getStaticComponentName(), aText, false, true, vrc);
|
---|
403 | }
|
---|
404 |
|
---|
405 | HRESULT i_registerMachine(Machine *aMachine);
|
---|
406 | HRESULT i_registerDHCPServer(DHCPServer *aDHCPServer,
|
---|
407 | bool aSaveRegistry = true);
|
---|
408 | HRESULT i_unregisterDHCPServer(DHCPServer *aDHCPServer);
|
---|
409 | HRESULT i_registerNATNetwork(NATNetwork *aNATNetwork,
|
---|
410 | bool aSaveRegistry = true);
|
---|
411 | HRESULT i_unregisterNATNetwork(NATNetwork *aNATNetwork,
|
---|
412 | bool aSaveRegistry = true);
|
---|
413 | HRESULT i_checkMediaForConflicts(const Guid &aId,
|
---|
414 | const Utf8Str &aLocation,
|
---|
415 | Utf8Str &aConflictType,
|
---|
416 | ComObjPtr<Medium> *pDupMedium);
|
---|
417 | int i_decryptSettings();
|
---|
418 | int i_decryptMediumSettings(Medium *pMedium);
|
---|
419 | int i_decryptSettingBytes(uint8_t *aPlaintext,
|
---|
420 | const uint8_t *aCiphertext,
|
---|
421 | size_t aCiphertextSize) const;
|
---|
422 | int i_encryptSettingBytes(const uint8_t *aPlaintext,
|
---|
423 | uint8_t *aCiphertext,
|
---|
424 | size_t aPlaintextSize,
|
---|
425 | size_t aCiphertextSize) const;
|
---|
426 | void i_reportDriverVersions(void);
|
---|
427 |
|
---|
428 | struct Data; // opaque data structure, defined in VirtualBoxImpl.cpp
|
---|
429 |
|
---|
430 | Data *m;
|
---|
431 |
|
---|
432 | /* static variables (defined in VirtualBoxImpl.cpp) */
|
---|
433 | static com::Utf8Str sVersion;
|
---|
434 | static com::Utf8Str sVersionNormalized;
|
---|
435 | static ULONG sRevision;
|
---|
436 | static com::Utf8Str sPackageType;
|
---|
437 | static com::Utf8Str sAPIVersion;
|
---|
438 | static std::map<com::Utf8Str, int> sNatNetworkNameToRefCount;
|
---|
439 | static RWLockHandle* spMtxNatNetworkNameToRefCountLock;
|
---|
440 |
|
---|
441 | static DECLCALLBACK(int) AsyncEventHandler(RTTHREAD thread, void *pvUser);
|
---|
442 |
|
---|
443 | #ifdef RT_OS_WINDOWS
|
---|
444 | friend class StartSVCHelperClientData;
|
---|
445 | static void i_SVCHelperClientThreadTask(StartSVCHelperClientData *pTask);
|
---|
446 | #endif
|
---|
447 |
|
---|
448 | #if defined(RT_OS_WINDOWS) && defined(VBOXSVC_WITH_CLIENT_WATCHER)
|
---|
449 | protected:
|
---|
450 | void i_callHook(const char *a_pszFunction) RT_OVERRIDE;
|
---|
451 | bool i_watchClientProcess(RTPROCESS a_pidClient, const char *a_pszFunction);
|
---|
452 | public:
|
---|
453 | static void i_logCaller(const char *a_pszFormat, ...);
|
---|
454 | private:
|
---|
455 |
|
---|
456 | #endif
|
---|
457 | };
|
---|
458 |
|
---|
459 | ////////////////////////////////////////////////////////////////////////////////
|
---|
460 |
|
---|
461 | #endif /* !MAIN_INCLUDED_VirtualBoxImpl_h */
|
---|
462 |
|
---|