VirtualBox

Ignore:
Timestamp:
Apr 25, 2008 11:23:10 AM (17 years ago)
Author:
vboxsync
Message:

Additions/WINNT: made the graphics miniport driver set the graphics guest capability

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.cpp

    r8155 r8383  
    2323
    2424#include <VBox/VBoxGuest.h>
     25#include <VBox/VBoxDev.h>
    2526#include <VBox/VBoxVideo.h>
    2627
     
    18301831
    18311832/**
     1833 * VBoxVideoSetGraphicsCap
     1834 *
     1835 * Tells the host whether or not we currently support graphics in the
     1836 * additions
     1837 */
     1838BOOLEAN FASTCALL VBoxVideoSetGraphicsCap(BOOLEAN isEnabled)
     1839{
     1840    VMMDevReqGuestCapabilities2 *req = NULL;
     1841    int rc;
     1842
     1843    rc = VbglGRAlloc ((VMMDevRequestHeader **)&req,
     1844                      sizeof (VMMDevReqGuestCapabilities2),
     1845                      VMMDevReq_SetGuestCapabilities);
     1846
     1847    if (!RT_SUCCESS(rc))
     1848        dprintf(("VBoxVideoSetGraphicsCap: failed to allocate a request, rc=%Rrc\n", rc));
     1849    else
     1850    {
     1851        req->u32OrMask = isEnabled ? VMMDEV_GUEST_SUPPORTS_GRAPHICS : 0;
     1852        req->u32NotMask = isEnabled ? 0 : VMMDEV_GUEST_SUPPORTS_GRAPHICS;
     1853 
     1854        rc = VbglGRPerform (&req->header);
     1855        if (!RT_SUCCESS(rc) || !RT_SUCCESS(req->header.rc))
     1856            dprintf(("VBoxVideoSetGraphicsCap: request failed, rc = %Rrc, VMMDev rc = %Rrc\n", rc, req->header.rc));
     1857        if (RT_SUCCESS(rc))
     1858            rc = req->header.rc;
     1859    }
     1860    if (req != NULL)
     1861        VbglGRFree (&req->header);
     1862    return RT_SUCCESS(rc);
     1863}
     1864
     1865/**
    18321866 * VBoxVideoSetCurrentMode
    18331867 *
     
    18651899    /** @todo read from the port to see if the mode switch was successful */
    18661900
     1901    /* Tell the host that we now support graphics in the additions */
     1902    VBoxVideoSetGraphicsCap(TRUE);
    18671903    return TRUE;
    18681904}
     
    18971933#endif
    18981934
    1899    return TRUE;
     1935    /* Tell the host that we no longer support graphics in the additions */
     1936    VBoxVideoSetGraphicsCap(FALSE);
     1937    return TRUE;
    19001938}
    19011939
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