当前位置: 首页>>代码示例>>C++>>正文


C++ VBoxCommonFromDeviceExt函数代码示例

本文整理汇总了C++中VBoxCommonFromDeviceExt函数的典型用法代码示例。如果您正苦于以下问题:C++ VBoxCommonFromDeviceExt函数的具体用法?C++ VBoxCommonFromDeviceExt怎么用?C++ VBoxCommonFromDeviceExt使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了VBoxCommonFromDeviceExt函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: VBoxWddmUpdateVideoModesInfoByMask

PVBOXWDDM_VIDEOMODES_INFO VBoxWddmUpdateVideoModesInfoByMask(PVBOXMP_DEVEXT pExt, uint8_t *pScreenIdMask)
{
    for (int i = 0; i < VBoxCommonFromDeviceExt(pExt)->cDisplays; ++i)
    {
        if (ASMBitTest(pScreenIdMask, i))
            VBoxWddmInvalidateVideoModesInfo(pExt, i);
    }

    /* ensure we have all the rest populated */
    VBoxWddmGetAllVideoModesInfos(pExt);
    return g_aVBoxVideoModeInfos;
}
开发者ID:ryenus,项目名称:vbox,代码行数:12,代码来源:VBoxMPVidModes.cpp

示例2: vboxVBVAInformHost

static int vboxVBVAInformHost (PVBOXMP_DEVEXT pDevExt, VBOXVBVAINFO * pVbva, BOOL bEnable)
{
    int rc = VERR_NO_MEMORY;
    void *p = VBoxHGSMIBufferAlloc (&VBoxCommonFromDeviceExt(pDevExt)->guestCtx,
                                  sizeof (VBVAENABLE_EX),
                                  HGSMI_CH_VBVA,
                                  VBVA_ENABLE);
    Assert(p);
    if (!p)
    {
        LOGREL(("HGSMIHeapAlloc failed"));
        rc = VERR_NO_MEMORY;
    }
    else
    {
        VBVAENABLE_EX *pEnableEx = (VBVAENABLE_EX *)p;
        pEnableEx->u32ScreenId = pVbva->srcId;

        VBVAENABLE *pEnable = &pEnableEx->Base;
        pEnable->u32Flags  = bEnable? VBVA_F_ENABLE: VBVA_F_DISABLE;
        pEnable->u32Flags |= VBVA_F_EXTENDED | VBVA_F_ABSOFFSET;
        pEnable->u32Offset = (uint32_t)pVbva->offVBVA;
        pEnable->i32Result = VERR_NOT_SUPPORTED;

        VBoxHGSMIBufferSubmit (&VBoxCommonFromDeviceExt(pDevExt)->guestCtx, p);

        if (bEnable)
        {
            rc = pEnable->i32Result;
            AssertRC(rc);
        }
        else
            rc = VINF_SUCCESS;

        VBoxHGSMIBufferFree (&VBoxCommonFromDeviceExt(pDevExt)->guestCtx, p);
    }
    return rc;
}
开发者ID:MadHacker217,项目名称:VirtualBox-OSE,代码行数:38,代码来源:VBoxMPVbva.cpp

示例3: VBoxMPHgsmiHandlerEnable

/* Called for IOCTL_VIDEO_HGSMI_HANDLER_ENABLE.
 * Enables HGSMI miniport channel.
 */
BOOLEAN VBoxMPHgsmiHandlerEnable(PVBOXMP_DEVEXT pExt, HGSMIHANDLERENABLE *pChannel, PSTATUS_BLOCK pStatus)
{
    BOOLEAN bRC = TRUE;
    LOGF_ENTER();

    if (VBoxCommonFromDeviceExt(pExt)->bHGSMI)
    {
        int rc = VBoxVbvaChannelDisplayEnable(VBoxCommonFromDeviceExt(pExt), pExt->iDevice, pChannel->u8Channel);
        if (RT_FAILURE(rc))
        {
            pStatus->Status = ERROR_INVALID_NAME;
            bRC=FALSE;
        }
    }
    else
    {
        pStatus->Status = ERROR_INVALID_FUNCTION;
        bRC=FALSE;
    }

    LOGF_LEAVE();
    return bRC;
}
开发者ID:etiago,项目名称:vbox,代码行数:26,代码来源:VBoxMPIOCTL.cpp

示例4: VBoxMPHGSMIQueryCallbacks

/* Called for IOCTL_VIDEO_HGSMI_QUERY_CALLBACKS.
 * Returns HGSMI related callbacks.
 */
BOOLEAN VBoxMPHGSMIQueryCallbacks(PVBOXMP_DEVEXT pExt, HGSMIQUERYCALLBACKS *pCallbacks, PSTATUS_BLOCK pStatus)
{
    BOOLEAN bRC = TRUE;
    LOGF_ENTER();

    if (VBoxCommonFromDeviceExt(pExt)->bHGSMI)
    {
        pCallbacks->hContext = VBoxCommonFromDeviceExt(pExt);
        pCallbacks->pfnCompletionHandler = VBoxMPHGSMIHostCmdCompleteCB;
        pCallbacks->pfnRequestCommandsHandler = VBoxMPHGSMIHostCmdRequestCB;

        pStatus->Information = sizeof(HGSMIQUERYCALLBACKS);
    }
    else
    {
        pStatus->Status = ERROR_INVALID_FUNCTION;
        bRC=FALSE;
    }


    LOGF_LEAVE();
    return bRC;
}
开发者ID:etiago,项目名称:vbox,代码行数:26,代码来源:VBoxMPIOCTL.cpp

示例5: vboxVhwaHlpGetSurfInfo

int vboxVhwaHlpGetSurfInfo(PVBOXMP_DEVEXT pDevExt, PVBOXWDDM_ALLOCATION pSurf)
{
    for (int i = 0; i < VBoxCommonFromDeviceExt(pDevExt)->cDisplays; ++i)
    {
        PVBOXWDDM_SOURCE pSource = &pDevExt->aSources[i];
        if (pSource->Vhwa.Settings.fFlags & VBOXVHWA_F_ENABLED)
        {
            int rc = vboxVhwaHlpGetSurfInfoForSource(pDevExt, pSurf, i);
            AssertRC(rc);
            return rc;
        }
    }
    AssertBreakpoint();
    return VERR_NOT_SUPPORTED;
}
开发者ID:LastRitter,项目名称:vbox-haiku,代码行数:15,代码来源:VBoxMPVhwa.cpp

示例6: VBoxWddmAdjustMode

void VBoxWddmAdjustMode(PVBOXMP_DEVEXT pExt, PVBOXWDDM_ADJUSTVIDEOMODE pMode)
{
    pMode->fFlags = 0;

    if (pMode->Mode.Id >= (UINT)VBoxCommonFromDeviceExt(pExt)->cDisplays)
    {
        WARN(("invalid screen id (%d)", pMode->Mode.Id));
        pMode->fFlags = VBOXWDDM_ADJUSTVIDEOMODE_F_INVALISCREENID;
        return;
    }

    PVBOXWDDM_TARGET pTarget = &pExt->aTargets[pMode->Mode.Id];
    /* @todo: this info should go from the target actually */
    PVBOXWDDM_SOURCE pSource = &pExt->aSources[pMode->Mode.Id];

    UINT newWidth = pMode->Mode.Width;
    UINT newHeight = pMode->Mode.Height;
    UINT newBpp = pMode->Mode.BitsPerPixel;

    if (!VBoxMPValidateVideoModeParams(pExt, pMode->Mode.Id, newWidth, newHeight, newBpp))
    {
        PVBOXWDDM_SOURCE pSource = &pExt->aSources[pMode->Mode.Id];
        pMode->fFlags |= VBOXWDDM_ADJUSTVIDEOMODE_F_UNSUPPORTED;
    }

    if (pMode->Mode.Width != newWidth
            || pMode->Mode.Height != newHeight
            || pMode->Mode.BitsPerPixel != newBpp)
    {
        pMode->fFlags |= VBOXWDDM_ADJUSTVIDEOMODE_F_ADJUSTED;
        pMode->Mode.Width = newWidth;
        pMode->Mode.Height = newHeight;
        pMode->Mode.BitsPerPixel = newBpp;
    }

    if (pTarget->HeightVisible /* <- active */
            && pSource->AllocData.SurfDesc.width == pMode->Mode.Width
            && pSource->AllocData.SurfDesc.height == pMode->Mode.Height
            && pSource->AllocData.SurfDesc.bpp == pMode->Mode.BitsPerPixel)
    {
        pMode->fFlags |= VBOXWDDM_ADJUSTVIDEOMODE_F_CURRENT;
        if (pMode->fFlags & VBOXWDDM_ADJUSTVIDEOMODE_F_UNSUPPORTED)
        {
            WARN(("current mode is reported as unsupported"));
        }
    }
}
开发者ID:ryenus,项目名称:vbox,代码行数:47,代码来源:VBoxMPVidModes.cpp

示例7: VBoxMPCmnMapAdapterMemory

int VBoxMPCmnMapAdapterMemory(PVBOXMP_COMMON pCommon, void **ppv, uint32_t ulOffset, uint32_t ulSize)
{
    PVBOXMP_DEVEXT pPEXT = VBoxCommonToPrimaryExt(pCommon);

    LOGF(("0x%08X[0x%X]", ulOffset, ulSize));

    if (!ulSize)
    {
        WARN(("Illegal length 0!"));
        return ERROR_INVALID_PARAMETER;
    }

    PHYSICAL_ADDRESS FrameBuffer;
    FrameBuffer.QuadPart = VBoxCommonFromDeviceExt(pPEXT)->phVRAM.QuadPart + ulOffset;

    PVOID VideoRamBase = NULL;
    ULONG VideoRamLength = ulSize;
    VP_STATUS Status;
#ifndef VBOX_WITH_WDDM
    ULONG inIoSpace = 0;

    Status = VideoPortMapMemory(pPEXT, FrameBuffer, &VideoRamLength, &inIoSpace, &VideoRamBase);
#else
    NTSTATUS ntStatus = pPEXT->u.primary.DxgkInterface.DxgkCbMapMemory(pPEXT->u.primary.DxgkInterface.DeviceHandle,
            FrameBuffer,
            VideoRamLength,
            FALSE, /* IN BOOLEAN InIoSpace */
            FALSE, /* IN BOOLEAN MapToUserMode */
            MmNonCached, /* IN MEMORY_CACHING_TYPE CacheType */
            &VideoRamBase /*OUT PVOID *VirtualAddress*/
            );
    Assert(ntStatus == STATUS_SUCCESS);
    /* this is what VideoPortMapMemory returns according to the docs */
    Status = ntStatus == STATUS_SUCCESS ? NO_ERROR : ERROR_INVALID_PARAMETER;
#endif

    if (Status == NO_ERROR)
    {
        *ppv = VideoRamBase;
    }

    LOGF(("rc = %d", Status));

    return (Status==NO_ERROR) ? VINF_SUCCESS:VERR_INVALID_PARAMETER;
}
开发者ID:Rootkitsmm,项目名称:virtualbox-org-svn-vbox-trunk,代码行数:45,代码来源:VBoxMPCommon.cpp

示例8: vboxVhwaCommandSubmitAsynch

/* do not wait for completion */
void vboxVhwaCommandSubmitAsynch(PVBOXMP_DEVEXT pDevExt, VBOXVHWACMD* pCmd, PFNVBOXVHWACMDCOMPLETION pfnCompletion, void * pContext)
{
    pCmd->GuestVBVAReserved1 = (uintptr_t)pfnCompletion;
    pCmd->GuestVBVAReserved2 = (uintptr_t)pContext;
    vbvaVhwaCommandRetain(pDevExt, pCmd);

    VBoxHGSMIBufferSubmit(&VBoxCommonFromDeviceExt(pDevExt)->guestCtx, pCmd);

    if(!(pCmd->Flags & VBOXVHWACMD_FLAG_HG_ASYNCH)
            || ((pCmd->Flags & VBOXVHWACMD_FLAG_GH_ASYNCH_NOCOMPLETION)
                    && (pCmd->Flags & VBOXVHWACMD_FLAG_HG_ASYNCH_RETURNED)))
    {
        /* the command is completed */
        pfnCompletion(pDevExt, pCmd, pContext);
    }

    vbvaVhwaCommandRelease(pDevExt, pCmd);
}
开发者ID:LastRitter,项目名称:vbox-haiku,代码行数:19,代码来源:VBoxMPVhwa.cpp

示例9: VBoxMPSetPointerAttr

/* Called for IOCTL_VIDEO_SET_POINTER_ATTR.
 * Sets pointer attributes.
 */
BOOLEAN VBoxMPSetPointerAttr(PVBOXMP_DEVEXT pExt, PVIDEO_POINTER_ATTRIBUTES pPointerAttrs, uint32_t cbLen, PSTATUS_BLOCK pStatus)
{
    BOOLEAN bRC;

    LOGF_ENTER();

    if (VBoxQueryHostWantsAbsolute())
    {
        bRC = VBoxMPCmnUpdatePointerShape(VBoxCommonFromDeviceExt(pExt), pPointerAttrs, cbLen);
    }
    else
    {
        LOG(("Fallback to sw pointer."));
        pStatus->Status = ERROR_INVALID_FUNCTION;
        bRC = FALSE;
    }

    LOGF_LEAVE();
    return bRC;
}
开发者ID:etiago,项目名称:vbox,代码行数:23,代码来源:VBoxMPIOCTL.cpp

示例10: VBoxCmdVbvaCreate

int VBoxCmdVbvaCreate(PVBOXMP_DEVEXT pDevExt, VBOXCMDVBVA *pVbva, ULONG offBuffer, ULONG cbBuffer)
{
    memset(pVbva, 0, sizeof (*pVbva));

    int rc = VBoxMPCmnMapAdapterMemory(VBoxCommonFromDeviceExt(pDevExt),
                                       (void**)&pVbva->Vbva.pVBVA,
                                       offBuffer,
                                       cbBuffer);
    if (RT_SUCCESS(rc))
    {
        Assert(pVbva->Vbva.pVBVA);
        VBoxVBVAExSetupBufferContext(&pVbva->Vbva, offBuffer, cbBuffer, voxCmdVbvaFlushCb, pDevExt);
    }
    else
    {
        WARN(("VBoxMPCmnMapAdapterMemory failed rc %d", rc));
    }

    return rc;
}
开发者ID:egraba,项目名称:vbox_openbsd,代码行数:20,代码来源:VBoxMPVbva.cpp

示例11: VBoxMPVhwaQueryInfo

/* Called for IOCTL_VIDEO_VHWA_QUERY_INFO.
 * Returns framebuffer offset.
 */
BOOLEAN VBoxMPVhwaQueryInfo(PVBOXMP_DEVEXT pExt, VHWAQUERYINFO *pInfo, PSTATUS_BLOCK pStatus)
{
    BOOLEAN bRC = TRUE;
    LOGF_ENTER();

    if (VBoxCommonFromDeviceExt(pExt)->bHGSMI)
    {
        pInfo->offVramBase = (ULONG_PTR)pExt->ulFrameBufferOffset;

        pStatus->Information = sizeof (VHWAQUERYINFO);
    }
    else
    {
        pStatus->Status = ERROR_INVALID_FUNCTION;
        bRC=FALSE;
    }

    LOGF_LEAVE();
    return bRC;
}
开发者ID:etiago,项目名称:vbox,代码行数:23,代码来源:VBoxMPIOCTL.cpp

示例12: VBoxMPShareVideoMemory

/* Called for IOCTL_VIDEO_SHARE_VIDEO_MEMORY.
 * Maps FrameBuffer as a linear frame buffer to a caller's virtual adress space. (obsolete).
 */
BOOLEAN VBoxMPShareVideoMemory(PVBOXMP_DEVEXT pExt, PVIDEO_SHARE_MEMORY pShareMem,
                               PVIDEO_SHARE_MEMORY_INFORMATION pShareMemInfo, PSTATUS_BLOCK pStatus)
{
    PHYSICAL_ADDRESS shareAddress;
    ULONG inIoSpace = 0;
    ULONG offset, size;
    PVOID virtualAddress;
    ULONG ulMaxFBSize;

    LOGF_ENTER();

    ulMaxFBSize = pExt->pPrimary->u.primary.ulMaxFrameBufferSize;
    offset = pShareMem->ViewOffset;
    size = pShareMem->ViewSize;
    virtualAddress = pShareMem->ProcessHandle;
    VBOXMPIOCTL_HIDE(pShareMem);

    if ((offset>ulMaxFBSize) || ((offset+size)>ulMaxFBSize))
    {
        WARN(("share failed offset:size(%#x:%#x) > %#x fb size.", offset, size, ulMaxFBSize));
        pStatus->Status = ERROR_INVALID_PARAMETER;
        return FALSE;
    }

    shareAddress.QuadPart = VBoxCommonFromDeviceExt(pExt)->phVRAM.QuadPart + pExt->ulFrameBufferOffset;

    pStatus->Status = VideoPortMapMemory(pExt, shareAddress, &size, &inIoSpace, &virtualAddress);

    if (NO_ERROR == pStatus->Status)
    {
        pShareMemInfo->SharedViewOffset = offset;
        pShareMemInfo->SharedViewSize = size;
        pShareMemInfo->VirtualAddress = virtualAddress;

        pStatus->Information = sizeof(VIDEO_SHARE_MEMORY_INFORMATION);
    }

    VBOXMPIOCTL_UNHIDE();
    LOGF_LEAVE();
    return NO_ERROR == pStatus->Status;
}
开发者ID:etiago,项目名称:vbox,代码行数:44,代码来源:VBoxMPIOCTL.cpp

示例13: VBoxMPHGSMIQueryPortProcs

/* Called for IOCTL_VIDEO_HGSMI_QUERY_PORTPROCS.
 * Returns video port api function pointers.
 */
BOOLEAN VBoxMPHGSMIQueryPortProcs(PVBOXMP_DEVEXT pExt, HGSMIQUERYCPORTPROCS *pProcs, PSTATUS_BLOCK pStatus)
{
    BOOLEAN bRC = TRUE;
    LOGF_ENTER();

    if (VBoxCommonFromDeviceExt(pExt)->bHGSMI)
    {
        pProcs->pContext = pExt->pPrimary;
        pProcs->VideoPortProcs = pExt->pPrimary->u.primary.VideoPortProcs;

        pStatus->Information = sizeof(HGSMIQUERYCPORTPROCS);
    }
    else
    {
        pStatus->Status = ERROR_INVALID_FUNCTION;
        bRC=FALSE;
    }

    LOGF_LEAVE();
    return bRC;
}
开发者ID:etiago,项目名称:vbox,代码行数:24,代码来源:VBoxMPIOCTL.cpp

示例14: vboxVbvaCreate

int vboxVbvaCreate(PVBOXMP_DEVEXT pDevExt, VBOXVBVAINFO *pVbva, ULONG offBuffer, ULONG cbBuffer, D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId)
{
    memset(pVbva, 0, sizeof(VBOXVBVAINFO));

    KeInitializeSpinLock(&pVbva->Lock);

    int rc = VBoxMPCmnMapAdapterMemory(VBoxCommonFromDeviceExt(pDevExt),
                                       (void**)&pVbva->pVBVA,
                                       offBuffer,
                                       cbBuffer);
    AssertRC(rc);
    if (RT_SUCCESS(rc))
    {
        Assert(pVbva->pVBVA);
        pVbva->offVBVA = offBuffer;
        pVbva->cbVBVA = cbBuffer;
        pVbva->srcId = srcId;
    }

    return rc;
}
开发者ID:MadHacker217,项目名称:VirtualBox-OSE,代码行数:21,代码来源:VBoxMPVbva.cpp

示例15: VBoxMPEnablePointer

/* Called for IOCTL_VIDEO_ENABLE_POINTER/IOCTL_VIDEO_DISABLE_POINTER.
 * Hides pointer or makes it visible depending on bEnable value passed.
 */
BOOLEAN VBoxMPEnablePointer(PVBOXMP_DEVEXT pExt, BOOLEAN bEnable, PSTATUS_BLOCK pStatus)
{
    BOOLEAN bRC = TRUE;
    LOGF_ENTER();

    if (VBoxQueryHostWantsAbsolute())
    {
        /* Check if it's not shown already. */
        if (bEnable == pExt->pPrimary->u.primary.fMouseHidden)
        {
            VIDEO_POINTER_ATTRIBUTES attrs;

            /* Visible and No Shape means show the pointer, 0 means hide pointer.
             * It's enough to init only this field.
             */
            attrs.Enable = bEnable ? VBOX_MOUSE_POINTER_VISIBLE:0;


            /* Pass info to the host. */
            bRC = VBoxMPCmnUpdatePointerShape(VBoxCommonFromDeviceExt(pExt), &attrs, sizeof(attrs));

            if (bRC)
            {
                /* Update device state. */
                pExt->pPrimary->u.primary.fMouseHidden = !bEnable;
            }
        }
    }
    else
    {
        pStatus->Status = ERROR_INVALID_FUNCTION;
        bRC = FALSE;
    }

    LOGF_LEAVE();
    return bRC;
}
开发者ID:etiago,项目名称:vbox,代码行数:40,代码来源:VBoxMPIOCTL.cpp


注:本文中的VBoxCommonFromDeviceExt函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。