VBoxDispMp.cpp revision 4f780a27cafb8bda8416015b294c4919c3413d4d
/** @file
*
* VBoxVideo Display D3D User mode dll
*
* Copyright (C) 2010 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
#include "VBoxDispD3DCmn.h"
#include "VBoxDispMp.h"
typedef struct VBOXVIDEOCM_ITERATOR
{
typedef struct VBOXDISPMP
{
} VBOXDISPMP, *PVBOXDISPMP;
DECLINLINE(void) vboxVideoCmIterInit(PVBOXVIDEOCM_ITERATOR pIter, PVBOXVIDEOCM_CMD_HDR pStart, uint32_t cbCmds)
{
}
{
{
return pCur;
}
return NULL;
}
{
}
static VBOXDISPMP g_VBoxDispMp;
{
g_VBoxDispMp.cbEscapeCmd = 0;
return S_OK;
}
{
if (g_VBoxDispMp.pEscapeCmd)
return S_OK;
}
#define VBOXDISPMP_BUF_INITSIZE 4000
#define VBOXDISPMP_BUF_INCREASE 4096
{
if (!pHdr)
{
if (!g_VBoxDispMp.pEscapeCmd)
{
if (g_VBoxDispMp.pEscapeCmd)
else
return E_OUTOFMEMORY;
}
do
{
{
{
pHdr = (PVBOXVIDEOCM_CMD_HDR)(((uint8_t*)g_VBoxDispMp.pEscapeCmd) + sizeof (VBOXDISPIFESCAPE_GETVBOXVIDEOCMCMD));
break;
}
else
{
uint32_t newSize = RT_MAX(g_VBoxDispMp.cbEscapeCmd + VBOXDISPMP_BUF_INCREASE, g_VBoxDispMp.pEscapeCmd->Hdr.cbRemainingFirstCmd);
if (newSize < VBOXDISPMP_BUF_MAXSIZE)
newSize = RT_MAX(newSize, RT_MIN(g_VBoxDispMp.pEscapeCmd->Hdr.cbRemainingCmds, VBOXDISPMP_BUF_MAXSIZE));
if (g_VBoxDispMp.pEscapeCmd)
else
{
g_VBoxDispMp.cbEscapeCmd = 0;
hr = E_OUTOFMEMORY;
break;
}
}
}
else
break;
} while (1);
}
{
PVBOXVIDEOCM_CMD_RECTS_INTERNAL pCmdInternal = (PVBOXVIDEOCM_CMD_RECTS_INTERNAL)(((uint8_t*)pHdr) + sizeof (VBOXVIDEOCM_CMD_HDR));
// UINT iScreen = pContext->pDevice->cScreens == 1 ? pContext->pDevice->iPrimaryScreen : pCmdInternal->VidPnSourceId;
// PVBOXWDDMDISP_SCREEN pScreen = &pContext->pDevice->aScreens[iScreen];
// Assert(pScreen->hWnd);
// Assert(pScreen->pDevice9If);
// pRegions->hWnd = pScreen->hWnd;
PVBOXWDDMDISP_SWAPCHAIN pSwapchain = RTListNodeGetLast(&pContext->pDevice->SwapchainList, VBOXWDDMDISP_SWAPCHAIN, ListEntry);
}
return hr;
}
VBOXDISPMP_DECL(HRESULT) VBoxDispMpGetCallbacks(uint32_t u32Version, PVBOXDISPMP_CALLBACKS pCallbacks)
{
if (u32Version != VBOXDISPMP_VERSION)
return E_INVALIDARG;
return S_OK;
}