summaryrefslogtreecommitdiff
path: root/src/VBox/Main
diff options
context:
space:
mode:
authorvboxsync <vboxsync@cfe28804-0f27-0410-a406-dd0f0b0b656f>2014-02-26 19:55:39 +0000
committervboxsync <vboxsync@cfe28804-0f27-0410-a406-dd0f0b0b656f>2014-02-26 19:55:39 +0000
commit5bf60971bb5e6c748d554d063f286e4842927990 (patch)
tree883df52427eab784e16b47be7d40d593a7b0f223 /src/VBox/Main
parent824fae800fe9a6339e9b7140004271220a425072 (diff)
downloadVirtualBox-svn-5bf60971bb5e6c748d554d063f286e4842927990.tar.gz
6813 src-client/GuestFileImpl.cpp
git-svn-id: https://www.virtualbox.org/svn/vbox/trunk@50618 cfe28804-0f27-0410-a406-dd0f0b0b656f
Diffstat (limited to 'src/VBox/Main')
-rw-r--r--src/VBox/Main/include/GuestCtrlImplPrivate.h4
-rw-r--r--src/VBox/Main/include/GuestDirectoryImpl.h4
-rw-r--r--src/VBox/Main/include/GuestFileImpl.h105
-rw-r--r--src/VBox/Main/include/GuestProcessImpl.h4
-rw-r--r--src/VBox/Main/src-client/GuestDirectoryImpl.cpp4
-rw-r--r--src/VBox/Main/src-client/GuestFileImpl.cpp253
-rw-r--r--src/VBox/Main/src-client/GuestProcessImpl.cpp4
-rw-r--r--src/VBox/Main/src-client/GuestSessionImpl.cpp24
-rw-r--r--src/VBox/Main/src-client/xpcom/module.cpp2
9 files changed, 168 insertions, 236 deletions
diff --git a/src/VBox/Main/include/GuestCtrlImplPrivate.h b/src/VBox/Main/include/GuestCtrlImplPrivate.h
index bd8a0f477a0..4952f44336a 100644
--- a/src/VBox/Main/include/GuestCtrlImplPrivate.h
+++ b/src/VBox/Main/include/GuestCtrlImplPrivate.h
@@ -641,10 +641,10 @@ public:
protected:
- virtual int onRemove(void) = 0;
+ virtual int i_onRemove(void) = 0;
/** Callback dispatcher -- must be implemented by the actual object. */
- virtual int callbackDispatcher(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb) = 0;
+ virtual int i_callbackDispatcher(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb) = 0;
protected:
diff --git a/src/VBox/Main/include/GuestDirectoryImpl.h b/src/VBox/Main/include/GuestDirectoryImpl.h
index 36ebb247df4..934e8f145f3 100644
--- a/src/VBox/Main/include/GuestDirectoryImpl.h
+++ b/src/VBox/Main/include/GuestDirectoryImpl.h
@@ -47,8 +47,8 @@ public:
public:
/** @name Public internal methods.
* @{ */
- int callbackDispatcher(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb);
- int onRemove(void);
+ int i_callbackDispatcher(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb);
+ int i_onRemove(void);
static Utf8Str i_guestErrorToString(int guestRc);
static HRESULT i_setErrorExternal(VirtualBoxBase *pInterface, int guestRc);
diff --git a/src/VBox/Main/include/GuestFileImpl.h b/src/VBox/Main/include/GuestFileImpl.h
index 853f8b482b9..ff8f565a466 100644
--- a/src/VBox/Main/include/GuestFileImpl.h
+++ b/src/VBox/Main/include/GuestFileImpl.h
@@ -23,6 +23,7 @@
#include "EventImpl.h"
#include "GuestCtrlImplPrivate.h"
+#include "GuestFileWrap.h"
class Console;
class GuestSession;
@@ -32,76 +33,80 @@ class GuestProcess;
* TODO
*/
class ATL_NO_VTABLE GuestFile :
- public VirtualBoxBase,
- public GuestObject,
- VBOX_SCRIPTABLE_IMPL(IGuestFile)
+ public GuestFileWrap,
+ public GuestObject
{
public:
/** @name COM and internal init/term/mapping cruft.
* @{ */
- VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(GuestFile, IGuestFile)
- DECLARE_NOT_AGGREGATABLE(GuestFile)
- DECLARE_PROTECT_FINAL_CONSTRUCT()
- BEGIN_COM_MAP(GuestFile)
- VBOX_DEFAULT_INTERFACE_ENTRIES(IGuestFile)
- COM_INTERFACE_ENTRY(IFile)
- END_COM_MAP()
DECLARE_EMPTY_CTOR_DTOR(GuestFile)
int init(Console *pConsole, GuestSession *pSession, ULONG uFileID, const GuestFileOpenInfo &openInfo);
void uninit(void);
+
HRESULT FinalConstruct(void);
void FinalRelease(void);
/** @} */
- /** @name IFile interface.
- * @{ */
- STDMETHOD(COMGETTER(CreationMode))(ULONG *aCreationMode);
- STDMETHOD(COMGETTER(Disposition))(BSTR *aDisposition);
- STDMETHOD(COMGETTER(EventSource))(IEventSource ** aEventSource);
- STDMETHOD(COMGETTER(FileName))(BSTR *aFileName);
- STDMETHOD(COMGETTER(Id))(ULONG *aID);
- STDMETHOD(COMGETTER(InitialSize))(LONG64 *aInitialSize);
- STDMETHOD(COMGETTER(Offset))(LONG64 *aOffset);
- STDMETHOD(COMGETTER(OpenMode))(BSTR *aOpenMode);
- STDMETHOD(COMGETTER(Status))(FileStatus_T *aStatus);
-
- STDMETHOD(Close)(void);
- STDMETHOD(QueryInfo)(IFsObjInfo **aInfo);
- STDMETHOD(Read)(ULONG aToRead, ULONG aTimeoutMS, ComSafeArrayOut(BYTE, aData));
- STDMETHOD(ReadAt)(LONG64 aOffset, ULONG aToRead, ULONG aTimeoutMS, ComSafeArrayOut(BYTE, aData));
- STDMETHOD(Seek)(LONG64 aOffset, FileSeekType_T aType);
- STDMETHOD(SetACL)(IN_BSTR aACL);
- STDMETHOD(Write)(ComSafeArrayIn(BYTE, aData), ULONG aTimeoutMS, ULONG *aWritten);
- STDMETHOD(WriteAt)(LONG64 aOffset, ComSafeArrayIn(BYTE, aData), ULONG aTimeoutMS, ULONG *aWritten);
- /** @} */
public:
/** @name Public internal methods.
* @{ */
- int callbackDispatcher(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb);
- int closeFile(int *pGuestRc);
- EventSource *getEventSource(void) { return mEventSource; }
- static Utf8Str guestErrorToString(int guestRc);
- int onFileNotify(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCbData);
- int onGuestDisconnected(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCbData);
- int onRemove(void);
- int openFile(uint32_t uTimeoutMS, int *pGuestRc);
- int readData(uint32_t uSize, uint32_t uTimeoutMS, void* pvData, uint32_t cbData, uint32_t* pcbRead);
- int readDataAt(uint64_t uOffset, uint32_t uSize, uint32_t uTimeoutMS, void* pvData, size_t cbData, size_t* pcbRead);
- int seekAt(int64_t iOffset, GUEST_FILE_SEEKTYPE eSeekType, uint32_t uTimeoutMS, uint64_t *puOffset);
- static HRESULT setErrorExternal(VirtualBoxBase *pInterface, int guestRc);
- int setFileStatus(FileStatus_T fileStatus, int fileRc);
- int waitForOffsetChange(GuestWaitEvent *pEvent, uint32_t uTimeoutMS, uint64_t *puOffset);
- int waitForRead(GuestWaitEvent *pEvent, uint32_t uTimeoutMS, void *pvData, size_t cbData, uint32_t *pcbRead);
- int waitForStatusChange(GuestWaitEvent *pEvent, uint32_t uTimeoutMS, FileStatus_T *pFileStatus, int *pGuestRc);
- int waitForWrite(GuestWaitEvent *pEvent, uint32_t uTimeoutMS, uint32_t *pcbWritten);
- int writeData(uint32_t uTimeoutMS, void *pvData, uint32_t cbData, uint32_t *pcbWritten);
- int writeDataAt(uint64_t uOffset, uint32_t uTimeoutMS, void *pvData, uint32_t cbData, uint32_t *pcbWritten);
+ int i_callbackDispatcher(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb);
+ int i_closeFile(int *pGuestRc);
+ EventSource *i_getEventSource(void) { return mEventSource; }
+ static Utf8Str i_guestErrorToString(int guestRc);
+ int i_onFileNotify(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCbData);
+ int i_onGuestDisconnected(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCbData);
+ int i_onRemove(void);
+ int i_openFile(uint32_t uTimeoutMS, int *pGuestRc);
+ int i_readData(uint32_t uSize, uint32_t uTimeoutMS, void* pvData, uint32_t cbData, uint32_t* pcbRead);
+ int i_readDataAt(uint64_t uOffset, uint32_t uSize, uint32_t uTimeoutMS, void* pvData, size_t cbData, size_t* pcbRead);
+ int i_seekAt(int64_t iOffset, GUEST_FILE_SEEKTYPE eSeekType, uint32_t uTimeoutMS, uint64_t *puOffset);
+ static HRESULT i_setErrorExternal(VirtualBoxBase *pInterface, int guestRc);
+ int i_setFileStatus(FileStatus_T fileStatus, int fileRc);
+ int i_waitForOffsetChange(GuestWaitEvent *pEvent, uint32_t uTimeoutMS, uint64_t *puOffset);
+ int i_waitForRead(GuestWaitEvent *pEvent, uint32_t uTimeoutMS, void *pvData, size_t cbData, uint32_t *pcbRead);
+ int i_waitForStatusChange(GuestWaitEvent *pEvent, uint32_t uTimeoutMS, FileStatus_T *pFileStatus, int *pGuestRc);
+ int i_waitForWrite(GuestWaitEvent *pEvent, uint32_t uTimeoutMS, uint32_t *pcbWritten);
+ int i_writeData(uint32_t uTimeoutMS, void *pvData, uint32_t cbData, uint32_t *pcbWritten);
+ int i_writeDataAt(uint64_t uOffset, uint32_t uTimeoutMS, void *pvData, uint32_t cbData, uint32_t *pcbWritten);
/** @} */
private:
+ // Wrapped IGuestFile properties.
+ HRESULT getCreationMode(ULONG *aCreationMode);
+ HRESULT getDisposition(com::Utf8Str &aDisposition);
+ HRESULT getEventSource(ComPtr<IEventSource> &aEventSource);
+ HRESULT getFileName(com::Utf8Str &aFileName);
+ HRESULT getId(ULONG *aId);
+ HRESULT getInitialSize(LONG64 *aInitialSize);
+ HRESULT getOpenMode(com::Utf8Str &aOpenMode);
+ HRESULT getOffset(LONG64 *aOffset);
+ HRESULT getStatus(FileStatus_T *aStatus);
+
+ // Wrapped IGuestFile methods.
+ HRESULT close();
+ HRESULT queryInfo(ComPtr<IFsObjInfo> &aObjInfo);
+ HRESULT read(ULONG aToRead,
+ ULONG aTimeoutMS,
+ std::vector<BYTE> &aData);
+ HRESULT readAt(LONG64 aOffset,
+ ULONG aToRead,
+ ULONG aTimeoutMS,
+ std::vector<BYTE> &aData);
+ HRESULT seek(LONG64 aOffset,
+ FileSeekType_T aWhence);
+ HRESULT setACL(const com::Utf8Str &aAcl);
+ HRESULT write(const std::vector<BYTE> &aData,
+ ULONG aTimeoutMS,
+ ULONG *aWritten);
+ HRESULT writeAt(LONG64 aOffset,
+ const std::vector<BYTE> &aData,
+ ULONG aTimeoutMS,
+ ULONG *aWritten);
+
/** This can safely be used without holding any locks.
* An AutoCaller suffices to prevent it being destroy while in use and
* internally there is a lock providing the necessary serialization. */
diff --git a/src/VBox/Main/include/GuestProcessImpl.h b/src/VBox/Main/include/GuestProcessImpl.h
index 195aefcf26f..42c1f68aca4 100644
--- a/src/VBox/Main/include/GuestProcessImpl.h
+++ b/src/VBox/Main/include/GuestProcessImpl.h
@@ -73,10 +73,10 @@ public:
public:
/** @name Public internal methods.
* @{ */
- int callbackDispatcher(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb);
+ int i_callbackDispatcher(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb);
inline int checkPID(uint32_t uPID);
static Utf8Str guestErrorToString(int guestRc);
- int onRemove(void);
+ int i_onRemove(void);
int readData(uint32_t uHandle, uint32_t uSize, uint32_t uTimeoutMS, void *pvData, size_t cbData, uint32_t *pcbRead, int *pGuestRc);
static HRESULT setErrorExternal(VirtualBoxBase *pInterface, int guestRc);
int startProcess(uint32_t uTimeoutMS, int *pGuestRc);
diff --git a/src/VBox/Main/src-client/GuestDirectoryImpl.cpp b/src/VBox/Main/src-client/GuestDirectoryImpl.cpp
index cac0fba66c6..fdc73707aa9 100644
--- a/src/VBox/Main/src-client/GuestDirectoryImpl.cpp
+++ b/src/VBox/Main/src-client/GuestDirectoryImpl.cpp
@@ -170,7 +170,7 @@ HRESULT GuestDirectory::getFilter(com::Utf8Str &aFilter)
// private methods
/////////////////////////////////////////////////////////////////////////////
-int GuestDirectory::callbackDispatcher(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb)
+int GuestDirectory::i_callbackDispatcher(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb)
{
AssertPtrReturn(pCbCtx, VERR_INVALID_POINTER);
AssertPtrReturn(pSvcCb, VERR_INVALID_POINTER);
@@ -241,7 +241,7 @@ Utf8Str GuestDirectory::i_guestErrorToString(int guestRc)
* Called by IGuestSession right before this directory gets
* removed from the public directory list.
*/
-int GuestDirectory::onRemove(void)
+int GuestDirectory::i_onRemove(void)
{
LogFlowThisFuncEnter();
diff --git a/src/VBox/Main/src-client/GuestFileImpl.cpp b/src/VBox/Main/src-client/GuestFileImpl.cpp
index 7443c593704..7903f6f705a 100644
--- a/src/VBox/Main/src-client/GuestFileImpl.cpp
+++ b/src/VBox/Main/src-client/GuestFileImpl.cpp
@@ -240,16 +240,11 @@ void GuestFile::uninit(void)
// implementation of public getters/setters for attributes
/////////////////////////////////////////////////////////////////////////////
-STDMETHODIMP GuestFile::COMGETTER(CreationMode)(ULONG *aCreationMode)
+HRESULT GuestFile::getCreationMode(ULONG *aCreationMode)
{
#ifndef VBOX_WITH_GUEST_CONTROL
ReturnComNotImplemented();
#else
- AutoCaller autoCaller(this);
- if (FAILED(autoCaller.rc())) return autoCaller.rc();
-
- CheckComArgOutPointerValid(aCreationMode);
-
AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
*aCreationMode = mData.mOpenInfo.mCreationMode;
@@ -258,87 +253,62 @@ STDMETHODIMP GuestFile::COMGETTER(CreationMode)(ULONG *aCreationMode)
#endif /* VBOX_WITH_GUEST_CONTROL */
}
-STDMETHODIMP GuestFile::COMGETTER(Disposition)(BSTR *aDisposition)
+HRESULT GuestFile::getDisposition(com::Utf8Str &aDisposition)
{
#ifndef VBOX_WITH_GUEST_CONTROL
ReturnComNotImplemented();
#else
- AutoCaller autoCaller(this);
- if (FAILED(autoCaller.rc())) return autoCaller.rc();
-
- CheckComArgOutPointerValid(aDisposition);
-
AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
- mData.mOpenInfo.mDisposition.cloneTo(aDisposition);
+ aDisposition = mData.mOpenInfo.mDisposition;
return S_OK;
#endif /* VBOX_WITH_GUEST_CONTROL */
}
-STDMETHODIMP GuestFile::COMGETTER(EventSource)(IEventSource ** aEventSource)
+HRESULT GuestFile::getEventSource(ComPtr<IEventSource> &aEventSource)
{
#ifndef VBOX_WITH_GUEST_CONTROL
ReturnComNotImplemented();
#else
- CheckComArgOutPointerValid(aEventSource);
-
- AutoCaller autoCaller(this);
- if (FAILED(autoCaller.rc())) return autoCaller.rc();
-
/* No need to lock - lifetime constant. */
- mEventSource.queryInterfaceTo(aEventSource);
+ mEventSource.queryInterfaceTo(aEventSource.asOutParam());
return S_OK;
#endif /* VBOX_WITH_GUEST_CONTROL */
}
-STDMETHODIMP GuestFile::COMGETTER(FileName)(BSTR *aFileName)
+HRESULT GuestFile::getFileName(com::Utf8Str &aFileName)
{
#ifndef VBOX_WITH_GUEST_CONTROL
ReturnComNotImplemented();
#else
- AutoCaller autoCaller(this);
- if (FAILED(autoCaller.rc())) return autoCaller.rc();
-
- CheckComArgOutPointerValid(aFileName);
-
AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
- mData.mOpenInfo.mFileName.cloneTo(aFileName);
+ aFileName = mData.mOpenInfo.mFileName;
return S_OK;
#endif /* VBOX_WITH_GUEST_CONTROL */
}
-STDMETHODIMP GuestFile::COMGETTER(Id)(ULONG *aID)
+HRESULT GuestFile::getId(ULONG *aId)
{
#ifndef VBOX_WITH_GUEST_CONTROL
ReturnComNotImplemented();
#else
- AutoCaller autoCaller(this);
- if (FAILED(autoCaller.rc())) return autoCaller.rc();
-
- CheckComArgOutPointerValid(aID);
-
AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
- *aID = mData.mID;
+ *aId = mData.mID;
return S_OK;
#endif /* VBOX_WITH_GUEST_CONTROL */
}
-STDMETHODIMP GuestFile::COMGETTER(InitialSize)(LONG64 *aInitialSize)
+HRESULT GuestFile::getInitialSize(LONG64 *aInitialSize)
{
#ifndef VBOX_WITH_GUEST_CONTROL
ReturnComNotImplemented();
#else
- AutoCaller autoCaller(this);
- if (FAILED(autoCaller.rc())) return autoCaller.rc();
-
- CheckComArgOutPointerValid(aInitialSize);
-
AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
*aInitialSize = mData.mInitialSize;
@@ -347,16 +317,11 @@ STDMETHODIMP GuestFile::COMGETTER(InitialSize)(LONG64 *aInitialSize)
#endif /* VBOX_WITH_GUEST_CONTROL */
}
-STDMETHODIMP GuestFile::COMGETTER(Offset)(LONG64 *aOffset)
+HRESULT GuestFile::getOffset(LONG64 *aOffset)
{
#ifndef VBOX_WITH_GUEST_CONTROL
ReturnComNotImplemented();
#else
- AutoCaller autoCaller(this);
- if (FAILED(autoCaller.rc())) return autoCaller.rc();
-
- CheckComArgOutPointerValid(aOffset);
-
AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
*aOffset = mData.mOffCurrent;
@@ -365,34 +330,26 @@ STDMETHODIMP GuestFile::COMGETTER(Offset)(LONG64 *aOffset)
#endif /* VBOX_WITH_GUEST_CONTROL */
}
-STDMETHODIMP GuestFile::COMGETTER(OpenMode)(BSTR *aOpenMode)
+HRESULT GuestFile::getOpenMode(com::Utf8Str &aOpenMode)
{
#ifndef VBOX_WITH_GUEST_CONTROL
ReturnComNotImplemented();
#else
- AutoCaller autoCaller(this);
- if (FAILED(autoCaller.rc())) return autoCaller.rc();
-
- CheckComArgOutPointerValid(aOpenMode);
-
AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
- mData.mOpenInfo.mOpenMode.cloneTo(aOpenMode);
+ aOpenMode = mData.mOpenInfo.mOpenMode;
return S_OK;
#endif /* VBOX_WITH_GUEST_CONTROL */
}
-STDMETHODIMP GuestFile::COMGETTER(Status)(FileStatus_T *aStatus)
+HRESULT GuestFile::getStatus(FileStatus_T *aStatus)
{
#ifndef VBOX_WITH_GUEST_CONTROL
ReturnComNotImplemented();
#else
LogFlowThisFuncEnter();
- AutoCaller autoCaller(this);
- if (FAILED(autoCaller.rc())) return autoCaller.rc();
-
AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
*aStatus = mData.mStatus;
@@ -404,7 +361,7 @@ STDMETHODIMP GuestFile::COMGETTER(Status)(FileStatus_T *aStatus)
// private methods
/////////////////////////////////////////////////////////////////////////////
-int GuestFile::callbackDispatcher(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb)
+int GuestFile::i_callbackDispatcher(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb)
{
AssertPtrReturn(pCbCtx, VERR_INVALID_POINTER);
AssertPtrReturn(pSvcCb, VERR_INVALID_POINTER);
@@ -416,11 +373,11 @@ int GuestFile::callbackDispatcher(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRL
switch (pCbCtx->uFunction)
{
case GUEST_DISCONNECTED:
- vrc = onGuestDisconnected(pCbCtx, pSvcCb);
+ vrc = i_onGuestDisconnected(pCbCtx, pSvcCb);
break;
case GUEST_FILE_NOTIFY:
- vrc = onFileNotify(pCbCtx, pSvcCb);
+ vrc = i_onFileNotify(pCbCtx, pSvcCb);
break;
default:
@@ -435,7 +392,7 @@ int GuestFile::callbackDispatcher(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRL
return vrc;
}
-int GuestFile::closeFile(int *pGuestRc)
+int GuestFile::i_closeFile(int *pGuestRc)
{
LogFlowThisFunc(("strFile=%s\n", mData.mOpenInfo.mFileName.c_str()));
@@ -465,8 +422,8 @@ int GuestFile::closeFile(int *pGuestRc)
vrc = sendCommand(HOST_FILE_CLOSE, i, paParms);
if (RT_SUCCESS(vrc))
- vrc = waitForStatusChange(pEvent, 30 * 1000 /* Timeout in ms */,
- NULL /* FileStatus */, pGuestRc);
+ vrc = i_waitForStatusChange(pEvent, 30 * 1000 /* Timeout in ms */,
+ NULL /* FileStatus */, pGuestRc);
unregisterWaitEvent(pEvent);
LogFlowFuncLeaveRC(vrc);
@@ -474,7 +431,7 @@ int GuestFile::closeFile(int *pGuestRc)
}
/* static */
-Utf8Str GuestFile::guestErrorToString(int guestRc)
+Utf8Str GuestFile::i_guestErrorToString(int guestRc)
{
Utf8Str strError;
@@ -505,7 +462,7 @@ Utf8Str GuestFile::guestErrorToString(int guestRc)
return strError;
}
-int GuestFile::onFileNotify(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCbData)
+int GuestFile::i_onFileNotify(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCbData)
{
AssertPtrReturn(pCbCtx, VERR_INVALID_POINTER);
AssertPtrReturn(pSvcCbData, VERR_INVALID_POINTER);
@@ -531,7 +488,7 @@ int GuestFile::onFileNotify(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCA
if (RT_FAILURE(guestRc))
{
- int rc2 = setFileStatus(FileStatus_Error, guestRc);
+ int rc2 = i_setFileStatus(FileStatus_Error, guestRc);
AssertRC(rc2);
rc2 = signalWaitEventInternal(pCbCtx,
@@ -545,7 +502,7 @@ int GuestFile::onFileNotify(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCA
{
case GUEST_FILE_NOTIFYTYPE_ERROR:
{
- int rc2 = setFileStatus(FileStatus_Error, guestRc);
+ int rc2 = i_setFileStatus(FileStatus_Error, guestRc);
AssertRC(rc2);
break;
@@ -569,7 +526,7 @@ int GuestFile::onFileNotify(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCA
}
/* Set the process status. */
- int rc2 = setFileStatus(FileStatus_Open, guestRc);
+ int rc2 = i_setFileStatus(FileStatus_Open, guestRc);
AssertRC(rc2);
}
else
@@ -580,7 +537,7 @@ int GuestFile::onFileNotify(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCA
case GUEST_FILE_NOTIFYTYPE_CLOSE:
{
- int rc2 = setFileStatus(FileStatus_Closed, guestRc);
+ int rc2 = i_setFileStatus(FileStatus_Closed, guestRc);
AssertRC(rc2);
break;
@@ -691,12 +648,12 @@ int GuestFile::onFileNotify(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCA
return vrc;
}
-int GuestFile::onGuestDisconnected(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCbData)
+int GuestFile::i_onGuestDisconnected(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCbData)
{
AssertPtrReturn(pCbCtx, VERR_INVALID_POINTER);
AssertPtrReturn(pSvcCbData, VERR_INVALID_POINTER);
- int vrc = setFileStatus(FileStatus_Down, VINF_SUCCESS);
+ int vrc = i_setFileStatus(FileStatus_Down, VINF_SUCCESS);
LogFlowFuncLeaveRC(vrc);
return vrc;
@@ -706,7 +663,7 @@ int GuestFile::onGuestDisconnected(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTR
* Called by IGuestSession right before this file gets removed
* from the public file list.
*/
-int GuestFile::onRemove(void)
+int GuestFile::i_onRemove(void)
{
LogFlowThisFuncEnter();
@@ -730,7 +687,7 @@ int GuestFile::onRemove(void)
return vrc;
}
-int GuestFile::openFile(uint32_t uTimeoutMS, int *pGuestRc)
+int GuestFile::i_openFile(uint32_t uTimeoutMS, int *pGuestRc)
{
LogFlowThisFuncEnter();
@@ -776,8 +733,8 @@ int GuestFile::openFile(uint32_t uTimeoutMS, int *pGuestRc)
vrc = sendCommand(HOST_FILE_OPEN, i, paParms);
if (RT_SUCCESS(vrc))
- vrc = waitForStatusChange(pEvent, uTimeoutMS,
- NULL /* FileStatus */, pGuestRc);
+ vrc = i_waitForStatusChange(pEvent, uTimeoutMS,
+ NULL /* FileStatus */, pGuestRc);
unregisterWaitEvent(pEvent);
@@ -785,8 +742,8 @@ int GuestFile::openFile(uint32_t uTimeoutMS, int *pGuestRc)
return vrc;
}
-int GuestFile::readData(uint32_t uSize, uint32_t uTimeoutMS,
- void* pvData, uint32_t cbData, uint32_t* pcbRead)
+int GuestFile::i_readData(uint32_t uSize, uint32_t uTimeoutMS,
+ void* pvData, uint32_t cbData, uint32_t* pcbRead)
{
AssertPtrReturn(pvData, VERR_INVALID_POINTER);
AssertReturn(cbData, VERR_INVALID_PARAMETER);
@@ -827,7 +784,7 @@ int GuestFile::readData(uint32_t uSize, uint32_t uTimeoutMS,
uint32_t cbRead;
vrc = sendCommand(HOST_FILE_READ, i, paParms);
if (RT_SUCCESS(vrc))
- vrc = waitForRead(pEvent, uTimeoutMS, pvData, cbData, &cbRead);
+ vrc = i_waitForRead(pEvent, uTimeoutMS, pvData, cbData, &cbRead);
if (RT_SUCCESS(vrc))
{
@@ -843,8 +800,8 @@ int GuestFile::readData(uint32_t uSize, uint32_t uTimeoutMS,
return vrc;
}
-int GuestFile::readDataAt(uint64_t uOffset, uint32_t uSize, uint32_t uTimeoutMS,
- void* pvData, size_t cbData, size_t* pcbRead)
+int GuestFile::i_readDataAt(uint64_t uOffset, uint32_t uSize, uint32_t uTimeoutMS,
+ void* pvData, size_t cbData, size_t* pcbRead)
{
LogFlowThisFunc(("uOffset=%RU64, uSize=%RU32, uTimeoutMS=%RU32, pvData=%p, cbData=%zu\n",
uOffset, uSize, uTimeoutMS, pvData, cbData));
@@ -883,7 +840,7 @@ int GuestFile::readDataAt(uint64_t uOffset, uint32_t uSize, uint32_t uTimeoutMS,
uint32_t cbRead;
vrc = sendCommand(HOST_FILE_READ_AT, i, paParms);
if (RT_SUCCESS(vrc))
- vrc = waitForRead(pEvent, uTimeoutMS, pvData, cbData, &cbRead);
+ vrc = i_waitForRead(pEvent, uTimeoutMS, pvData, cbData, &cbRead);
if (RT_SUCCESS(vrc))
{
@@ -899,8 +856,8 @@ int GuestFile::readDataAt(uint64_t uOffset, uint32_t uSize, uint32_t uTimeoutMS,
return vrc;
}
-int GuestFile::seekAt(int64_t iOffset, GUEST_FILE_SEEKTYPE eSeekType,
- uint32_t uTimeoutMS, uint64_t *puOffset)
+int GuestFile::i_seekAt(int64_t iOffset, GUEST_FILE_SEEKTYPE eSeekType,
+ uint32_t uTimeoutMS, uint64_t *puOffset)
{
LogFlowThisFunc(("iOffset=%RI64, uTimeoutMS=%RU32\n",
iOffset, uTimeoutMS));
@@ -939,7 +896,7 @@ int GuestFile::seekAt(int64_t iOffset, GUEST_FILE_SEEKTYPE eSeekType,
vrc = sendCommand(HOST_FILE_SEEK, i, paParms);
if (RT_SUCCESS(vrc))
- vrc = waitForOffsetChange(pEvent, uTimeoutMS, puOffset);
+ vrc = i_waitForOffsetChange(pEvent, uTimeoutMS, puOffset);
unregisterWaitEvent(pEvent);
@@ -948,15 +905,15 @@ int GuestFile::seekAt(int64_t iOffset, GUEST_FILE_SEEKTYPE eSeekType,
}
/* static */
-HRESULT GuestFile::setErrorExternal(VirtualBoxBase *pInterface, int guestRc)
+HRESULT GuestFile::i_setErrorExternal(VirtualBoxBase *pInterface, int guestRc)
{
AssertPtr(pInterface);
AssertMsg(RT_FAILURE(guestRc), ("Guest rc does not indicate a failure when setting error\n"));
- return pInterface->setError(VBOX_E_IPRT_ERROR, GuestFile::guestErrorToString(guestRc).c_str());
+ return pInterface->setError(VBOX_E_IPRT_ERROR, GuestFile::i_guestErrorToString(guestRc).c_str());
}
-int GuestFile::setFileStatus(FileStatus_T fileStatus, int fileRc)
+int GuestFile::i_setFileStatus(FileStatus_T fileStatus, int fileRc)
{
LogFlowThisFuncEnter();
@@ -986,7 +943,7 @@ int GuestFile::setFileStatus(FileStatus_T fileStatus, int fileRc)
{
hr = errorInfo->initEx(VBOX_E_IPRT_ERROR, fileRc,
COM_IIDOF(IGuestFile), getComponentName(),
- guestErrorToString(fileRc));
+ i_guestErrorToString(fileRc));
ComAssertComRC(hr);
}
@@ -999,8 +956,8 @@ int GuestFile::setFileStatus(FileStatus_T fileStatus, int fileRc)
return VINF_SUCCESS;
}
-int GuestFile::waitForOffsetChange(GuestWaitEvent *pEvent,
- uint32_t uTimeoutMS, uint64_t *puOffset)
+int GuestFile::i_waitForOffsetChange(GuestWaitEvent *pEvent,
+ uint32_t uTimeoutMS, uint64_t *puOffset)
{
AssertPtrReturn(pEvent, VERR_INVALID_POINTER);
@@ -1028,9 +985,8 @@ int GuestFile::waitForOffsetChange(GuestWaitEvent *pEvent,
return vrc;
}
-int GuestFile::waitForRead(GuestWaitEvent *pEvent,
- uint32_t uTimeoutMS,
- void *pvData, size_t cbData, uint32_t *pcbRead)
+int GuestFile::i_waitForRead(GuestWaitEvent *pEvent, uint32_t uTimeoutMS,
+ void *pvData, size_t cbData, uint32_t *pcbRead)
{
AssertPtrReturn(pEvent, VERR_INVALID_POINTER);
@@ -1073,8 +1029,8 @@ int GuestFile::waitForRead(GuestWaitEvent *pEvent,
return vrc;
}
-int GuestFile::waitForStatusChange(GuestWaitEvent *pEvent, uint32_t uTimeoutMS,
- FileStatus_T *pFileStatus, int *pGuestRc)
+int GuestFile::i_waitForStatusChange(GuestWaitEvent *pEvent, uint32_t uTimeoutMS,
+ FileStatus_T *pFileStatus, int *pGuestRc)
{
AssertPtrReturn(pEvent, VERR_INVALID_POINTER);
/* pFileStatus is optional. */
@@ -1117,8 +1073,8 @@ int GuestFile::waitForStatusChange(GuestWaitEvent *pEvent, uint32_t uTimeoutMS,
return vrc;
}
-int GuestFile::waitForWrite(GuestWaitEvent *pEvent,
- uint32_t uTimeoutMS, uint32_t *pcbWritten)
+int GuestFile::i_waitForWrite(GuestWaitEvent *pEvent,
+ uint32_t uTimeoutMS, uint32_t *pcbWritten)
{
AssertPtrReturn(pEvent, VERR_INVALID_POINTER);
@@ -1146,8 +1102,8 @@ int GuestFile::waitForWrite(GuestWaitEvent *pEvent,
return vrc;
}
-int GuestFile::writeData(uint32_t uTimeoutMS, void *pvData, uint32_t cbData,
- uint32_t *pcbWritten)
+int GuestFile::i_writeData(uint32_t uTimeoutMS, void *pvData, uint32_t cbData,
+ uint32_t *pcbWritten)
{
AssertPtrReturn(pvData, VERR_INVALID_POINTER);
AssertReturn(cbData, VERR_INVALID_PARAMETER);
@@ -1189,7 +1145,7 @@ int GuestFile::writeData(uint32_t uTimeoutMS, void *pvData, uint32_t cbData,
uint32_t cbWritten;
vrc = sendCommand(HOST_FILE_WRITE, i, paParms);
if (RT_SUCCESS(vrc))
- vrc = waitForWrite(pEvent, uTimeoutMS, &cbWritten);
+ vrc = i_waitForWrite(pEvent, uTimeoutMS, &cbWritten);
if (RT_SUCCESS(vrc))
{
@@ -1205,8 +1161,8 @@ int GuestFile::writeData(uint32_t uTimeoutMS, void *pvData, uint32_t cbData,
return vrc;
}
-int GuestFile::writeDataAt(uint64_t uOffset, uint32_t uTimeoutMS,
- void *pvData, uint32_t cbData, uint32_t *pcbWritten)
+int GuestFile::i_writeDataAt(uint64_t uOffset, uint32_t uTimeoutMS,
+ void *pvData, uint32_t cbData, uint32_t *pcbWritten)
{
AssertPtrReturn(pvData, VERR_INVALID_POINTER);
AssertReturn(cbData, VERR_INVALID_PARAMETER);
@@ -1249,7 +1205,7 @@ int GuestFile::writeDataAt(uint64_t uOffset, uint32_t uTimeoutMS,
uint32_t cbWritten;
vrc = sendCommand(HOST_FILE_WRITE_AT, i, paParms);
if (RT_SUCCESS(vrc))
- vrc = waitForWrite(pEvent, uTimeoutMS, &cbWritten);
+ vrc = i_waitForWrite(pEvent, uTimeoutMS, &cbWritten);
if (RT_SUCCESS(vrc))
{
@@ -1265,22 +1221,18 @@ int GuestFile::writeDataAt(uint64_t uOffset, uint32_t uTimeoutMS,
return vrc;
}
-// implementation of public methods
+// Wrapped IGuestFile methods
/////////////////////////////////////////////////////////////////////////////
-
-STDMETHODIMP GuestFile::Close(void)
+HRESULT GuestFile::close()
{
#ifndef VBOX_WITH_GUEST_CONTROL
ReturnComNotImplemented();
#else
LogFlowThisFuncEnter();
- AutoCaller autoCaller(this);
- if (FAILED(autoCaller.rc())) return autoCaller.rc();
-
/* Close file on guest. */
int guestRc;
- int rc = closeFile(&guestRc);
+ int rc = i_closeFile(&guestRc);
/* On failure don't return here, instead do all the cleanup
* work first and then return an error. */
@@ -1292,7 +1244,7 @@ STDMETHODIMP GuestFile::Close(void)
if (RT_FAILURE(rc))
{
if (rc == VERR_GSTCTL_GUEST_ERROR)
- return GuestFile::setErrorExternal(this, guestRc);
+ return GuestFile::i_setErrorExternal(this, guestRc);
return setError(VBOX_E_IPRT_ERROR,
tr("Closing guest file failed with %Rrc\n"), rc);
@@ -1303,29 +1255,22 @@ STDMETHODIMP GuestFile::Close(void)
#endif /* VBOX_WITH_GUEST_CONTROL */
}
-STDMETHODIMP GuestFile::QueryInfo(IFsObjInfo **aInfo)
+HRESULT GuestFile::queryInfo(ComPtr<IFsObjInfo> &aObjInfo)
{
#ifndef VBOX_WITH_GUEST_CONTROL
ReturnComNotImplemented();
#else
- AutoCaller autoCaller(this);
- if (FAILED(autoCaller.rc())) return autoCaller.rc();
-
ReturnComNotImplemented();
#endif /* VBOX_WITH_GUEST_CONTROL */
}
-STDMETHODIMP GuestFile::Read(ULONG aToRead, ULONG aTimeoutMS, ComSafeArrayOut(BYTE, aData))
+HRESULT GuestFile::read(ULONG aToRead, ULONG aTimeoutMS, std::vector<BYTE> &aData)
{
#ifndef VBOX_WITH_GUEST_CONTROL
ReturnComNotImplemented();
#else
if (aToRead == 0)
return setError(E_INVALIDARG, tr("The size to read is zero"));
- CheckComArgOutSafeArrayPointerValid(aData);
-
- AutoCaller autoCaller(this);
- if (FAILED(autoCaller.rc())) return autoCaller.rc();
com::SafeArray<BYTE> data((size_t)aToRead);
Assert(data.size() >= aToRead);
@@ -1333,13 +1278,16 @@ STDMETHODIMP GuestFile::Read(ULONG aToRead, ULONG aTimeoutMS, ComSafeArrayOut(BY
HRESULT hr = S_OK;
uint32_t cbRead;
- int vrc = readData(aToRead, aTimeoutMS,
- data.raw(), aToRead, &cbRead);
+ int vrc = i_readData(aToRead, aTimeoutMS,
+ data.raw(), aToRead, &cbRead);
+
if (RT_SUCCESS(vrc))
{
if (data.size() != cbRead)
data.resize(cbRead);
- data.detachTo(ComSafeArrayOutArg(aData));
+ aData.resize(data.size());
+ for(size_t i = 0; i < data.size(); ++i)
+ aData[i] = data[i];
}
else
{
@@ -1357,18 +1305,14 @@ STDMETHODIMP GuestFile::Read(ULONG aToRead, ULONG aTimeoutMS, ComSafeArrayOut(BY
return hr;
#endif /* VBOX_WITH_GUEST_CONTROL */
}
+HRESULT GuestFile::readAt(LONG64 aOffset, ULONG aToRead, ULONG aTimeoutMS, std::vector<BYTE> &aData)
-STDMETHODIMP GuestFile::ReadAt(LONG64 aOffset, ULONG aToRead, ULONG aTimeoutMS, ComSafeArrayOut(BYTE, aData))
{
#ifndef VBOX_WITH_GUEST_CONTROL
ReturnComNotImplemented();
#else
if (aToRead == 0)
return setError(E_INVALIDARG, tr("The size to read is zero"));
- CheckComArgOutSafeArrayPointerValid(aData);
-
- AutoCaller autoCaller(this);
- if (FAILED(autoCaller.rc())) return autoCaller.rc();
com::SafeArray<BYTE> data((size_t)aToRead);
Assert(data.size() >= aToRead);
@@ -1376,13 +1320,15 @@ STDMETHODIMP GuestFile::ReadAt(LONG64 aOffset, ULONG aToRead, ULONG aTimeoutMS,
HRESULT hr = S_OK;
size_t cbRead;
- int vrc = readDataAt(aOffset, aToRead, aTimeoutMS,
- data.raw(), aToRead, &cbRead);
+ int vrc = i_readDataAt(aOffset, aToRead, aTimeoutMS,
+ data.raw(), aToRead, &cbRead);
if (RT_SUCCESS(vrc))
{
if (data.size() != cbRead)
data.resize(cbRead);
- data.detachTo(ComSafeArrayOutArg(aData));
+ aData.resize(data.size());
+ for(size_t i = 0; i < data.size(); ++i)
+ aData[i] = data[i];
}
else
{
@@ -1401,20 +1347,17 @@ STDMETHODIMP GuestFile::ReadAt(LONG64 aOffset, ULONG aToRead, ULONG aTimeoutMS,
#endif /* VBOX_WITH_GUEST_CONTROL */
}
-STDMETHODIMP GuestFile::Seek(LONG64 aOffset, FileSeekType_T aType)
+HRESULT GuestFile::seek(LONG64 aOffset, FileSeekType_T aWhence)
{
#ifndef VBOX_WITH_GUEST_CONTROL
ReturnComNotImplemented();
#else
LogFlowThisFuncEnter();
- AutoCaller autoCaller(this);
- if (FAILED(autoCaller.rc())) return autoCaller.rc();
-
HRESULT hr = S_OK;
GUEST_FILE_SEEKTYPE eSeekType;
- switch (aType)
+ switch (aWhence)
{
case FileSeekType_Set:
eSeekType = GUEST_FILE_SEEKTYPE_BEGIN;
@@ -1429,8 +1372,8 @@ STDMETHODIMP GuestFile::Seek(LONG64 aOffset, FileSeekType_T aType)
break; /* Never reached. */
}
- int vrc = seekAt(aOffset, eSeekType,
- 30 * 1000 /* 30s timeout */, NULL /* puOffset */);
+ int vrc = i_seekAt(aOffset, eSeekType,
+ 30 * 1000 /* 30s timeout */, NULL /* puOffset */);
if (RT_FAILURE(vrc))
{
switch (vrc)
@@ -1448,36 +1391,27 @@ STDMETHODIMP GuestFile::Seek(LONG64 aOffset, FileSeekType_T aType)
#endif /* VBOX_WITH_GUEST_CONTROL */
}
-STDMETHODIMP GuestFile::SetACL(IN_BSTR aACL)
+HRESULT GuestFile::setACL(const com::Utf8Str &aAcl)
{
#ifndef VBOX_WITH_GUEST_CONTROL
ReturnComNotImplemented();
#else
- AutoCaller autoCaller(this);
- if (FAILED(autoCaller.rc())) return autoCaller.rc();
-
ReturnComNotImplemented();
#endif /* VBOX_WITH_GUEST_CONTROL */
}
-STDMETHODIMP GuestFile::Write(ComSafeArrayIn(BYTE, aData), ULONG aTimeoutMS, ULONG *aWritten)
+HRESULT GuestFile::write(const std::vector<BYTE> &aData, ULONG aTimeoutMS, ULONG *aWritten)
{
#ifndef VBOX_WITH_GUEST_CONTROL
ReturnComNotImplemented();
#else
LogFlowThisFuncEnter();
- CheckComArgSafeArrayNotNull(aData);
- CheckComArgOutPointerValid(aWritten);
-
- AutoCaller autoCaller(this);
- if (FAILED(autoCaller.rc())) return autoCaller.rc();
-
HRESULT hr = S_OK;
- com::SafeArray<BYTE> data(ComSafeArrayInArg(aData));
- int vrc = writeData(aTimeoutMS, data.raw(), (uint32_t)data.size(),
- (uint32_t*)aWritten);
+ com::SafeArray<BYTE> data(aData);
+ int vrc = i_writeData(aTimeoutMS, data.raw(), (uint32_t)data.size(),
+ (uint32_t*)aWritten);
if (RT_FAILURE(vrc))
{
switch (vrc)
@@ -1495,24 +1429,19 @@ STDMETHODIMP GuestFile::Write(ComSafeArrayIn(BYTE, aData), ULONG aTimeoutMS, ULO
#endif /* VBOX_WITH_GUEST_CONTROL */
}
-STDMETHODIMP GuestFile::WriteAt(LONG64 aOffset, ComSafeArrayIn(BYTE, aData), ULONG aTimeoutMS, ULONG *aWritten)
+HRESULT GuestFile::writeAt(LONG64 aOffset, const std::vector<BYTE> &aData, ULONG aTimeoutMS, ULONG *aWritten)
+
{
#ifndef VBOX_WITH_GUEST_CONTROL
ReturnComNotImplemented();
#else
LogFlowThisFuncEnter();
- CheckComArgSafeArrayNotNull(aData);
- CheckComArgOutPointerValid(aWritten);
-
- AutoCaller autoCaller(this);
- if (FAILED(autoCaller.rc())) return autoCaller.rc();
-
HRESULT hr = S_OK;
- com::SafeArray<BYTE> data(ComSafeArrayInArg(aData));
- int vrc = writeData(aTimeoutMS, data.raw(), (uint32_t)data.size(),
- (uint32_t*)aWritten);
+ com::SafeArray<BYTE> data(aData);
+ int vrc = i_writeData(aTimeoutMS, data.raw(), (uint32_t)data.size(),
+ (uint32_t*)aWritten);
if (RT_FAILURE(vrc))
{
switch (vrc)
diff --git a/src/VBox/Main/src-client/GuestProcessImpl.cpp b/src/VBox/Main/src-client/GuestProcessImpl.cpp
index 7c43a41144e..427bdd135e8 100644
--- a/src/VBox/Main/src-client/GuestProcessImpl.cpp
+++ b/src/VBox/Main/src-client/GuestProcessImpl.cpp
@@ -461,7 +461,7 @@ STDMETHODIMP GuestProcess::COMGETTER(Status)(ProcessStatus_T *aStatus)
// private methods
/////////////////////////////////////////////////////////////////////////////
-int GuestProcess::callbackDispatcher(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb)
+int GuestProcess::i_callbackDispatcher(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb)
{
AssertPtrReturn(pCbCtx, VERR_INVALID_POINTER);
AssertPtrReturn(pSvcCb, VERR_INVALID_POINTER);
@@ -865,7 +865,7 @@ int GuestProcess::onProcessOutput(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRL
* Called by IGuestSession right before this process gets
* removed from the public process list.
*/
-int GuestProcess::onRemove(void)
+int GuestProcess::i_onRemove(void)
{
LogFlowThisFuncEnter();
diff --git a/src/VBox/Main/src-client/GuestSessionImpl.cpp b/src/VBox/Main/src-client/GuestSessionImpl.cpp
index 20df45844f0..bf26f200f61 100644
--- a/src/VBox/Main/src-client/GuestSessionImpl.cpp
+++ b/src/VBox/Main/src-client/GuestSessionImpl.cpp
@@ -292,7 +292,7 @@ void GuestSession::uninit(void)
{
Assert(mData.mNumObjects);
mData.mNumObjects--;
- itDirs->second->onRemove();
+ itDirs->second->i_onRemove();
itDirs->second->uninit();
}
mData.mDirectories.clear();
@@ -304,7 +304,7 @@ void GuestSession::uninit(void)
{
Assert(mData.mNumObjects);
mData.mNumObjects--;
- itFiles->second->onRemove();
+ itFiles->second->i_onRemove();
itFiles->second->uninit();
}
mData.mFiles.clear();
@@ -316,7 +316,7 @@ void GuestSession::uninit(void)
{
Assert(mData.mNumObjects);
mData.mNumObjects--;
- itProcs->second->onRemove();
+ itProcs->second->i_onRemove();
itProcs->second->uninit();
}
mData.mProcesses.clear();
@@ -809,7 +809,7 @@ int GuestSession::directoryRemoveFromList(GuestDirectory *pDirectory)
LogFlowFunc(("Removing directory \"%s\" (Session: %RU32) (now total %zu processes, %RU32 objects)\n",
Utf8Str(strName).c_str(), mData.mSession.mID, mData.mDirectories.size() - 1, mData.mNumObjects - 1));
- rc = pDirectory->onRemove();
+ rc = pDirectory->i_onRemove();
mData.mDirectories.erase(itDirs);
mData.mNumObjects--;
@@ -1042,7 +1042,7 @@ int GuestSession::dispatchToDirectory(PVBOXGUESTCTRLHOSTCBCTX pCtxCb, PVBOXGUEST
alock.release();
- rc = pDirectory->callbackDispatcher(pCtxCb, pSvcCb);
+ rc = pDirectory->i_callbackDispatcher(pCtxCb, pSvcCb);
}
else
rc = VERR_NOT_FOUND;
@@ -1075,7 +1075,7 @@ int GuestSession::dispatchToFile(PVBOXGUESTCTRLHOSTCBCTX pCtxCb, PVBOXGUESTCTRLH
alock.release();
- rc = pFile->callbackDispatcher(pCtxCb, pSvcCb);
+ rc = pFile->i_callbackDispatcher(pCtxCb, pSvcCb);
}
else
rc = VERR_NOT_FOUND;
@@ -1166,7 +1166,7 @@ int GuestSession::dispatchToProcess(PVBOXGUESTCTRLHOSTCBCTX pCtxCb, PVBOXGUESTCT
pCtxCb->uProtocol = mData.mProtocolVersion;
alock.release();
- rc = pProcess->callbackDispatcher(pCtxCb, pSvcCb);
+ rc = pProcess->i_callbackDispatcher(pCtxCb, pSvcCb);
}
else
rc = VERR_NOT_FOUND;
@@ -1246,7 +1246,7 @@ int GuestSession::fileRemoveFromList(GuestFile *pFile)
LogFlowThisFunc(("Removing guest file \"%s\" (Session: %RU32) (now total %zu files, %RU32 objects)\n",
Utf8Str(strName).c_str(), mData.mSession.mID, mData.mFiles.size() - 1, mData.mNumObjects - 1));
- rc = pFile->onRemove();
+ rc = pFile->i_onRemove();
mData.mFiles.erase(itFiles);
mData.mNumObjects--;
@@ -1384,7 +1384,7 @@ int GuestSession::fileOpenInternal(const GuestFileOpenInfo &openInfo,
if (RT_SUCCESS(rc))
{
int guestRc;
- rc = pFile->openFile(30 * 1000 /* 30s timeout */, &guestRc);
+ rc = pFile->i_openFile(30 * 1000 /* 30s timeout */, &guestRc);
if ( rc == VERR_GSTCTL_GUEST_ERROR
&& pGuestRc)
{
@@ -1874,7 +1874,7 @@ int GuestSession::processRemoveFromList(GuestProcess *pProcess)
LogFlowFunc(("Removing process ID=%RU32 (Session: %RU32), guest PID=%RU32 (now total %zu processes, %RU32 objects)\n",
pProcess->getObjectID(), mData.mSession.mID, uPID, mData.mProcesses.size() - 1, mData.mNumObjects - 1));
- rc = pProcess->onRemove();
+ rc = pProcess->i_onRemove();
mData.mProcesses.erase(itProcs);
mData.mNumObjects--;
@@ -2947,7 +2947,7 @@ STDMETHODIMP GuestSession::DirectoryRemoveRecursive(IN_BSTR aPath, ComSafeArrayI
break;
case VERR_GSTCTL_GUEST_ERROR:
- hr = GuestFile::setErrorExternal(this, guestRc);
+ hr = GuestFile::i_setErrorExternal(this, guestRc);
break;
default:
@@ -3284,7 +3284,7 @@ STDMETHODIMP GuestSession::FileOpenEx(IN_BSTR aPath, IN_BSTR aOpenMode, IN_BSTR
break;
case VERR_GSTCTL_GUEST_ERROR:
- hr = GuestFile::setErrorExternal(this, guestRc);
+ hr = GuestFile::i_setErrorExternal(this, guestRc);
break;
default:
diff --git a/src/VBox/Main/src-client/xpcom/module.cpp b/src/VBox/Main/src-client/xpcom/module.cpp
index ec7c8490b0f..c3dee43602c 100644
--- a/src/VBox/Main/src-client/xpcom/module.cpp
+++ b/src/VBox/Main/src-client/xpcom/module.cpp
@@ -68,8 +68,6 @@ NS_IMPL_THREADSAFE_ISUPPORTS2_CI(Session, ISession, IInternalSessionControl)
NS_DECL_CLASSINFO(Guest)
NS_IMPL_THREADSAFE_ISUPPORTS1_CI(Guest, IGuest)
#ifdef VBOX_WITH_GUEST_CONTROL
-NS_DECL_CLASSINFO(GuestFile)
-NS_IMPL_THREADSAFE_ISUPPORTS2_CI(GuestFile, IGuestFile, IFile)
NS_DECL_CLASSINFO(GuestProcess)
NS_IMPL_THREADSAFE_ISUPPORTS2_CI(GuestProcess, IGuestProcess, IProcess)
NS_DECL_CLASSINFO(GuestSession)