com.cpp revision df03c5ed15c9b5bf6d75fedcdf5057d3ffce8577
/* $Id$ */
/** @file
* MS COM / XPCOM Abstraction Layer
*/
/*
* Copyright (C) 2005-2012 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.
*/
#if !defined (VBOX_WITH_XPCOM)
# include <objbase.h>
#else /* !defined (VBOX_WITH_XPCOM) */
# include <stdlib.h>
# include <nsCOMPtr.h>
# include <nsIServiceManagerUtils.h>
# include <nsIComponentManager.h>
# include <ipcIService.h>
# include <ipcCID.h>
# include <ipcIDConnectService.h>
# include <nsIInterfaceInfo.h>
# include <nsIInterfaceInfoManager.h>
// official XPCOM headers don't define it yet
#define IPC_DCONNECTSERVICE_CONTRACTID \
#endif /* !defined (VBOX_WITH_XPCOM) */
#include <package-generated.h>
#include <iprt/buildconfig.h>
#ifdef RT_OS_DARWIN
# define VBOX_USER_HOME_SUFFIX "Library/VirtualBox"
#else
# define VBOX_USER_HOME_SUFFIX ".VirtualBox"
#endif
#include "Logging.h"
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 */
if (rc != ERROR_SUCCESS)
{
}
}
}
}
}
#else /* !defined (VBOX_WITH_XPCOM) */
if (NS_SUCCEEDED(rv))
{
if (NS_SUCCEEDED(rv))
{
{
{
}
}
}
}
#endif /* !defined (VBOX_WITH_XPCOM) */
}
#ifdef VBOX_WITH_XPCOM
const char *serverName,
void** ppobj)
{
{
{
id,
ppobj);
}
}
return rc;
}
void** ppobj)
{
id,
ppobj);
return rc;
}
#endif // VBOX_WITH_XPCOM
{
/* start with null */
*aDir = 0;
char szTmp[RTPATH_MAX];
{
if (RT_SUCCESS(vrc))
{
/* get the full path name */
}
else
{
/* compose the config directory (full path) */
/** @todo r=bird: RTPathUserHome doesn't necessarily return a full (abs) path
* like the comment above seems to indicate. */
if (RT_SUCCESS(vrc))
}
/* ensure the home directory exists */
if (RT_SUCCESS(vrc))
if (!RTDirExists(aDir))
}
return vrc;
}
static const char *g_pszLogEntity = NULL;
static void vboxHeaderFooter(PRTLOGGER pReleaseLogger, RTLOGPHASE enmPhase, PFNRTLOGPHASEMSG pfnLog)
{
/* some introductory information */
static RTTIMESPEC s_TimeSpec;
char szTmp[256];
if (enmPhase == RTLOGPHASE_BEGIN)
switch (enmPhase)
{
case RTLOGPHASE_BEGIN:
{
"VirtualBox %s %s r%u %s (%s %s) release log\n"
#ifdef VBOX_BLEEDING_EDGE
#endif
"Log opened %s\n",
if (RT_SUCCESS(vrc))
if (RT_SUCCESS(vrc))
/* the package type is interesting for Linux distributions */
char szExecName[RTPATH_MAX];
"Executable: %s\n"
"Process ID: %u\n"
"Package type: %s"
#ifdef VBOX_OSE
" (OSE)"
#endif
"\n",
RTProcSelf(),
break;
}
case RTLOGPHASE_PREROTATE:
break;
case RTLOGPHASE_POSTROTATE:
break;
case RTLOGPHASE_END:
break;
default:
/* nothing */;
}
}
{
/* create release logger */
static const char * const s_apszGroups[] = VBOX_LOGGROUP_NAMES;
#if defined(RT_OS_WINDOWS) || defined(RT_OS_OS2)
#endif
if (RT_SUCCESS(vrc))
{
/* make sure that we don't flood logfiles */
/* explicitly flush the log, to have some info when buffering */
/* register this logger as the release logger */
}
return vrc;
}
/* static */
#if defined (VBOX_WITH_XPCOM)
/* static */
#endif /* (VBOX_WITH_XPCOM) */
/**
* Used by ComPtr and friends to log details about reference counting.
* @param pcszFormat
*/
void LogRef(const char *pcszFormat, ...)
{
char *pszNewMsg;
}
} /* namespace com */