Init.cpp revision b357df727b216b85d4517efecf466a7b14c2e80c
/** @file
*
* VBoxGuestLib - A support library for VirtualBox guest additions:
* Library initialization
*/
/*
* Copyright (C) 2006-2007 Sun Microsystems, Inc.
*
* 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 (GPL) 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.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
* Clara, CA 95054 USA or visit http://www.sun.com if you need
* additional information or have any questions.
*/
#include <VBox/VBoxGuestLib.h>
#define VBGL_DECL_DATA
#include "VBGLInternal.h"
#ifndef VBGL_VBOXGUEST
/* The guest library uses lazy initialization for VMMDev port and memory,
* because these values are provided by the VBoxGuest driver and it might
* be loaded later than other drivers.
* The VbglEnter checks the current library status, tries to retrive these
* values and fails if they are unavailable.
*/
static void vbglQueryVMMDevPort (void)
{
int rc = VINF_SUCCESS;
if (VBOX_SUCCESS(rc))
{
if (VBOX_SUCCESS (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))
{
/* Try to obtain VMMDev port via IOCTL to VBoxGuest main driver. */
#ifdef VBOX_HGCM
rc = vbglHGCMInit ();
#endif /* VBOX_HGCM */
if (VBOX_FAILURE(rc))
{
}
}
return rc;
}
DECLVBGL(void) VbglTerminate (void)
{
#ifdef VBOX_HGCM
#endif
return;
}
#endif /* !VBGL_VBOXGUEST */