VirtualBox

Changeset 6935 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Feb 13, 2008 4:43:19 PM (17 years ago)
Author:
vboxsync
Message:

Main: Changed 'defined (RT_OS_WINDOWS)' => '!defined (VBOX_WITH_XPCOM)' in relevant places, for clarity (not XPCOM is possible only on Windows so far).

Location:
trunk/src/VBox/Main
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/ConsoleImpl2.cpp

    r6616 r6935  
    7070    bool afPciDeviceNo[15] = {false};
    7171
    72 #if defined(RT_OS_WINDOWS)
     72#if !defined (VBOX_WITH_XPCOM)
    7373    {
    7474        /* initialize COM */
  • trunk/src/VBox/Main/ProgressImpl.cpp

    r6375 r6935  
    770770
    771771#if !defined (VBOX_WITH_XPCOM)
    772 #if defined (RT_OS_WINDOWS)
    773772
    774773        ComPtr <IErrorInfo> err;
     
    781780        }
    782781
    783 #endif // !defined (RT_OS_WINDOWS)
    784782#else // !defined (VBOX_WITH_XPCOM)
    785783
  • trunk/src/VBox/Main/VirtualBoxBase.cpp

    r6851 r6935  
    1919
    2020#if !defined (VBOX_WITH_XPCOM)
    21 #if defined (RT_OS_WINDOWS)
    2221#include <windows.h>
    2322#include <dbghelp.h>
    24 #endif
    2523#else // !defined (VBOX_WITH_XPCOM)
    2624#include <nsIServiceManager.h>
     
    672670
    673671#if !defined (VBOX_WITH_XPCOM)
    674 #if defined (RT_OS_WINDOWS)
    675672
    676673        ComPtr <IVirtualBoxErrorInfo> curInfo;
     
    708705            rc = ::SetErrorInfo (0, err);
    709706
    710 #endif
    711707#else // !defined (VBOX_WITH_XPCOM)
    712708
     
    937933/**
    938934 * Uninitializes all dependent children registered with #addDependentChild().
    939  * 
    940  * Typically called from the uninit() method. Note that this method will call 
    941  * uninit() methods of child objects. If these methods need to call the parent 
    942  * object during initialization, uninitDependentChildren() must be called before 
    943  * the relevant part of the parent is uninitialized, usually at the begnning of 
    944  * the parent uninitialization sequence. 
     935 *
     936 * Typically called from the uninit() method. Note that this method will call
     937 * uninit() methods of child objects. If these methods need to call the parent
     938 * object during initialization, uninitDependentChildren() must be called before
     939 * the relevant part of the parent is uninitialized, usually at the begnning of
     940 * the parent uninitialization sequence.
    945941 */
    946942void VirtualBoxBaseWithChildrenNEXT::uninitDependentChildren()
     
    1003999 * Returns a pointer to the dependent child corresponding to the given
    10041000 * interface pointer (used as a key in the map of dependent children) or NULL
    1005  * if the interface pointer doesn't correspond to any child registered using 
    1006  * #addDependentChild(). 
    1007  * 
    1008  * Note that ComPtr <IUnknown> is used as an argument instead of IUnknown * in 
    1009  * order to guarantee IUnknown identity and disambiguation by doing 
    1010  * QueryInterface (IUnknown) rather than a regular C cast. 
     1001 * if the interface pointer doesn't correspond to any child registered using
     1002 * #addDependentChild().
     1003 *
     1004 * Note that ComPtr <IUnknown> is used as an argument instead of IUnknown * in
     1005 * order to guarantee IUnknown identity and disambiguation by doing
     1006 * QueryInterface (IUnknown) rather than a regular C cast.
    10111007 *
    10121008 * @param aUnk  Pointer to map to the dependent child object.
     
    10811077
    10821078/**
    1083  * Uninitializes all dependent children registered with 
    1084  * #addDependentChild(). 
    1085  *
    1086  * @note This method will call uninit() methods of children. If these 
     1079 * Uninitializes all dependent children registered with
     1080 * #addDependentChild().
     1081 *
     1082 * @note This method will call uninit() methods of children. If these
    10871083 *       methods access the parent object, uninitDependentChildren() must be
    10881084 *       called either at the beginning of the parent uninitialization
     
    11881184    if (RT_FAILURE (vrc))
    11891185        throw ENoConversion (FmtStr ("'%s' is not Guid (%Vrc)", aValue, vrc));
    1190        
     1186
    11911187    return com::Guid (uuid);
    11921188}
  • trunk/src/VBox/Main/VirtualBoxErrorInfoImpl.cpp

    r5999 r6935  
    8484
    8585#if !defined (VBOX_WITH_XPCOM)
    86 #if defined (RT_OS_WINDOWS)
    8786
    8887/**
     
    139138}
    140139
    141 #endif // defined (RT_OS_WINDOWS)
    142140#else // !defined (VBOX_WITH_XPCOM)
    143141
  • trunk/src/VBox/Main/VirtualBoxImpl.cpp

    r6909 r6935  
    33543354        if (aHardDisk->storageType() == HardDiskStorageType_VirtualDiskImage)
    33553355#if !defined (VBOX_WITH_XPCOM)
    3356 #if defined(RT_OS_WINDOWS)
    33573356            /// @todo (dmik) stupid BSTR declaration lacks the BCSTR counterpart
    33583357            const_cast <BSTR> (aFilePathFull) = aHardDisk->asVDI()->filePathFull();
    3359 #endif
    33603358#else
    33613359            aFilePathFull = aHardDisk->asVDI()->filePathFull();
  • trunk/src/VBox/Main/include/VirtualBoxBase.h

    r6851 r6935  
    4141#include <map>
    4242
    43 #if defined (RT_OS_WINDOWS)
     43#if !defined (VBOX_WITH_XPCOM)
    4444
    4545#include <atlcom.h>
     
    117117};
    118118
    119 #endif // defined (RT_OS_WINDOWS)
     119#endif // !defined (VBOX_WITH_XPCOM)
    120120
    121121// macros
     
    432432
    433433class ATL_NO_VTABLE VirtualBoxBaseNEXT_base
    434 #ifdef RT_OS_WINDOWS
     434#if !defined (VBOX_WITH_XPCOM)
    435435    : public CComObjectRootEx <CComMultiThreadModel>
    436436#else
     
    476476        return addCaller (aState, true /* aLimited */);
    477477    }
    478    
     478
    479479    /**
    480480     *  Smart class that automatically increases the number of callers of the
     
    497497     *  @note It is preferrable to use the AutoCaller and AutoLimitedCaller
    498498     *        classes than specify the @a aLimited argument, for better
    499      *        self-descriptiveness. 
     499     *        self-descriptiveness.
    500500     */
    501501    template <bool aLimited>
     
    613613     */
    614614    typedef AutoCallerBase <false> AutoCaller;
    615    
     615
    616616    /**
    617617     *  Smart class that automatically increases the number of limited callers
     
    638638     */
    639639    typedef AutoCallerBase <true> AutoLimitedCaller;
    640    
     640
    641641protected:
    642642
     
    692692
    693693        enum Status { Failed = 0x0, Succeeded = 0x1, Limited = 0x2 };
    694    
     694
    695695        AutoInitSpan (VirtualBoxBaseNEXT_base *aObj, Status aStatus = Failed);
    696696        ~AutoInitSpan();
     
    726726
    727727        /** Returns the current initialization status. */
    728         Status status() { return mStatus; } 
     728        Status status() { return mStatus; }
    729729
    730730    private:
     
    928928/// @todo (dmik) remove after we switch to VirtualBoxBaseNEXT completely
    929929class ATL_NO_VTABLE VirtualBoxBase : public VirtualBoxBaseNEXT_base
    930 //#ifdef RT_OS_WINDOWS
     930//#if !defined (VBOX_WITH_XPCOM)
    931931//    : public CComObjectRootEx<CComMultiThreadModel>
    932932//#else
     
    10981098protected:
    10991099
    1100     inline static HRESULT setError (HRESULT aResultCode, const GUID &aIID,
     1100    static HRESULT setError (HRESULT aResultCode, const GUID &aIID,
    11011101                                    const Bstr &aComponent,
    11021102                                    const Bstr &aText)
     
    11061106    }
    11071107
    1108     inline static HRESULT addError (HRESULT aResultCode, const GUID &aIID,
     1108    static HRESULT addError (HRESULT aResultCode, const GUID &aIID,
    11091109                                    const Bstr &aComponent,
    11101110                                    const Bstr &aText)
     
    11591159class ATL_NO_VTABLE VirtualBoxSupportErrorInfoImpl
    11601160    : protected VirtualBoxSupportErrorInfoImplBase
    1161 #if defined (RT_OS_WINDOWS)
     1161#if !defined (VBOX_WITH_XPCOM)
    11621162    , public ISupportErrorInfo
    11631163#else
     
    11661166public:
    11671167
    1168 #if defined (RT_OS_WINDOWS)
     1168#if !defined (VBOX_WITH_XPCOM)
    11691169    STDMETHOD(InterfaceSupportsErrorInfo) (REFIID riid)
    11701170    {
     
    11971197        return bSupports ? S_OK : S_FALSE;
    11981198    }
    1199 #endif // defined (RT_OS_WINDOWS)
     1199#endif // !defined (VBOX_WITH_XPCOM)
    12001200
    12011201protected:
     
    12411241     *      error argument.
    12421242     */
    1243     inline static HRESULT setError (HRESULT aResultCode, const GUID &aIID,
    1244                                     const wchar_t *aComponent,
    1245                                     const char *aText, ...)
     1243    static HRESULT setError (HRESULT aResultCode, const GUID &aIID,
     1244                             const wchar_t *aComponent,
     1245                             const char *aText, ...)
    12461246    {
    12471247        va_list args;
     
    12591259     *  attribute of the new error info object.
    12601260     */
    1261     inline static HRESULT addError (HRESULT aResultCode, const GUID &aIID,
    1262                                     const wchar_t *aComponent,
    1263                                     const char *aText, ...)
     1261    static HRESULT addError (HRESULT aResultCode, const GUID &aIID,
     1262                             const wchar_t *aComponent,
     1263                             const char *aText, ...)
    12641264    {
    12651265        va_list args;
     
    12941294     *  </code>
    12951295     */
    1296     inline static HRESULT setError (HRESULT aResultCode, const char *aText, ...)
     1296    static HRESULT setError (HRESULT aResultCode, const char *aText, ...)
    12971297    {
    12981298        va_list args;
     
    13101310     *  attribute of the new error info object.
    13111311     */
    1312     inline static HRESULT addError (HRESULT aResultCode, const char *aText, ...)
     1312    static HRESULT addError (HRESULT aResultCode, const char *aText, ...)
    13131313    {
    13141314        va_list args;
     
    13291329     *  and #setError (HRESULT, const char *, ...)  for details.
    13301330     */
    1331     inline static HRESULT setErrorV (HRESULT aResultCode, const char *aText,
    1332                                      va_list aArgs)
     1331    static HRESULT setErrorV (HRESULT aResultCode, const char *aText,
     1332                              va_list aArgs)
    13331333    {
    13341334        HRESULT rc = VirtualBoxSupportErrorInfoImplBase::setError
     
    13431343     *  attribute of the new error info object.
    13441344     */
    1345     inline static HRESULT addErrorV (HRESULT aResultCode, const char *aText,
    1346                                      va_list aArgs)
     1345    static HRESULT addErrorV (HRESULT aResultCode, const char *aText,
     1346                              va_list aArgs)
    13471347    {
    13481348        HRESULT rc = VirtualBoxSupportErrorInfoImplBase::addError
     
    13581358     *
    13591359     *  This method is preferred iy you have a ready (translated and formatted)
    1360      *  Bstr string, because it omits an extra conversion Utf8Str -> Bstr. 
     1360     *  Bstr string, because it omits an extra conversion Utf8Str -> Bstr.
    13611361     *
    13621362     *  See #setError (HRESULT, const GUID &, const wchar_t *, const char *text, ...)
    13631363     *  and #setError (HRESULT, const char *, ...)  for details.
    13641364     */
    1365     inline static HRESULT setErrorBstr (HRESULT aResultCode, const Bstr &aText)
     1365    static HRESULT setErrorBstr (HRESULT aResultCode, const Bstr &aText)
    13661366    {
    13671367        HRESULT rc = VirtualBoxSupportErrorInfoImplBase::setError
     
    13761376     *  attribute of the new error info object.
    13771377     */
    1378     inline static HRESULT addErrorBstr (HRESULT aResultCode, const Bstr &aText)
     1378    static HRESULT addErrorBstr (HRESULT aResultCode, const Bstr &aText)
    13791379    {
    13801380        HRESULT rc = VirtualBoxSupportErrorInfoImplBase::addError
     
    13921392     *  for details.
    13931393     */
    1394     inline static HRESULT setError (HRESULT aResultCode, const GUID &aIID,
    1395                                     const char *aText, ...)
     1394    static HRESULT setError (HRESULT aResultCode, const GUID &aIID,
     1395                             const char *aText, ...)
    13961396    {
    13971397        va_list args;
     
    14091409     *  attribute of the new error info object.
    14101410     */
    1411     inline static HRESULT addError (HRESULT aResultCode, const GUID &aIID,
    1412                                     const char *aText, ...)
     1411    static HRESULT addError (HRESULT aResultCode, const GUID &aIID,
     1412                             const char *aText, ...)
    14131413    {
    14141414        va_list args;
     
    14711471 *  if #addDependentChild() or #removeDependentChild() are used incorrectly
    14721472 *  (called at inappropriate times). Check the above rules once more.
    1473  * 
     1473 *
    14741474 *  @deprecated Use VirtualBoxBaseWithChildrenNEXT for new classes.
    14751475 */
     
    15491549
    15501550/**
    1551  * 
     1551 *
    15521552 * Base class to track VirtualBoxBaseNEXT chlidren of the component.
    1553  * 
    1554  * This class is a preferrable VirtualBoxBase replacement for components that 
    1555  * operate with collections of child components. It gives two useful 
    1556  * possibilities: 
    1557  *
    1558  * <ol><li> 
    1559  *      Given an IUnknown instance, it's possible to quickly determine 
     1553 *
     1554 * This class is a preferrable VirtualBoxBase replacement for components that
     1555 * operate with collections of child components. It gives two useful
     1556 * possibilities:
     1557 *
     1558 * <ol><li>
     1559 *      Given an IUnknown instance, it's possible to quickly determine
    15601560 *      whether this instance represents a child object created by the given
    15611561 *      component, and if so, get a valid VirtualBoxBase pointer to the child
     
    15951595 *
    15961596 * Note that children added by #addDependentChild() are <b>weakly</b> referenced
    1597  * (i.e. AddRef() is not called), so when a child object is deleted externally 
    1598  * (because it's reference count goes to zero), it will automatically remove 
     1597 * (i.e. AddRef() is not called), so when a child object is deleted externally
     1598 * (because it's reference count goes to zero), it will automatically remove
    15991599 * itself from the map of dependent children provided that it follows the rules
    1600  * described here. 
    1601  *
    1602  * @note Once again: because of weak referencing, deadlocks and assertions are 
     1600 * described here.
     1601 *
     1602 * @note Once again: because of weak referencing, deadlocks and assertions are
    16031603 *       very likely if #addDependentChild() or #removeDependentChild() are used
    16041604 *       incorrectly (called at inappropriate times). Check the above rules once
    16051605 *       more.
    1606  * 
    1607  * @todo This is a VirtualBoxBaseWithChildren equivalent that uses the 
     1606 *
     1607 * @todo This is a VirtualBoxBaseWithChildren equivalent that uses the
    16081608 *       VirtualBoxBaseNEXT implementation. Will completely supercede
    16091609 *       VirtualBoxBaseWithChildren after the old VirtualBoxBase implementation
     
    16221622
    16231623    /**
    1624      * Adds the given child to the map of dependent children. 
     1624     * Adds the given child to the map of dependent children.
    16251625     *
    16261626     * Typically called from the child's init() method, from within the
    16271627     * AutoInitSpan scope.  Otherwise, VirtualBoxBase::AutoCaller must be
    1628      * used on @a aChild to make sure it is not uninitialized during this 
     1628     * used on @a aChild to make sure it is not uninitialized during this
    16291629     * method's call.
    16301630     *
    1631      * @param aChild    Child object to add (must inherit VirtualBoxBase AND 
     1631     * @param aChild    Child object to add (must inherit VirtualBoxBase AND
    16321632     *                  implement some interface).
    16331633     */
     
    16401640
    16411641    /**
    1642      * Removes the given child from the map of dependent children. 
    1643      * 
    1644      * Make sure this method is called after the child has successfully entered 
    1645      * AutoUninitSpan and outside the child lock. 
    1646      * 
    1647      * If called not from within the AutoUninitSpan scope, 
    1648      * VirtualBoxBase::AutoCaller must be used on @a aChild to make sure it is 
    1649      * not uninitialized during this method's call. 
     1642     * Removes the given child from the map of dependent children.
     1643     *
     1644     * Make sure this method is called after the child has successfully entered
     1645     * AutoUninitSpan and outside the child lock.
     1646     *
     1647     * If called not from within the AutoUninitSpan scope,
     1648     * VirtualBoxBase::AutoCaller must be used on @a aChild to make sure it is
     1649     * not uninitialized during this method's call.
    16501650     *
    16511651     * @param aChild    Child object to remove (must inherit VirtualBoxBase AND
     
    17071707 *  @param C    type of child objects (must inherit VirtualBoxBase AND
    17081708 *              implement some interface)
    1709  * 
     1709 *
    17101710 *  @deprecated Use VirtualBoxBaseWithTypedChildrenNEXT for new classes.
    17111711 */
     
    18441844 * Base class to track component's chlidren of the particular type.
    18451845 *
    1846  * This class is similar to VirtualBoxBaseWithChildren, with the exception that 
    1847  * all children must be of the same type. For this reason, it's not necessary to 
    1848  * use a map to store children, so a list is used instead. 
     1846 * This class is similar to VirtualBoxBaseWithChildren, with the exception that
     1847 * all children must be of the same type. For this reason, it's not necessary to
     1848 * use a map to store children, so a list is used instead.
    18491849 *
    18501850 * As opposed to VirtualBoxBaseWithChildren, children added by
    1851  * #addDependentChild() are <b>strongly</b> referenced, so that they cannot be 
    1852  * externally deleted until #removeDependentChild() is called. For this 
    1853  * reason, strict rules of calling #removeDependentChild() don't apply to 
    1854  * instances of this class -- it can be called anywhere in the child's uninit() 
    1855  * implementation. 
    1856  *
    1857  * @param C Type of child objects (must inherit VirtualBoxBase AND implementsome 
     1851 * #addDependentChild() are <b>strongly</b> referenced, so that they cannot be
     1852 * externally deleted until #removeDependentChild() is called. For this
     1853 * reason, strict rules of calling #removeDependentChild() don't apply to
     1854 * instances of this class -- it can be called anywhere in the child's uninit()
     1855 * implementation.
     1856 *
     1857 * @param C Type of child objects (must inherit VirtualBoxBase AND implementsome
    18581858 *          interface).
    1859  * 
    1860  * @todo This is a VirtualBoxBaseWithChildren equivalent that uses the 
     1859 *
     1860 * @todo This is a VirtualBoxBaseWithChildren equivalent that uses the
    18611861 *       VirtualBoxBaseNEXT implementation. Will completely supercede
    18621862 *       VirtualBoxBaseWithChildren after the old VirtualBoxBase implementation
     
    18751875
    18761876    /**
    1877      * Adds the given child to the list of dependent children. 
    1878      * 
    1879      * VirtualBoxBase::AutoCaller must be used on @a aChild to make sure it is 
     1877     * Adds the given child to the list of dependent children.
     1878     *
     1879     * VirtualBoxBase::AutoCaller must be used on @a aChild to make sure it is
    18801880     * not uninitialized during this method's call.
    18811881     *
     
    18951895
    18961896    /**
    1897      * Removes the given child from the list of dependent children. 
    1898      * 
    1899      * VirtualBoxBase::AutoCaller must be used on @a aChild to make sure it is 
    1900      * not uninitialized during this method's call. 
     1897     * Removes the given child from the list of dependent children.
     1898     *
     1899     * VirtualBoxBase::AutoCaller must be used on @a aChild to make sure it is
     1900     * not uninitialized during this method's call.
    19011901     *
    19021902     *  @param aChild   the child object to remove (must inherit VirtualBoxBase
     
    19171917
    19181918    /**
    1919      * Returns an internal lock handle used to lock the list of children 
    1920      * returned by #dependentChildren(). This lock is to be used by AutoLock as 
    1921      * follows: 
    1922      * <code> 
     1919     * Returns an internal lock handle used to lock the list of children
     1920     * returned by #dependentChildren(). This lock is to be used by AutoLock as
     1921     * follows:
     1922     * <code>
    19231923     *      AutoLock alock (dependentChildrenLock());
    19241924     * </code>
     
    19271927
    19281928    /**
    1929      * Returns the read-only list of all dependent children. 
    1930      * 
    1931      * @note Access the returned list (iterate, get size etc.) only after doing 
     1929     * Returns the read-only list of all dependent children.
     1930     *
     1931     * @note Access the returned list (iterate, get size etc.) only after doing
    19321932     *       AutoLock alock (dependentChildrenLock())!
    19331933     */
     
    22102210#if defined VBOX_MAIN_SETTINGS_ADDONS
    22112211
    2212 /** 
     2212/**
    22132213 * Settinsg API additions.
    22142214 */
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