VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/VBoxClient/check3d.cpp@ 68458

最後變更 在這個檔案從68458是 68458,由 vboxsync 提交於 8 年 前

Introducing macros for initializing the VBoxGuestHGCMCallInfo structure.

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 2.1 KB
 
1/* $Id: check3d.cpp 68458 2017-08-18 10:31:10Z vboxsync $ */
2/** @file
3 * X11 guest client - 3D pass-through check.
4 */
5
6/*
7 * Copyright (C) 2011-2016 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.alldomusa.eu.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18#include "VBoxClient.h"
19
20#include <VBox/VBoxGuest.h>
21#include <VBox/VBoxGuestLib.h>
22#include <VBox/HostServices/VBoxCrOpenGLSvc.h>
23#include "../../common/VBoxGuestLib/VBGLR3Internal.h" /* HACK ALERT! Using vbglR3DoIOCtl directly!! */
24
25#include <stdlib.h>
26
27#define CR_VBOX_CAP_HOST_CAPS_NOT_SUFFICIENT 0x00000020
28
29static int run(struct VBCLSERVICE **ppInterface, bool fDaemonised)
30{
31 int rc;
32 HGCMCLIENTID idClient;
33 CRVBOXHGCMGETCAPS caps;
34 LogFlowFunc(("\n"));
35
36 NOREF(ppInterface);
37 NOREF(fDaemonised);
38 /* Initialise the guest library. */
39 rc = VbglR3InitUser();
40 if (RT_FAILURE(rc))
41 exit(1);
42 rc = VbglR3HGCMConnect("VBoxSharedCrOpenGL", &idClient);
43 if (RT_FAILURE(rc))
44 exit(1);
45
46 VBGL_HGCM_HDR_INIT(&caps.hdr, idClient, SHCRGL_GUEST_FN_GET_CAPS_LEGACY, SHCRGL_CPARMS_GET_CAPS_LEGACY);
47 caps.Caps.type = VMMDevHGCMParmType_32bit;
48 caps.Caps.u.value32 = 0;
49
50 rc = vbglR3DoIOCtl(VBOXGUEST_IOCTL_HGCM_CALL(sizeof(caps)), &caps, sizeof(caps));
51 if (RT_FAILURE(rc))
52 exit(1);
53 if (caps.Caps.u.value32 & CR_VBOX_CAP_HOST_CAPS_NOT_SUFFICIENT)
54 exit(1);
55 VbglR3HGCMDisconnect(idClient);
56 VbglR3Term();
57 LogFlowFunc(("returning %Rrc\n", rc));
58 return rc;
59}
60
61static struct VBCLSERVICE g_vbclCheck3DInterface =
62{
63 NULL,
64 VBClServiceDefaultHandler, /* init */
65 run,
66 VBClServiceDefaultCleanup
67};
68static struct VBCLSERVICE *g_pvbclCheck3DInterface = &g_vbclCheck3DInterface;
69
70/* Static factory */
71struct VBCLSERVICE **VBClCheck3DService()
72{
73 return &g_pvbclCheck3DInterface;
74}
75
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette