GuestImpl.h revision bd0ffc0b469d1642b02d98f8cd729a3427c3731e
0218789478dbe859fd4593d9dd37360750a43893neil_a_wilson * VirtualBox COM class implementation
0218789478dbe859fd4593d9dd37360750a43893neil_a_wilson * Copyright (C) 2006-2007 Oracle Corporation
8cf870d281dc8c242f083d14dfef05f24aa5fceeJnRouvignac * This file is part of VirtualBox Open Source Edition (OSE), as
8cf870d281dc8c242f083d14dfef05f24aa5fceeJnRouvignac * available from http://www.virtualbox.org. This file is free software;
0218789478dbe859fd4593d9dd37360750a43893neil_a_wilson * you can redistribute it and/or modify it under the terms of the GNU
0218789478dbe859fd4593d9dd37360750a43893neil_a_wilson * General Public License (GPL) as published by the Free Software
0218789478dbe859fd4593d9dd37360750a43893neil_a_wilson * Foundation, in version 2 as it comes in the "COPYING" file of the
0218789478dbe859fd4593d9dd37360750a43893neil_a_wilson * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
8cf870d281dc8c242f083d14dfef05f24aa5fceeJnRouvignac * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
0218789478dbe859fd4593d9dd37360750a43893neil_a_wilson# include <VBox/HostServices/GuestControlSvc.h>
0218789478dbe859fd4593d9dd37360750a43893neil_a_wilson public VirtualBoxSupportErrorInfoImpl<Guest, IGuest>,
0218789478dbe859fd4593d9dd37360750a43893neil_a_wilson // public initializer/uninitializer for internal purposes only
0218789478dbe859fd4593d9dd37360750a43893neil_a_wilson // IGuest properties
0218789478dbe859fd4593d9dd37360750a43893neil_a_wilson STDMETHOD(COMGETTER(OSTypeId)) (BSTR *aOSTypeId);
0218789478dbe859fd4593d9dd37360750a43893neil_a_wilson STDMETHOD(COMGETTER(AdditionsActive)) (BOOL *aAdditionsActive);
0218789478dbe859fd4593d9dd37360750a43893neil_a_wilson STDMETHOD(COMGETTER(AdditionsVersion)) (BSTR *aAdditionsVersion);
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift STDMETHOD(COMGETTER(SupportsSeamless)) (BOOL *aSupportsSeamless);
0218789478dbe859fd4593d9dd37360750a43893neil_a_wilson STDMETHOD(COMGETTER(SupportsGraphics)) (BOOL *aSupportsGraphics);
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift STDMETHOD(COMGETTER(SharedPagingEnabled)) (BOOL *enabled);
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift STDMETHOD(COMSETTER(SharedPagingEnabled)) (BOOL enabled);
0218789478dbe859fd4593d9dd37360750a43893neil_a_wilson STDMETHOD(COMGETTER(MemoryBalloonSize)) (ULONG *aMemoryBalloonSize);
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift STDMETHOD(COMSETTER(MemoryBalloonSize)) (ULONG aMemoryBalloonSize);
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift STDMETHOD(COMGETTER(StatisticsUpdateInterval)) (ULONG *aUpdateInterval);
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift STDMETHOD(COMSETTER(StatisticsUpdateInterval)) (ULONG aUpdateInterval);
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift // IGuest methods
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift STDMETHOD(SetCredentials)(IN_BSTR aUserName, IN_BSTR aPassword,
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift IN_BSTR aDomain, BOOL aAllowInteractiveLogon);
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift STDMETHOD(ExecuteProcess)(IN_BSTR aCommand, ULONG aFlags,
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift ComSafeArrayIn(IN_BSTR, aArguments), ComSafeArrayIn(IN_BSTR, aEnvironment),
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift IN_BSTR aStdIn, IN_BSTR aStdOut, IN_BSTR aStdErr,
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift ULONG aTimeoutMS, ULONG *aPID, IProgress **aProgress);
0218789478dbe859fd4593d9dd37360750a43893neil_a_wilson STDMETHOD(GetProcessOutput)(ULONG aPID, ULONG aFlags, ULONG aTimeoutMS, ULONG64 aSize, ComSafeArrayOut(BYTE, aData));
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift STDMETHOD(GetProcessStatus)(ULONG aPID, ULONG *aExitCode, ULONG *aFlags, ULONG *aStatus);
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift STDMETHOD(InternalGetStatistics)(ULONG *aCpuUser, ULONG *aCpuKernel, ULONG *aCpuIdle,
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift ULONG *aMemTotal, ULONG *aMemFree, ULONG *aMemBalloon, ULONG *aMemShared, ULONG *aMemCache,
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift ULONG *aPageTotal, ULONG *aMemAllocTotal, ULONG *aMemFreeTotal, ULONG *aMemBalloonTotal, ULONG *aMemSharedTotal);
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift // public methods that are not in IDL
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift void setAdditionsVersion (Bstr aVersion, VBOXOSTYPE aOsType);
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift void setSupportsSeamless (BOOL aSupportsSeamless);
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift void setSupportsGraphics (BOOL aSupportsGraphics);
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift HRESULT SetStatistic(ULONG aCpuId, GUESTSTATTYPE enmType, ULONG aVal);
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift // for VirtualBoxSupportErrorInfoImpl
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift static const wchar_t *getComponentName() { return L"Guest"; }
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift /** Static callback for handling guest notifications. */
94e4fd51556092f22a664c3c8080cb4688f09140sin static DECLCALLBACK(int) doGuestCtrlNotification(void *pvExtension, uint32_t u32Function, void *pvParms, uint32_t cbParms);
e595b7115481489471844679dc84222cf121a754boli /** Atomic flag whether callback was called. */
e595b7115481489471844679dc84222cf121a754boli volatile bool bCalled;
e595b7115481489471844679dc84222cf121a754boli /** Pointer to user-supplied IProgress. */
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift typedef std::list< CallbackContext > CallbackList;
e595b7115481489471844679dc84222cf121a754boli typedef std::list< CallbackContext >::iterator CallbackListIter;
e595b7115481489471844679dc84222cf121a754boli typedef std::list< CallbackContext >::const_iterator CallbackListIterConst;
e595b7115481489471844679dc84222cf121a754boli typedef std::list< GuestProcess >::iterator GuestProcessIter;
e595b7115481489471844679dc84222cf121a754boli typedef std::list< GuestProcess >::const_iterator GuestProcessIterConst;
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift int prepareExecuteEnv(const char *pszEnv, void **ppvList, uint32_t *pcbList, uint32_t *pcEnv);
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift /** Handler for guest execution control notifications. */
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift int notifyCtrlExec(uint32_t u32Function, PHOSTEXECCALLBACKDATA pData);
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift int notifyCtrlExecOut(uint32_t u32Function, PHOSTEXECOUTCALLBACKDATA pData);
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift CallbackListIter getCtrlCallbackContextByID(uint32_t u32ContextID);
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift GuestProcessIter getProcessByPID(uint32_t u32PID);
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift void destroyCtrlCallbackContext(CallbackListIter it);
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift uint32_t addCtrlCallbackContext(eVBoxGuestCtrlCallbackType enmType, void *pvData, uint32_t cbData, Progress* pProgress);
0218789478dbe859fd4593d9dd37360750a43893neil_a_wilson Data() : mAdditionsActive (FALSE), mSupportsSeamless (FALSE),
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift /** General extension callback for guest control. */
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift#endif // ____H_GUESTIMPL
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift/* vi: set tabstop=4 shiftwidth=4 expandtab: */