kHlpEnv-iprt.cpp revision 62263e030f89e8323226e9f7243cbba769597e14
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync * kHlpEnv - Environment Manipulation, IPRT based implementation.
62263e030f89e8323226e9f7243cbba769597e14vboxsync * Copyright (C) 2007 innotek GmbH
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync * available from http://www.virtualbox.org. This file is free software;
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync * you can redistribute it and/or modify it under the terms of the GNU
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync * General Public License as published by the Free Software Foundation,
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync * distribution. VirtualBox OSE is distributed in the hope that it will
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync * be useful, but WITHOUT ANY WARRANTY of any kind.
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync/*******************************************************************************
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync* Header Files *
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync*******************************************************************************/
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsyncKHLP_DECL(int) kHlpGetEnv(const char *pszVar, char *pszVal, KSIZE cchVal)
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync int rc = RTEnvGetEx(RTENV_DEFAULT, pszVar, pszVal, cchVal, NULL);
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync case VINF_SUCCESS: return 0;
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync case VERR_ENV_VAR_NOT_FOUND: return KERR_ENVVAR_NOT_FOUND;
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync case VERR_BUFFER_OVERFLOW: return KERR_BUFFER_OVERFLOW;
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync default: AssertMsgFailedReturn(("%Rrc\n", rc), rc);