com.cpp revision 0010ccca43c2554000fdd0572c7b9cf5ad17ac91
/** @file
* MS COM / XPCOM Abstraction Layer
*/
/*
* 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.
*/
#if !defined (VBOX_WITH_XPCOM)
#include <objbase.h>
#else /* !defined (VBOX_WITH_XPCOM) */
#include <stdlib.h>
#include <nsCOMPtr.h>
#include <nsIServiceManagerUtils.h>
#include <nsIInterfaceInfo.h>
#include <nsIInterfaceInfoManager.h>
#endif /* !defined (VBOX_WITH_XPCOM) */
#ifdef RT_OS_DARWIN
#define VBOX_USER_HOME_SUFFIX "Library/VirtualBox"
#else
#define VBOX_USER_HOME_SUFFIX ".VirtualBox"
#endif
namespace com
{
{
if (!aName)
return;
#if !defined (VBOX_WITH_XPCOM)
{
0, KEY_QUERY_VALUE, &ifaceKey);
if (rc == ERROR_SUCCESS)
{
if (rc == ERROR_SUCCESS)
{
/* determine the size and type */
{
/* query the value to BSTR */
sizeof (TCHAR) + 1);
if (rc != ERROR_SUCCESS)
{
SysFreeString (*aName);
}
}
}
}
}
#else /* !defined (VBOX_WITH_XPCOM) */
if (NS_SUCCEEDED (rv))
{
if (NS_SUCCEEDED (rv))
{
{
{
}
}
}
}
#endif /* !defined (VBOX_WITH_XPCOM) */
}
{
/* start with null */
*aDir = 0;
char path [RTPATH_MAX];
int vrc = VINF_SUCCESS;
if (VBoxUserHome)
{
/* get the full path name */
char *VBoxUserHomeUtf8 = NULL;
if (RT_SUCCESS (vrc))
{
if (RT_SUCCESS (vrc))
{
else
}
}
}
else
{
/* compose the config directory (full path) */
if (RT_SUCCESS (vrc))
{
}
}
/* ensure the home directory exists */
if (RT_SUCCESS (vrc))
if (!RTDirExists (aDir))
return vrc;
}
}; // namespace com