Changeset 60865 in vbox for trunk/src/VBox
- Timestamp:
- May 6, 2016 2:43:04 PM (9 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxBalloonCtrl/VBoxWatchdog.cpp
r60759 r60865 144 144 static void watchdogShutdown(); 145 145 146 #ifdef RT_OS_WINDOWS147 /* Required for ATL. */148 static ATL::CComModule _Module;149 #endif150 146 151 147 /** … … 988 984 if (RT_FAILURE(rc)) 989 985 return RTMsgInitFailure(rc); 986 #ifdef RT_OS_WINDOWS 987 ATL::CComModule _Module; /* Required internally by ATL (constructor records instance in global variable). */ 988 #endif 990 989 991 990 /* 992 991 * Parse the global options 993 */992 */ 994 993 int c; 995 994 const char *pszLogFile = NULL; -
trunk/src/VBox/Frontends/VBoxHeadless/VBoxHeadless.cpp
r60759 r60865 588 588 } 589 589 590 #ifdef RT_OS_WINDOWS591 // Required for ATL592 static ATL::CComModule _Module;593 #endif594 590 595 591 #ifdef RT_OS_DARWIN … … 636 632 const char *pszFileNameParam = "VBox-%d.vob"; 637 633 #endif /* VBOX_WITH_VPX */ 634 #ifdef RT_OS_WINDOWS 635 ATL::CComModule _Module; /* Required internally by ATL (constructor records instance in global variable). */ 636 #endif 638 637 639 638 LogFlow(("VBoxHeadless STARTED.\n")); -
trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp
r60759 r60865 91 91 static volatile bool g_fCanceled = false; 92 92 93 # ifdef RT_OS_WINDOWS94 // Required for ATL95 static ATL::CComModule _Module;96 # endif97 93 98 94 /** … … 464 460 */ 465 461 RTR3InitExe(argc, &argv, 0); 462 #if defined(RT_OS_WINDOWS) && !defined(VBOX_ONLY_DOCS) 463 ATL::CComModule _Module; /* Required internally by ATL (constructor records instance in global variable). */ 464 #endif 466 465 467 466 /* -
trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp
r60759 r60865 737 737 738 738 739 #ifdef RT_OS_WINDOWS740 // Required for ATL741 static ATL::CComModule _Module;742 #endif743 744 739 /** entry point */ 745 740 extern "C" 746 741 DECLEXPORT(int) TrustedMain(int argc, char **argv, char **envp) 747 742 { 743 #ifdef RT_OS_WINDOWS 744 ATL::CComModule _Module; /* Required internally by ATL (constructor records instance in global variable). */ 745 #endif 746 748 747 #ifdef Q_WS_X11 749 748 if (!XInitThreads()) -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
r60862 r60865 180 180 //////////////////////////////////////////////////////////////////////////////// 181 181 182 #ifdef VBOX_WS_WIN183 /** ATL requires a module to be instantiated (set internal global variable).184 * @note Do NOT do this statically as it starts using IPRT before it's ready! */185 static ATL::CComModule *_Module;186 #endif187 182 188 183 /* static */ … … 203 198 /* Create instance: */ 204 199 new VBoxGlobal; 205 #ifdef VBOX_WS_WIN206 _Module = new ATL::CComModule;207 #endif208 200 /* Prepare instance: */ 209 201 m_spInstance->prepare(); -
trunk/src/VBox/Frontends/VirtualBox/src/main.cpp
r60362 r60865 362 362 extern "C" DECLEXPORT(int) TrustedMain(int argc, char **argv, char ** /*envp*/) 363 363 { 364 #ifdef RT_OS_WINDOWS 365 ATL::CComModule _Module; /* Required internally by ATL (constructor records instance in global variable). */ 366 #endif 367 364 368 /* Failed result initially: */ 365 369 int iResultCode = 1; -
trunk/src/VBox/Main/src-client/win/dllmain.cpp
r60765 r60865 31 31 * Global Variables * 32 32 *********************************************************************************************************************************/ 33 static ATL::CComModule _Module;33 static ATL::CComModule *g_pAtlComModule; 34 34 35 35 BEGIN_OBJECT_MAP(ObjectMap) … … 50 50 RTR3InitDll(RTR3INIT_FLAGS_UNOBTRUSIVE); 51 51 52 _Module.Init(ObjectMap, hInstance, &LIBID_VirtualBox); 52 g_pAtlComModule = new(ATL::CComModule); 53 if (!g_pAtlComModule) 54 return FALSE; 55 56 g_pAtlComModule->Init(ObjectMap, hInstance, &LIBID_VirtualBox); 53 57 DisableThreadLibraryCalls(hInstance); 54 58 } 55 59 else if (dwReason == DLL_PROCESS_DETACH) 56 60 { 57 _Module.Term(); 61 if (g_pAtlComModule) 62 { 63 g_pAtlComModule->Term(); 64 delete g_pAtlComModule; 65 g_pAtlComModule = NULL; 66 } 58 67 } 59 68 return TRUE; … … 65 74 STDAPI DllCanUnloadNow(void) 66 75 { 67 return (_Module.GetLockCount() == 0) ? S_OK : S_FALSE; 76 AssertReturn(g_pAtlComModule, S_OK); 77 return g_pAtlComModule->GetLockCount() == 0 ? S_OK : S_FALSE; 68 78 } 69 79 … … 73 83 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) 74 84 { 75 return _Module.GetClassObject(rclsid, riid, ppv); 85 AssertReturn(g_pAtlComModule, E_UNEXPECTED); 86 return g_pAtlComModule->GetClassObject(rclsid, riid, ppv); 76 87 } 77 88 … … 83 94 #ifndef VBOX_WITH_MIDL_PROXY_STUB 84 95 // registers object, typelib and all interfaces in typelib 85 return _Module.RegisterServer(TRUE); 96 AssertReturn(g_pAtlComModule, E_UNEXPECTED); 97 return g_pAtlComModule->RegisterServer(TRUE); 86 98 #else 87 99 return S_OK; /* VBoxProxyStub does all the work, no need to duplicate it here. */ … … 95 107 { 96 108 #ifndef VBOX_WITH_MIDL_PROXY_STUB 97 HRESULT hrc = _Module.UnregisterServer(TRUE); 109 AssertReturn(g_pAtlComModule, E_UNEXPECTED); 110 HRESULT hrc = g_pAtlComModule->UnregisterServer(TRUE); 98 111 return hrc; 99 112 #else -
trunk/src/VBox/Main/src-server/win/svcmain.cpp
r60765 r60865 131 131 } 132 132 133 static CExeModule _Module;134 133 135 134 BEGIN_OBJECT_MAP(ObjectMap) … … 173 172 */ 174 173 RTR3InitExe(argc, &argv, 0); 174 CExeModule _Module; 175 175 176 176 /* Note that all options are given lowercase/camel case/uppercase to -
trunk/src/VBox/Main/webservice/vboxweb.cpp
r60536 r60865 989 989 990 990 #ifdef RT_OS_WINDOWS 991 // Required for ATL992 static ATL::CComModule _Module;993 994 991 /** 995 992 * "Signal" handler for cleanly terminating the event loop. … … 1049 1046 if (RT_FAILURE(rc)) 1050 1047 return RTMsgInitFailure(rc); 1048 #ifdef RT_OS_WINDOWS 1049 ATL::CComModule _Module; /* Required internally by ATL (constructor records instance in global variable). */ 1050 #endif 1051 1051 1052 1052 // store a log prefix for this thread
Note:
See TracChangeset
for help on using the changeset viewer.