VirtualBox

Changeset 99945 in vbox for trunk/src/VBox/Devices/PC


Ignore:
Timestamp:
May 23, 2023 9:29:27 PM (21 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
157602
Message:

Devices/PC/DevQemuFwCfg: Add screenshot support for the RAM based framebuffer, bugref:10431

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/PC/DevQemuFwCfg.cpp

    r99917 r99945  
    16781678                                                            uint32_t *pcx, uint32_t *pcy)
    16791679{
    1680     RT_NOREF(pInterface, ppbData, pcbData, pcx, pcy);
    1681     return VERR_NOT_SUPPORTED;
     1680    PDEVQEMUFWCFG pThis = RT_FROM_MEMBER(pInterface, DEVQEMUFWCFG, IPortRamfb);
     1681
     1682    LogFlowFunc(("\n"));
     1683
     1684    int const rcLock = PDMDevHlpCritSectEnter(pThis->pDevIns, &pThis->CritSectRamfb, VERR_SEM_BUSY);
     1685    PDM_CRITSECT_RELEASE_ASSERT_RC_DEV(pThis->pDevIns, &pThis->CritSectRamfb, rcLock);
     1686
     1687    int rc;
     1688    size_t cbData = pThis->RamfbCfg.cHeight * pThis->RamfbCfg.cbStride;
     1689    if (   pThis->RamfbCfg.GCPhysRamfbBase
     1690        && cbData)
     1691    {
     1692        uint8_t *pbData = (uint8_t *)RTMemAlloc(cbData);
     1693        if (pbData)
     1694        {
     1695            rc = PDMDevHlpPhysReadUser(pThis->pDevIns, pThis->RamfbCfg.GCPhysRamfbBase, pbData, cbData);
     1696            if (RT_SUCCESS(rc))
     1697            {
     1698                *ppbData = pbData;
     1699                *pcbData = cbData;
     1700                *pcx     = pThis->RamfbCfg.cWidth;
     1701                *pcy     = pThis->RamfbCfg.cHeight;
     1702            }
     1703        }
     1704        else
     1705            rc = VERR_NO_MEMORY;
     1706    }
     1707    else
     1708        rc = VERR_NOT_SUPPORTED;
     1709
     1710    PDMDevHlpCritSectLeave(pThis->pDevIns, &pThis->CritSectRamfb);
     1711    return rc;
    16821712}
    16831713
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