VirtualBox

Ignore:
Timestamp:
Jul 5, 2007 8:14:18 AM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
22642
Message:

Fixed issue with NULL parameter passing

Location:
trunk/src/VBox/Additions/WINNT/Graphics/OpenGL
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/OpenGL/OGLComplexSync.cpp

    r3427 r3432  
    122122{
    123123    /* if ppfd == NULL, then DrvDescribelayerPlane returns the maximum nr of supported pixel formats */
    124     if (ppfd)
    125     {
    126         VBOX_OGL_GEN_SYNC_OP4_PASS_PTR_RET(int, DrvDescribePixelFormat, hdc, iPixelFormat, nBytes, nBytes, ppfd);
    127         return retval;
    128     }
    129     else
    130     {
    131         VBOX_OGL_GEN_SYNC_OP4_RET(int, DrvDescribePixelFormat, hdc, iPixelFormat, nBytes, ppfd);
    132         return retval;
    133     }
     124    VBOX_OGL_GEN_SYNC_OP4_PASS_PTR_RET(int, DrvDescribePixelFormat, hdc, iPixelFormat, nBytes, nBytes, ppfd);
     125    return retval;
    134126}
    135127
  • trunk/src/VBox/Additions/WINNT/Graphics/OpenGL/VBoxOGL.cpp

    r3339 r3432  
    435435    parms.lasterror.type                    = VMMDevHGCMParmType_32bit;
    436436    parms.lasterror.u.value32               = 0;
    437     parms.pLastParam.type                   = VMMDevHGCMParmType_LinAddr;
    438     parms.pLastParam.u.Pointer.size         = cbParam;
    439     parms.pLastParam.u.Pointer.u.linearAddr = (vmmDevHypPtr)pLastParam;
     437    if (!cbParam || !pLastParam)
     438    {
     439        parms.pLastParam.type                   = VMMDevHGCMParmType_LinAddr;
     440        parms.pLastParam.u.Pointer.size         = cbParam;
     441        parms.pLastParam.u.Pointer.u.linearAddr = (vmmDevHypPtr)pLastParam;
     442    }
     443    else
     444    {
     445        /* Placeholder as HGCM doesn't like NULL pointers */
     446        Assert(!cbParam && !pLastParam);
     447        parms.pLastParam.type                   = VMMDevHGCMParmType_32bit;
     448        parms.pLastParam.u.value32              = 0;
     449    }
    440450
    441451    int rc = vboxHGCMCall(vboxOGLCtx.hGuestDrv, &parms, sizeof (parms));
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