service.cpp revision 648f4eb3997820a317f8aa900598a4b7fe425c23
/** @file
* VBox OpenGL: Host service entry points.
*/
/*
* Copyright (C) 2006-2007 innotek GmbH
*
* 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 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.
*
* If you received this file as part of a commercial VirtualBox
* distribution, then only the terms of your commercial VirtualBox
* license agreement apply instead of the previous paragraph.
*/
#define LOG_GROUP LOG_GROUP_SHARED_OPENGL
#include "vboxgl.h"
#include "gldrv.h"
static DECLCALLBACK(int) svcUnload (void)
{
int rc = VINF_SUCCESS;
Log(("svcUnload\n"));
return rc;
}
{
int rc = VINF_SUCCESS;
return rc;
}
{
int rc = VINF_SUCCESS;
return rc;
}
/**
* We can't save the OpenGL state, so there's not much to do. Perhaps we should invalidate the client id?
*/
{
return VINF_SUCCESS;
}
{
return VINF_SUCCESS;
}
static DECLCALLBACK(void) svcCall (VBOXHGCMCALLHANDLE callHandle, uint32_t u32ClientID, void *pvClient, uint32_t u32Function, uint32_t cParms, VBOXHGCMSVCPARM paParms[])
{
int rc = VINF_SUCCESS;
Log(("svcCall: u32ClientID = %d, fn = %d, cParms = %d, pparms = %d\n", u32ClientID, u32Function, cParms, paParms));
#ifdef DEBUG
uint32_t i;
for (i = 0; i < cParms; i++)
{
/** @todo parameters other than 32 bit */
}
#endif
switch (u32Function)
{
case VBOXOGL_FN_GLGETSTRING:
{
Log(("svcCall: VBOXOGL_FN_GLGETSTRING\n"));
/* Verify parameter count and types. */
if (cParms != VBOXOGL_CPARMS_GLGETSTRING)
{
}
else
)
{
}
else
{
/* Fetch parameters. */
/* Verify parameters values. */
if ( (cbString < 32)
)
{
}
else
{
/* Execute the function. */
if (VBOX_SUCCESS(rc))
{
/* Update parameters.*/
}
}
}
break;
}
case VBOXOGL_FN_GLFLUSH:
{
Log(("svcCall: VBOXOGL_FN_GLFLUSH\n"));
/* Verify parameter count and types. */
if (cParms != VBOXOGL_CPARMS_GLFLUSH)
{
}
else
)
{
}
else
{
/* Fetch parameters. */
/* Execute the function. */
if (VBOX_SUCCESS(rc))
{
/* Update parameters.*/
}
}
break;
}
case VBOXOGL_FN_GLFLUSHPTR:
{
Log(("svcCall: VBOXOGL_FN_GLFLUSHPTR\n"));
/* Verify parameter count and types. */
if (cParms != VBOXOGL_CPARMS_GLFLUSHPTR)
{
}
else
)
{
}
else
{
/* Fetch parameters. */
/* Save the last parameter of the last command in the client structure so the macro can pick it up there */
{
/* HGCM doesn't like NULL pointers. */
pClient->cbLastParam = 0;
}
else
{
}
/* Execute the function. */
/* Clear last parameter info again */
pClient->pLastParam = 0;
pClient->cbLastParam = 0;
if (VBOX_SUCCESS(rc))
{
/* Update parameters.*/
}
}
break;
}
case VBOXOGL_FN_GLCHECKEXT:
{
Log(("svcCall: VBOXOGL_FN_GLCHECKEXT\n"));
/* Verify parameter count and types. */
if (cParms != VBOXOGL_CPARMS_GLCHECKEXT)
{
}
else
)
{
}
else
{
/* Fetch parameters. */
/* sanity checks */
if ( cbExtFnName > 256
)
{
}
else
{
#ifdef __WIN__
/* Execute the function. */
rc = VINF_SUCCESS;
else
#else
#endif
if (VBOX_SUCCESS(rc))
{
/* Update parameters.*/
}
}
}
break;
}
default:
{
}
}
}
/*
* We differentiate between a function handler for the guest and one for the host. The guest is not allowed to add or remove mappings for obvious security reasons.
*/
static DECLCALLBACK(int) svcHostCall (uint32_t u32Function, uint32_t cParms, VBOXHGCMSVCPARM paParms[])
{
int rc = VINF_SUCCESS;
#ifdef DEBUG
uint32_t i;
for (i = 0; i < cParms; i++)
{
/** @todo parameters other than 32 bit */
}
#endif
switch (u32Function)
{
default:
break;
}
return rc;
}
{
int rc = VINF_SUCCESS;
if (!ptable)
{
}
else
{
Log(("VBoxHGCMSvcLoad: ptable->cbSize = %d, ptable->u32Version = 0x%08X\n", ptable->cbSize, ptable->u32Version));
{
}
else
{
}
}
return rc;
}