Changeset 2976 in vbox for trunk/include/VBox/com
- Timestamp:
- Jun 1, 2007 1:47:51 PM (18 years ago)
- svn:sync-xref-src-repo-rev:
- 21692
- Location:
- trunk/include/VBox/com
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/com/com.h
r2672 r2976 25 25 26 26 #include "VBox/com/defs.h" 27 #include "VBox/com/string.h" 27 28 28 29 namespace com … … 42 43 * No COM calls may be made after this method returns. 43 44 */ 44 voidShutdown();45 HRESULT Shutdown(); 45 46 46 47 /** … … 55 56 void GetInterfaceNameByIID (const GUID &aIID, BSTR *aName); 56 57 58 /** 59 * Returns the VirtualBox user home directory. 60 * 61 * On failure, this function will return a path that caused a failure (or a 62 * null string if the faiulre is not path-related). 63 * 64 * On success, this function will try to create the returned directory if it 65 * doesn't exist yet. This may also fail with the corresponding status code. 66 * 67 * @param aDir Where to return the directory to. 68 * @return VBox status code. 69 */ 70 int GetVBoxUserHomeDirectory (Utf8Str &aDir); 71 57 72 }; // namespace com 58 73 -
trunk/include/VBox/com/defs.h
r612 r2976 138 138 #define E_ABORT NS_ERROR_ABORT 139 139 #define E_FAIL NS_ERROR_FAILURE 140 /* Note: a better analog for E_ACCESSDENIED would probably be 141 * NS_ERROR_NOT_AVAILABLE, but we want binary compatibility for now. */ 140 142 #define E_ACCESSDENIED ((nsresult) 0x80070005L) 141 143 -
trunk/include/VBox/com/ptr.h
r1472 r2976 24 24 #define __VBox_com_ptr_h__ 25 25 26 #if defined (__WIN__)26 #if !defined (VBOX_WITH_XPCOM) 27 27 28 28 #include <atlbase.h> … … 32 32 #endif 33 33 34 #else / / !defined (__WIN__)34 #else /* !defined (VBOX_WITH_XPCOM) */ 35 35 36 36 #include <nsXPCOM.h> … … 46 46 "@mozilla.org/ipc/dconnect-service;1" 47 47 48 #endif / / !defined (__WIN__)48 #endif /* !defined (VBOX_WITH_XPCOM) */ 49 49 50 50 #include <VBox/com/defs.h> … … 85 85 class NoAddRefRelease : public I { 86 86 private: 87 #if def __WIN__87 #if !defined (VBOX_WITH_XPCOM) 88 88 STDMETHOD_(ULONG, AddRef)() = 0; 89 89 STDMETHOD_(ULONG, Release)() = 0; 90 #else 90 #else /* !defined (VBOX_WITH_XPCOM) */ 91 91 NS_IMETHOD_(nsrefcnt) AddRef(void) = 0; 92 92 NS_IMETHOD_(nsrefcnt) Release(void) = 0; 93 #endif 93 #endif /* !defined (VBOX_WITH_XPCOM) */ 94 94 }; 95 95 … … 255 255 HRESULT rc; 256 256 I *obj = NULL; 257 #if defined (__WIN__)257 #if !defined (VBOX_WITH_XPCOM) 258 258 rc = CoCreateInstance (clsid, NULL, CLSCTX_INPROC_SERVER, _ATL_IIDOF (I), 259 259 (void **) &obj); 260 #else 260 #else /* !defined (VBOX_WITH_XPCOM) */ 261 261 nsCOMPtr <nsIComponentManager> manager; 262 262 rc = NS_GetComponentManager (getter_AddRefs (manager)); … … 264 264 rc = manager->CreateInstance (clsid, nsnull, NS_GET_IID (I), 265 265 (void **) &obj); 266 #endif 266 #endif /* !defined (VBOX_WITH_XPCOM) */ 267 267 *this = obj; 268 268 if (SUCCEEDED (rc)) … … 282 282 HRESULT createLocalObject (const CLSID &clsid) 283 283 { 284 #if defined (__WIN__)284 #if !defined (VBOX_WITH_XPCOM) 285 285 HRESULT rc; 286 286 I *obj = NULL; … … 291 291 obj->Release(); 292 292 return rc; 293 #else 293 #else /* !defined (VBOX_WITH_XPCOM) */ 294 294 return createInprocObject (clsid); 295 #endif 295 #endif /* !defined (VBOX_WITH_XPCOM) */ 296 296 } 297 297 … … 410 410 HRESULT createObject() { 411 411 HRESULT rc; 412 #if defined (__WIN__)412 #if !defined (VBOX_WITH_XPCOM) 413 413 # ifdef VBOX_COM_OUTOFPROC_MODULE 414 414 CComObjectNoLock <C> *obj = new CComObjectNoLock <C>(); … … 424 424 rc = CComObject <C>::CreateInstance (&obj); 425 425 # endif 426 #else 426 #else /* !defined (VBOX_WITH_XPCOM) */ 427 427 CComObject <C> *obj = new CComObject <C>(); 428 428 if (obj) { … … 431 431 rc = E_OUTOFMEMORY; 432 432 } 433 #endif 433 #endif /* !defined (VBOX_WITH_XPCOM) */ 434 434 *this = obj; 435 435 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.