VirtualBox

Changeset 50618 in vbox for trunk/src/VBox/Main/src-client


Ignore:
Timestamp:
Feb 26, 2014 7:55:39 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
92493
Message:

6813 src-client/GuestFileImpl.cpp

Location:
trunk/src/VBox/Main/src-client
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/GuestDirectoryImpl.cpp

    r50559 r50618  
    171171/////////////////////////////////////////////////////////////////////////////
    172172
    173 int GuestDirectory::callbackDispatcher(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb)
     173int GuestDirectory::i_callbackDispatcher(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb)
    174174{
    175175    AssertPtrReturn(pCbCtx, VERR_INVALID_POINTER);
     
    242242 * removed from the public directory list.
    243243 */
    244 int GuestDirectory::onRemove(void)
     244int GuestDirectory::i_onRemove(void)
    245245{
    246246    LogFlowThisFuncEnter();
  • trunk/src/VBox/Main/src-client/GuestFileImpl.cpp

    r50544 r50618  
    241241/////////////////////////////////////////////////////////////////////////////
    242242
    243 STDMETHODIMP GuestFile::COMGETTER(CreationMode)(ULONG *aCreationMode)
    244 {
    245 #ifndef VBOX_WITH_GUEST_CONTROL
    246     ReturnComNotImplemented();
    247 #else
    248     AutoCaller autoCaller(this);
    249     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    250 
    251     CheckComArgOutPointerValid(aCreationMode);
    252 
     243HRESULT GuestFile::getCreationMode(ULONG *aCreationMode)
     244{
     245#ifndef VBOX_WITH_GUEST_CONTROL
     246    ReturnComNotImplemented();
     247#else
    253248    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    254249
     
    259254}
    260255
    261 STDMETHODIMP GuestFile::COMGETTER(Disposition)(BSTR *aDisposition)
    262 {
    263 #ifndef VBOX_WITH_GUEST_CONTROL
    264     ReturnComNotImplemented();
    265 #else
    266     AutoCaller autoCaller(this);
    267     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    268 
    269     CheckComArgOutPointerValid(aDisposition);
    270 
     256HRESULT GuestFile::getDisposition(com::Utf8Str &aDisposition)
     257{
     258#ifndef VBOX_WITH_GUEST_CONTROL
     259    ReturnComNotImplemented();
     260#else
    271261    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    272262
    273     mData.mOpenInfo.mDisposition.cloneTo(aDisposition);
     263    aDisposition = mData.mOpenInfo.mDisposition;
    274264
    275265    return S_OK;
     
    277267}
    278268
    279 STDMETHODIMP GuestFile::COMGETTER(EventSource)(IEventSource ** aEventSource)
    280 {
    281 #ifndef VBOX_WITH_GUEST_CONTROL
    282     ReturnComNotImplemented();
    283 #else
    284     CheckComArgOutPointerValid(aEventSource);
    285 
    286     AutoCaller autoCaller(this);
    287     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    288 
     269HRESULT GuestFile::getEventSource(ComPtr<IEventSource> &aEventSource)
     270{
     271#ifndef VBOX_WITH_GUEST_CONTROL
     272    ReturnComNotImplemented();
     273#else
    289274    /* No need to lock - lifetime constant. */
    290     mEventSource.queryInterfaceTo(aEventSource);
     275    mEventSource.queryInterfaceTo(aEventSource.asOutParam());
    291276
    292277    return S_OK;
     
    294279}
    295280
    296 STDMETHODIMP GuestFile::COMGETTER(FileName)(BSTR *aFileName)
    297 {
    298 #ifndef VBOX_WITH_GUEST_CONTROL
    299     ReturnComNotImplemented();
    300 #else
    301     AutoCaller autoCaller(this);
    302     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    303 
    304     CheckComArgOutPointerValid(aFileName);
    305 
     281HRESULT GuestFile::getFileName(com::Utf8Str &aFileName)
     282{
     283#ifndef VBOX_WITH_GUEST_CONTROL
     284    ReturnComNotImplemented();
     285#else
    306286    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    307287
    308     mData.mOpenInfo.mFileName.cloneTo(aFileName);
     288    aFileName = mData.mOpenInfo.mFileName;
    309289
    310290    return S_OK;
     
    312292}
    313293
    314 STDMETHODIMP GuestFile::COMGETTER(Id)(ULONG *aID)
    315 {
    316 #ifndef VBOX_WITH_GUEST_CONTROL
    317     ReturnComNotImplemented();
    318 #else
    319     AutoCaller autoCaller(this);
    320     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    321 
    322     CheckComArgOutPointerValid(aID);
    323 
     294HRESULT GuestFile::getId(ULONG *aId)
     295{
     296#ifndef VBOX_WITH_GUEST_CONTROL
     297    ReturnComNotImplemented();
     298#else
    324299    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    325300
    326     *aID = mData.mID;
     301    *aId = mData.mID;
    327302
    328303    return S_OK;
     
    330305}
    331306
    332 STDMETHODIMP GuestFile::COMGETTER(InitialSize)(LONG64 *aInitialSize)
    333 {
    334 #ifndef VBOX_WITH_GUEST_CONTROL
    335     ReturnComNotImplemented();
    336 #else
    337     AutoCaller autoCaller(this);
    338     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    339 
    340     CheckComArgOutPointerValid(aInitialSize);
    341 
     307HRESULT GuestFile::getInitialSize(LONG64 *aInitialSize)
     308{
     309#ifndef VBOX_WITH_GUEST_CONTROL
     310    ReturnComNotImplemented();
     311#else
    342312    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    343313
     
    348318}
    349319
    350 STDMETHODIMP GuestFile::COMGETTER(Offset)(LONG64 *aOffset)
    351 {
    352 #ifndef VBOX_WITH_GUEST_CONTROL
    353     ReturnComNotImplemented();
    354 #else
    355     AutoCaller autoCaller(this);
    356     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    357 
    358     CheckComArgOutPointerValid(aOffset);
    359 
     320HRESULT GuestFile::getOffset(LONG64 *aOffset)
     321{
     322#ifndef VBOX_WITH_GUEST_CONTROL
     323    ReturnComNotImplemented();
     324#else
    360325    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    361326
     
    366331}
    367332
    368 STDMETHODIMP GuestFile::COMGETTER(OpenMode)(BSTR *aOpenMode)
    369 {
    370 #ifndef VBOX_WITH_GUEST_CONTROL
    371     ReturnComNotImplemented();
    372 #else
    373     AutoCaller autoCaller(this);
    374     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    375 
    376     CheckComArgOutPointerValid(aOpenMode);
    377 
     333HRESULT GuestFile::getOpenMode(com::Utf8Str &aOpenMode)
     334{
     335#ifndef VBOX_WITH_GUEST_CONTROL
     336    ReturnComNotImplemented();
     337#else
    378338    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    379339
    380     mData.mOpenInfo.mOpenMode.cloneTo(aOpenMode);
     340    aOpenMode = mData.mOpenInfo.mOpenMode;
    381341
    382342    return S_OK;
     
    384344}
    385345
    386 STDMETHODIMP GuestFile::COMGETTER(Status)(FileStatus_T *aStatus)
     346HRESULT GuestFile::getStatus(FileStatus_T *aStatus)
    387347{
    388348#ifndef VBOX_WITH_GUEST_CONTROL
     
    390350#else
    391351    LogFlowThisFuncEnter();
    392 
    393     AutoCaller autoCaller(this);
    394     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    395352
    396353    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     
    405362/////////////////////////////////////////////////////////////////////////////
    406363
    407 int GuestFile::callbackDispatcher(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb)
     364int GuestFile::i_callbackDispatcher(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb)
    408365{
    409366    AssertPtrReturn(pCbCtx, VERR_INVALID_POINTER);
     
    417374    {
    418375        case GUEST_DISCONNECTED:
    419             vrc = onGuestDisconnected(pCbCtx, pSvcCb);
     376            vrc = i_onGuestDisconnected(pCbCtx, pSvcCb);
    420377            break;
    421378
    422379        case GUEST_FILE_NOTIFY:
    423             vrc = onFileNotify(pCbCtx, pSvcCb);
     380            vrc = i_onFileNotify(pCbCtx, pSvcCb);
    424381            break;
    425382
     
    436393}
    437394
    438 int GuestFile::closeFile(int *pGuestRc)
     395int GuestFile::i_closeFile(int *pGuestRc)
    439396{
    440397    LogFlowThisFunc(("strFile=%s\n", mData.mOpenInfo.mFileName.c_str()));
     
    466423    vrc = sendCommand(HOST_FILE_CLOSE, i, paParms);
    467424    if (RT_SUCCESS(vrc))
    468         vrc = waitForStatusChange(pEvent, 30 * 1000 /* Timeout in ms */,
    469                                   NULL /* FileStatus */, pGuestRc);
     425        vrc = i_waitForStatusChange(pEvent, 30 * 1000 /* Timeout in ms */,
     426                                    NULL /* FileStatus */, pGuestRc);
    470427    unregisterWaitEvent(pEvent);
    471428
     
    475432
    476433/* static */
    477 Utf8Str GuestFile::guestErrorToString(int guestRc)
     434Utf8Str GuestFile::i_guestErrorToString(int guestRc)
    478435{
    479436    Utf8Str strError;
     
    506463}
    507464
    508 int GuestFile::onFileNotify(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCbData)
     465int GuestFile::i_onFileNotify(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCbData)
    509466{
    510467    AssertPtrReturn(pCbCtx, VERR_INVALID_POINTER);
     
    532489    if (RT_FAILURE(guestRc))
    533490    {
    534         int rc2 = setFileStatus(FileStatus_Error, guestRc);
     491        int rc2 = i_setFileStatus(FileStatus_Error, guestRc);
    535492        AssertRC(rc2);
    536493
     
    546503        case GUEST_FILE_NOTIFYTYPE_ERROR:
    547504        {
    548             int rc2 = setFileStatus(FileStatus_Error, guestRc);
     505            int rc2 = i_setFileStatus(FileStatus_Error, guestRc);
    549506            AssertRC(rc2);
    550507
     
    570527
    571528                /* Set the process status. */
    572                 int rc2 = setFileStatus(FileStatus_Open, guestRc);
     529                int rc2 = i_setFileStatus(FileStatus_Open, guestRc);
    573530                AssertRC(rc2);
    574531            }
     
    581538        case GUEST_FILE_NOTIFYTYPE_CLOSE:
    582539        {
    583             int rc2 = setFileStatus(FileStatus_Closed, guestRc);
     540            int rc2 = i_setFileStatus(FileStatus_Closed, guestRc);
    584541            AssertRC(rc2);
    585542
     
    692649}
    693650
    694 int GuestFile::onGuestDisconnected(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCbData)
     651int GuestFile::i_onGuestDisconnected(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCbData)
    695652{
    696653    AssertPtrReturn(pCbCtx, VERR_INVALID_POINTER);
    697654    AssertPtrReturn(pSvcCbData, VERR_INVALID_POINTER);
    698655
    699     int vrc = setFileStatus(FileStatus_Down, VINF_SUCCESS);
     656    int vrc = i_setFileStatus(FileStatus_Down, VINF_SUCCESS);
    700657
    701658    LogFlowFuncLeaveRC(vrc);
     
    707664 * from the public file list.
    708665 */
    709 int GuestFile::onRemove(void)
     666int GuestFile::i_onRemove(void)
    710667{
    711668    LogFlowThisFuncEnter();
     
    731688}
    732689
    733 int GuestFile::openFile(uint32_t uTimeoutMS, int *pGuestRc)
     690int GuestFile::i_openFile(uint32_t uTimeoutMS, int *pGuestRc)
    734691{
    735692    LogFlowThisFuncEnter();
     
    777734    vrc = sendCommand(HOST_FILE_OPEN, i, paParms);
    778735    if (RT_SUCCESS(vrc))
    779         vrc = waitForStatusChange(pEvent, uTimeoutMS,
    780                                   NULL /* FileStatus */, pGuestRc);
     736        vrc = i_waitForStatusChange(pEvent, uTimeoutMS,
     737                                    NULL /* FileStatus */, pGuestRc);
    781738
    782739    unregisterWaitEvent(pEvent);
     
    786743}
    787744
    788 int GuestFile::readData(uint32_t uSize, uint32_t uTimeoutMS,
    789                         void* pvData, uint32_t cbData, uint32_t* pcbRead)
     745int GuestFile::i_readData(uint32_t uSize, uint32_t uTimeoutMS,
     746                          void* pvData, uint32_t cbData, uint32_t* pcbRead)
    790747{
    791748    AssertPtrReturn(pvData, VERR_INVALID_POINTER);
     
    828785    vrc = sendCommand(HOST_FILE_READ, i, paParms);
    829786    if (RT_SUCCESS(vrc))
    830         vrc = waitForRead(pEvent, uTimeoutMS, pvData, cbData, &cbRead);
     787        vrc = i_waitForRead(pEvent, uTimeoutMS, pvData, cbData, &cbRead);
    831788
    832789    if (RT_SUCCESS(vrc))
     
    844801}
    845802
    846 int GuestFile::readDataAt(uint64_t uOffset, uint32_t uSize, uint32_t uTimeoutMS,
    847                           void* pvData, size_t cbData, size_t* pcbRead)
     803int GuestFile::i_readDataAt(uint64_t uOffset, uint32_t uSize, uint32_t uTimeoutMS,
     804                            void* pvData, size_t cbData, size_t* pcbRead)
    848805{
    849806    LogFlowThisFunc(("uOffset=%RU64, uSize=%RU32, uTimeoutMS=%RU32, pvData=%p, cbData=%zu\n",
     
    884841    vrc = sendCommand(HOST_FILE_READ_AT, i, paParms);
    885842    if (RT_SUCCESS(vrc))
    886         vrc = waitForRead(pEvent, uTimeoutMS, pvData, cbData, &cbRead);
     843        vrc = i_waitForRead(pEvent, uTimeoutMS, pvData, cbData, &cbRead);
    887844
    888845    if (RT_SUCCESS(vrc))
     
    900857}
    901858
    902 int GuestFile::seekAt(int64_t iOffset, GUEST_FILE_SEEKTYPE eSeekType,
    903                       uint32_t uTimeoutMS, uint64_t *puOffset)
     859int GuestFile::i_seekAt(int64_t iOffset, GUEST_FILE_SEEKTYPE eSeekType,
     860                        uint32_t uTimeoutMS, uint64_t *puOffset)
    904861{
    905862    LogFlowThisFunc(("iOffset=%RI64, uTimeoutMS=%RU32\n",
     
    940897    vrc = sendCommand(HOST_FILE_SEEK, i, paParms);
    941898    if (RT_SUCCESS(vrc))
    942         vrc = waitForOffsetChange(pEvent, uTimeoutMS, puOffset);
     899        vrc = i_waitForOffsetChange(pEvent, uTimeoutMS, puOffset);
    943900
    944901    unregisterWaitEvent(pEvent);
     
    949906
    950907/* static */
    951 HRESULT GuestFile::setErrorExternal(VirtualBoxBase *pInterface, int guestRc)
     908HRESULT GuestFile::i_setErrorExternal(VirtualBoxBase *pInterface, int guestRc)
    952909{
    953910    AssertPtr(pInterface);
    954911    AssertMsg(RT_FAILURE(guestRc), ("Guest rc does not indicate a failure when setting error\n"));
    955912
    956     return pInterface->setError(VBOX_E_IPRT_ERROR, GuestFile::guestErrorToString(guestRc).c_str());
    957 }
    958 
    959 int GuestFile::setFileStatus(FileStatus_T fileStatus, int fileRc)
     913    return pInterface->setError(VBOX_E_IPRT_ERROR, GuestFile::i_guestErrorToString(guestRc).c_str());
     914}
     915
     916int GuestFile::i_setFileStatus(FileStatus_T fileStatus, int fileRc)
    960917{
    961918    LogFlowThisFuncEnter();
     
    987944            hr = errorInfo->initEx(VBOX_E_IPRT_ERROR, fileRc,
    988945                                   COM_IIDOF(IGuestFile), getComponentName(),
    989                                    guestErrorToString(fileRc));
     946                                   i_guestErrorToString(fileRc));
    990947            ComAssertComRC(hr);
    991948        }
     
    1000957}
    1001958
    1002 int GuestFile::waitForOffsetChange(GuestWaitEvent *pEvent,
    1003                                    uint32_t uTimeoutMS, uint64_t *puOffset)
     959int GuestFile::i_waitForOffsetChange(GuestWaitEvent *pEvent,
     960                                     uint32_t uTimeoutMS, uint64_t *puOffset)
    1004961{
    1005962    AssertPtrReturn(pEvent, VERR_INVALID_POINTER);
     
    1029986}
    1030987
    1031 int GuestFile::waitForRead(GuestWaitEvent *pEvent,
    1032                            uint32_t uTimeoutMS,
    1033                            void *pvData, size_t cbData, uint32_t *pcbRead)
     988int GuestFile::i_waitForRead(GuestWaitEvent *pEvent, uint32_t uTimeoutMS,
     989                             void *pvData, size_t cbData, uint32_t *pcbRead)
    1034990{
    1035991    AssertPtrReturn(pEvent, VERR_INVALID_POINTER);
     
    10741030}
    10751031
    1076 int GuestFile::waitForStatusChange(GuestWaitEvent *pEvent, uint32_t uTimeoutMS,
    1077                                    FileStatus_T *pFileStatus, int *pGuestRc)
     1032int GuestFile::i_waitForStatusChange(GuestWaitEvent *pEvent, uint32_t uTimeoutMS,
     1033                                     FileStatus_T *pFileStatus, int *pGuestRc)
    10781034{
    10791035    AssertPtrReturn(pEvent, VERR_INVALID_POINTER);
     
    11181074}
    11191075
    1120 int GuestFile::waitForWrite(GuestWaitEvent *pEvent,
    1121                             uint32_t uTimeoutMS, uint32_t *pcbWritten)
     1076int GuestFile::i_waitForWrite(GuestWaitEvent *pEvent,
     1077                              uint32_t uTimeoutMS, uint32_t *pcbWritten)
    11221078{
    11231079    AssertPtrReturn(pEvent, VERR_INVALID_POINTER);
     
    11471103}
    11481104
    1149 int GuestFile::writeData(uint32_t uTimeoutMS, void *pvData, uint32_t cbData,
    1150                          uint32_t *pcbWritten)
     1105int GuestFile::i_writeData(uint32_t uTimeoutMS, void *pvData, uint32_t cbData,
     1106                           uint32_t *pcbWritten)
    11511107{
    11521108    AssertPtrReturn(pvData, VERR_INVALID_POINTER);
     
    11901146    vrc = sendCommand(HOST_FILE_WRITE, i, paParms);
    11911147    if (RT_SUCCESS(vrc))
    1192         vrc = waitForWrite(pEvent, uTimeoutMS, &cbWritten);
     1148        vrc = i_waitForWrite(pEvent, uTimeoutMS, &cbWritten);
    11931149
    11941150    if (RT_SUCCESS(vrc))
     
    12061162}
    12071163
    1208 int GuestFile::writeDataAt(uint64_t uOffset, uint32_t uTimeoutMS,
    1209                            void *pvData, uint32_t cbData, uint32_t *pcbWritten)
     1164int GuestFile::i_writeDataAt(uint64_t uOffset, uint32_t uTimeoutMS,
     1165                             void *pvData, uint32_t cbData, uint32_t *pcbWritten)
    12101166{
    12111167    AssertPtrReturn(pvData, VERR_INVALID_POINTER);
     
    12501206    vrc = sendCommand(HOST_FILE_WRITE_AT, i, paParms);
    12511207    if (RT_SUCCESS(vrc))
    1252         vrc = waitForWrite(pEvent, uTimeoutMS, &cbWritten);
     1208        vrc = i_waitForWrite(pEvent, uTimeoutMS, &cbWritten);
    12531209
    12541210    if (RT_SUCCESS(vrc))
     
    12661222}
    12671223
    1268 // implementation of public methods
     1224// Wrapped IGuestFile methods
    12691225/////////////////////////////////////////////////////////////////////////////
    1270 
    1271 STDMETHODIMP GuestFile::Close(void)
     1226HRESULT GuestFile::close()
    12721227{
    12731228#ifndef VBOX_WITH_GUEST_CONTROL
     
    12751230#else
    12761231    LogFlowThisFuncEnter();
    1277 
    1278     AutoCaller autoCaller(this);
    1279     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    12801232
    12811233    /* Close file on guest. */
    12821234    int guestRc;
    1283     int rc = closeFile(&guestRc);
     1235    int rc = i_closeFile(&guestRc);
    12841236    /* On failure don't return here, instead do all the cleanup
    12851237     * work first and then return an error. */
     
    12931245    {
    12941246        if (rc == VERR_GSTCTL_GUEST_ERROR)
    1295             return GuestFile::setErrorExternal(this, guestRc);
     1247            return GuestFile::i_setErrorExternal(this, guestRc);
    12961248
    12971249        return setError(VBOX_E_IPRT_ERROR,
     
    13041256}
    13051257
    1306 STDMETHODIMP GuestFile::QueryInfo(IFsObjInfo **aInfo)
    1307 {
    1308 #ifndef VBOX_WITH_GUEST_CONTROL
    1309     ReturnComNotImplemented();
    1310 #else
    1311     AutoCaller autoCaller(this);
    1312     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1313 
    1314     ReturnComNotImplemented();
    1315 #endif /* VBOX_WITH_GUEST_CONTROL */
    1316 }
    1317 
    1318 STDMETHODIMP GuestFile::Read(ULONG aToRead, ULONG aTimeoutMS, ComSafeArrayOut(BYTE, aData))
     1258HRESULT GuestFile::queryInfo(ComPtr<IFsObjInfo> &aObjInfo)
     1259{
     1260#ifndef VBOX_WITH_GUEST_CONTROL
     1261    ReturnComNotImplemented();
     1262#else
     1263    ReturnComNotImplemented();
     1264#endif /* VBOX_WITH_GUEST_CONTROL */
     1265}
     1266
     1267HRESULT GuestFile::read(ULONG aToRead, ULONG aTimeoutMS, std::vector<BYTE> &aData)
    13191268{
    13201269#ifndef VBOX_WITH_GUEST_CONTROL
     
    13231272    if (aToRead == 0)
    13241273        return setError(E_INVALIDARG, tr("The size to read is zero"));
    1325     CheckComArgOutSafeArrayPointerValid(aData);
    1326 
    1327     AutoCaller autoCaller(this);
    1328     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    13291274
    13301275    com::SafeArray<BYTE> data((size_t)aToRead);
     
    13341279
    13351280    uint32_t cbRead;
    1336     int vrc = readData(aToRead, aTimeoutMS,
    1337                        data.raw(), aToRead, &cbRead);
     1281    int vrc = i_readData(aToRead, aTimeoutMS,
     1282                         data.raw(), aToRead, &cbRead);
     1283
    13381284    if (RT_SUCCESS(vrc))
    13391285    {
    13401286        if (data.size() != cbRead)
    13411287            data.resize(cbRead);
    1342         data.detachTo(ComSafeArrayOutArg(aData));
     1288        aData.resize(data.size());
     1289        for(size_t i = 0; i < data.size(); ++i)
     1290            aData[i] = data[i];
    13431291    }
    13441292    else
     
    13581306#endif /* VBOX_WITH_GUEST_CONTROL */
    13591307}
    1360 
    1361 STDMETHODIMP GuestFile::ReadAt(LONG64 aOffset, ULONG aToRead, ULONG aTimeoutMS, ComSafeArrayOut(BYTE, aData))
     1308HRESULT GuestFile::readAt(LONG64 aOffset, ULONG aToRead, ULONG aTimeoutMS, std::vector<BYTE> &aData)
     1309
    13621310{
    13631311#ifndef VBOX_WITH_GUEST_CONTROL
     
    13661314    if (aToRead == 0)
    13671315        return setError(E_INVALIDARG, tr("The size to read is zero"));
    1368     CheckComArgOutSafeArrayPointerValid(aData);
    1369 
    1370     AutoCaller autoCaller(this);
    1371     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    13721316
    13731317    com::SafeArray<BYTE> data((size_t)aToRead);
     
    13771321
    13781322    size_t cbRead;
    1379     int vrc = readDataAt(aOffset, aToRead, aTimeoutMS,
    1380                          data.raw(), aToRead, &cbRead);
     1323    int vrc = i_readDataAt(aOffset, aToRead, aTimeoutMS,
     1324                           data.raw(), aToRead, &cbRead);
    13811325    if (RT_SUCCESS(vrc))
    13821326    {
    13831327        if (data.size() != cbRead)
    13841328            data.resize(cbRead);
    1385         data.detachTo(ComSafeArrayOutArg(aData));
     1329        aData.resize(data.size());
     1330        for(size_t i = 0; i < data.size(); ++i)
     1331            aData[i] = data[i];
    13861332    }
    13871333    else
     
    14021348}
    14031349
    1404 STDMETHODIMP GuestFile::Seek(LONG64 aOffset, FileSeekType_T aType)
     1350HRESULT GuestFile::seek(LONG64 aOffset, FileSeekType_T aWhence)
    14051351{
    14061352#ifndef VBOX_WITH_GUEST_CONTROL
     
    14091355    LogFlowThisFuncEnter();
    14101356
    1411     AutoCaller autoCaller(this);
    1412     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1413 
    14141357    HRESULT hr = S_OK;
    14151358
    14161359    GUEST_FILE_SEEKTYPE eSeekType;
    1417     switch (aType)
     1360    switch (aWhence)
    14181361    {
    14191362        case FileSeekType_Set:
     
    14301373    }
    14311374
    1432     int vrc = seekAt(aOffset, eSeekType,
    1433                      30 * 1000 /* 30s timeout */, NULL /* puOffset */);
     1375    int vrc = i_seekAt(aOffset, eSeekType,
     1376                       30 * 1000 /* 30s timeout */, NULL /* puOffset */);
    14341377    if (RT_FAILURE(vrc))
    14351378    {
     
    14491392}
    14501393
    1451 STDMETHODIMP GuestFile::SetACL(IN_BSTR aACL)
    1452 {
    1453 #ifndef VBOX_WITH_GUEST_CONTROL
    1454     ReturnComNotImplemented();
    1455 #else
    1456     AutoCaller autoCaller(this);
    1457     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1458 
    1459     ReturnComNotImplemented();
    1460 #endif /* VBOX_WITH_GUEST_CONTROL */
    1461 }
    1462 
    1463 STDMETHODIMP GuestFile::Write(ComSafeArrayIn(BYTE, aData), ULONG aTimeoutMS, ULONG *aWritten)
     1394HRESULT GuestFile::setACL(const com::Utf8Str &aAcl)
     1395{
     1396#ifndef VBOX_WITH_GUEST_CONTROL
     1397    ReturnComNotImplemented();
     1398#else
     1399    ReturnComNotImplemented();
     1400#endif /* VBOX_WITH_GUEST_CONTROL */
     1401}
     1402
     1403HRESULT GuestFile::write(const std::vector<BYTE> &aData, ULONG aTimeoutMS, ULONG *aWritten)
    14641404{
    14651405#ifndef VBOX_WITH_GUEST_CONTROL
     
    14681408    LogFlowThisFuncEnter();
    14691409
    1470     CheckComArgSafeArrayNotNull(aData);
    1471     CheckComArgOutPointerValid(aWritten);
    1472 
    1473     AutoCaller autoCaller(this);
    1474     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1475 
    14761410    HRESULT hr = S_OK;
    14771411
    1478     com::SafeArray<BYTE> data(ComSafeArrayInArg(aData));
    1479     int vrc = writeData(aTimeoutMS, data.raw(), (uint32_t)data.size(),
    1480                         (uint32_t*)aWritten);
     1412    com::SafeArray<BYTE> data(aData);
     1413    int vrc = i_writeData(aTimeoutMS, data.raw(), (uint32_t)data.size(),
     1414                          (uint32_t*)aWritten);
    14811415    if (RT_FAILURE(vrc))
    14821416    {
     
    14961430}
    14971431
    1498 STDMETHODIMP GuestFile::WriteAt(LONG64 aOffset, ComSafeArrayIn(BYTE, aData), ULONG aTimeoutMS, ULONG *aWritten)
     1432HRESULT GuestFile::writeAt(LONG64 aOffset, const std::vector<BYTE> &aData, ULONG aTimeoutMS, ULONG *aWritten)
     1433
    14991434{
    15001435#ifndef VBOX_WITH_GUEST_CONTROL
     
    15031438    LogFlowThisFuncEnter();
    15041439
    1505     CheckComArgSafeArrayNotNull(aData);
    1506     CheckComArgOutPointerValid(aWritten);
    1507 
    1508     AutoCaller autoCaller(this);
    1509     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1510 
    15111440    HRESULT hr = S_OK;
    15121441
    1513     com::SafeArray<BYTE> data(ComSafeArrayInArg(aData));
    1514     int vrc = writeData(aTimeoutMS, data.raw(), (uint32_t)data.size(),
    1515                          (uint32_t*)aWritten);
     1442    com::SafeArray<BYTE> data(aData);
     1443    int vrc = i_writeData(aTimeoutMS, data.raw(), (uint32_t)data.size(),
     1444                          (uint32_t*)aWritten);
    15161445    if (RT_FAILURE(vrc))
    15171446    {
  • trunk/src/VBox/Main/src-client/GuestProcessImpl.cpp

    r50544 r50618  
    462462/////////////////////////////////////////////////////////////////////////////
    463463
    464 int GuestProcess::callbackDispatcher(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb)
     464int GuestProcess::i_callbackDispatcher(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb)
    465465{
    466466    AssertPtrReturn(pCbCtx, VERR_INVALID_POINTER);
     
    866866 * removed from the public process list.
    867867 */
    868 int GuestProcess::onRemove(void)
     868int GuestProcess::i_onRemove(void)
    869869{
    870870    LogFlowThisFuncEnter();
  • trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp

    r50559 r50618  
    293293        Assert(mData.mNumObjects);
    294294        mData.mNumObjects--;
    295         itDirs->second->onRemove();
     295        itDirs->second->i_onRemove();
    296296        itDirs->second->uninit();
    297297    }
     
    305305        Assert(mData.mNumObjects);
    306306        mData.mNumObjects--;
    307         itFiles->second->onRemove();
     307        itFiles->second->i_onRemove();
    308308        itFiles->second->uninit();
    309309    }
     
    317317        Assert(mData.mNumObjects);
    318318        mData.mNumObjects--;
    319         itProcs->second->onRemove();
     319        itProcs->second->i_onRemove();
    320320        itProcs->second->uninit();
    321321    }
     
    810810                         Utf8Str(strName).c_str(), mData.mSession.mID, mData.mDirectories.size() - 1, mData.mNumObjects - 1));
    811811
    812             rc = pDirectory->onRemove();
     812            rc = pDirectory->i_onRemove();
    813813            mData.mDirectories.erase(itDirs);
    814814            mData.mNumObjects--;
     
    10431043        alock.release();
    10441044
    1045         rc = pDirectory->callbackDispatcher(pCtxCb, pSvcCb);
     1045        rc = pDirectory->i_callbackDispatcher(pCtxCb, pSvcCb);
    10461046    }
    10471047    else
     
    10761076        alock.release();
    10771077
    1078         rc = pFile->callbackDispatcher(pCtxCb, pSvcCb);
     1078        rc = pFile->i_callbackDispatcher(pCtxCb, pSvcCb);
    10791079    }
    10801080    else
     
    11671167
    11681168        alock.release();
    1169         rc = pProcess->callbackDispatcher(pCtxCb, pSvcCb);
     1169        rc = pProcess->i_callbackDispatcher(pCtxCb, pSvcCb);
    11701170    }
    11711171    else
     
    12471247                             Utf8Str(strName).c_str(), mData.mSession.mID, mData.mFiles.size() - 1, mData.mNumObjects - 1));
    12481248
    1249             rc = pFile->onRemove();
     1249            rc = pFile->i_onRemove();
    12501250            mData.mFiles.erase(itFiles);
    12511251            mData.mNumObjects--;
     
    13851385    {
    13861386        int guestRc;
    1387         rc = pFile->openFile(30 * 1000 /* 30s timeout */, &guestRc);
     1387        rc = pFile->i_openFile(30 * 1000 /* 30s timeout */, &guestRc);
    13881388        if (   rc == VERR_GSTCTL_GUEST_ERROR
    13891389            && pGuestRc)
     
    18751875                         pProcess->getObjectID(), mData.mSession.mID, uPID, mData.mProcesses.size() - 1, mData.mNumObjects - 1));
    18761876
    1877             rc = pProcess->onRemove();
     1877            rc = pProcess->i_onRemove();
    18781878            mData.mProcesses.erase(itProcs);
    18791879            mData.mNumObjects--;
     
    29482948
    29492949            case VERR_GSTCTL_GUEST_ERROR:
    2950                 hr = GuestFile::setErrorExternal(this, guestRc);
     2950                hr = GuestFile::i_setErrorExternal(this, guestRc);
    29512951                break;
    29522952
     
    32853285
    32863286            case VERR_GSTCTL_GUEST_ERROR:
    3287                 hr = GuestFile::setErrorExternal(this, guestRc);
     3287                hr = GuestFile::i_setErrorExternal(this, guestRc);
    32883288                break;
    32893289
  • trunk/src/VBox/Main/src-client/xpcom/module.cpp

    r50613 r50618  
    6969NS_IMPL_THREADSAFE_ISUPPORTS1_CI(Guest, IGuest)
    7070 #ifdef VBOX_WITH_GUEST_CONTROL
    71 NS_DECL_CLASSINFO(GuestFile)
    72 NS_IMPL_THREADSAFE_ISUPPORTS2_CI(GuestFile, IGuestFile, IFile)
    7371NS_DECL_CLASSINFO(GuestProcess)
    7472NS_IMPL_THREADSAFE_ISUPPORTS2_CI(GuestProcess, IGuestProcess, IProcess)
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette