GuestImpl.h revision 5933e6056ecf92c059bed82aca44cda9e9fd1a18
/** @file
* VirtualBox COM class implementation
*/
/*
* Copyright (C) 2006-2011 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
#ifndef ____H_GUESTIMPL
#define ____H_GUESTIMPL
#include "VirtualBoxBase.h"
#include "AdditionsFacilityImpl.h"
#include "GuestCtrlImplPrivate.h"
#include "HGCM.h"
#ifdef VBOX_WITH_GUEST_CONTROL
#endif
typedef enum
{
#ifdef VBOX_WITH_GUEST_CONTROL
#endif
{
void FinalRelease();
// Public initializer/uninitializer for internal purposes only
void uninit();
// IGuest properties
// IGuest methods
STDMETHOD(GetFacilityStatus)(AdditionsFacilityType_T aType, LONG64 *aTimestamp, AdditionsFacilityStatus_T *aStatus);
// Process execution
STDMETHOD(GetProcessOutput)(ULONG aPID, ULONG aFlags, ULONG aTimeoutMS, LONG64 aSize, ComSafeArrayOut(BYTE, aData));
STDMETHOD(SetProcessInput)(ULONG aPID, ULONG aFlags, ULONG aTimeoutMS, ComSafeArrayIn(BYTE, aData), ULONG *aBytesWritten);
STDMETHOD(GetProcessStatus)(ULONG aPID, ULONG *aExitCode, ULONG *aFlags, ExecuteProcessStatus_T *aStatus);
// File copying
STDMETHOD(CopyFromGuest)(IN_BSTR aSource, IN_BSTR aDest, IN_BSTR aUsername, IN_BSTR aPassword, ULONG aFlags, IProgress **aProgress);
STDMETHOD(CopyToGuest)(IN_BSTR aSource, IN_BSTR aDest, IN_BSTR aUsername, IN_BSTR aPassword, ULONG aFlags, IProgress **aProgress);
// Directory handling
STDMETHOD(DirectoryCreate)(IN_BSTR aDirectory, IN_BSTR aUsername, IN_BSTR aPassword, ULONG aMode, ULONG aFlags);
// File handling
// Misc stuff
ULONG *aPageTotal, ULONG *aMemAllocTotal, ULONG *aMemFreeTotal, ULONG *aMemBalloonTotal, ULONG *aMemSharedTotal);
// Public methods that are not in IDL (only called internally).
void setAdditionsStatus(VBoxGuestFacilityType enmFacility, VBoxGuestFacilityStatus enmStatus, ULONG aFlags);
{
return setErrorInternal(aResultCode, getStaticClassIID(), getStaticComponentName(), aText, false, true);
}
# ifdef VBOX_WITH_GUEST_CONTROL
HRESULT executeProcessResult(const char *pszCommand, const char *pszUser, ULONG ulTimeout, PCALLBACKDATAEXECSTATUS pExecStatus, ULONG *puPID);
HRESULT executeWaitForStatusChange(ULONG uPID, ULONG uTimeoutMS, ExecuteProcessStatus_T *pRetStatus, ULONG *puRetExitCode);
HRESULT fileExistsInternal(IN_BSTR aFile, IN_BSTR aUsername, IN_BSTR aPassword, BOOL *aExists, int *pRC);
HRESULT fileQuerySizeInternal(IN_BSTR aFile, IN_BSTR aUsername, IN_BSTR aPassword, LONG64 *aSize, int *pRC);
// Guest control dispatcher.
/** Static callback for handling guest notifications. */
static DECLCALLBACK(int) notifyCtrlDispatcher(void *pvExtension, uint32_t u32Function, void *pvParms, uint32_t cbParms);
// Internal tasks.
//extern struct GuestTask;
# endif
#ifdef VBOX_WITH_GUEST_CONTROL
// Internal guest callback representation.
typedef struct VBOXGUESTCTRL_CALLBACK
{
/** Pointer to user-supplied data. */
void *pvData;
/** Size of user-supplied data. */
/** Pointer to user-supplied IProgress. */
void callbackFreeUserData(void *pvData);
int callbackGetUserData(uint32_t uContextID, eVBoxGuestCtrlCallbackType *pEnmType, void **ppvData, size_t *pcbData);
// Internal guest process representation.
typedef struct VBOXGUESTCTRL_PROCESS
{
int processAdd(uint32_t u32PID, ExecuteProcessStatus_T enmStatus, uint32_t uExitCode, uint32_t uFlags);
int processSetStatus(uint32_t u32PID, ExecuteProcessStatus_T enmStatus, uint32_t uExitCode, uint32_t uFlags);
// Internal guest directory representation.
typedef struct VBOXGUESTCTRL_DIRECTORY
{
char *mpszDirectory;
char *mpszFilter;
/** Associated PID of started vbox_ls tool. */
#if 0
/** Next enetry in our stream objects vector
* to process. */
/** The guest stream object containing all */
#endif
int directoryCreateHandle(ULONG *puHandle, ULONG uPID, const char *pszDirectory, const char *pszFilter, ULONG uFlags);
// Utility functions.
/*
* Handler for guest execution control notifications.
*/
# endif
typedef std::map< AdditionsFacilityType_T, ComObjPtr<AdditionsFacility> >::iterator FacilityMapIter;
typedef std::map< AdditionsFacilityType_T, ComObjPtr<AdditionsFacility> >::const_iterator FacilityMapIterConst;
struct Data
{
};
# ifdef VBOX_WITH_GUEST_CONTROL
/** General extension callback for guest control. */
/** Next upcoming context ID. */
volatile uint32_t mNextContextID;
/** Next upcoming directory handle ID. */
volatile uint32_t mNextDirectoryID;
# endif
};
#endif // ____H_GUESTIMPL
/* vi: set tabstop=4 shiftwidth=4 expandtab: */