VirtualBox

Changeset 60765 in vbox for trunk/src


Ignore:
Timestamp:
Apr 29, 2016 2:26:58 PM (9 years ago)
Author:
vboxsync
Message:

API: stop using ATL and use a vastly smaller lookalike instead, plus a lot of cleanups

Location:
trunk/src/VBox
Files:
22 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/VBoxNetFlt/Makefile.kmk

    r60592 r60765  
    55
    66#
    7 # Copyright (C) 2008-2015 Oracle Corporation
     7# Copyright (C) 2008-2016 Oracle Corporation
    88#
    99# This file is part of VirtualBox Open Source Edition (OSE), as
     
    365365        win/nobj/VBoxNetFltNobj.rc
    366366 VBoxNetFltNobj_LIBS       = \
    367         $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_LIB)/atls$(VBOX_VCC_CRT_TYPE).lib
     367        $(LIB_RUNTIME)
    368368 #VBoxNetFltNobj_INTERMEDIATES =
    369369 VBoxNetFltNobj_DEPS       = \
  • trunk/src/VBox/HostDrivers/VBoxNetFlt/win/nobj/VBoxNetFltNobj.cpp

    r56293 r60765  
    55 */
    66/*
    7  * Copyright (C) 2011-2015 Oracle Corporation
     7 * Copyright (C) 2011-2016 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    542542
    543543
    544 CComModule _Module;
     544static ATL::CComModule _Module;
    545545
    546546BEGIN_OBJECT_MAP(ObjectMap)
     
    575575STDAPI DllRegisterServer()
    576576{
     577// this is a "just in case" conditional, which is not defined
     578#ifdef VBOX_FORCE_REGISTER_SERVER
    577579    return _Module.RegisterServer(TRUE);
     580#else
     581    return S_OK;
     582#endif
    578583}
    579584
    580585STDAPI DllUnregisterServer()
    581586{
     587// this is a "just in case" conditional, which is not defined
     588#ifdef VBOX_FORCE_REGISTER_SERVER
    582589    return _Module.UnregisterServer(TRUE);
    583 }
     590#else
     591    return S_OK;
     592#endif
     593}
  • trunk/src/VBox/HostDrivers/VBoxNetFlt/win/nobj/VBoxNetFltNobj.h

    r56293 r60765  
    55 */
    66/*
    7  * Copyright (C) 2011-2015 Oracle Corporation
     7 * Copyright (C) 2011-2016 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    1919
    2020#include <windows.h>
    21 /* atl stuff */
    22 #include <atlbase.h>
    23 extern CComModule _Module;
    24 #include <atlcom.h>
    2521
     22#include "VBox/com/defs.h"
    2623#include "VBoxNetFltNobjT.h"
    2724#include "VBoxNetFltNobjRc.h"
     
    3431 */
    3532class ATL_NO_VTABLE VBoxNetFltNobj :
    36     public CComObjectRootEx<CComObjectThreadModel>,
    37     public CComCoClass<VBoxNetFltNobj, &CLSID_VBoxNetFltNobj>,
     33    public ATL::CComObjectRootEx<ATL::CComMultiThreadModel>,
     34    public ATL::CComCoClass<VBoxNetFltNobj, &CLSID_VBoxNetFltNobj>,
    3835    public INetCfgComponentControl,
    3936    public INetCfgComponentNotifyBinding
     
    4845    END_COM_MAP()
    4946
     47    // this is a "just in case" conditional, which is not defined
     48#ifdef VBOX_FORCE_REGISTER_SERVER
    5049    DECLARE_REGISTRY_RESOURCEID(IDR_VBOXNETFLT_NOBJ)
     50#endif
    5151
    5252    /* INetCfgComponentControl methods */
  • trunk/src/VBox/HostServices/DragAndDrop/Makefile.kmk

    r56301 r60765  
    55
    66#
    7 # Copyright (C) 2011-2015 Oracle Corporation
     7# Copyright (C) 2011-2016 Oracle Corporation
    88#
    99# This file is part of VirtualBox Open Source Edition (OSE), as
     
    3333VBoxDragAndDropSvc_INCS      = $(PATH_ROOT)/src/VBox/Main/include ./
    3434VBoxDragAndDropSvc_INCS.win  = \
    35         $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_INC) \
    3635        $(VBOX_PATH_SDK)
    3736
  • trunk/src/VBox/HostServices/GuestControl/Makefile.kmk

    r56301 r60765  
    55
    66#
    7 # Copyright (C) 2011-2015 Oracle Corporation
     7# Copyright (C) 2011-2016 Oracle Corporation
    88#
    99# This file is part of VirtualBox Open Source Edition (OSE), as
     
    3131VBoxGuestControlSvc_INCS      = $(PATH_ROOT)/src/VBox/Main/include
    3232VBoxGuestControlSvc_INCS.win  = \
    33         $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_INC) \
    3433        $(VBOX_PATH_SDK)
    3534
  • trunk/src/VBox/HostServices/GuestProperties/Makefile.kmk

    r56301 r60765  
    55
    66#
    7 # Copyright (C) 2006-2015 Oracle Corporation
     7# Copyright (C) 2006-2016 Oracle Corporation
    88#
    99# This file is part of VirtualBox Open Source Edition (OSE), as
     
    3131VBoxGuestPropSvc_INCS      = $(PATH_ROOT)/src/VBox/Main/include
    3232VBoxGuestPropSvc_INCS.win  = \
    33         $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_INC) \
    3433        $(VBOX_PATH_SDK)
    3534
  • trunk/src/VBox/HostServices/SharedFolders/Makefile.kmk

    r56962 r60765  
    55
    66#
    7 # Copyright (C) 2006-2015 Oracle Corporation
     7# Copyright (C) 2006-2016 Oracle Corporation
    88#
    99# This file is part of VirtualBox Open Source Edition (OSE), as
     
    3030VBoxSharedFolders_DEFS      = VBOX_WITH_HGCM RTSHFL
    3131VBoxSharedFolders_INCS.win  = \
    32         $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_INC) \
    3332        $(VBOX_PATH_SDK)
    3433
  • trunk/src/VBox/HostServices/SharedOpenGL/Makefile.kmk

    r60072 r60765  
    55
    66#
    7 # Copyright (C) 2008-2015 Oracle Corporation
     7# Copyright (C) 2008-2016 Oracle Corporation
    88#
    99# This file is part of VirtualBox Open Source Edition (OSE), as
     
    6060        $(TEMPLATE_VBOXMAINEXE_INTERMEDIATES)
    6161VBoxSharedCrOpenGL_INCS.win = \
    62         $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_INC) \
    6362        $(VBOX_PATH_SDK)/bindings/mscom/include
    6463ifdef VBOX_WITH_XPCOM
     
    8584ifeq ($(KBUILD_TARGET),win)
    8685 VBoxSharedCrOpenGL_LIBS += \
    87         $(PATH_OBJ)/VBoxOGLrenderspu/VBoxOGLrenderspu$(VBOX_SUFF_LIB) \
    88         $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_LIB)/atls$(VBOX_SUFF_LIB)
     86        $(PATH_OBJ)/VBoxOGLrenderspu/VBoxOGLrenderspu$(VBOX_SUFF_LIB)
    8987else
    9088 VBoxSharedCrOpenGL_LIBS += \
  • trunk/src/VBox/Main/idl/apiwrap-server.xsl

    r56596 r60765  
    66        VirtualBox.xidl.
    77
    8     Copyright (C) 2010-2015 Oracle Corporation
     8    Copyright (C) 2010-2016 Oracle Corporation
    99
    1010    This file is part of VirtualBox Open Source Edition (OSE), as
     
    170170        </xsl:for-each>
    171171    </xsl:if>
    172     <xsl:text>        COM_INTERFACE_ENTRY_AGGREGATE(IID_IMarshal, m_pUnkMarshaler.p)
    173     END_COM_MAP()
     172    <xsl:value-of select="concat('        VBOX_TWEAK_INTERFACE_ENTRY(', @name, ')', $G_sNewLine)"/>
     173    <xsl:text>    END_COM_MAP()
    174174
    175175</xsl:text>
  • trunk/src/VBox/Main/idl/comimpl.xsl

    r56328 r60765  
    1414        Further extension to other interfaces is possible and anticipated.
    1515
    16     Copyright (C) 2010-2015 Oracle Corporation
     16    Copyright (C) 2010-2016 Oracle Corporation
    1717
    1818    This file is part of VirtualBox Open Source Edition (OSE), as
     
    5858
    5959/*
    60  * Copyright (C) 2010-2015 Oracle Corporation
     60 * Copyright (C) 2010-2016 Oracle Corporation
    6161 *
    6262 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    488488  <xsl:value-of select="       '    DECLARE_PROTECT_FINAL_CONSTRUCT()&#10;'" />
    489489  <xsl:value-of select="concat('    BEGIN_COM_MAP(', $implName, ')&#10;')" />
    490   <xsl:value-of select="concat('        VBOX_DEFAULT_INTERFACE_ENTRIES(', @name, ')&#10;')" />
     490  <xsl:value-of select="       '        COM_INTERFACE_ENTRY(ISupportErrorInfo)&#10;'" />
     491  <xsl:value-of select="concat('        COM_INTERFACE_ENTRY(', @name, ')&#10;')" />
     492  <xsl:value-of select="concat('        COM_INTERFACE_ENTRY2(IDispatch, ', @name, ')&#10;')" />
     493  <xsl:value-of select="concat('        VBOX_TWEAK_INTERFACE_ENTRY(', @name, ')&#10;')" />
    491494
    492495  <xsl:call-template name="genComEntry">
  • trunk/src/VBox/Main/include/MachineImpl.h

    r60410 r60765  
    55
    66/*
    7  * Copyright (C) 2006-2015 Oracle Corporation
     7 * Copyright (C) 2006-2016 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    12941294
    12951295    BEGIN_COM_MAP(SessionMachine)
    1296         VBOX_DEFAULT_INTERFACE_ENTRIES(IMachine)
     1296        COM_INTERFACE_ENTRY(ISupportErrorInfo)
     1297        COM_INTERFACE_ENTRY(IMachine)
     1298        COM_INTERFACE_ENTRY2(IDispatch, IMachine)
    12971299        COM_INTERFACE_ENTRY(IInternalMachineControl)
     1300        VBOX_TWEAK_INTERFACE_ENTRY(IMachine)
    12981301    END_COM_MAP()
    12991302
     
    15481551
    15491552    BEGIN_COM_MAP(SnapshotMachine)
    1550         VBOX_DEFAULT_INTERFACE_ENTRIES(IMachine)
     1553        COM_INTERFACE_ENTRY(ISupportErrorInfo)
     1554        COM_INTERFACE_ENTRY(IMachine)
     1555        COM_INTERFACE_ENTRY2(IDispatch, IMachine)
     1556        VBOX_TWEAK_INTERFACE_ENTRY(IMachine)
    15511557    END_COM_MAP()
    15521558
  • trunk/src/VBox/Main/include/ProgressProxyImpl.h

    r44528 r60765  
    11/* $Id$ */
    22/** @file
    3  * IProgress implementation for Machine::openRemoteSession in VBoxSVC.
     3 * IProgress implementation for Machine::LaunchVMProcess in VBoxSVC.
    44 */
    55
    66/*
    7  * Copyright (C) 2006-2012 Oracle Corporation
     7 * Copyright (C) 2006-2016 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    3737
    3838    BEGIN_COM_MAP(ProgressProxy)
    39         VBOX_DEFAULT_INTERFACE_ENTRIES (IProgress)
     39        COM_INTERFACE_ENTRY(ISupportErrorInfo)
     40        COM_INTERFACE_ENTRY(IProgress)
     41        COM_INTERFACE_ENTRY2(IDispatch, IProgress)
     42        VBOX_TWEAK_INTERFACE_ENTRY(IProgress)
    4043    END_COM_MAP()
    4144
     
    4346    void    FinalRelease();
    4447    HRESULT init(
    45 #if !defined (VBOX_COM_INPROC)
     48#ifndef VBOX_COM_INPROC
    4649                 VirtualBox *pParent,
    4750#endif
     
    5053                 BOOL fCancelable);
    5154    HRESULT init(
    52 #if !defined (VBOX_COM_INPROC)
     55#ifndef VBOX_COM_INPROC
    5356                 VirtualBox *pParent,
    5457#endif
  • trunk/src/VBox/Main/include/SessionImpl.h

    r56450 r60765  
    55
    66/*
    7  * Copyright (C) 2006-2015 Oracle Corporation
     7 * Copyright (C) 2006-2016 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    3232    public SessionWrap
    3333#ifdef RT_OS_WINDOWS
    34     , public CComCoClass<Session, &CLSID_Session>
     34    , public ATL::CComCoClass<Session, &CLSID_Session>
    3535#endif
    3636{
     
    3939    DECLARE_CLASSFACTORY()
    4040
    41     DECLARE_REGISTRY_RESOURCEID(IDR_VIRTUALBOX)
     41    // Do not use any ATL registry support.
     42    //DECLARE_REGISTRY_RESOURCEID(IDR_VIRTUALBOX)
    4243
    4344    DECLARE_NOT_AGGREGATABLE(Session)
  • trunk/src/VBox/Main/include/VirtualBoxBase.h

    r57065 r60765  
    55
    66/*
    7  * Copyright (C) 2006-2015 Oracle Corporation
     7 * Copyright (C) 2006-2016 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    6262#if !defined(VBOX_WITH_XPCOM)
    6363
    64 #include <atlcom.h>
    65 
    6664/* use a special version of the singleton class factory,
    6765 * see KB811591 in msdn for more info. */
     
    7169
    7270template <class T>
    73 class CMyComClassFactorySingleton : public CComClassFactory
     71class CMyComClassFactorySingleton : public ATL::CComClassFactory
    7472{
    7573public:
    76     CMyComClassFactorySingleton() : m_hrCreate(S_OK){}
    77     virtual ~CMyComClassFactorySingleton(){}
     74    CMyComClassFactorySingleton() :
     75        m_hrCreate(S_OK), m_spObj(NULL)
     76    {
     77    }
     78    virtual ~CMyComClassFactorySingleton()
     79    {
     80        if (m_spObj)
     81            m_spObj->Release();
     82    }
    7883    // IClassFactory
    7984    STDMETHOD(CreateInstance)(LPUNKNOWN pUnkOuter, REFIID riid, void** ppvObj)
     
    8388        {
    8489            *ppvObj = NULL;
    85             // Aggregation is not supported in singleton objects.
    86             ATLASSERT(pUnkOuter == NULL);
    87             if (pUnkOuter != NULL)
    88                 hRes = CLASS_E_NOAGGREGATION;
     90            // no aggregation for singletons
     91            AssertReturn(pUnkOuter == NULL, CLASS_E_NOAGGREGATION);
     92            if (m_hrCreate == S_OK && m_spObj == NULL)
     93            {
     94                Lock();
     95                __try
     96                {
     97                    // Fix:  The following If statement was moved inside the __try statement.
     98                    // Did another thread arrive here first?
     99                    if (m_hrCreate == S_OK && m_spObj == NULL)
     100                    {
     101                        // lock the module to indicate activity
     102                        // (necessary for the monitor shutdown thread to correctly
     103                        // terminate the module in case when CreateInstance() fails)
     104                        ATL::_pAtlModule->Lock();
     105                        ATL::CComObjectCached<T> *p;
     106                        m_hrCreate = ATL::CComObjectCached<T>::CreateInstance(&p);
     107                        if (SUCCEEDED(m_hrCreate))
     108                        {
     109                            m_hrCreate = p->QueryInterface(IID_IUnknown, (void **)&m_spObj);
     110                            if (FAILED(m_hrCreate))
     111                            {
     112                                delete p;
     113                            }
     114                        }
     115                        ATL::_pAtlModule->Unlock();
     116                    }
     117                }
     118                __finally
     119                {
     120                    Unlock();
     121                }
     122            }
     123            if (m_hrCreate == S_OK)
     124            {
     125                hRes = m_spObj->QueryInterface(riid, ppvObj);
     126            }
    89127            else
    90128            {
    91                 if (m_hrCreate == S_OK && m_spObj == NULL)
    92                 {
    93                     Lock();
    94                     __try
    95                     {
    96                         // Fix:  The following If statement was moved inside the __try statement.
    97                         // Did another thread arrive here first?
    98                         if (m_hrCreate == S_OK && m_spObj == NULL)
    99                         {
    100                             // lock the module to indicate activity
    101                             // (necessary for the monitor shutdown thread to correctly
    102                             // terminate the module in case when CreateInstance() fails)
    103                             _pAtlModule->Lock();
    104                             CComObjectCached<T> *p;
    105                             m_hrCreate = CComObjectCached<T>::CreateInstance(&p);
    106                             if (SUCCEEDED(m_hrCreate))
    107                             {
    108                                 m_hrCreate = p->QueryInterface(IID_IUnknown, (void**)&m_spObj);
    109                                 if (FAILED(m_hrCreate))
    110                                 {
    111                                     delete p;
    112                                 }
    113                             }
    114                             _pAtlModule->Unlock();
    115                         }
    116                     }
    117                     __finally
    118                     {
    119                         Unlock();
    120                     }
    121                 }
    122                 if (m_hrCreate == S_OK)
    123                 {
    124                     hRes = m_spObj->QueryInterface(riid, ppvObj);
    125                 }
    126                 else
    127                 {
    128                     hRes = m_hrCreate;
    129                 }
     129                hRes = m_hrCreate;
    130130            }
    131131        }
     
    133133    }
    134134    HRESULT m_hrCreate;
    135     CComPtr<IUnknown> m_spObj;
     135    IUnknown *m_spObj;
    136136};
    137137
     
    642642  #define VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(cls, iface) \
    643643    VIRTUALBOXBASE_ADD_VIRTUAL_COMPONENT_METHODS(cls, iface)
    644 #else // #ifdef VBOX_WITH_XPCOM
     644#else // !VBOX_WITH_XPCOM
    645645  #define VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(cls, iface) \
    646646    VIRTUALBOXBASE_ADD_VIRTUAL_COMPONENT_METHODS(cls, iface) \
    647647    STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid) \
    648648    { \
    649         const _ATL_INTMAP_ENTRY* pEntries = cls::_GetEntries(); \
     649        const ATL::_ATL_INTMAP_ENTRY* pEntries = cls::_GetEntries(); \
    650650        Assert(pEntries); \
    651651        if (!pEntries) \
     
    664664        return bSupports ? S_OK : S_FALSE; \
    665665    }
    666 #endif // #ifdef VBOX_WITH_XPCOM
     666#endif // !VBOX_WITH_XPCOM
     667
     668/**
     669 * VBOX_TWEAK_INTERFACE_ENTRY:
     670 * Macro for defining magic interface entries needed for all interfaces
     671 * implemented by any subclass of VirtualBoxBase.
     672 */
     673#ifdef VBOX_WITH_XPCOM
     674#define VBOX_TWEAK_INTERFACE_ENTRY(iface)
     675#else // !VBOX_WITH_XPCOM
     676#define VBOX_TWEAK_INTERFACE_ENTRY(iface)                                   \
     677        COM_INTERFACE_ENTRY_AGGREGATE(IID_IMarshal, m_pUnkMarshaler.m_p)
     678#endif // !VBOX_WITH_XPCOM
     679
    667680
    668681/**
     
    676689class ATL_NO_VTABLE VirtualBoxBase
    677690    : public VirtualBoxTranslatable,
    678       public CComObjectRootEx<CComMultiThreadModel>
     691      public ATL::CComObjectRootEx<ATL::CComMultiThreadModel>
    679692#if !defined (VBOX_WITH_XPCOM)
    680693    , public ISupportErrorInfo
     
    683696protected:
    684697#ifdef RT_OS_WINDOWS
    685      CComPtr <IUnknown>  m_pUnkMarshaler;
     698     ComPtr<IUnknown> m_pUnkMarshaler;
    686699#endif
    687700
    688      HRESULT   BaseFinalConstruct()
     701     HRESULT BaseFinalConstruct()
    689702     {
    690703#ifdef RT_OS_WINDOWS
    691704        return CoCreateFreeThreadedMarshaler(this, //GetControllingUnknown(),
    692                                              &m_pUnkMarshaler.p);
     705                                             m_pUnkMarshaler.asOutParam());
    693706#else
    694707        return S_OK;
     
    696709     }
    697710
    698      void   BaseFinalRelease()
     711     void BaseFinalRelease()
    699712     {
    700713#ifdef RT_OS_WINDOWS
    701          m_pUnkMarshaler.Release();
     714         m_pUnkMarshaler.setNull();
    702715#endif
    703716     }
  • trunk/src/VBox/Main/include/VirtualBoxClientImpl.h

    r52442 r60765  
    66
    77/*
    8  * Copyright (C) 2010-2014 Oracle Corporation
     8 * Copyright (C) 2010-2016 Oracle Corporation
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    3030    public VirtualBoxClientWrap
    3131#ifdef RT_OS_WINDOWS
    32     , public CComCoClass<VirtualBoxClient, &CLSID_VirtualBoxClient>
     32    , public ATL::CComCoClass<VirtualBoxClient, &CLSID_VirtualBoxClient>
    3333#endif
    3434{
     
    3636    DECLARE_CLASSFACTORY()
    3737
    38     DECLARE_REGISTRY_RESOURCEID(IDR_VIRTUALBOX)
     38    // Do not use any ATL registry support.
     39    //DECLARE_REGISTRY_RESOURCEID(IDR_VIRTUALBOX)
    3940
    4041    DECLARE_NOT_AGGREGATABLE(VirtualBoxClient)
  • trunk/src/VBox/Main/include/VirtualBoxErrorInfoImpl.h

    r55401 r60765  
    2424
    2525class ATL_NO_VTABLE VirtualBoxErrorInfo
    26     : public CComObjectRootEx<CComMultiThreadModel>
     26    : public ATL::CComObjectRootEx<ATL::CComMultiThreadModel>
    2727    , VBOX_SCRIPTABLE_IMPL(IVirtualBoxErrorInfo)
    2828#ifndef VBOX_WITH_XPCOM /* IErrorInfo doesn't inherit from IDispatch, ugly 3am hack: */
  • trunk/src/VBox/Main/include/VirtualBoxImpl.h

    r59571 r60765  
    55
    66/*
    7  * Copyright (C) 2006-2015 Oracle Corporation
     7 * Copyright (C) 2006-2016 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    6161    public VirtualBoxWrap
    6262#ifdef RT_OS_WINDOWS
    63      , public CComCoClass<VirtualBox, &CLSID_VirtualBox>
     63     , public ATL::CComCoClass<VirtualBox, &CLSID_VirtualBox>
    6464#endif
    6565{
     
    7575    DECLARE_CLASSFACTORY_SINGLETON(VirtualBox)
    7676
    77     DECLARE_REGISTRY_RESOURCEID(IDR_VIRTUALBOX)
     77    // Do not use any ATL registry support.
     78    //DECLARE_REGISTRY_RESOURCEID(IDR_VIRTUALBOX)
    7879
    7980    // Kind of redundant (VirtualBoxWrap declares itself not aggregatable and
  • trunk/src/VBox/Main/src-all/EventImpl.cpp

    r60240 r60765  
    12611261
    12621262    BEGIN_COM_MAP(PassiveEventListener)
    1263         VBOX_DEFAULT_INTERFACE_ENTRIES(IEventListener)
     1263        COM_INTERFACE_ENTRY(ISupportErrorInfo)
     1264        COM_INTERFACE_ENTRY(IEventListener)
     1265        COM_INTERFACE_ENTRY2(IDispatch, IEventListener)
     1266        VBOX_TWEAK_INTERFACE_ENTRY(IEventListener)
    12641267    END_COM_MAP()
    12651268
     
    13011304
    13021305    BEGIN_COM_MAP(ProxyEventListener)
    1303         VBOX_DEFAULT_INTERFACE_ENTRIES(IEventListener)
     1306        COM_INTERFACE_ENTRY(ISupportErrorInfo)
     1307        COM_INTERFACE_ENTRY(IEventListener)
     1308        COM_INTERFACE_ENTRY2(IDispatch, IEventListener)
     1309        VBOX_TWEAK_INTERFACE_ENTRY(IEventListener)
    13041310    END_COM_MAP()
    13051311
     
    13561362
    13571363    BEGIN_COM_MAP(EventSourceAggregator)
    1358         VBOX_DEFAULT_INTERFACE_ENTRIES(IEventSource)
     1364        COM_INTERFACE_ENTRY(ISupportErrorInfo)
     1365        COM_INTERFACE_ENTRY(IEventSource)
     1366        COM_INTERFACE_ENTRY2(IDispatch, IEventSource)
     1367        VBOX_TWEAK_INTERFACE_ENTRY(IEventSource)
    13591368    END_COM_MAP()
    13601369
  • trunk/src/VBox/Main/src-client/win/dllmain.cpp

    r59369 r60765  
    2525#include <VirtualBoxClientImpl.h>
    2626
    27 #include <atlbase.h>
    28 #include <atlcom.h>
    29 
    3027#include <iprt/initterm.h>
    3128
     
    3431*   Global Variables                                                                                                             *
    3532*********************************************************************************************************************************/
    36 CComModule _Module;
     33static ATL::CComModule _Module;
    3734
    3835BEGIN_OBJECT_MAP(ObjectMap)
     
    5047    if (dwReason == DLL_PROCESS_ATTACH)
    5148    {
     49        // idempotent, so doesn't harm, and needed for COM embedding scenario
     50        RTR3InitDll(RTR3INIT_FLAGS_UNOBTRUSIVE);
     51
    5252        _Module.Init(ObjectMap, hInstance, &LIBID_VirtualBox);
    5353        DisableThreadLibraryCalls(hInstance);
    54 
    55         // idempotent, so doesn't harm, and needed for COM embedding scenario
    56         RTR3InitDll(RTR3INIT_FLAGS_UNOBTRUSIVE);
    5754    }
    5855    else if (dwReason == DLL_PROCESS_DETACH)
     
    6865STDAPI DllCanUnloadNow(void)
    6966{
    70     return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
     67    return (_Module.GetLockCount() == 0) ? S_OK : S_FALSE;
    7168}
    7269
     
    7471// Returns a class factory to create an object of the requested type
    7572
    76 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
     73STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
    7774{
    7875    return _Module.GetClassObject(rclsid, riid, ppv);
  • trunk/src/VBox/Main/src-server/USBDeviceFiltersImpl.cpp

    r60159 r60765  
    55
    66/*
    7  * Copyright (C) 2005-2015 Oracle Corporation
     7 * Copyright (C) 2005-2016 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    258258    DECLARE_PROTECT_FINAL_CONSTRUCT()
    259259    BEGIN_COM_MAP(USBDeviceFilter)
    260         VBOX_DEFAULT_INTERFACE_ENTRIES(IUSBDeviceFilter)
     260        COM_INTERFACE_ENTRY(ISupportErrorInfo)
     261        COM_INTERFACE_ENTRY(IUSBDeviceFilter)
     262        COM_INTERFACE_ENTRY2(IDispatch, IUSBDeviceFilter)
     263        VBOX_TWEAK_INTERFACE_ENTRY(IUSBDeviceFilter)
    261264    END_COM_MAP()
    262265
  • trunk/src/VBox/Main/src-server/win/svcmain.cpp

    r59369 r60765  
    66
    77/*
    8  * Copyright (C) 2004-2013 Oracle Corporation
     8 * Copyright (C) 2004-2016 Oracle Corporation
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2020#include <stdio.h>
    2121#include <stdlib.h>
     22#include <tchar.h>
    2223
    2324#include "VBox/com/defs.h"
     
    4142#include <iprt/message.h>
    4243
    43 #include <atlbase.h>
    44 #include <atlcom.h>
    45 
    46 #define _ATL_FREE_THREADED
    47 
    48 class CExeModule : public CComModule
     44class CExeModule : public ATL::CComModule
    4945{
    5046public:
     
    7066LONG CExeModule::Unlock()
    7167{
    72     LONG l = CComModule::Unlock();
     68    LONG l = ATL::CComModule::Unlock();
    7369    if (l == 0)
    7470    {
     
    9288        } while (dwWait == WAIT_OBJECT_0);
    9389        /* timed out */
    94         if (!bActivity && m_nLockCnt == 0) /* if no activity let's really bail */
     90        if (!bActivity && GetLockCount() == 0) /* if no activity let's really bail */
    9591        {
    9692            /* Disable log rotation at this point, worst case a log file
     
    114110                }
    115111            }
    116 #if _WIN32_WINNT >= 0x0400 & defined(_ATL_FREE_THREADED)
     112#if _WIN32_WINNT >= 0x0400
    117113            CoSuspendClassObjects();
    118             if (!bActivity && m_nLockCnt == 0)
     114            if (!bActivity && GetLockCount() == 0)
    119115#endif
    120116                break;
     
    135131}
    136132
    137 CExeModule _Module;
     133static CExeModule _Module;
    138134
    139135BEGIN_OBJECT_MAP(ObjectMap)
     
    384380    {
    385381        _Module.StartMonitor();
    386 #if _WIN32_WINNT >= 0x0400 & defined(_ATL_FREE_THREADED)
     382#if _WIN32_WINNT >= 0x0400
    387383        hRes = _Module.RegisterClassObjects(CLSCTX_LOCAL_SERVER, REGCLS_MULTIPLEUSE | REGCLS_SUSPENDED);
    388384        _ASSERTE(SUCCEEDED(hRes));
  • trunk/src/VBox/Main/testcase/makefile.tstVBoxAPIWin

    r45064 r60765  
    33#
    44#
    5 # Copyright (C) 2006-2013 Oracle Corporation
     5# Copyright (C) 2006-2016 Oracle Corporation
    66#
    77# This file is part of VirtualBox Open Source Edition (OSE), as
     
    3232# VS_INSTALL_PATH = "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\"
    3333# VS_INCLUDE_PATH = "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include"
    34 # VS_ATLMFC_INCLUDE_PATH = "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\include"
    3534# WIN_SDK_INCLUDE_PATH = "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include"
    3635# WIN_SDK_LIB_PATH = "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib\x64\"
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette