VirtualBox

Changeset 80778 in vbox


Ignore:
Timestamp:
Sep 13, 2019 1:18:21 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
133343
Message:

VBox/com/array.h: Adding ComSafeArrayNullInParam. bugref:9341

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/com/array.h

    r80373 r80778  
    188188#include "iprt/cpp/list.h"
    189189
    190 #ifdef VBOX_WITH_XPCOM
    191 
    192 /**
     190/** @def ComSafeArrayAsInParam
    193191 * Wraps the given com::SafeArray instance to generate an expression that is
    194192 * suitable for passing it to functions that take input safearray parameters
     
    197195 * @param aArray    com::SafeArray instance to pass as an input parameter.
    198196 */
    199 #define ComSafeArrayAsInParam(aArray)   \
    200     (PRUint32)(aArray).size(), (aArray).__asInParam_Arr((aArray).raw())
    201 
    202 /**
     197
     198/** @def ComSafeArrayAsOutParam
    203199 * Wraps the given com::SafeArray instance to generate an expression that is
    204200 * suitable for passing it to functions that take output safearray parameters
     
    207203 * @param aArray    com::SafeArray instance to pass as an output parameter.
    208204 */
    209 #define ComSafeArrayAsOutParam(aArray)  \
     205
     206/** @def ComSafeArrayNullInParam
     207 * Helper for passing a NULL array parameter to a COM / XPCOM method.
     208 */
     209
     210#ifdef VBOX_WITH_XPCOM
     211
     212# define ComSafeArrayAsInParam(aArray) \
     213    (PRUint32)(aArray).size(), (aArray).__asInParam_Arr((aArray).raw())
     214
     215# define ComSafeArrayAsOutParam(aArray) \
    210216    (aArray).__asOutParam_Size(), (aArray).__asOutParam_Arr()
    211217
     218# define ComSafeArrayNullInParam()      0, NULL
     219
    212220#else /* !VBOX_WITH_XPCOM */
    213221
    214 #define ComSafeArrayAsInParam(aArray)   (aArray).__asInParam()
    215 
    216 #define ComSafeArrayAsOutParam(aArray)  (aArray).__asOutParam()
     222# define ComSafeArrayAsInParam(aArray)  (aArray).__asInParam()
     223
     224# define ComSafeArrayAsOutParam(aArray) (aArray).__asOutParam()
     225
     226# define ComSafeArrayNullInParam()      (NULL)
    217227
    218228#endif /* !VBOX_WITH_XPCOM */
Note: See TracChangeset for help on using the changeset viewer.

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