VirtualBox

Changeset 37165 in vbox for trunk/src/VBox


Ignore:
Timestamp:
May 20, 2011 1:22:01 PM (14 years ago)
Author:
vboxsync
Message:

wddm: fix autoresize

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/common/VBoxMPVidModes.cpp

    r37127 r37165  
    869869        {
    870870            VBoxFillVidModeInfo(&g_CustomVideoModes[VidPnTargetId], xres, yres, bpp, 1/*index*/, 0);
     871            Assert(g_CustomVideoModes[VidPnTargetId].ModeIndex == 1);
    871872        }
    872873    }
     
    875876    if (g_CustomVideoModes[VidPnTargetId].ModeIndex)
    876877    {
    877         if (RT_ELEMENTS(pModes->aModes) == pModes->cModes)
     878        if (RT_ELEMENTS(pModes->aModes) > pModes->cModes)
    878879        {
    879880            g_CustomVideoModes[VidPnTargetId].ModeIndex = pModes->cModes;
     
    903904                {
    904905                    WARN(("table full, can't add other bpp for specail mode!"));
     906#ifdef DEBUG_misha
     907                    /* this is definitely something we do not expect */
     908                    AssertFailed();
     909#endif
    905910                    break;
    906911                }
     912
     913                AssertRelease(RT_ELEMENTS(pModes->aModes) > pModes->cModes); /* if not - the driver state is screwed up, @todo: better do KeBugCheckEx here */
    907914
    908915                if (pModes->aModes[pModes->iPreferredMode].BitsPerPlane != bpp)
     
    912919                                        pModes->aModes[pModes->iPreferredMode].VisScreenHeight,
    913920                                        bpp, pModes->cModes, 0);
    914                     if (!VBoxMPFindVideoMode(pModes->aModes, pModes->cModes, &pModes->aModes[pModes->cModes]))
     921                    if (VBoxMPFindVideoMode(pModes->aModes, pModes->cModes, &pModes->aModes[pModes->cModes]) < 0)
    915922                    {
    916923                        ++pModes->cModes;
     
    921928        else
    922929        {
     930            AssertRelease(RT_ELEMENTS(pModes->aModes) == pModes->cModes); /* if not - the driver state is screwed up, @todo: better do KeBugCheckEx here */
    923931            WARN(("table full, can't add video mode for a host request!"));
     932#ifdef DEBUG_misha
     933            /* this is definitely something we do not expect */
     934            AssertFailed();
     935#endif
    924936        }
    925937    }
     
    931943        {
    932944           WARN(("table full, can't add addl modes!"));
     945#ifdef DEBUG_misha
     946            /* this is definitely something we do not expect */
     947            AssertFailed();
     948#endif
    933949           break;
    934950        }
     951
     952        AssertRelease(RT_ELEMENTS(pModes->aModes) > pModes->cModes); /* if not - the driver state is screwed up, @todo: better do KeBugCheckEx here */
    935953
    936954        if (!pExt->fAnyX)
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