VBoxCrHgsmi.cpp revision 4e664340a06cc85b77cd1e6bddcd5b2da558ddd5
#include <VBox/VBoxCrHgsmi.h>
#include "VBoxUhgsmiKmt.h"
static uint32_t g_cVBoxCrHgsmiProvider = 0;
typedef VBOXWDDMDISP_DECL(int) FNVBOXDISPCRHGSMI_TERM();
{
static int bKmtCallbacksInited = 0;
if (!bKmtCallbacksInited)
{
bKmtCallbacksInited = 1;
else
bKmtCallbacksInited = -1;
}
if (bKmtCallbacksInited < 0)
{
Assert(0);
return VERR_NOT_SUPPORTED;
}
if (!g_hVBoxCrHgsmiProvider)
{
// g_hVBoxCrHgsmiProvider = GetModuleHandle(L"VBoxDispD3D");
if (bRc)
{
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)
{
{
}
}
else
return hClient;
}
VBOXCRHGSMI_DECL(int) VBoxCrHgsmiTerm()
{
Assert(0);
#if 0
if (pHgsmiGL)
{
gt_pHgsmiGL = NULL;
}
#endif
return VINF_SUCCESS;
}
{
{
if (pCmd)
{
D3DKMT_ESCAPE EscapeData = {0};
//EscapeData.hDevice = NULL;
// EscapeData.Flags.HardwareAccess = 1;
//EscapeData.hContext = NULL;
}
}
}
///* to be used by injection thread and by ogl ICD driver for hgsmi initialization*/
//VBOXCRHGSMI_DECL(int) VBoxCrHgsmiCustomCreate(PVBOXUHGSMI *ppHgsmi)
//{
// PVBOXUHGSMI_PRIVATE_KMT pHgsmi = RTMemAllocZ(sizeof (*pHgsmi));
// if (pHgsmi)
// {
// HRESULT hr = vboxUhgsmiKmtCreate(pHgsmi, FALSE);
// Assert(hr == S_OK);
// if (hr == S_OK)
// {
// *ppHgsmi = &pHgsmi->BasePrivate.Base;
// return VINF_SUCCESS;
// }
// RTMemFree(pHgsmi);
// return VERR_GENERAL_FAILURE;
// }
// return VERR_NO_MEMORY;
//}
//
//VBOXCRHGSMI_DECL(int) VBoxCrHgsmiCustomDestroy(PVBOXUHGSMI pHgsmi)
//{
// PVBOXUHGSMI_PRIVATE_KMT pHgsmiKmt = VBOXUHGSMIKMT_GET(pHgsmi);
// HRESULT hr = vboxUhgsmiKmtDestroy(pHgsmiKmt, FALSE);
// Assert(hr == S_OK);
// if (hr == S_OK)
// {
// RTMemFree(pHgsmiKmt);
// return VINF_SUCCESS;
// }
// return VERR_GENERAL_FAILURE;
//}