- Timestamp:
- Mar 25, 2011 4:19:12 PM (14 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/ConsoleImpl.h
r36437 r36439 591 591 592 592 static DECLCALLBACK(int) vmm2User_SaveState(PCVMM2USERMETHODS pThis, PUVM pUVM); 593 static DECLCALLBACK(void) vmm2User_NotifyEmtInit(PCVMM2USERMETHODS pThis, PUVM pUVM, PUVMCPU pUVCpu); 593 594 static DECLCALLBACK(void) vmm2User_NotifyEmtTerm(PCVMM2USERMETHODS pThis, PUVM pUVM, PUVMCPU pUVCpu); 595 static DECLCALLBACK(void) vmm2User_NotifyPdmtInit(PCVMM2USERMETHODS pThis, PUVM pUVM); 594 596 static DECLCALLBACK(void) vmm2User_NotifyPdmtTerm(PCVMM2USERMETHODS pThis, PUVM pUVM); 595 597 -
trunk/src/VBox/Main/include/VirtualBoxBase.h
r36411 r36439 754 754 HRESULT setErrorNoLog(HRESULT aResultCode, const char *pcsz, ...); 755 755 756 757 /** Initialize COM for a new thread. */ 758 static HRESULT initializeComForThread(void) 759 { 760 #ifndef VBOX_WITH_XPCOM 761 HRESULT hrc = CoInitializeEx(NULL, COINIT_MULTITHREADED | COINIT_DISABLE_OLE1DDE | COINIT_SPEED_OVER_MEMORY); 762 AssertComRCReturn(hrc, hrc); 763 #endif 764 return S_OK; 765 } 766 767 /** Uninitializes COM for a dying thread. */ 768 static void uninitializeComForThread(void) 769 { 770 #ifndef VBOX_WITH_XPCOM 771 CoUninitialize(); 772 #endif 773 } 774 775 756 776 private: 757 777 -
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r36437 r36439 397 397 pVmm2UserMethods->u32Version = VMM2USERMETHODS_VERSION; 398 398 pVmm2UserMethods->pfnSaveState = Console::vmm2User_SaveState; 399 pVmm2UserMethods->pfnNotifyEmtInit = NULL;399 pVmm2UserMethods->pfnNotifyEmtInit = Console::vmm2User_NotifyEmtInit; 400 400 pVmm2UserMethods->pfnNotifyEmtTerm = Console::vmm2User_NotifyEmtTerm; 401 pVmm2UserMethods->pfnNotifyPdmtInit = NULL;401 pVmm2UserMethods->pfnNotifyPdmtInit = Console::vmm2User_NotifyPdmtInit; 402 402 pVmm2UserMethods->pfnNotifyPdmtTerm = Console::vmm2User_NotifyPdmtTerm; 403 403 pVmm2UserMethods->u32EndMagic = VMM2USERMETHODS_MAGIC; … … 7823 7823 AssertReturn(!task->mProgress.isNull(), VERR_INVALID_PARAMETER); 7824 7824 7825 #if defined(RT_OS_WINDOWS) 7826 { 7827 /* initialize COM */ 7828 HRESULT hrc = CoInitializeEx(NULL, 7829 COINIT_MULTITHREADED | COINIT_DISABLE_OLE1DDE | 7830 COINIT_SPEED_OVER_MEMORY); 7831 LogFlowFunc(("CoInitializeEx()=%Rhrc\n", hrc)); 7832 } 7833 #endif 7825 VirtualBoxBase::initializeComForThread(); 7834 7826 7835 7827 HRESULT rc = S_OK; … … 8810 8802 8811 8803 /** 8804 * @interface_method_impl{VMM2USERMETHODS,pfnNotifyEmtInit} 8805 */ 8806 /*static*/ DECLCALLBACK(void) 8807 Console::vmm2User_NotifyEmtInit(PCVMM2USERMETHODS pThis, PUVM pUVM, PUVMCPU pUVCpu) 8808 { 8809 NOREF(pThis); NOREF(pUVM); NOREF(pUVCpu); 8810 VirtualBoxBase::initializeComForThread(); 8811 } 8812 8813 /** 8812 8814 * @interface_method_impl{VMM2USERMETHODS,pfnNotifyEmtTerm} 8813 8815 */ … … 8816 8818 { 8817 8819 NOREF(pThis); NOREF(pUVM); NOREF(pUVCpu); 8818 #ifdef RT_OS_WINDOWS 8819 CoUninitialize(); 8820 #endif 8820 VirtualBoxBase::uninitializeComForThread(); 8821 } 8822 8823 /** 8824 * @interface_method_impl{VMM2USERMETHODS,pfnNotifyPdmtInit} 8825 */ 8826 /*static*/ DECLCALLBACK(void) 8827 Console::vmm2User_NotifyPdmtInit(PCVMM2USERMETHODS pThis, PUVM pUVM) 8828 { 8829 NOREF(pThis); NOREF(pUVM); 8830 VirtualBoxBase::initializeComForThread(); 8821 8831 } 8822 8832 … … 8828 8838 { 8829 8839 NOREF(pThis); NOREF(pUVM); 8830 #ifdef RT_OS_WINDOWS 8831 CoUninitialize(); 8832 #endif 8840 VirtualBoxBase::uninitializeComForThread(); 8833 8841 } 8834 8842 -
trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
r36434 r36439 585 585 { 586 586 LogFlowFuncEnter(); 587 588 #if !defined(VBOX_WITH_XPCOM)589 {590 /* initialize COM */591 HRESULT hrc = CoInitializeEx(NULL,592 COINIT_MULTITHREADED | COINIT_DISABLE_OLE1DDE |593 COINIT_SPEED_OVER_MEMORY);594 LogFlow(("Console::configConstructor(): CoInitializeEx()=%08X\n", hrc));595 AssertComRCReturn(hrc, VERR_GENERAL_FAILURE);596 }597 #endif598 587 599 588 AssertReturn(pvConsole, VERR_GENERAL_FAILURE); -
trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp
r36027 r36439 3955 3955 size_t cntSpawned = 0; 3956 3956 3957 VirtualBoxBase::initializeComForThread(); 3958 3957 3959 #if defined(RT_OS_WINDOWS) 3958 3960 3959 HRESULT hrc = CoInitializeEx(NULL, 3960 COINIT_MULTITHREADED | COINIT_DISABLE_OLE1DDE | 3961 COINIT_SPEED_OVER_MEMORY); 3962 AssertComRC(hrc); 3961 HRESULT hrc; 3963 3962 3964 3963 /// @todo (dmik) processes reaping! … … 4413 4412 #endif 4414 4413 4414 VirtualBoxBase::uninitializeComForThread(); 4415 4415 LogFlowFuncLeave(); 4416 4416 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.