VirtualBox

Changeset 50837 in vbox for trunk/src/VBox/Additions


Ignore:
Timestamp:
Mar 21, 2014 9:29:56 AM (11 years ago)
Author:
vboxsync
Message:

Additions: also check the actual result of certain vbglDriverIOCtl() calls

Location:
trunk/src/VBox/Additions/common/VBoxGuestLib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxGuestLib/HGCM.cpp

    r44528 r50837  
    138138        return VERR_INVALID_PARAMETER;
    139139
    140     pHandleData = vbglHGCMHandleAlloc ();
    141 
    142     rc = VINF_SUCCESS;
    143 
     140    pHandleData = vbglHGCMHandleAlloc();
    144141    if (!pHandleData)
    145     {
    146142        rc = VERR_NO_MEMORY;
    147     }
    148143    else
    149144    {
    150145        rc = vbglDriverOpen (&pHandleData->driver);
    151 
    152146        if (RT_SUCCESS(rc))
    153147        {
    154148            rc = vbglDriverIOCtl (&pHandleData->driver, VBOXGUEST_IOCTL_HGCM_CONNECT, pData, sizeof (*pData));
    155 
    156             if (RT_SUCCESS(rc))
     149            if (   RT_SUCCESS(rc)
     150                && RT_SUCCESS(pData->result))
    157151            {
    158152                *pHandle = pHandleData;
    159             }
    160             else
    161             {
    162                 vbglDriverClose (&pHandleData->driver);
     153                return rc;
    163154            }
    164155        }
    165 
    166         if (RT_FAILURE(rc))
    167         {
    168             vbglHGCMHandleFree (pHandleData);
    169         }
    170156    }
    171 
     157    vbglDriverClose (&pHandleData->driver);
     158    vbglHGCMHandleFree (pHandleData);
    172159    return rc;
    173160}
  • trunk/src/VBox/Additions/common/VBoxGuestLib/Mouse.cpp

    r42227 r50837  
    4646    VBoxGuestMouseSetNotifyCallback NotifyCallback;
    4747    VBGLDRIVER *pDriver;
    48     int rc;
    49 
    50     rc = vbglGetDriver(&pDriver);
     48    int rc = vbglGetDriver(&pDriver);
    5149    if (RT_FAILURE(rc))
    5250        return rc;
     
    8583    if (RT_FAILURE(rc))
    8684        return rc;
     85    if (RT_FAILURE(Req.header.rc))
     86        return Req.header.rc;
    8787    if (pfFeatures)
    8888        *pfFeatures = Req.mouseFeatures;
Note: See TracChangeset for help on using the changeset viewer.

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