VBoxCrHgsmi.cpp revision 87150caf549846b0edba30c50dabe5092df70b5f
/* $Id$ */
/** @file
* VBoxVideo Display D3D User mode dll
*/
/*
* Copyright (C) 2011 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 <VBox/VBoxCrHgsmi.h>
#include "VBoxUhgsmiKmt.h"
static int g_bVBoxKmtCallbacksInited = 0;
static uint32_t g_VBoxCrVersionMajor;
static uint32_t g_VBoxCrVersionMinor;
#ifdef VBOX_CRHGSMI_WITH_D3DDEV
static uint32_t g_cVBoxCrHgsmiProvider = 0;
typedef VBOXWDDMDISP_DECL(int) FNVBOXDISPCRHGSMI_TERM();
{
{
else
}
if (g_bVBoxKmtCallbacksInited < 0)
{
Assert(0);
return VERR_NOT_SUPPORTED;
}
if (!g_hVBoxCrHgsmiProvider)
{
{
}
{
g_pfnVBoxDispCrHgsmiInit = (PFNVBOXDISPCRHGSMI_INIT)GetProcAddress(g_hVBoxCrHgsmiProvider, "VBoxDispCrHgsmiInit");
{
}
g_pfnVBoxDispCrHgsmiTerm = (PFNVBOXDISPCRHGSMI_TERM)GetProcAddress(g_hVBoxCrHgsmiProvider, "VBoxDispCrHgsmiTerm");
g_pfnVBoxDispCrHgsmiQueryClient = (PFNVBOXDISPCRHGSMI_QUERY_CLIENT)GetProcAddress(g_hVBoxCrHgsmiProvider, "VBoxDispCrHgsmiQueryClient");
}
#ifdef DEBUG_misha
else
{
Assert(0);
}
#endif
}
{
{
}
return VINF_SUCCESS;
}
/* we're called from ogl ICD driver*/
Assert(0);
return VINF_SUCCESS;
}
{
{
//#ifdef DEBUG_misha
// Assert(hClient);
//#endif
if (hClient)
return hClient;
}
if (pHgsmiGL)
{
}
if (pHgsmiGL)
{
#if 0
#else
#endif
{
if (hClient)
{
return hClient;
}
}
}
return NULL;
}
#else
{
/*Assert(hr == S_OK);*/
{
/* check if we can create the hgsmi */
if (pHgsmi)
{
/* yes, we can, so this is wddm mode */
Log(("CrHgsmi: WDDM mode supported\n"));
return 1;
}
}
Log(("CrHgsmi: unsupported\n"));
return -1;
}
{
{
{
}
}
}
{
if (pHgsmiGL)
{
#if 0
HRESULT hr = vboxUhgsmiKmtCreate(pHgsmiGL, g_VBoxCrVersionMajor, g_VBoxCrVersionMinor, TRUE /* bD3D tmp for injection thread*/);
#else
HRESULT hr = vboxUhgsmiKmtEscCreate(pHgsmiGL, g_VBoxCrVersionMajor, g_VBoxCrVersionMinor, TRUE /* bD3D tmp for injection thread*/);
#endif
{
}
}
return NULL;
}
{
{
}
}
#endif
VBOXCRHGSMI_DECL(int) VBoxCrHgsmiTerm()
{
#if 0
if (pHgsmiGL)
{
gt_pHgsmiGL = NULL;
}
#endif
if (g_bVBoxKmtCallbacksInited > 0)
{
}
return VINF_SUCCESS;
}
{
}
{
if (!RT_SUCCESS(rc))
{
}
return rc;
}
VBOXCRHGSMI_DECL(int) VBoxCrHgsmiCtlConCall(PVBOXUHGSMI pHgsmi, struct VBoxGuestHGCMCallInfo *pCallInfo, int cbCallInfo)
{
if (!RT_SUCCESS(rc))
{
}
return rc;
}