SUPLib-os2.cpp revision 00c0f6aad1f43632e70b7e66a28aa5c41445277f
/* $Id$ */
/** @file
* VirtualBox Support Library - OS/2 specific parts.
*/
/*
* Copyright (C) 2006-2007 Oracle Corporation
*
* 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.
*
* The contents of this file may alternatively be used under the terms
* of the Common Development and Distribution License Version 1.0
* (CDDL) only, as it comes in the "COPYING.CDDL" file of the
* VirtualBox OSE distribution, in which case the provisions of the
* CDDL are applicable instead of those of the GPL.
*
* You may elect to license modified versions of this file under the
* terms and conditions of either the GPL or the CDDL or both.
*/
/*******************************************************************************
* Header Files *
*******************************************************************************/
#define INCL_BASE
#define INCL_ERRORS
#include <os2.h>
#ifdef IN_SUP_HARDENED_R3
# define LOG_DISABLED
/** @todo RTLOGREL_DISABLED */
#endif
#include "../SUPLibInternal.h"
#include "../SUPDrvIOC.h"
#include <errno.h>
#include <unistd.h>
#include <stdlib.h>
/*******************************************************************************
* Defined Constants And Macros *
*******************************************************************************/
/** OS/2 Device name. */
#define DEVICE_NAME "/dev/vboxdrv$"
{
/*
* Nothing to do if pre-inited.
*/
if (fPreInited)
return VINF_SUCCESS;
/*
* Try open the device.
*/
&hDevice,
&ulAction,
0,
NULL);
if (rc)
{
int vrc;
switch (rc)
{
case ERROR_FILE_NOT_FOUND:
default: vrc = VERR_VM_DRIVER_OPEN_ERROR; break;
}
return vrc;
}
pThis->fUnrestricted = true;
return VINF_SUCCESS;
}
#ifndef IN_SUP_HARDENED_R3
{
/*
* Check if we're inited at all.
*/
{
}
return 0;
}
int suplibOsInstall(void)
{
/** @remark OS/2: Not supported */
return VERR_NOT_SUPPORTED;
}
int suplibOsUninstall(void)
{
/** @remark OS/2: Not supported */
return VERR_NOT_SUPPORTED;
}
{
return VINF_SUCCESS;
return RTErrConvertFromOS2(rc);
}
{
else
return rc;
}
{
int rc = DosAllocMem(ppvPages, cPages << PAGE_SHIFT, PAG_READ | PAG_WRITE | PAG_EXECUTE | PAG_COMMIT | OBJ_ANY);
if (rc == ERROR_INVALID_PARAMETER)
rc = DosAllocMem(ppvPages, cPages << PAGE_SHIFT, PAG_READ | PAG_WRITE | PAG_EXECUTE | PAG_COMMIT | OBJ_ANY);
if (!rc)
rc = VINF_SUCCESS;
else
return rc;
}
{
if (pvPages)
{
}
return VINF_SUCCESS;
}
#endif /* !IN_SUP_HARDENED_R3 */