Init.cpp revision 7e880f47fa567d2ae917f5ec63fd46ad42460961
/** @file
*
* VBoxGuestLib - A support library for VirtualBox guest additions:
* Library initialization
*/
/*
* Copyright (C) 2006 InnoTek Systemberatung 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.
*/
#if defined(__LINUX__) && defined(__KERNEL__)
#ifndef bool /* Linux 2.6.19 C++ nightmare */
#define bool bool_type
#define true true_type
#define false false_type
#define _Bool int
#define bool_Init_cpp
#endif
#ifdef bool_Init_cpp
#undef bool
#undef true
#undef false
#undef _Bool
#endif
#else
#include <string.h>
#endif
#include <VBox/VBoxGuestLib.h>
#define VBGL_DECL_DATA
#include "VBGLInternal.h"
#ifndef VBGL_VBOXGUEST
static int vbglQueryVMMDevPort (void)
{
int rc = VINF_SUCCESS;
if (VBOX_SUCCESS(rc))
{
if (VBOX_SUCCESS (rc))
{
}
}
return rc;
}
#endif
int VbglEnter (void)
{
int rc;
#ifndef VBGL_VBOXGUEST
{
}
#endif
// dprintf(("VbglEnter: rc = %d\n", rc));
return rc;
}
int vbglInitCommon (void)
{
int rc = VINF_SUCCESS;
rc = VbglPhysHeapInit ();
if (VBOX_SUCCESS(rc))
{
/* other subsystems, none yet */
;
}
return rc;
}
DECLVBGL(void) vbglTerminateCommon (void)
{
return;
}
#ifdef VBGL_VBOXGUEST
{
int rc = VINF_SUCCESS;
{
/* Initialization is already in process. */
return rc;
}
rc = vbglInitCommon ();
if (VBOX_SUCCESS(rc))
{
}
else
{
}
return rc;
}
DECLVBGL(void) VbglTerminate (void)
{
return;
}
#else /* !VBGL_VBOXGUEST */
{
int rc = VINF_SUCCESS;
{
/* Initialization is already in process. */
return rc;
}
rc = vbglInitCommon ();
if (VBOX_SUCCESS(rc))
{
/* Obtain VMMDev port via IOCTL to VBoxGuest main driver. */
#ifdef VBOX_HGCM
rc = vbglHGCMInit ();
#endif
if (VBOX_FAILURE(rc))
{
}
}
return rc;
}
DECLVBGL(void) VbglTerminate (void)
{
#ifdef VBOX_HGCM
#endif
return;
}
#endif /* !VBGL_VBOXGUEST */