crservice.cpp revision 2fd23abb6f9e4d687f636f3e62e707e822aaadd6
3060d81006dcdf8f1cef7e93def2369befe82915vboxsync * VBox crOpenGL: Host service entry points.
3060d81006dcdf8f1cef7e93def2369befe82915vboxsync * Copyright (C) 2006-2008 Sun Microsystems, Inc.
3060d81006dcdf8f1cef7e93def2369befe82915vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
3060d81006dcdf8f1cef7e93def2369befe82915vboxsync * available from http://www.virtualbox.org. This file is free software;
3060d81006dcdf8f1cef7e93def2369befe82915vboxsync * you can redistribute it and/or modify it under the terms of the GNU
3060d81006dcdf8f1cef7e93def2369befe82915vboxsync * General Public License (GPL) as published by the Free Software
3060d81006dcdf8f1cef7e93def2369befe82915vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
3060d81006dcdf8f1cef7e93def2369befe82915vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
3060d81006dcdf8f1cef7e93def2369befe82915vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
3060d81006dcdf8f1cef7e93def2369befe82915vboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
3060d81006dcdf8f1cef7e93def2369befe82915vboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
3060d81006dcdf8f1cef7e93def2369befe82915vboxsync * additional information or have any questions.
3060d81006dcdf8f1cef7e93def2369befe82915vboxsync#define __STDC_CONSTANT_MACROS /* needed for a definition in iprt/string.h */
#include "cr_server.h"
#ifndef RT_OS_WINDOWS
#define DWORD int
#define WINAPI
return rc;
return rc;
return rc;
static DECLCALLBACK(int) svcSaveState(void *, uint32_t u32ClientID, void *pvClient, PSSMHANDLE pSSM)
return VINF_SUCCESS;
static DECLCALLBACK(int) svcLoadState(void *, uint32_t u32ClientID, void *pvClient, PSSMHANDLE pSSM)
return VERR_SSM_UNEXPECTED_DATA;
return rc;
return VERR_SSM_UNEXPECTED_DATA;
return VINF_SUCCESS;
/*MS's opengl32 tryes to load our ICD around 30 times on failure...this is to prevent unnecessary spam*/
static int shown = 0;
static DECLCALLBACK(void) svcPresentFBO(void *data, int32_t screenId, int32_t x, int32_t y, uint32_t w, uint32_t h)
static DECLCALLBACK(void) svcCall (void *, VBOXHGCMCALLHANDLE callHandle, uint32_t u32ClientID, void *pvClient, uint32_t u32Function, uint32_t cParms, VBOXHGCMSVCPARM paParms[])
Log(("SHARED_CROPENGL 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++)
switch (u32Function)
case SHCRGL_GUEST_FN_WRITE:
svcClientVersionUnsupported(0, 0);
case SHCRGL_GUEST_FN_READ:
svcClientVersionUnsupported(0, 0);
svcClientVersionUnsupported(0, 0);
static DECLCALLBACK(int) svcHostCall (void *, uint32_t u32Function, uint32_t cParms, VBOXHGCMSVCPARM paParms[])
Log(("SHARED_CROPENGL svcHostCall: fn = %d, cParms = %d, pparms = %d\n", u32Function, cParms, paParms));
#ifdef DEBUG
uint32_t i;
for (i = 0; i < cParms; i++)
switch (u32Function)
else if (!pConsole)
for (i=0; i<monitorCount; ++i)
if (!pDisplay)
case SHCRGL_HOST_FN_SET_VM:
ULONG w, h;
if (!pFramebuffer)
return rc;
if (!ptable)
Log(("VBoxHGCMSvcLoad: ptable->cbSize = %d, ptable->u32Version = 0x%08X\n", ptable->cbSize, ptable->u32Version));
if (!crVBoxServerInit())
return VERR_NOT_SUPPORTED;
return rc;