Changeset 45058 in vbox for trunk/include/VBox/com/defs.h
- Timestamp:
- Mar 18, 2013 12:12:38 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/com/defs.h
r44528 r45058 5 5 6 6 /* 7 * Copyright (C) 2006-201 2Oracle Corporation7 * Copyright (C) 2006-2013 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 60 60 # endif 61 61 62 #endif /* defined 62 #endif /* defined(RT_OS_OS2) */ 63 63 64 64 /* Include iprt/types.h (which also includes iprt/types.h) now to make sure iprt … … 67 67 #include <iprt/types.h> 68 68 69 #if !defined 70 71 #if defined 69 #if !defined(VBOX_WITH_XPCOM) 70 71 #if defined(RT_OS_WINDOWS) 72 72 73 73 // Windows COM … … 89 89 90 90 /** Returns @c true if @a rc represents a warning result code */ 91 #define SUCCEEDED_WARNING(rc) (SUCCEEDED 91 #define SUCCEEDED_WARNING(rc) (SUCCEEDED(rc) && (rc) != S_OK) 92 92 93 93 /** Tests is a COM result code indicates that the process implementing the … … 148 148 * Wraps the given parameter name to generate an expression that is suitable for 149 149 * passing the parameter to functions that take input safearray parameters 150 * declared using the ComSafeArrayIn ma rco.150 * declared using the ComSafeArrayIn macro. 151 151 * 152 152 * @param aArg Parameter name to wrap. The given parameter must be declared … … 200 200 * @param aArg Parameter name to wrap. 201 201 */ 202 #define ComSafeGUIDArrayInIsNull(aArg) ComSafeArrayInIsNull 202 #define ComSafeGUIDArrayInIsNull(aArg) ComSafeArrayInIsNull(aArg) 203 203 204 204 /** … … 206 206 * @param aArg Parameter name to wrap. 207 207 */ 208 #define ComSafeGUIDArrayInArg(aArg) ComSafeArrayInArg 208 #define ComSafeGUIDArrayInArg(aArg) ComSafeArrayInArg(aArg) 209 209 210 210 /** … … 218 218 * @param aArg Parameter name to wrap. 219 219 */ 220 #define ComSafeGUIDArrayOutIsNull(aArg) ComSafeArrayOutIsNull 220 #define ComSafeGUIDArrayOutIsNull(aArg) ComSafeArrayOutIsNull(aArg) 221 221 222 222 /** … … 224 224 * @param aArg Parameter name to wrap. 225 225 */ 226 #define ComSafeGUIDArrayOutArg(aArg) ComSafeArrayOutArg (aArg) 226 #define ComSafeGUIDArrayOutArg(aArg) ComSafeArrayOutArg(aArg) 227 228 /** 229 * Gets size of safearray parameter. 230 * @param aArg Parameter name. 231 */ 232 #define ComSafeArraySize(aArg) ((aArg) == NULL ? 0 : (aArg)->rgsabound[0].cElements) 227 233 228 234 /** … … 243 249 #define COM_STRUCT_OR_CLASS(I) struct I 244 250 245 #else /* defined 251 #else /* defined(RT_OS_WINDOWS) */ 246 252 247 253 #error "VBOX_WITH_XPCOM must be defined on a platform other than Windows!" 248 254 249 #endif /* defined 250 251 #else /* !defined 255 #endif /* defined(RT_OS_WINDOWS) */ 256 257 #else /* !defined(VBOX_WITH_XPCOM) */ 252 258 253 259 // XPCOM 254 260 ///////////////////////////////////////////////////////////////////////////// 255 261 256 #if defined (RT_OS_DARWIN) || (defined(QT_VERSION) && (QT_VERSION >= 0x040000))262 #if defined(RT_OS_DARWIN) || (defined(QT_VERSION) && (QT_VERSION >= 0x040000)) 257 263 /* CFBase.h defines these & 258 264 * qglobal.h from Qt4 defines these */ … … 279 285 #define FAILED NS_FAILED 280 286 281 #define SUCCEEDED_WARNING(rc) (NS_SUCCEEDED 287 #define SUCCEEDED_WARNING(rc) (NS_SUCCEEDED(rc) && (rc) != NS_OK) 282 288 283 289 #define FAILED_DEAD_INTERFACE(rc) ( (rc) == NS_ERROR_ABORT \ … … 339 345 /* safearray input parameter macros for GUID */ 340 346 #define ComSafeGUIDArrayIn(aArg) PRUint32 aArg##Size, const nsID **aArg 341 #define ComSafeGUIDArrayInIsNull(aArg) ComSafeArrayInIsNull 342 #define ComSafeGUIDArrayInArg(aArg) ComSafeArrayInArg 347 #define ComSafeGUIDArrayInIsNull(aArg) ComSafeArrayInIsNull(aArg) 348 #define ComSafeGUIDArrayInArg(aArg) ComSafeArrayInArg(aArg) 343 349 344 350 /* safearray output parameter macros for GUID */ 345 351 #define ComSafeGUIDArrayOut(aArg) PRUint32 *aArg##Size, nsID ***aArg 346 #define ComSafeGUIDArrayOutIsNull(aArg) ComSafeArrayOutIsNull (aArg) 347 #define ComSafeGUIDArrayOutArg(aArg) ComSafeArrayOutArg (aArg) 352 #define ComSafeGUIDArrayOutIsNull(aArg) ComSafeArrayOutIsNull(aArg) 353 #define ComSafeGUIDArrayOutArg(aArg) ComSafeArrayOutArg(aArg) 354 355 /* safearray size */ 356 #define ComSafeArraySize(aArg) ((aArg) == NULL ? 0 : (aArg##Size)) 348 357 349 358 /* CLSID and IID for compatibility with Win32 */ … … 352 361 353 362 /* OLE error codes */ 354 #define S_OK ((nsresult) 363 #define S_OK ((nsresult)NS_OK) 355 364 #define E_UNEXPECTED NS_ERROR_UNEXPECTED 356 365 #define E_NOTIMPL NS_ERROR_NOT_IMPLEMENTED … … 363 372 /* Note: a better analog for E_ACCESSDENIED would probably be 364 373 * NS_ERROR_NOT_AVAILABLE, but we want binary compatibility for now. */ 365 #define E_ACCESSDENIED ((nsresult) 374 #define E_ACCESSDENIED ((nsresult)0x80070005L) 366 375 367 376 #define STDMETHOD(a) NS_IMETHOD a … … 395 404 extern "C" 396 405 { 397 BSTR SysAllocString 398 BSTR SysAllocStringByteLen 399 BSTR SysAllocStringLen 400 void SysFreeString 401 int SysReAllocString 402 int SysReAllocStringLen 403 unsigned int SysStringByteLen 404 unsigned int SysStringLen 406 BSTR SysAllocString(const OLECHAR* sz); 407 BSTR SysAllocStringByteLen(char *psz, unsigned int len); 408 BSTR SysAllocStringLen(const OLECHAR *pch, unsigned int cch); 409 void SysFreeString(BSTR bstr); 410 int SysReAllocString(BSTR *pbstr, const OLECHAR *psz); 411 int SysReAllocStringLen(BSTR *pbstr, const OLECHAR *psz, unsigned int cch); 412 unsigned int SysStringByteLen(BSTR bstr); 413 unsigned int SysStringLen(BSTR bstr); 405 414 } 406 415 … … 444 453 * 'Constructor' that uses an existing getter function that gets a singleton. 445 454 * The getter function must have the following prototype: 446 * nsresult _GetterProc 455 * nsresult _GetterProc(_InstanceClass **inst) 447 456 * This constructor, as opposed to NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR, 448 457 * lets the getter function return a result code that is passed back to the … … 482 491 } 483 492 484 #endif /* !defined 493 #endif /* !defined(VBOX_WITH_XPCOM) */ 485 494 486 495 /** … … 489 498 * @param s expression to stringify 490 499 */ 491 #if defined 500 #if defined(_MSC_VER) 492 501 # define WSTR_LITERAL(s) L#s 493 #elif defined 502 #elif defined(__GNUC__) 494 503 # define WSTR_LITERAL(s) L""#s 495 504 #else
Note:
See TracChangeset
for help on using the changeset viewer.