Пример #1
0
static DECLCALLBACK(int) vboxDispMpTstThreadProc(RTTHREAD ThreadSelf, void *pvUser)
{
    VBOXDISPMP_REGIONS Regions;

    HRESULT hr = g_VBoxDispMpTstCallbacks.pfnEnableEvents();
    Assert(hr == S_OK);
    if (hr != S_OK)
        return VERR_GENERAL_FAILURE;

    do
    {
        hr = g_VBoxDispMpTstCallbacks.pfnGetRegions(&Regions, INFINITE);
        Assert(hr == S_OK);
        if (hr == S_OK)
        {
            vboxVDbgPrint(("\n>>>\n"));
            HWND hWnd = Regions.hWnd;
            if (Regions.pRegions->fFlags.bSetVisibleRects)
            {
                uint32_t iVisibleRects = 0;
                uint32_t cVisibleRects = Regions.pRegions->RectsInfo.cRects;
                if (Regions.pRegions->fFlags.bSetViewRect)
                {
                    iVisibleRects = 1;

                    vboxVDbgPrint(("hWnd (0x%p), position and/or size changed: ", hWnd));
                    vboxDispMpTstLogRect("", Regions.pRegions->RectsInfo.aRects, "\n");
                }

                vboxVDbgPrint(("hWnd (0x%p), visibleRects: \n", hWnd));
                for (uint32_t i = iVisibleRects; i < cVisibleRects; ++i)
                {
                    vboxDispMpTstLogRect("", &Regions.pRegions->RectsInfo.aRects[i], "");
                }
            }
            else if (Regions.pRegions->fFlags.bAddHiddenRects)
            {
                vboxVDbgPrint(("hWnd (0x%p), hiddenRects: \n", hWnd));
                for (uint32_t i = 0; i < Regions.pRegions->RectsInfo.cRects; ++i)
                {
                    vboxDispMpTstLogRect("", &Regions.pRegions->RectsInfo.aRects[i], "");
                }
            }

            vboxVDbgPrint(("\n<<<\n"));
        }
    } while (1);

    hr = g_VBoxDispMpTstCallbacks.pfnDisableEvents();
    Assert(hr == S_OK);

    return VINF_SUCCESS;
}
Пример #2
0
void vboxDispCmLog(LPCSTR pszMsg)
{
    PVBOXDISPCM_SESSION pSession = &g_pVBoxCmMgr.Session;

    EnterCriticalSection(&pSession->CritSect);
    /* use any context for identifying the kernel CmSession. We're using the first one */
    PVBOXWDDMDISP_CONTEXT pContext = RTListGetFirst(&pSession->CtxList, VBOXWDDMDISP_CONTEXT, ListNode);
    Assert(pContext);
    if (pContext)
    {
        PVBOXWDDMDISP_DEVICE pDevice = pContext->pDevice;
        Assert(pDevice);
        vboxVDbgPrint(("%s", pszMsg));
    }
    LeaveCriticalSection(&pSession->CritSect);
}
Пример #3
0
static HRESULT vboxDispCmSessionCmdQueryData(PVBOXDISPCM_SESSION pSession, PVBOXDISPIFESCAPE_GETVBOXVIDEOCMCMD pCmd, uint32_t cbCmd)
{

    HRESULT hr = S_OK;
    D3DDDICB_ESCAPE DdiEscape;
    DdiEscape.Flags.Value = 0;
    DdiEscape.pPrivateDriverData = pCmd;
    DdiEscape.PrivateDriverDataSize = cbCmd;

    pCmd->EscapeHdr.escapeCode = VBOXESC_GETVBOXVIDEOCMCMD;
    /* lock to ensure the context is not destroyed */
    EnterCriticalSection(&pSession->CritSect);
    /* use any context for identifying the kernel CmSession. We're using the first one */
    PVBOXWDDMDISP_CONTEXT pContext = RTListGetFirst(&pSession->CtxList, VBOXWDDMDISP_CONTEXT, ListNode);
    if (pContext)
    {
        PVBOXWDDMDISP_DEVICE pDevice = pContext->pDevice;
        DdiEscape.hDevice = pDevice->hDevice;
        DdiEscape.hContext = pContext->ContextInfo.hContext;
        Assert (DdiEscape.hContext);
        Assert (DdiEscape.hDevice);
        hr = pDevice->RtCallbacks.pfnEscapeCb(pDevice->pAdapter->hAdapter, &DdiEscape);
        LeaveCriticalSection(&pSession->CritSect);
        Assert(hr == S_OK);
        if (hr == S_OK)
        {
            if (!pCmd->Hdr.cbCmdsReturned && !pCmd->Hdr.cbRemainingFirstCmd)
                hr = S_FALSE;
        }
        else
        {
            vboxVDbgPrint(("DispD3D: vboxDispCmSessionCmdQueryData, pfnEscapeCb failed hr (0x%x)\n", hr));
            exit(1);
        }
    }
    else
    {
        LeaveCriticalSection(&pSession->CritSect);
        hr = S_FALSE;
    }

    return hr;
}
Пример #4
0
static void vboxDispMpTstLogRect(const char * pPrefix, RECT *pRect, const char * pSuffix)
{
    vboxVDbgPrint(("%s left(%d), top(%d), right(%d), bottom(%d) %s", pPrefix, pRect->left, pRect->top, pRect->right, pRect->bottom, pSuffix));
}
VOID vboxVDbgDoPrintDmlCmd(const char* pszDesc, const char* pszCmd)
{
    vboxVDbgPrint(("<?dml?><exec cmd=\"%s\">%s</exec>, ( %s )\n", pszCmd, pszDesc, pszCmd));
}