VirtualBox

source: vbox/trunk/src/VBox/ExtPacks/VNC/VBoxVNCMain.cpp@ 62873

Last change on this file since 62873 was 62496, checked in by vboxsync, 8 years ago

(C) 2016

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.3 KB
Line 
1/* $Id: VBoxVNCMain.cpp 62496 2016-07-22 18:47:44Z vboxsync $ */
2/** @file
3 * VNC main module.
4 */
5
6/*
7 * Copyright (C) 2010-2016 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.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
19/*********************************************************************************************************************************
20* Header Files *
21*********************************************************************************************************************************/
22#include <VBox/ExtPack/ExtPack.h>
23
24#include <VBox/err.h>
25#include <VBox/version.h>
26#include <VBox/vmm/cfgm.h>
27#include <iprt/string.h>
28#include <iprt/param.h>
29#include <iprt/path.h>
30
31
32/*********************************************************************************************************************************
33* Global Variables *
34*********************************************************************************************************************************/
35/** Pointer to the extension pack helpers. */
36static PCVBOXEXTPACKHLP g_pHlp;
37
38
39// /**
40// * @interface_method_impl{VBOXEXTPACKREG,pfnInstalled}
41// */
42// static DECLCALLBACK(void) vboxVNCExtPack_Installed(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox);
43// /**
44// * @interface_method_impl{VBOXEXTPACKREG,pfnUninstall}
45// */
46// static DECLCALLBACK(int) vboxVNCExtPack_Uninstall(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox);
47//
48// /**
49// * @interface_method_impl{VBOXEXTPACKREG,pfnVirtualBoxReady}
50// */
51// static DECLCALLBACK(void) vboxVNCExtPack_VirtualBoxReady(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox);
52//
53// /**
54// * @interface_method_impl{VBOXEXTPACKREG,pfnUnload}
55// */
56// static DECLCALLBACK(void) vboxVNCExtPack_Unload(PCVBOXEXTPACKREG pThis);
57// /**
58// * @interface_method_impl{VBOXEXTPACKREG,pfnVMCreated}
59// */
60// static DECLCALLBACK(int) vboxVNCExtPack_VMCreated(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox, IMachine *pMachine);
61//
62// /**
63// * @interface_method_impl{VBOXEXTPACKREG,pfnVMConfigureVMM}
64// */
65// static DECLCALLBACK(int) vboxVNCExtPack_VMConfigureVMM(PCVBOXEXTPACKREG pThis, IConsole *pConsole, PVM pVM);
66//
67// /**
68// * @interface_method_impl{VBOXEXTPACKREG,pfnVMPowerOn}
69// */
70// static DECLCALLBACK(int) vboxVNCExtPack_VMPowerOn(PCVBOXEXTPACKREG pThis, IConsole *pConsole, PVM pVM);
71// /**
72// * @interface_method_impl{VBOXEXTPACKREG,pfnVMPowerOff}
73// */
74// static DECLCALLBACK(void) vboxVNCExtPack_VMPowerOff(PCVBOXEXTPACKREG pThis, IConsole *pConsole, PVM pVM);
75// /**
76// * @interface_method_impl{VBOXEXTPACKREG,pfnVMPowerOff}
77// */
78// static DECLCALLBACK(void) vboxVNCExtPack_QueryObject(PCVBOXEXTPACKREG pThis, PCRTUUID pObjectId);
79
80
81static const VBOXEXTPACKREG g_vboxVNCExtPackReg =
82{
83 VBOXEXTPACKREG_VERSION,
84 /* .uVBoxFullVersion = */ VBOX_FULL_VERSION,
85 /* .pfnInstalled = */ NULL,
86 /* .pfnUninstall = */ NULL,
87 /* .pfnVirtualBoxReady =*/ NULL,
88 /* .pfnConsoleReady = */ NULL,
89 /* .pfnUnload = */ NULL,
90 /* .pfnVMCreated = */ NULL,
91 /* .pfnVMConfigureVMM = */ NULL,
92 /* .pfnVMPowerOn = */ NULL,
93 /* .pfnVMPowerOff = */ NULL,
94 /* .pfnQueryObject = */ NULL,
95 /* .pfnReserved1 = */ NULL,
96 /* .pfnReserved2 = */ NULL,
97 /* .pfnReserved3 = */ NULL,
98 /* .pfnReserved4 = */ NULL,
99 /* .pfnReserved5 = */ NULL,
100 /* .pfnReserved6 = */ NULL,
101 /* .u32Reserved7 = */ 0,
102 VBOXEXTPACKREG_VERSION
103};
104
105
106/** @callback_method_impl{FNVBOXEXTPACKREGISTER} */
107extern "C" DECLEXPORT(int) VBoxExtPackRegister(PCVBOXEXTPACKHLP pHlp, PCVBOXEXTPACKREG *ppReg, PRTERRINFO pErrInfo)
108{
109 /*
110 * Check the VirtualBox version.
111 */
112 if (!VBOXEXTPACK_IS_VER_COMPAT(pHlp->u32Version, VBOXEXTPACKHLP_VERSION))
113 return RTErrInfoSetF(pErrInfo, VERR_VERSION_MISMATCH,
114 "Helper version mismatch - expected %#x got %#x",
115 VBOXEXTPACKHLP_VERSION, pHlp->u32Version);
116 if ( VBOX_FULL_VERSION_GET_MAJOR(pHlp->uVBoxFullVersion) != VBOX_VERSION_MAJOR
117 || VBOX_FULL_VERSION_GET_MINOR(pHlp->uVBoxFullVersion) != VBOX_VERSION_MINOR)
118 return RTErrInfoSetF(pErrInfo, VERR_VERSION_MISMATCH,
119 "VirtualBox version mismatch - expected %u.%u got %u.%u",
120 VBOX_VERSION_MAJOR, VBOX_VERSION_MINOR,
121 VBOX_FULL_VERSION_GET_MAJOR(pHlp->uVBoxFullVersion),
122 VBOX_FULL_VERSION_GET_MINOR(pHlp->uVBoxFullVersion));
123
124 /*
125 * We're good, save input and return the registration structure.
126 */
127 g_pHlp = pHlp;
128 *ppReg = &g_vboxVNCExtPackReg;
129
130 return VINF_SUCCESS;
131}
132
Note: See TracBrowser for help on using the repository browser.

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