SysHlp.cpp revision da39ff9f7632ab1e015816399de1c95daba95a34
/** @file
*
* VBoxGuestLib - A support library for VirtualBox guest additions:
* Physical memory heap
*/
/*
* Copyright (C) 2006-2007 innotek 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.
*/
#define LOG_GROUP LOG_GROUP_HGCM
#include <VBox/VBoxGuestLib.h>
#include "SysHlp.h"
#endif
{
int rc = VINF_SUCCESS;
#ifdef __WIN__
{
}
else
{
__try {
}
}
#else
/* Default to IPRT - this ASSUMES that it is USER addresses we're locking. */
if (RT_SUCCESS(rc))
else
*ppvCtx = NIL_RTR0MEMOBJ;
#endif
return rc;
}
{
#ifdef __WIN__
{
}
#else
/* default to IPRT */
#endif
}
#ifndef VBGL_VBOXGUEST
#if defined (__LINUX__) && !defined (__KERNEL__)
# include <unistd.h>
# include <errno.h>
#endif
#ifdef __LINUX__
extern DECLVBGL(void *) vboxadd_cmc_open (void);
extern DECLVBGL(void) vboxadd_cmc_close (void *);
#endif /* __LINUX__ */
#ifdef __OS2__
/*
* On OS/2 we'll do the connecting in the assembly code of the
* client driver, exporting a g_VBoxGuestIDC symbol containing
* the connection information obtained from the 16-bit IDC.
*/
extern VBOXGUESTOS2IDCCONNECT g_VBoxGuestIDC;
#endif
{
#ifdef __WIN__
&pFileObject, &pDeviceObject);
if (NT_SUCCESS (rc))
{
return VINF_SUCCESS;
}
/** @todo return RTErrConvertFromNtStatus(rc)! */
return rc;
void *opaque;
opaque = (void *) vboxadd_cmc_open ();
if (!opaque)
{
return VERR_NOT_IMPLEMENTED;
}
return VINF_SUCCESS;
/*
* Just check whether the connection was made or not.
*/
{
return VINF_SUCCESS;
}
Log(("vbglDriverOpen: failed\n"));
return VERR_FILE_NOT_FOUND;
#else
# error "Port me"
#endif
}
{
#ifdef __WIN__
FALSE, /* external */
&Event,
{
Log(("vbglDriverIOCtl: IoBuildDeviceIoControlRequest failed\n"));
return VERR_NO_MEMORY;
}
if (rc == STATUS_PENDING)
{
Log(("vbglDriverIOCtl: STATUS_PENDING\n"));
NULL);
}
if (!NT_SUCCESS(rc))
if ( pDriver->u32Session
Log(("vbglDriverIOCtl: No connection\n"));
return VERR_WRONG_ORDER;
#else
# error "Port me"
#endif
}
{
#ifdef __WIN__
pDriver->u32Session = 0;
#else
# error "Port me"
#endif
}
#endif /* !VBGL_VBOXGUEST */