VirtualBox

Ignore:
Timestamp:
Sep 6, 2007 2:50:26 PM (17 years ago)
Author:
vboxsync
Message:

Updates

File:
1 edited

Legend:

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

    r4526 r4579  
    428428}
    429429
    430 static NTSTATUS VBoxGuestQueryMemoryBalloon(PVBOXGUESTDEVEXT pDevExt)
    431 {
    432     NTSTATUS Status = STATUS_SUCCESS;
    433 
     430static int VBoxGuestQueryMemoryBalloon(PVBOXGUESTDEVEXT pDevExt, ULONG *pMemBalloonSize)
     431{
    434432    /* just perform the request */
    435433    VMMDevGetMemBalloonChangeRequest *req = NULL;
     
    449447            dprintf(("VBoxGuest::VBoxGuestDeviceControl IOCTL_VBOXGUEST_CTL_CHECK_BALLOON: error issuing request to VMMDev!"
    450448                     "rc = %d, VMMDev rc = %Vrc\n", rc, req->header.rc));
    451             Status = STATUS_UNSUCCESSFUL;
    452449        }
    453450        else
     
    458455        VbglGRFree(&req->header);
    459456    }
    460     else
    461     {
    462         Status = STATUS_UNSUCCESSFUL;
    463     }
    464     return Status;
     457    return rc;
    465458}
    466459
     
    815808        case IOCTL_VBOXGUEST_CTL_CHECK_BALLOON:
    816809        {
    817             Status = VBoxGuestQueryMemoryBalloon(pDevExt);
     810            ULONG *pMemBalloonSize = (ULONG *) pBuf;
     811
     812            if (pStack->Parameters.DeviceIoControl.OutputBufferLength != sizeof(ULONG))
     813            {
     814                dprintf(("VBoxGuest::VBoxGuestDeviceControl: OutputBufferLength %d != sizeof(ULONG) %d\n",
     815                         pStack->Parameters.DeviceIoControl.OutputBufferLength, sizeof(ULONG)));
     816                Status = STATUS_INVALID_PARAMETER;
     817                break;
     818            }
     819
     820            int rc = VBoxGuestQueryMemoryBalloon(pDevExt, pMemBalloonSize);
     821            if (VBOX_FAILURE(rc))
     822            {
     823                dprintf(("IOCTL_VBOXGUEST_CTL_CHECK_BALLOON: vbox rc = %Vrc\n", rc));
     824                Status = STATUS_UNSUCCESSFUL;
     825            }
     826            else
     827            {
     828                cbOut = pStack->Parameters.DeviceIoControl.OutputBufferLength;
     829            }
    818830            break;
    819831        }
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