[SHELL][RAPPS_NEW]
authorThomas Faber <thomas.faber@reactos.org>
Sun, 22 Nov 2015 21:13:14 +0000 (21:13 +0000)
committerThomas Faber <thomas.faber@reactos.org>
Sun, 22 Nov 2015 21:13:14 +0000 (21:13 +0000)
- Don't call placement new on static objects. The constructors work just fine.
CORE-10562 #resolve

svn path=/trunk/; revision=70040

reactos/base/applications/rapps_new/winmain.cpp
reactos/base/shell/explorer/explorer.cpp
reactos/base/shell/rshell/misc.cpp
reactos/dll/shellext/ntobjshex/ntobjshex.cpp
reactos/dll/shellext/stobject/stobject.cpp
reactos/dll/win32/browseui/browseui.cpp
reactos/dll/win32/shell32/shell32.cpp

index 5326dbf..795952c 100644 (file)
@@ -40,12 +40,6 @@ static VOID InitializeAtlModule(HINSTANCE hInstance, BOOL bInitialize)
 {
     if (bInitialize)
     {
-        /* HACK - the global constructors don't run, so I placement new them here */
-        new (&gModule) CRAppsModule;
-        new (&gWinModule) CAtlWinModule;
-        new (&_AtlBaseModule) CAtlBaseModule;
-        new (&_AtlComModule) CAtlComModule;
-
         gModule.Init(ObjectMap, hInstance, NULL);
     }
     else
index 4d869d1..af1468a 100644 (file)
@@ -45,12 +45,6 @@ static VOID InitializeAtlModule(HINSTANCE hInstance, BOOL bInitialize)
 {
     if (bInitialize)
     {
-        /* HACK - the global constructors don't run, so I placement new them here */
-        new (&gModule) CExplorerModule;
-        new (&gWinModule) CAtlWinModule;
-        new (&_AtlBaseModule) CAtlBaseModule;
-        new (&_AtlComModule) CAtlComModule;
-
         gModule.Init(ObjectMap, hInstance, NULL);
     }
     else
index 17329a5..88a2a11 100644 (file)
@@ -119,12 +119,6 @@ STDAPI_(BOOL) DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID fImpLoad)
     {
         g_hRShell = hInstance;
 
-        /* HACK - the global constructors don't run, so I placement new them here */
-        new (&gModule) CRShellModule;
-        new (&gWinModule) CAtlWinModule;
-        new (&_AtlBaseModule) CAtlBaseModule;
-        new (&_AtlComModule) CAtlComModule;
-
         gModule.Init(NULL, hInstance, NULL);
         DisableThreadLibraryCalls(hInstance);
     }
index 1c829f9..8c2cc3d 100644 (file)
@@ -33,12 +33,6 @@ DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
         g_hInstance = hinstDLL;
         DisableThreadLibraryCalls(g_hInstance);
 
-        /* HACK - the global constructors don't run, so I placement new them here */
-        new (&g_Module) CComModule;
-        new (&_AtlWinModule) CAtlWinModule;
-        new (&_AtlBaseModule) CAtlBaseModule;
-        new (&_AtlComModule) CAtlComModule;
-
         g_Module.Init(ObjectMap, g_hInstance, NULL);
     }
     else if (fdwReason == DLL_PROCESS_DETACH)
index 39ce6a4..ed832f9 100644 (file)
@@ -34,12 +34,6 @@ DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
         g_hInstance = hinstDLL;
         DisableThreadLibraryCalls(g_hInstance);
 
-        /* HACK - the global constructors don't run, so I placement new them here */
-        new (&g_Module) CComModule;
-        new (&_AtlWinModule) CAtlWinModule;
-        new (&_AtlBaseModule) CAtlBaseModule;
-        new (&_AtlComModule) CAtlComModule;
-
         g_Module.Init(ObjectMap, g_hInstance, NULL);
     }
     else if (fdwReason == DLL_PROCESS_DETACH)
index 9a269cc..26e248c 100644 (file)
@@ -60,12 +60,6 @@ STDAPI_(BOOL) DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID fImpLoad)
 
     if (dwReason == DLL_PROCESS_ATTACH)
     {
-        /* HACK - the global constructors don't run, so I placement new them here */
-        new (&gModule) CBrowseUIModule;
-        new (&gWinModule) CAtlWinModule;
-        new (&_AtlBaseModule) CAtlBaseModule;
-        new (&_AtlComModule) CAtlComModule;
-
         gModule.Init(ObjectMap, hInstance, NULL);
         DisableThreadLibraryCalls (hInstance);
     }
index 3d125ba..2038cbd 100644 (file)
@@ -290,12 +290,6 @@ STDAPI_(BOOL) DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID fImpLoad)
     TRACE("%p 0x%x %p\n", hInstance, dwReason, fImpLoad);
     if (dwReason == DLL_PROCESS_ATTACH)
     {
-        /* HACK - the global constructors don't run, so I placement new them here */
-        new (&gModule) CShell32Module;
-        new (&_AtlWinModule) CAtlWinModule;
-        new (&_AtlBaseModule) CAtlBaseModule;
-        new (&_AtlComModule) CAtlComModule;
-
         shell32_hInstance = hInstance;
         gModule.Init(ObjectMap, hInstance, NULL);