VirtualBox

Ignore:
Timestamp:
Sep 10, 2007 3:54:41 PM (17 years ago)
Author:
vboxsync
Message:

Fixed wraparound

File:
1 edited

Legend:

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

    r4673 r4675  
    550550    {
    551551        /* deflate */
    552         for (uint32_t i=pDevExt->MemBalloon.cBalloons-1;i>=u32BalloonSize;i--)
    553         {
    554             PMDL  pMdl = pDevExt->MemBalloon.paMdlMemBalloon[i];
     552        for (uint32_t _i=pDevExt->MemBalloon.cBalloons;_i>u32BalloonSize;_i--)
     553        {
     554            uint32_t index = _i - 1;
     555            PMDL  pMdl = pDevExt->MemBalloon.paMdlMemBalloon[index];
    555556
    556557            Assert(pMdl);
    557558            if (pMdl)
    558559            {
     560#ifdef TARGET_NT4
    559561                PVOID pvBalloon = MmGetMdlVirtualAddress(pMdl);
     562#endif
    560563
    561564                PPFN_NUMBER pPageDesc = MmGetMdlPfnArray(pMdl);
     
    576579                }
    577580
    578                 dprintf(("VBoxGuest::VBoxGuestSetBalloonSize %d MB free chunk at %x\n", i, pvBalloon));
    579 
    580581                /* Free the ballooned memory */
    581582#ifndef TARGET_NT4
     583                dprintf(("VBoxGuest::VBoxGuestSetBalloonSize %d MB free chunk at %x\n", index, pMdl));
    582584                MmFreePagesFromMdl(pMdl);
    583585                ExFreePool(pMdl);
    584586#else
     587                dprintf(("VBoxGuest::VBoxGuestSetBalloonSize %d MB free chunk at %x\n", index, pvBalloon));
    585588                MmUnlockPages (pMdl);
    586589                IoFreeMdl (pMdl);
     
    588591#endif
    589592
    590                 pDevExt->MemBalloon.paMdlMemBalloon[i] = NULL;
     593                pDevExt->MemBalloon.paMdlMemBalloon[index] = NULL;
    591594                pDevExt->MemBalloon.cBalloons--;
    592595            }
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