VirtualBox

Changeset 54615 in vbox for trunk/src


Ignore:
Timestamp:
Mar 3, 2015 11:48:06 PM (10 years ago)
Author:
vboxsync
Message:

Fixed VBOXGUEST_IOCTL_CANCEL_ALL_WAITEVENTS validation and adjusted some logging.

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

Legend:

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

    r54614 r54615  
    6464*******************************************************************************/
    6565#define VBOXGUEST_ACQUIRE_STYLE_EVENTS (VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST | VMMDEV_EVENT_SEAMLESS_MODE_CHANGE_REQUEST)
    66 
    67 
    68 /*******************************************************************************
    69 *   Structures and Typedefs                                                    *
    70 *******************************************************************************/
    71 /** Host flags to be updated by a given invocation of the
    72  * vboxGuestUpdateHostFlags() method. */
    73 /** @todo r=bird: Use RT_BIT_32 for the bits, preferably replace enum with
    74  *        \#define. */
    75 enum
    76 {
    77     HostFlags_FilterMask   = 1,
    78     HostFlags_MouseStatus  = 4,
    79     HostFlags_All          = 7,
    80     HostFlags_SizeHack = (unsigned)-1
    81 };
    8266
    8367
     
    15271511static int vbgdIoCtl_GetVMMDevPort(PVBOXGUESTDEVEXT pDevExt, VBoxGuestPortInfo *pInfo, size_t *pcbDataReturned)
    15281512{
    1529     LogFlow(("VbgdCommonIoCtl: GETVMMDEVPORT\n"));
     1513    LogFlow(("VBOXGUEST_IOCTL_GETVMMDEVPORT\n"));
    15301514
    15311515    pInfo->portAddress = pDevExt->IOPortBase;
     
    15471531int vbgdIoCtl_SetMouseNotifyCallback(PVBOXGUESTDEVEXT pDevExt, VBoxGuestMouseSetNotifyCallback *pNotify)
    15481532{
    1549     LogFlow(("VbgdCommonIoCtl: SET_MOUSE_NOTIFY_CALLBACK\n"));
     1533    LogFlow(("VBOXGUEST_IOCTL_SET_MOUSE_NOTIFY_CALLBACK: pfnNotify=%p pvUser=%p\n", pNotify->pfnNotify, pNotify->pvUser));
    15501534
    15511535    RTSpinlockAcquire(pDevExt->EventSpinlock);
     
    15781562        pInfo->u32Result = VBOXGUEST_WAITEVENT_OK;
    15791563        if (fReqEvents & ~((uint32_t)1 << iEvent))
    1580             LogFlow(("VbgdCommonIoCtl: WAITEVENT: returns %#x\n", pInfo->u32EventFlagsOut));
     1564            LogFlow(("VBOXGUEST_IOCTL_WAITEVENT: returns %#x\n", pInfo->u32EventFlagsOut));
    15811565        else
    1582             LogFlow(("VbgdCommonIoCtl: WAITEVENT: returns %#x/%d\n", pInfo->u32EventFlagsOut, iEvent));
     1566            LogFlow(("VBOXGUEST_IOCTL_WAITEVENT: returns %#x/%d\n", pInfo->u32EventFlagsOut, iEvent));
    15831567        pSession->fPendingCancelWaitEvents = false;
    15841568        return VINF_SUCCESS;
     
    16101594    if (RT_UNLIKELY(iEvent < 0))
    16111595    {
    1612         LogRel(("VbgdCommonIoCtl: WAITEVENT: Invalid input mask %#x!!\n", fReqEvents));
     1596        LogRel(("VBOXGUEST_IOCTL_WAITEVENT: Invalid input mask %#x!!\n", fReqEvents));
    16131597        return VERR_INVALID_PARAMETER;
    16141598    }
     
    16251609    {
    16261610        pInfo->u32Result = VBOXGUEST_WAITEVENT_TIMEOUT;
    1627         LogFlow(("VbgdCommonIoCtl: WAITEVENT: returns VERR_TIMEOUT\n"));
     1611        LogFlow(("VBOXGUEST_IOCTL_WAITEVENT: returns VERR_TIMEOUT\n"));
    16281612        return VERR_TIMEOUT;
    16291613    }
     
    16801664        pInfo->u32Result = VBOXGUEST_WAITEVENT_OK;
    16811665        if (fReqEvents & ~((uint32_t)1 << iEvent))
    1682             LogFlow(("VbgdCommonIoCtl: WAITEVENT: returns %#x\n", pInfo->u32EventFlagsOut));
     1666            LogFlow(("VBOXGUEST_IOCTL_WAITEVENT: returns %#x\n", pInfo->u32EventFlagsOut));
    16831667        else
    1684             LogFlow(("VbgdCommonIoCtl: WAITEVENT: returns %#x/%d\n", pInfo->u32EventFlagsOut, iEvent));
     1668            LogFlow(("VBOXGUEST_IOCTL_WAITEVENT: returns %#x/%d\n", pInfo->u32EventFlagsOut, iEvent));
    16851669        rc = VINF_SUCCESS;
    16861670    }
     
    16901674        pInfo->u32Result = VBOXGUEST_WAITEVENT_INTERRUPTED;
    16911675        rc = VERR_INTERRUPTED;
    1692         LogFlow(("VbgdCommonIoCtl: WAITEVENT: returns VERR_INTERRUPTED\n"));
     1676        LogFlow(("VBOXGUEST_IOCTL_WAITEVENT: returns VERR_INTERRUPTED\n"));
    16931677    }
    16941678    else if (rc == VERR_TIMEOUT)
    16951679    {
    16961680        pInfo->u32Result = VBOXGUEST_WAITEVENT_TIMEOUT;
    1697         LogFlow(("VbgdCommonIoCtl: WAITEVENT: returns VERR_TIMEOUT (2)\n"));
     1681        LogFlow(("VBOXGUEST_IOCTL_WAITEVENT: returns VERR_TIMEOUT (2)\n"));
    16981682    }
    16991683    else
     
    17011685        if (RT_SUCCESS(rc))
    17021686        {
    1703             LogRelMax(32, ("VbgdCommonIoCtl: WAITEVENT: returns %Rrc but no events!\n", rc));
     1687            LogRelMax(32, ("VBOXGUEST_IOCTL_WAITEVENT: returns %Rrc but no events!\n", rc));
    17041688            rc = VERR_INTERNAL_ERROR;
    17051689        }
    17061690        pInfo->u32Result = VBOXGUEST_WAITEVENT_ERROR;
    1707         LogFlow(("VbgdCommonIoCtl: WAITEVENT: returns %Rrc\n", rc));
     1691        LogFlow(("VBOXGUEST_IOCTL_WAITEVENT: returns %Rrc\n", rc));
    17081692    }
    17091693
     
    17231707    bool                    fCancelledOne = false;
    17241708
    1725     LogFlow(("VbgdCommonIoCtl: CANCEL_ALL_WAITEVENTS\n"));
     1709    LogFlow(("VBOXGUEST_IOCTL_CANCEL_ALL_WAITEVENTS\n"));
    17261710
    17271711    /*
     
    17561740    return VINF_SUCCESS;
    17571741}
     1742
    17581743
    17591744/**
     
    19231908    const uint32_t          cbMinSize = (uint32_t)vmmdevGetRequestSize(enmType);
    19241909
    1925     LogFlow(("VbgdCommonIoCtl: VMMREQUEST type %d\n", pReqHdr->requestType));
     1910    LogFlow(("VBOXGUEST_IOCTL_VMMREQUEST: type %d\n", pReqHdr->requestType));
    19261911
    19271912    if (cbReq < cbMinSize)
    19281913    {
    1929         LogRel(("VbgdCommonIoCtl: VMMREQUEST: invalid hdr size %#x, expected >= %#x; type=%#x!!\n",
     1914        LogRel(("VBOXGUEST_IOCTL_VMMREQUEST: invalid hdr size %#x, expected >= %#x; type=%#x!!\n",
    19301915                cbReq, cbMinSize, enmType));
    19311916        return VERR_INVALID_PARAMETER;
     
    19331918    if (cbReq > cbData)
    19341919    {
    1935         LogRel(("VbgdCommonIoCtl: VMMREQUEST: invalid size %#x, expected >= %#x (hdr); type=%#x!!\n",
     1920        LogRel(("VBOXGUEST_IOCTL_VMMREQUEST: invalid size %#x, expected >= %#x (hdr); type=%#x!!\n",
    19361921                cbData, cbReq, enmType));
    19371922        return VERR_INVALID_PARAMETER;
     
    19401925    if (RT_FAILURE(rc))
    19411926    {
    1942         Log(("VbgdCommonIoCtl: VMMREQUEST: invalid header: size %#x, expected >= %#x (hdr); type=%#x; rc=%Rrc!!\n",
     1927        Log(("VBOXGUEST_IOCTL_VMMREQUEST: invalid header: size %#x, expected >= %#x (hdr); type=%#x; rc=%Rrc!!\n",
    19431928             cbData, cbReq, enmType, rc));
    19441929        return rc;
     
    19481933    if (RT_FAILURE(rc))
    19491934    {
    1950         Log(("VbgdCommonIoCtl: VMMREQUEST: Operation not allowed! type=%#x rc=%Rrc\n", enmType, rc));
     1935        Log(("VBOXGUEST_IOCTL_VMMREQUEST: Operation not allowed! type=%#x rc=%Rrc\n", enmType, rc));
    19511936        return rc;
    19521937    }
     
    19621947    if (RT_FAILURE(rc))
    19631948    {
    1964         Log(("VbgdCommonIoCtl: VMMREQUEST: failed to allocate %u (%#x) bytes to cache the request. rc=%Rrc!!\n",
     1949        Log(("VBOXGUEST_IOCTL_VMMREQUEST: failed to allocate %u (%#x) bytes to cache the request. rc=%Rrc!!\n",
    19651950             cbReq, cbReq, rc));
    19661951        return rc;
     
    19721957
    19731958    rc = VbglGRPerform(pReqCopy);
    1974     if (    RT_SUCCESS(rc)
    1975         &&  RT_SUCCESS(pReqCopy->rc))
     1959    if (   RT_SUCCESS(rc)
     1960        && RT_SUCCESS(pReqCopy->rc))
    19761961    {
    19771962        Assert(rc != VINF_HGCM_ASYNC_EXECUTE);
     
    19831968    }
    19841969    else if (RT_FAILURE(rc))
    1985         Log(("VbgdCommonIoCtl: VMMREQUEST: VbglGRPerform - rc=%Rrc!\n", rc));
     1970        Log(("VBOXGUEST_IOCTL_VMMREQUEST: VbglGRPerform - rc=%Rrc!\n", rc));
    19861971    else
    19871972    {
    1988         Log(("VbgdCommonIoCtl: VMMREQUEST: request execution failed; VMMDev rc=%Rrc!\n", pReqCopy->rc));
     1973        Log(("VBOXGUEST_IOCTL_VMMREQUEST: request execution failed; VMMDev rc=%Rrc!\n", pReqCopy->rc));
    19891974        rc = pReqCopy->rc;
    19901975    }
     
    20582043     * Unlink, free and return.
    20592044     */
    2060     if (    RT_FAILURE(rc)
    2061         &&  rc != VERR_TIMEOUT
    2062         &&  (    !fInterruptible
    2063              || rc != VERR_INTERRUPTED))
     2045    if (   RT_FAILURE(rc)
     2046        && rc != VERR_TIMEOUT
     2047        && (   !fInterruptible
     2048            || rc != VERR_INTERRUPTED))
    20642049        LogRel(("vbgdHgcmAsyncWaitCallback: wait failed! %Rrc\n", rc));
    20652050
     
    21072092     * to deal with cancelled requests.
    21082093     */
    2109     Log(("VbgdCommonIoCtl: HGCM_CONNECT: %.128s\n",
     2094    Log(("VBOXGUEST_IOCTL_HGCM_CONNECT: %.128s\n",
    21102095         pInfo->Loc.type == VMMDevHGCMLoc_LocalHost || pInfo->Loc.type == VMMDevHGCMLoc_LocalHost_Existing
    21112096         ? pInfo->Loc.u.host.achName : "<not local host>"));
     
    21142099    if (RT_SUCCESS(rc))
    21152100    {
    2116         Log(("VbgdCommonIoCtl: HGCM_CONNECT: u32Client=%RX32 result=%Rrc (rc=%Rrc)\n",
     2101        Log(("VBOXGUEST_IOCTL_HGCM_CONNECT: u32Client=%RX32 result=%Rrc (rc=%Rrc)\n",
    21172102             pInfo->u32ClientID, pInfo->result, rc));
    21182103        if (RT_SUCCESS(pInfo->result))
     
    21342119            {
    21352120                VBoxGuestHGCMDisconnectInfo Info;
    2136                 LogRelMax(32, ("VbgdCommonIoCtl: HGCM_CONNECT: too many HGCMConnect calls for one session!\n"));
     2121                LogRelMax(32, ("VBOXGUEST_IOCTL_HGCM_CONNECT: too many HGCMConnect calls for one session!\n"));
    21372122                Info.result = 0;
    21382123                Info.u32ClientID = pInfo->u32ClientID;
     
    21692154    if (i >= RT_ELEMENTS(pSession->aHGCMClientIds))
    21702155    {
    2171         LogRelMax(32, ("VbgdCommonIoCtl: HGCM_DISCONNECT: u32Client=%RX32\n", u32ClientId));
     2156        LogRelMax(32, ("VBOXGUEST_IOCTL_HGCM_DISCONNECT: u32Client=%RX32\n", u32ClientId));
    21722157        return VERR_INVALID_HANDLE;
    21732158    }
     
    21782163     * to deal with cancelled requests.
    21792164     */
    2180     Log(("VbgdCommonIoCtl: HGCM_DISCONNECT: u32Client=%RX32\n", pInfo->u32ClientID));
     2165    Log(("VBOXGUEST_IOCTL_HGCM_DISCONNECT: u32Client=%RX32\n", pInfo->u32ClientID));
    21812166    rc = VbglR0HGCMInternalDisconnect(pInfo, vbgdHgcmAsyncWaitCallback, pDevExt, RT_INDEFINITE_WAIT);
    21822167    if (RT_SUCCESS(rc))
    21832168    {
    2184         LogFlow(("VbgdCommonIoCtl: HGCM_DISCONNECT: result=%Rrc\n", pInfo->result));
     2169        LogFlow(("VBOXGUEST_IOCTL_HGCM_DISCONNECT: result=%Rrc\n", pInfo->result));
    21852170        if (pcbDataReturned)
    21862171            *pcbDataReturned = sizeof(*pInfo);
     
    22122197    if (pInfo->cParms > 4096) /* (Just make sure it doesn't overflow the next check.) */
    22132198    {
    2214         LogRel(("VbgdCommonIoCtl: HGCM_CALL: cParm=%RX32 is not sane\n", pInfo->cParms));
     2199        LogRel(("VBOXGUEST_IOCTL_HGCM_CALL: cParm=%RX32 is not sane\n", pInfo->cParms));
    22152200        return VERR_INVALID_PARAMETER;
    22162201    }
     
    22252210    if (cbData < cbActual)
    22262211    {
    2227         LogRel(("VbgdCommonIoCtl: HGCM_CALL: cbData=%#zx (%zu) required size is %#zx (%zu)\n",
     2212        LogRel(("VBOXGUEST_IOCTL_HGCM_CALL: cbData=%#zx (%zu) required size is %#zx (%zu)\n",
    22282213               cbData, cbData, cbActual, cbActual));
    22292214        return VERR_INVALID_PARAMETER;
     
    22402225    if (RT_UNLIKELY(i >= RT_ELEMENTS(pSession->aHGCMClientIds)))
    22412226    {
    2242         LogRelMax(32, ("VbgdCommonIoCtl: HGCM_CALL: Invalid handle. u32Client=%RX32\n", u32ClientId));
     2227        LogRelMax(32, ("VBOXGUEST_IOCTL_HGCM_CALL: Invalid handle. u32Client=%RX32\n", u32ClientId));
    22432228        return VERR_INVALID_HANDLE;
    22442229    }
     
    22502235     * be interruptible (should add a flag for this later I guess).
    22512236     */
    2252     LogFlow(("VbgdCommonIoCtl: HGCM_CALL: u32Client=%RX32\n", pInfo->u32ClientID));
     2237    LogFlow(("VBOXGUEST_IOCTL_HGCM_CALL: u32Client=%RX32\n", pInfo->u32ClientID));
    22532238    fFlags = !fUserData && pSession->R0Process == NIL_RTR0PROCESS ? VBGLR0_HGCMCALL_F_KERNEL : VBGLR0_HGCMCALL_F_USER;
    22542239    uint32_t cbInfo = (uint32_t)(cbData - cbExtra);
     
    22712256    if (RT_SUCCESS(rc))
    22722257    {
    2273         LogFlow(("VbgdCommonIoCtl: HGCM_CALL: result=%Rrc\n", pInfo->result));
     2258        LogFlow(("VBOXGUEST_IOCTL_HGCM_CALL: result=%Rrc\n", pInfo->result));
    22742259        if (pcbDataReturned)
    22752260            *pcbDataReturned = cbActual;
     
    22792264        if (   rc != VERR_INTERRUPTED
    22802265            && rc != VERR_TIMEOUT)
    2281             LogRelMax(32, ("VbgdCommonIoCtl: HGCM_CALL: %s Failed. rc=%Rrc.\n", f32bit ? "32" : "64", rc));
     2266            LogRelMax(32, ("VBOXGUEST_IOCTL_HGCM_CALL: %s Failed. rc=%Rrc.\n", f32bit ? "32" : "64", rc));
    22822267        else
    2283             Log(("VbgdCommonIoCtl: HGCM_CALL: %s Failed. rc=%Rrc.\n", f32bit ? "32" : "64", rc));
     2268            Log(("VBOXGUEST_IOCTL_HGCM_CALL: %s Failed. rc=%Rrc.\n", f32bit ? "32" : "64", rc));
    22842269    }
    22852270    return rc;
     
    23092294    int rc;
    23102295
    2311     LogFlow(("VbgdCommonIoCtl: CHECK_MEMORY_BALLOON\n"));
     2296    LogFlow(("VBOXGUEST_IOCTL_CHECK_BALLOON:\n"));
    23122297    rc = RTSemFastMutexRequest(pDevExt->MemBalloon.hMtx);
    23132298    AssertRCReturn(rc, rc);
     
    23522337            }
    23532338            else
    2354                 LogRel(("VbgdCommonIoCtl: CHECK_MEMORY_BALLOON: VbglGRPerform failed. rc=%Rrc\n", rc));
     2339                LogRel(("VBOXGUEST_IOCTL_CHECK_BALLOON: VbglGRPerform failed. rc=%Rrc\n", rc));
    23552340            VbglGRFree(&pReq->header);
    23562341        }
     
    23602345
    23612346    RTSemFastMutexRelease(pDevExt->MemBalloon.hMtx);
    2362     LogFlow(("VbgdCommonIoCtl: CHECK_MEMORY_BALLOON returns %Rrc\n", rc));
     2347    LogFlow(("VBOXGUEST_IOCTL_CHECK_BALLOON returns %Rrc\n", rc));
    23632348    return rc;
    23642349}
     
    23802365{
    23812366    int rc;
    2382 
    2383     LogFlow(("VbgdCommonIoCtl: CHANGE_BALLOON\n"));
     2367    LogFlow(("VBOXGUEST_IOCTL_CHANGE_BALLOON: fInflate=%RTbool u64ChunkAddr=%#RX64\n", pInfo->fInflate, pInfo->u64ChunkAddr));
     2368
    23842369    rc = RTSemFastMutexRequest(pDevExt->MemBalloon.hMtx);
    23852370    AssertRCReturn(rc, rc);
     
    24242409    VMMDevReqWriteCoreDump *pReq = NULL;
    24252410    int rc;
    2426 
    2427     LogFlow(("VbgdCommonIoCtl: WRITE_CORE_DUMP\n"));
     2411    LogFlow(("VBOXGUEST_IOCTL_WRITE_CORE_DUMP\n"));
     2412
    24282413    rc = VbglGRAlloc((VMMDevRequestHeader **)&pReq, sizeof(*pReq), VMMDevReq_WriteCoreDump);
    2429     if (RT_FAILURE(rc))
    2430     {
    2431         Log(("VbgdCommonIoCtl: WRITE_CORE_DUMP: failed to allocate %u (%#x) bytes to cache the request. rc=%Rrc!!\n",
     2414    if (RT_SUCCESS(rc))
     2415    {
     2416        pReq->fFlags = pInfo->fFlags;
     2417        rc = VbglGRPerform(&pReq->header);
     2418        if (RT_FAILURE(rc))
     2419            Log(("VBOXGUEST_IOCTL_WRITE_CORE_DUMP: VbglGRPerform failed, rc=%Rrc!\n", rc));
     2420
     2421        VbglGRFree(&pReq->header);
     2422    }
     2423    else
     2424        Log(("VBOXGUEST_IOCTL_WRITE_CORE_DUMP: failed to allocate %u (%#x) bytes to cache the request. rc=%Rrc!!\n",
    24322425             sizeof(*pReq), sizeof(*pReq), rc));
    2433         return rc;
    2434     }
    2435 
    2436     pReq->fFlags = pInfo->fFlags;
    2437     rc = VbglGRPerform(&pReq->header);
    2438     if (RT_FAILURE(rc))
    2439         Log(("VbgdCommonIoCtl: WRITE_CORE_DUMP: VbglGRPerform failed, rc=%Rrc!\n", rc));
    2440 
    2441     VbglGRFree(&pReq->header);
    24422426    return rc;
    24432427}
     
    24562440static int vbgdIoCtl_Log(PVBOXGUESTDEVEXT pDevExt, const char *pch, size_t cbData, size_t *pcbDataReturned, bool fUserSession)
    24572441{
    2458     NOREF(pch);
    2459     NOREF(cbData);
    24602442    if (pDevExt->fLoggingEnabled)
    24612443        RTLogBackdoorPrintf("%.*s", cbData, pch);
     
    27122694static int vbgdIoCtl_CtlFilterMask(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION pSession, VBoxGuestFilterMaskInfo *pInfo)
    27132695{
    2714     LogFlow(("VbgdCommonIoCtl: CTL_FILTER_MASK or=%#x not=%#x\n", pInfo->u32OrMask, pInfo->u32NotMask));
     2696    LogFlow(("VBOXGUEST_IOCTL_CTL_FILTER_MASK: or=%#x not=%#x\n", pInfo->u32OrMask, pInfo->u32NotMask));
    27152697
    27162698    if ((pInfo->u32OrMask | pInfo->u32NotMask) & ~VMMDEV_EVENT_VALID_EVENT_MASK)
    27172699    {
    2718         Log(("VbgdCommonIoCtl: CTL_FILTER_MASK or=%#x not=%#x: Invalid masks!\n", pInfo->u32OrMask, pInfo->u32NotMask));
     2700        Log(("VBOXGUEST_IOCTL_CTL_FILTER_MASK: or=%#x not=%#x: Invalid masks!\n", pInfo->u32OrMask, pInfo->u32NotMask));
    27192701        return VERR_INVALID_PARAMETER;
    27202702    }
     
    28632845{
    28642846    int rc;
    2865     LogFlow(("VbgdCommonIoCtl: CTL_FILTER_MASK features=%#x\n", fFeatures));
     2847    LogFlow(("VBOXGUEST_IOCTL_SET_MOUSE_STATUS: features=%#x\n", fFeatures));
    28662848
    28672849    if (fFeatures & ~VMMDEV_MOUSE_GUEST_MASK)
     
    32053187{
    32063188    int rc;
    3207     LogFlow(("VbgdCommonIoCtl: GUEST_CAPS_ACQUIRE or=%#x not=%#x flags=%#x\n",
     3189    LogFlow(("VBOXGUEST_IOCTL_GUEST_CAPS_ACQUIRE: or=%#x not=%#x flags=%#x\n",
    32083190             pAcquire->u32OrMask, pAcquire->u32NotMask, pAcquire->enmFlags));
    32093191
     
    33233305{
    33243306    int rc;
    3325     LogFlow(("VbgdCommonIoCtl: SET_GUEST_CAPABILITIES or=%#x not=%#x\n", pInfo->u32OrMask, pInfo->u32NotMask));
     3307    LogFlow(("VBOXGUEST_IOCTL_SET_GUEST_CAPABILITIES: or=%#x not=%#x\n", pInfo->u32OrMask, pInfo->u32NotMask));
    33263308
    33273309    if (!((pInfo->u32OrMask | pInfo->u32NotMask) & ~VMMDEV_GUEST_CAPABILITIES_MASK))
     
    34943476
    34953477            case VBOXGUEST_IOCTL_CANCEL_ALL_WAITEVENTS:
    3496                 if (cbData != 0)
    3497                     rc = VERR_INVALID_PARAMETER;
     3478                CHECKRET_SIZE("CANCEL_ALL_WAITEVENTS", 0);
    34983479                rc = vbgdIoCtl_CancelAllWaitEvents(pDevExt, pSession);
    34993480                break;
  • trunk/src/VBox/Additions/common/VBoxGuestLib/GenericRequest.cpp

    r47294 r54615  
    3737    if (!pReq || cbReq < sizeof (VMMDevRequestHeader))
    3838    {
    39         dprintf(("VbglGRVerify: Invalid parameter: pReq = %p, cbReq = %d\n", pReq, cbReq));
     39        dprintf(("VbglGRVerify: Invalid parameter: pReq = %p, cbReq = %zu\n", pReq, cbReq));
    4040        return VERR_INVALID_PARAMETER;
    4141    }
     
    4343    if (pReq->size > cbReq)
    4444    {
    45         dprintf(("VbglGRVerify: request size %d > buffer size %d\n", pReq->size, cbReq));
     45        dprintf(("VbglGRVerify: request size %u > buffer size %zu\n", pReq->size, cbReq));
    4646        return VERR_INVALID_PARAMETER;
    4747    }
     
    5252    if (cbReq < cbReqExpected)
    5353    {
    54         dprintf(("VbglGRVerify: buffer size %d < expected size %d\n", cbReq, cbReqExpected));
     54        dprintf(("VbglGRVerify: buffer size %zu < expected size %zu\n", cbReq, cbReqExpected));
    5555        return VERR_INVALID_PARAMETER;
    5656    }
     
    6363        if (pReq->size != cbReqExpected)
    6464        {
    65             dprintf(("VbglGRVerify: request size %d != expected size %d\n", pReq->size, cbReqExpected));
     65            dprintf(("VbglGRVerify: request size %u != expected size %zu\n", pReq->size, cbReqExpected));
    6666            return VERR_INVALID_PARAMETER;
    6767        }
     
    9191        if (cbReq > VMMDEV_MAX_VMMDEVREQ_SIZE)
    9292        {
    93             dprintf(("VbglGRVerify: VMMDevReq_LogString: buffer size %d too big\n", cbReq));
     93            dprintf(("VbglGRVerify: VMMDevReq_LogString: buffer size %zu too big\n", cbReq));
    9494            return VERR_BUFFER_OVERFLOW; /* @todo is this error code ok? */
    9595        }
     
    9797    else
    9898    {
    99         dprintf(("VbglGRVerify: request size %d > buffer size %d\n", pReq->size, cbReq));
     99        dprintf(("VbglGRVerify: request size %u > buffer size %zu\n", pReq->size, cbReq));
    100100        return VERR_IO_BAD_LENGTH; /* @todo is this error code ok? */
    101101    }
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