com.cpp revision 90d4f1c99db3fb2981bc2cea649ce71d1e93ebcb
/** @file
*
* MS COM / XPCOM Abstraction Layer
*/
/*
* Copyright (C) 2006 InnoTek Systemberatung 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
#include <stdlib.h>
#include <nsXPCOMGlue.h>
#include <nsIComponentRegistrar.h>
#include <nsIServiceManager.h>
#include <nsCOMPtr.h>
#include <nsEventQueueUtils.h>
#include <nsIInterfaceInfo.h>
#include <nsIInterfaceInfoManager.h>
#endif
namespace com
{
{
#if !defined (VBOX_WITH_XPCOM)
#else
/* Set VBOX_XPCOM_HOME if not present */
if (!getenv("VBOX_XPCOM_HOME"))
{
/* get the executable path */
char szPathProgram[1024];
if (VBOX_SUCCESS(rcVBox))
{
}
}
if (rc == NS_ERROR_NOT_INITIALIZED)
{
if (NS_SUCCEEDED (rc))
{
if (NS_SUCCEEDED (rc))
}
}
#endif
AssertComRC (rc);
return rc;
}
void Shutdown()
{
#if !defined (VBOX_WITH_XPCOM)
#else
if (NS_SUCCEEDED (rc))
{
if (isOnMainThread)
{
/* only the main thread needs to uninitialize XPCOM */
}
}
#endif
}
{
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
if (NS_SUCCEEDED (rv))
{
if (NS_SUCCEEDED (rv))
{
{
{
}
}
}
}
#endif
}
}; // namespace com