VBoxXPCOMCGlue.c revision 0bb65e71fd8bb74172b634aa7cba33cb5161c76b
9e9e6faf459961590a805c4053383a27a5c37826vboxsync/* $Revision$ */
9e9e6faf459961590a805c4053383a27a5c37826vboxsync * Glue code for dynamically linking to VBoxXPCOMC.
c98fb3e16fcd571a790eab772c0c66173d225205vboxsync * Copyright (C) 2008-2013 Oracle Corporation
c98fb3e16fcd571a790eab772c0c66173d225205vboxsync * Permission is hereby granted, free of charge, to any person
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * obtaining a copy of this software and associated documentation
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * files (the "Software"), to deal in the Software without
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * restriction, including without limitation the rights to use,
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * copy, modify, merge, publish, distribute, sublicense, and/or sell
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync * copies of the Software, and to permit persons to whom the
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync * Software is furnished to do so, subject to the following
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync * conditions:
9e9e6faf459961590a805c4053383a27a5c37826vboxsync * The above copyright notice and this permission notice shall be
9e9e6faf459961590a805c4053383a27a5c37826vboxsync * included in all copies or substantial portions of the Software.
9e9e6faf459961590a805c4053383a27a5c37826vboxsync * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
9e9e6faf459961590a805c4053383a27a5c37826vboxsync * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
383c24a5b199735003fdfadc6c19c92273278cc5vboxsync * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
9e9e6faf459961590a805c4053383a27a5c37826vboxsync * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
9e9e6faf459961590a805c4053383a27a5c37826vboxsync * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
9e9e6faf459961590a805c4053383a27a5c37826vboxsync * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
9e9e6faf459961590a805c4053383a27a5c37826vboxsync * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
9e9e6faf459961590a805c4053383a27a5c37826vboxsync * OTHER DEALINGS IN THE SOFTWARE.
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdarg.h>
#include <stdint.h>
#include <dlfcn.h>
#include <pthread.h>
#include "VBoxXPCOMCGlue.h"
typedef void FNDUMMY(void);
if ( fAlways
|| !g_szVBoxErrMsg[0])
* Try load VBoxXPCOMC.so/dylib/dll from the specified location and resolve all
(unsigned)cbBufNeeded);
if (cchHome)
cchHome++;
if (fSetAppHome)
if (pszHome)
if (g_hVBoxXPCOMC)
if (pfnGetFunctions)
if (g_pVBoxFuncs)
return rc;
* Tries to locate and load VBoxXPCOMC.so/dylib/dll, resolving all the related
int VBoxCGlueInit(void)
if (pszHome)
void VBoxCGlueTerm(void)
if (g_hVBoxXPCOMC)
#if 0 /* VBoxRT.so doesn't like being reloaded. See @bugref{3725}. */