VirtualBox

Changeset 36309 in vbox


Ignore:
Timestamp:
Mar 17, 2011 2:43:25 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
70617
Message:

Main/GuestCtrl: Some more checking for SetProcessInput.

File:
1 edited

Legend:

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

    r36206 r36309  
    12431243                && !fCompleted)
    12441244            {
    1245                     /* If we previously got completed notification, don't trigger again. */
     1245                /* If we previously got completed notification, don't trigger again. */
    12461246                it->second.pProgress->notifyComplete(S_OK);
    12471247            }
     
    12701270        /* Save bytes processed. */
    12711271        pCBData->cbProcessed = pData->cbProcessed;
     1272        pCBData->u32Status = pData->u32Status;
     1273        pCBData->u32Flags = pData->u32Flags;
     1274        pCBData->u32PID = pData->u32PID;
    12721275
    12731276        /* Only trigger completion once. */
     
    19501953                    if (FAILED(rc)) throw rc;
    19511954
    1952                     /* Was the call completed within time? */
    1953                     LONG uResult;
    1954                     if (   SUCCEEDED(it->second.pProgress->COMGETTER(ResultCode)(&uResult))
    1955                         && uResult == S_OK)
    1956                     {
    1957                         PCALLBACKDATAEXECINSTATUS pStatusData = (PCALLBACKDATAEXECINSTATUS)it->second.pvData;
    1958                         AssertPtr(pStatusData);
    1959                         Assert(it->second.cbData == sizeof(CALLBACKDATAEXECINSTATUS));
    1960 
    1961                         *aBytesWritten = pStatusData->cbProcessed;
    1962                     }
    1963                     else if (   SUCCEEDED(it->second.pProgress->COMGETTER(Canceled)(&fCanceled))
    1964                              && fCanceled)
    1965                     {
    1966                         rc = setError(VBOX_E_IPRT_ERROR,
    1967                                       tr("The input operation was canceled by the guest"));
     1955                    /* Was the operation canceled by one of the parties? */
     1956                    rc = it->second.pProgress->COMGETTER(Canceled)(&fCanceled);
     1957                    if (FAILED(rc)) throw rc;
     1958
     1959                    if (!fCanceled)
     1960                    {   
     1961                        BOOL fCompleted;
     1962                        if (   SUCCEEDED(it->second.pProgress->COMGETTER(Completed)(&fCompleted))
     1963                            && fCompleted)
     1964                        {
     1965                            AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);                       
     1966
     1967                            PCALLBACKDATAEXECINSTATUS pStatusData = (PCALLBACKDATAEXECINSTATUS)it->second.pvData;
     1968                            AssertPtr(pStatusData);
     1969                            Assert(it->second.cbData == sizeof(CALLBACKDATAEXECINSTATUS));
     1970
     1971                            switch (pStatusData->u32Status)
     1972                            {
     1973                                case INPUT_STS_WRITTEN:
     1974                                    *aBytesWritten = pStatusData->cbProcessed;
     1975                                    break;
     1976
     1977                                default:
     1978                                    rc = setError(VBOX_E_IPRT_ERROR,
     1979                                                  tr("Client error %u while processing input data"), pStatusData->u32Status);
     1980                                    break;
     1981                            }                                                           
     1982                        }
     1983                        else
     1984                            rc = setError(VBOX_E_IPRT_ERROR,
     1985                                          tr("The input operation was not acknowledged from guest within time (%ums)"), aTimeoutMS);
    19681986                    }
    19691987                    else
    19701988                        rc = setError(VBOX_E_IPRT_ERROR,
    1971                                       tr("The input operation was not acknowledged from guest within time (%ums)"), aTimeoutMS);
    1972 
     1989                                      tr("The input operation was canceled by the guest"));
    19731990                    {
    19741991                        AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
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