SysHlp.cpp revision e237c01e391f63ff290fa81d3e52776571c8b01c
/** @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"
{
int rc = VINF_SUCCESS;
#ifdef __WIN__
{
}
else
{
__try {
}
}
#else
#endif /* __WIN__ */
return rc;
}
{
#ifdef __WIN__
{
}
#else
#endif /* __WIN__ */
}
#ifndef VBGL_VBOXGUEST
#if defined (__LINUX__) && !defined (__KERNEL__)
# include <unistd.h>
# include <errno.h>
#endif
#ifndef __WIN__
# ifdef __cplusplus
extern "C" {
# endif
extern DECLVBGL(void *) vboxadd_cmc_open (void);
extern DECLVBGL(void) vboxadd_cmc_close (void *);
# ifdef __cplusplus
}
# endif
#endif
{
#ifdef __WIN__
&pFileObject, &pDeviceObject);
if (NT_SUCCESS (rc))
{
return VINF_SUCCESS;
}
/** @todo return RTErrConvertFromNtStatus(rc)! */
return rc;
#else
void *opaque;
opaque = (void *) vboxadd_cmc_open ();
if (!opaque)
{
return VERR_NOT_IMPLEMENTED;
}
return VINF_SUCCESS;
#endif
}
{
#ifdef __WIN__
#ifdef KEVENT_STACK_ALLOC
pEvent = &eventAlloc;
#else
if (!pEvent) return VERR_NO_MEMORY;
#endif /* KEVENT_STACK_ALLOC */
{
Log(("vbglDriverIOCtl: IoBuildDeviceIoControlRequest failed\n"));
#ifndef KEVENT_STACK_ALLOC
ExFreePool (pEvent);
#endif /* KEVENT_STACK_ALLOC */
return VERR_NO_MEMORY;
}
if (rc == STATUS_PENDING)
{
Log(("vbglDriverIOCtl: STATUS_PENDING\n"));
NULL);
}
if (!NT_SUCCESS(rc))
#ifndef KEVENT_STACK_ALLOC
ExFreePool (pEvent);
#endif /* KEVENT_STACK_ALLOC */
#else
#endif
}
{
#ifdef __WIN__
#else
#endif
}
#endif /* !VBGL_VBOXGUEST */