COMDefs.h revision 0c04bf3d366953a24840080b5f7be34d9406a7dc
4c221b0da1816acf2ca302b10092df059484468dvboxsync/** @file
4c221b0da1816acf2ca302b10092df059484468dvboxsync * VBox frontends: Basic Frontend (BFE):
4c221b0da1816acf2ca302b10092df059484468dvboxsync * COM definitions
4c221b0da1816acf2ca302b10092df059484468dvboxsync */
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsync/*
4c221b0da1816acf2ca302b10092df059484468dvboxsync * Copyright (C) 2006-2007 innotek GmbH
4c221b0da1816acf2ca302b10092df059484468dvboxsync *
4c221b0da1816acf2ca302b10092df059484468dvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
4c221b0da1816acf2ca302b10092df059484468dvboxsync * available from http://www.virtualbox.org. This file is free software;
4c221b0da1816acf2ca302b10092df059484468dvboxsync * you can redistribute it and/or modify it under the terms of the GNU
4c221b0da1816acf2ca302b10092df059484468dvboxsync * General Public License as published by the Free Software Foundation,
4c221b0da1816acf2ca302b10092df059484468dvboxsync * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
4c221b0da1816acf2ca302b10092df059484468dvboxsync * distribution. VirtualBox OSE is distributed in the hope that it will
4c221b0da1816acf2ca302b10092df059484468dvboxsync * be useful, but WITHOUT ANY WARRANTY of any kind.
4c221b0da1816acf2ca302b10092df059484468dvboxsync *
4c221b0da1816acf2ca302b10092df059484468dvboxsync * If you received this file as part of a commercial VirtualBox
4c221b0da1816acf2ca302b10092df059484468dvboxsync * distribution, then only the terms of your commercial VirtualBox
4c221b0da1816acf2ca302b10092df059484468dvboxsync * license agreement apply instead of the previous paragraph.
4c221b0da1816acf2ca302b10092df059484468dvboxsync */
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsync#ifndef COMDefs_H
4c221b0da1816acf2ca302b10092df059484468dvboxsync#define COMDefs_H
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsync#ifdef RT_OS_WINDOWS
4c221b0da1816acf2ca302b10092df059484468dvboxsync# include <Windows.h>
4c221b0da1816acf2ca302b10092df059484468dvboxsync#endif
4c221b0da1816acf2ca302b10092df059484468dvboxsync#include <stdarg.h>
4c221b0da1816acf2ca302b10092df059484468dvboxsync#include <iprt/assert.h>
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsync/* This is a transitional file used to get rid of all COM
4c221b0da1816acf2ca302b10092df059484468dvboxsync * definitions from COM/XPCOM. */
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsync#define COMGETTER(n) get_##n
4c221b0da1816acf2ca302b10092df059484468dvboxsync#define COMSETTER(n) put_##n
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsync#define NS_LIKELY(x) RT_LIKELY(x)
4c221b0da1816acf2ca302b10092df059484468dvboxsync#define NS_UNLIKELY(x) RT_UNLIKELY(x)
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsync#define NS_SUCCEEDED(_nsresult) (NS_LIKELY(!((_nsresult) & 0x80000000)))
4c221b0da1816acf2ca302b10092df059484468dvboxsync#define NS_FAILED(_nsresult) (NS_UNLIKELY((_nsresult) & 0x80000000))
4c221b0da1816acf2ca302b10092df059484468dvboxsync
#define ATL_NO_VTABLE
#ifndef RT_OS_WINDOWS
typedef unsigned long HRESULT;
typedef unsigned long ULONG; /// @todo 64-bit: ULONG is 32-bit.
typedef signed long LONG; /// @todo 64-bit: ULONG is 32-bit.
typedef unsigned short USHORT;
typedef bool BOOL;
typedef unsigned char BYTE;
# define STDMETHODIMP unsigned long
# define STDMETHOD(a) virtual unsigned long a
# define S_OK 0
# if ! defined(E_NOTIMPL)
# define E_NOTIMPL ((unsigned long) 0x80004001L)
# endif
# define E_POINTER ((unsigned long) 0x80004003L)
# define E_FAIL ((unsigned long) 0x80004005L)
# define E_UNEXPECTED ((unsigned long) 0x8000ffffL)
# define E_INVALIDARG ((unsigned long) 0x80070057L)
# if ! defined(FALSE)
# define FALSE false
# endif
# if ! defined(TRUE)
# define TRUE true
# endif
# define SUCCEEDED NS_SUCCEEDED
# define FAILED NS_FAILED
#endif /* !RT_OS_WINDOWS */
#endif