com.h revision a126a5a0d184e3245a585414758011d1d095b35f
1N/A/** @file
1N/A * MS COM / XPCOM Abstraction Layer:
1N/A * COM initialization / shutdown
1N/A */
1N/A
1N/A/*
1N/A * Copyright (C) 2006-2007 Oracle Corporation
1N/A *
1N/A * This file is part of VirtualBox Open Source Edition (OSE), as
1N/A * available from http://www.virtualbox.org. This file is free software;
1N/A * you can redistribute it and/or modify it under the terms of the GNU
1N/A * General Public License (GPL) as published by the Free Software
1N/A * Foundation, in version 2 as it comes in the "COPYING" file of the
1N/A * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
1N/A * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
1N/A *
1N/A * The contents of this file may alternatively be used under the terms
1N/A * of the Common Development and Distribution License Version 1.0
1N/A * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
1N/A * VirtualBox OSE distribution, in which case the provisions of the
1N/A * CDDL are applicable instead of those of the GPL.
1N/A *
1N/A * You may elect to license modified versions of this file under the
1N/A * terms and conditions of either the GPL or the CDDL or both.
1N/A */
1N/A
1N/A#ifndef ___VBox_com_com_h
1N/A#define ___VBox_com_com_h
1N/A
1N/A#include "VBox/com/defs.h"
1N/A
1N/Anamespace com
1N/A{
1N/A
1N/A/**
1N/A * Initializes the COM runtime.
1N/A * Must be called on the main thread, before any COM activity in any thread.
1N/A *
1N/A * @return COM result code
1N/A */
1N/AHRESULT Initialize();
1N/A
1N/A/**
1N/A * Shuts down the COM runtime.
1N/A * Must be called on the main thread before termination.
1N/A * No COM calls may be made in any thread after this method returns.
1N/A */
1N/AHRESULT Shutdown();
1N/A
1N/A/**
1N/A * Resolves a given interface ID to a string containing the interface name.
1N/A * If, for some reason, the given IID cannot be resolved to a name, a NULL
1N/A * string is returned. A non-NULL string returned by this function must be
1N/A * freed using SysFreeString().
1N/A *
1N/A * @param aIID ID of the interface to get a name for
1N/A * @param aName Resolved interface name or @c NULL on error
1N/A */
1N/Avoid GetInterfaceNameByIID(const GUID &aIID, BSTR *aName);
1N/A
1N/A/**
1N/A * Returns the VirtualBox user home directory.
1N/A *
1N/A * On failure, this function will return a path that caused a failure (or
1N/A * NULL if the failure is not path-related).
1N/A *
1N/A * On success, this function will try to create the returned directory if it
1N/A * doesn't exist yet. This may also fail with the corresponding status code.
1N/A *
1N/A * If @a aDirLen is smaller than RTPATH_MAX then there is a great chance that
1N/A * this method will return VERR_BUFFER_OVERFLOW.
1N/A *
1N/A * @param aDir Buffer to store the directory string in UTF-8 encoding.
1N/A * @param aDirLen Length of the supplied buffer including space for the
1N/A * terminating null character, in bytes.
1N/A * @return VBox status code.
1N/A */
1N/Aint GetVBoxUserHomeDirectory (char *aDir, size_t aDirLen);
1N/A
1N/A} /* namespace com */
1N/A
1N/A#endif