- Timestamp:
- Apr 14, 2016 3:54:59 PM (9 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/COMDefs.cpp
r54644 r60500 330 330 mIsFullAvailable = mIsBasicAvailable = false; 331 331 332 AssertReturn (!callee || calleeIID, (void) 0);332 AssertReturnVoid(!callee || calleeIID); 333 333 334 334 HRESULT rc = E_FAIL; 335 335 336 #if !defined 336 #if !defined(VBOX_WITH_XPCOM) 337 337 338 338 if (callee) 339 339 { 340 CComPtr <IUnknown> iface = callee; 341 CComQIPtr <ISupportErrorInfo> serr; 342 serr = callee; 340 ComPtr<IUnknown> iface(callee); 341 ComPtr<ISupportErrorInfo> serr(iface); 343 342 if (!serr) 344 343 return; 345 rc = serr->InterfaceSupportsErrorInfo 346 if (!SUCCEEDED 344 rc = serr->InterfaceSupportsErrorInfo(*calleeIID); 345 if (!SUCCEEDED(rc)) 347 346 return; 348 347 } 349 348 350 C ComPtr<IErrorInfo> err;351 rc = ::GetErrorInfo (0, &err);349 ComPtr<IErrorInfo> err; 350 rc = ::GetErrorInfo(0, err.asOutParam()); 352 351 if (rc == S_OK && err) 353 352 { 354 CComPtr <IVirtualBoxErrorInfo> info; 355 info = err; 353 ComPtr<IVirtualBoxErrorInfo> info(err); 356 354 if (info) 357 init (CVirtualBoxErrorInfo(info));355 init(CVirtualBoxErrorInfo(info)); 358 356 359 357 if (!mIsFullAvailable) … … 361 359 bool gotSomething = false; 362 360 363 rc = err->GetGUID (COMBase::GUIDOut(mInterfaceID));364 gotSomething |= SUCCEEDED 365 if (SUCCEEDED 366 mInterfaceName = getInterfaceNameFromIID 367 368 rc = err->GetSource (COMBase::BSTROut(mComponent));369 gotSomething |= SUCCEEDED 370 371 rc = err->GetDescription (COMBase::BSTROut(mText));372 gotSomething |= SUCCEEDED 361 rc = err->GetGUID(COMBase::GUIDOut(mInterfaceID)); 362 gotSomething |= SUCCEEDED(rc); 363 if (SUCCEEDED(rc)) 364 mInterfaceName = getInterfaceNameFromIID(mInterfaceID); 365 366 rc = err->GetSource(COMBase::BSTROut(mComponent)); 367 gotSomething |= SUCCEEDED(rc); 368 369 rc = err->GetDescription(COMBase::BSTROut(mText)); 370 gotSomething |= SUCCEEDED(rc); 373 371 374 372 if (gotSomething) … … 377 375 mIsNull = !gotSomething; 378 376 379 AssertMsg (gotSomething,("Nothing to fetch!\n"));377 AssertMsg(gotSomething,("Nothing to fetch!\n")); 380 378 } 381 379 } 382 380 383 #else /* !defined 384 385 nsCOMPtr 386 es = do_GetService 387 if (NS_SUCCEEDED 388 { 389 nsCOMPtr 390 rc = es->GetCurrentExceptionManager (getter_AddRefs(em));391 if (NS_SUCCEEDED 381 #else /* !defined(VBOX_WITH_XPCOM) */ 382 383 nsCOMPtr<nsIExceptionService> es; 384 es = do_GetService(NS_EXCEPTIONSERVICE_CONTRACTID, &rc); 385 if (NS_SUCCEEDED(rc)) 386 { 387 nsCOMPtr<nsIExceptionManager> em; 388 rc = es->GetCurrentExceptionManager(getter_AddRefs(em)); 389 if (NS_SUCCEEDED(rc)) 392 390 { 393 nsCOMPtr 394 rc = em->GetCurrentException 395 if (NS_SUCCEEDED 391 nsCOMPtr<nsIException> ex; 392 rc = em->GetCurrentException(getter_AddRefs(ex)); 393 if (NS_SUCCEEDED(rc) && ex) 396 394 { 397 nsCOMPtr<IVirtualBoxErrorInfo> info;398 info = do_QueryInterface (ex, &rc);399 if (NS_SUCCEEDED 400 init (CVirtualBoxErrorInfo(info));395 ComPtr<IVirtualBoxErrorInfo> info; 396 rc = ex.queryInterfaceTo(info.asOutParam()); 397 if (NS_SUCCEEDED(rc) && info) 398 init(CVirtualBoxErrorInfo(info)); 401 399 402 400 if (!mIsFullAvailable) … … 404 402 bool gotSomething = false; 405 403 406 rc = ex->GetResult 407 gotSomething |= NS_SUCCEEDED 404 rc = ex->GetResult(&mResultCode); 405 gotSomething |= NS_SUCCEEDED(rc); 408 406 409 407 char *message = NULL; // utf8 410 rc = ex->GetMessage 411 gotSomething |= NS_SUCCEEDED 412 if (NS_SUCCEEDED 408 rc = ex->GetMessage(&message); 409 gotSomething |= NS_SUCCEEDED(rc); 410 if (NS_SUCCEEDED(rc) && message) 413 411 { 414 mText = QString::fromUtf8 415 nsMemory::Free 412 mText = QString::fromUtf8(message); 413 nsMemory::Free(message); 416 414 } 417 415 … … 421 419 mIsNull = !gotSomething; 422 420 423 AssertMsg 421 AssertMsg(gotSomething, ("Nothing to fetch!\n")); 424 422 } 425 423 426 424 // set the exception to NULL (to emulate Win32 behavior) 427 em->SetCurrentException 425 em->SetCurrentException(NULL); 428 426 429 427 rc = NS_OK; … … 432 430 } 433 431 434 AssertComRC 435 436 #endif /* !defined 432 AssertComRC(rc); 433 434 #endif /* !defined(VBOX_WITH_XPCOM) */ 437 435 438 436 if (callee && calleeIID && mIsBasicAvailable) 439 437 { 440 mCalleeIID = COMBase::ToQUuid 441 mCalleeName = getInterfaceNameFromIID 438 mCalleeIID = COMBase::ToQUuid(*calleeIID); 439 mCalleeName = getInterfaceNameFromIID(mCalleeIID); 442 440 } 443 441 } -
trunk/src/VBox/Frontends/VirtualBox/src/globals/COMDefs.h
r55401 r60500 657 657 #if !defined(VBOX_WITH_XPCOM) 658 658 B::mRC = CoCreateInstance(aClsId, NULL, CLSCTX_ALL, 659 _ATL_IIDOF(I), (void **)&pObj);659 COM_IIDOF(I), (void **)&pObj); 660 660 #else 661 661 nsCOMPtr<nsIComponentManager> manager; -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
r60436 r60500 180 180 //////////////////////////////////////////////////////////////////////////////// 181 181 182 #ifdef VBOX_WS_WIN 183 /* Make sure that ATL is usable in this linking namespace. */ 184 static ATL::CComModule _Module; 185 #endif /* VBOX_WS_WIN */ 186 182 187 /* static */ 183 188 bool VBoxGlobal::m_sfCleanupInProgress = false; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.cpp
r60362 r60500 72 72 /** IFramebuffer implementation used to maintain VM display video memory. */ 73 73 class ATL_NO_VTABLE UIFrameBufferPrivate : public QObject, 74 public CComObjectRootEx<CComMultiThreadModel>,74 public ATL::CComObjectRootEx<ATL::CComMultiThreadModel>, 75 75 VBOX_SCRIPTABLE_IMPL(IFramebuffer) 76 76 { … … 182 182 COM_INTERFACE_ENTRY(IFramebuffer) 183 183 COM_INTERFACE_ENTRY2(IDispatch,IFramebuffer) 184 COM_INTERFACE_ENTRY_AGGREGATE(IID_IMarshal, m_pUnkMarshaler. p)184 COM_INTERFACE_ENTRY_AGGREGATE(IID_IMarshal, m_pUnkMarshaler.m_p) 185 185 END_COM_MAP() 186 186 … … 395 395 396 396 #ifdef Q_OS_WIN 397 C ComPtr<IUnknown> m_pUnkMarshaler;397 ComPtr<IUnknown> m_pUnkMarshaler; 398 398 #endif /* Q_OS_WIN */ 399 399 /** Identifier returned by AttachFramebuffer. Used in DetachFramebuffer. */ … … 521 521 522 522 523 /* COM stuff: */ 524 #ifdef VBOX_WS_WIN 525 static CComModule _Module; 526 #else /* !VBOX_WS_WIN */ 523 #ifdef VBOX_WITH_XPCOM 527 524 NS_DECL_CLASSINFO(UIFrameBufferPrivate) 528 525 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(UIFrameBufferPrivate, IFramebuffer) 529 #endif /* !VBOX_WS_WIN*/526 #endif /* VBOX_WITH_XPCOM */ 530 527 531 528 … … 583 580 584 581 #ifdef Q_OS_WIN 585 CoCreateFreeThreadedMarshaler(this, &m_pUnkMarshaler.p);582 CoCreateFreeThreadedMarshaler(this, m_pUnkMarshaler.asOutParam()); 586 583 #endif /* Q_OS_WIN */ 587 584 return S_OK;
Note:
See TracChangeset
for help on using the changeset viewer.