76
75
// IGuest properties
77
76
STDMETHOD(COMGETTER(OSTypeId)) (BSTR *aOSTypeId);
79
/** @todo Will replace old AdditionsActive call. */
80
STDMETHOD(COMGETTER(AdditionsActive)) (ULONG aLevel, BOOL *aAdditionsActive);
82
STDMETHOD(COMGETTER(AdditionsActive)) (BOOL *aAdditionsActive);
84
/** @todo Will replace AdditionsVersion to be more clear. */
85
STDMETHOD(COMGETTER(AdditionsAPIVersion)) (BSTR *aAdditionsVersion);
77
STDMETHOD(COMGETTER(AdditionsRunLevel)) (AdditionsRunLevelType_T *aRunLevel);
87
78
STDMETHOD(COMGETTER(AdditionsVersion)) (BSTR *aAdditionsVersion);
79
/** @todo Remove later by replacing it by AdditionsFeatureAvailable(). */
89
80
STDMETHOD(COMGETTER(SupportsSeamless)) (BOOL *aSupportsSeamless);
90
81
STDMETHOD(COMGETTER(SupportsGraphics)) (BOOL *aSupportsGraphics);
92
83
/** @todo Will replace SupportsSeamless, SupportsGraphics, ... */
93
STDMETHOD(COMGETTER(AdditionsFeatureAvailable)) (ULONG64 aFeature, BOOL *aActive, BOOL *aAvailable);
84
STDMETHOD(COMGETTER(AdditionsFeatureAvailable)) (LONG64 aFeature, BOOL *aActive, BOOL *aAvailable);
95
86
STDMETHOD(COMGETTER(MemoryBalloonSize)) (ULONG *aMemoryBalloonSize);
96
87
STDMETHOD(COMSETTER(MemoryBalloonSize)) (ULONG aMemoryBalloonSize);
97
STDMETHOD(COMGETTER(PageFusionEnabled)) (BOOL *aPageFusionEnabled);
98
STDMETHOD(COMSETTER(PageFusionEnabled)) (BOOL aPageFusionEnabled);
99
88
STDMETHOD(COMGETTER(StatisticsUpdateInterval)) (ULONG *aUpdateInterval);
100
89
STDMETHOD(COMSETTER(StatisticsUpdateInterval)) (ULONG aUpdateInterval);
92
STDMETHOD(GetAdditionsStatus)(AdditionsRunLevelType_T aLevel, BOOL *aActive);
103
93
STDMETHOD(SetCredentials)(IN_BSTR aUserName, IN_BSTR aPassword,
104
94
IN_BSTR aDomain, BOOL aAllowInteractiveLogon);
105
95
STDMETHOD(ExecuteProcess)(IN_BSTR aCommand, ULONG aFlags,
106
96
ComSafeArrayIn(IN_BSTR, aArguments), ComSafeArrayIn(IN_BSTR, aEnvironment),
107
97
IN_BSTR aUserName, IN_BSTR aPassword,
108
98
ULONG aTimeoutMS, ULONG *aPID, IProgress **aProgress);
109
STDMETHOD(GetProcessOutput)(ULONG aPID, ULONG aFlags, ULONG aTimeoutMS, ULONG64 aSize, ComSafeArrayOut(BYTE, aData));
99
STDMETHOD(GetProcessOutput)(ULONG aPID, ULONG aFlags, ULONG aTimeoutMS, LONG64 aSize, ComSafeArrayOut(BYTE, aData));
100
STDMETHOD(SetProcessInput)(ULONG aPID, ULONG aFlags, ULONG aTimeoutMS, ComSafeArrayIn(BYTE, aData), ULONG *aBytesWritten);
110
101
STDMETHOD(GetProcessStatus)(ULONG aPID, ULONG *aExitCode, ULONG *aFlags, ULONG *aStatus);
102
STDMETHOD(CopyToGuest)(IN_BSTR aSource, IN_BSTR aDest, IN_BSTR aUserName, IN_BSTR aPassword, ULONG aFlags, IProgress **aProgress);
103
STDMETHOD(CreateDirectory)(IN_BSTR aDirectory, IN_BSTR aUserName, IN_BSTR aPassword, ULONG aMode, ULONG aFlags, IProgress **aProgress);
111
104
STDMETHOD(InternalGetStatistics)(ULONG *aCpuUser, ULONG *aCpuKernel, ULONG *aCpuIdle,
112
105
ULONG *aMemTotal, ULONG *aMemFree, ULONG *aMemBalloon, ULONG *aMemShared, ULONG *aMemCache,
113
106
ULONG *aPageTotal, ULONG *aMemAllocTotal, ULONG *aMemFreeTotal, ULONG *aMemBalloonTotal, ULONG *aMemSharedTotal);
107
STDMETHOD(UpdateGuestAdditions)(IN_BSTR aSource, ULONG aFlags, IProgress **aProgress);
115
109
// Public methods that are not in IDL (only called internally).
116
void setAdditionsInfo(Bstr aVersion, VBOXOSTYPE aOsType);
110
HRESULT executeProcessInternal(IN_BSTR aCommand, ULONG aFlags,
111
ComSafeArrayIn(IN_BSTR, aArguments), ComSafeArrayIn(IN_BSTR, aEnvironment),
112
IN_BSTR aUserName, IN_BSTR aPassword,
113
ULONG aTimeoutMS, ULONG *aPID, IProgress **aProgress, int *pRC);
114
HRESULT createDirectoryInternal(IN_BSTR aDirectory, IN_BSTR aUserName, IN_BSTR aPassword,
115
ULONG aMode, ULONG aFlags, IProgress **aProgress, int *pRC);
116
void setAdditionsInfo(Bstr aInterfaceVersion, VBOXOSTYPE aOsType);
117
void setAdditionsInfo2(Bstr aAdditionsVersion, Bstr aVersionName, Bstr aRevision);
117
118
void setAdditionsStatus(VBoxGuestStatusFacility Facility, VBoxGuestStatusCurrent Status, ULONG ulFlags);
118
void setSupportedFeatures(ULONG64 ulCaps, ULONG64 ulActive);
119
void setSupportedFeatures(uint32_t fCaps, uint32_t fActive);
119
120
HRESULT setStatistic(ULONG aCpuId, GUESTSTATTYPE enmType, ULONG aVal);
121
// for VirtualBoxSupportErrorInfoImpl
122
static const wchar_t *getComponentName() { return L"Guest"; }
121
BOOL isPageFusionEnabled();
124
122
# ifdef VBOX_WITH_GUEST_CONTROL
125
123
/** Static callback for handling guest notifications. */
126
124
static DECLCALLBACK(int) doGuestCtrlNotification(void *pvExtension, uint32_t u32Function, void *pvParms, uint32_t cbParms);
126
static HRESULT setErrorStatic(HRESULT aResultCode,
127
const Utf8Str &aText)
129
return setErrorInternal(aResultCode, getStaticClassIID(), getStaticComponentName(), aText, false, true);
131
# ifdef VBOX_WITH_GUEST_CONTROL
135
struct TaskGuest; /* Worker thread helper. */
136
#ifdef VBOX_WITH_GUEST_CONTROL
137
HRESULT taskCopyFile(TaskGuest *aTask);
138
HRESULT taskUpdateGuestAdditions(TaskGuest *aTask);
132
140
struct CallbackContext
134
142
eVBoxGuestCtrlCallbackType mType;
135
/** Pointer to user-supplied data. */
143
/** Pointer to user-supplied data. */
137
145
/** Size of user-supplied data. */
159
167
typedef std::map< uint32_t, GuestProcess >::iterator GuestProcessMapIter;
160
168
typedef std::map< uint32_t, GuestProcess >::const_iterator GuestProcessMapIterConst;
170
int directoryEntryAppend(const char *pszPath, PRTLISTNODE pList);
171
int directoryRead(const char *pszDirectory, const char *pszFilter, ULONG uFlags, ULONG *pcObjects, PRTLISTNODE pList);
162
173
int prepareExecuteEnv(const char *pszEnv, void **ppvList, uint32_t *pcbList, uint32_t *pcEnv);
163
174
/** Handler for guest execution control notifications. */
164
175
int notifyCtrlClientDisconnected(uint32_t u32Function, PCALLBACKDATACLIENTDISCONNECTED pData);
165
176
int notifyCtrlExecStatus(uint32_t u32Function, PCALLBACKDATAEXECSTATUS pData);
166
177
int notifyCtrlExecOut(uint32_t u32Function, PCALLBACKDATAEXECOUT pData);
178
int notifyCtrlExecInStatus(uint32_t u32Function, PCALLBACKDATAEXECINSTATUS pData);
167
179
CallbackMapIter getCtrlCallbackContextByID(uint32_t u32ContextID);
168
180
GuestProcessMapIter getProcessByPID(uint32_t u32PID);
181
void notifyCtrlCallbackContext(Guest::CallbackMapIter it, const char *pszText);
169
182
void destroyCtrlCallbackContext(CallbackMapIter it);
170
183
uint32_t addCtrlCallbackContext(eVBoxGuestCtrlCallbackType enmType, void *pvData, uint32_t cbData, Progress* pProgress);
184
HRESULT waitForProcessStatusChange(ULONG uPID, ULONG *puRetStatus, ULONG *puRetExitCode, ULONG uTimeoutMS);
175
Data() : mAdditionsActive (FALSE), mSupportsSeamless (FALSE),
189
Data() : mAdditionsRunLevel (AdditionsRunLevelType_None),
190
mSupportsSeamless (FALSE),
176
191
mSupportsGraphics (FALSE) {}
179
BOOL mAdditionsActive;
180
Bstr mAdditionsVersion;
181
BOOL mSupportsSeamless;
182
BOOL mSupportsGraphics;
194
AdditionsRunLevelType_T mAdditionsRunLevel;
195
Bstr mAdditionsVersion;
196
Bstr mInterfaceVersion;
197
BOOL mSupportsSeamless;
198
BOOL mSupportsGraphics;
185
201
ULONG mMemoryBalloonSize;