Changeset 1472 in vbox for trunk/include/VBox/com
- Timestamp:
- Mar 14, 2007 2:59:26 PM (18 years ago)
- svn:sync-xref-src-repo-rev:
- 19532
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/com/ptr.h
r1 r1472 251 251 * manage a reference to the created object in case of success. 252 252 */ 253 HRESULT createInprocObject (const CLSID &clsid) { 253 HRESULT createInprocObject (const CLSID &clsid) 254 { 254 255 HRESULT rc; 255 256 I *obj = NULL; … … 274 275 * to manage a reference to the created object in case of success. 275 276 * 276 * @param serverName 277 * name of the server to create the object within (Linux only) 277 * Note: In XPCOM, the out-of-process functionality is currently emulated 278 * through in-process wrapper objects (that start a dedicated process and 279 * redirect all object requests to that process). For this reason, this 280 * method is fully equivalent to #createInprocObject() for now. 278 281 */ 279 HRESULT createLocalObject (const CLSID &clsid, const char *serverName) { 282 HRESULT createLocalObject (const CLSID &clsid) 283 { 284 #if defined (__WIN__) 280 285 HRESULT rc; 281 286 I *obj = NULL; 282 #if defined (__WIN__)283 287 rc = CoCreateInstance (clsid, NULL, CLSCTX_LOCAL_SERVER, _ATL_IIDOF (I), 284 288 (void **) &obj); 289 *this = obj; 290 if (SUCCEEDED (rc)) 291 obj->Release(); 292 return rc; 285 293 #else 294 return createInprocObject (clsid); 295 #endif 296 } 297 298 #ifdef VBOX_WITH_XPCOM 299 /** 300 * Createas an object of the given class ID on the specified server and 301 * starts to manage a reference to the created object in case of success. 302 * 303 * @param serverName Name of the server to create an object within. 304 */ 305 HRESULT createObjectOnServer (const CLSID &clsid, const char *serverName) 306 { 307 HRESULT rc; 308 I *obj = NULL; 286 309 nsCOMPtr <ipcIService> ipcServ = do_GetService (IPC_SERVICE_CONTRACTID, &rc); 287 if (SUCCEEDED (rc)) { 310 if (SUCCEEDED (rc)) 311 { 288 312 PRUint32 serverID = 0; 289 313 rc = ipcServ->ResolveClientName (serverName, &serverID); … … 296 320 } 297 321 } 298 #endif299 322 *this = obj; 300 323 if (SUCCEEDED (rc)) … … 302 325 return rc; 303 326 } 327 #endif 304 328 }; 305 329
Note:
See TracChangeset
for help on using the changeset viewer.