From: Mark Jansen Date: Tue, 6 Dec 2016 21:18:17 +0000 (+0000) Subject: [SHELL32] Don't call CoInitialize in DllMain, bad things happen when calling into... X-Git-Tag: ReactOS-0.4.4-FOSDEM2017~101 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=54e99fcd1b96623911968c8b7e69330701b62276 [SHELL32] Don't call CoInitialize in DllMain, bad things happen when calling into dll's that are being loaded! CORE-12443 #comment Please retest! svn path=/trunk/; revision=73434 --- diff --git a/reactos/dll/win32/shell32/folders.cpp b/reactos/dll/win32/shell32/folders.cpp index 9e5a987ac2b..975a825a5d7 100644 --- a/reactos/dll/win32/shell32/folders.cpp +++ b/reactos/dll/win32/shell32/folders.cpp @@ -87,7 +87,7 @@ static HRESULT getIconLocationForFolder(IShellFolder * psf, LPCITEMIDLIST pidl, return S_OK; } -void InitIconOverlays(void) +static void InitIconOverlays(void) { HKEY hKey; DWORD dwIndex, dwResult, dwSize; @@ -161,6 +161,8 @@ GetIconOverlay(LPCITEMIDLIST pidl, WCHAR * wTemp, int* pIndex) if(!SHGetPathFromIDListW(pidl, szPath)) return FALSE; + if (!Handlers) + InitIconOverlays(); HighestPriority = 101; IconIndex = NumIconOverlayHandlers; diff --git a/reactos/dll/win32/shell32/shell32.cpp b/reactos/dll/win32/shell32/shell32.cpp index b1c590b77f8..0b1e444dc75 100644 --- a/reactos/dll/win32/shell32/shell32.cpp +++ b/reactos/dll/win32/shell32/shell32.cpp @@ -307,9 +307,9 @@ STDAPI_(BOOL) DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID fImpLoad) InitCtrls.dwICC = ICC_WIN95_CLASSES | ICC_DATE_CLASSES | ICC_USEREX_CLASSES; InitCommonControlsEx(&InitCtrls); + /* Bad idea, initialization in DllMain! */ SIC_Initialize(); InitChangeNotifications(); - InitIconOverlays(); } else if (dwReason == DLL_PROCESS_DETACH) { diff --git a/reactos/dll/win32/shell32/wine/shell32_main.h b/reactos/dll/win32/shell32/wine/shell32_main.h index 127a5661593..66a98592efb 100644 --- a/reactos/dll/win32/shell32/wine/shell32_main.h +++ b/reactos/dll/win32/shell32/wine/shell32_main.h @@ -109,7 +109,6 @@ HGLOBAL RenderFILENAMEW (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl) /* Change Notification */ void InitChangeNotifications(void) DECLSPEC_HIDDEN; void FreeChangeNotifications(void) DECLSPEC_HIDDEN; -void InitIconOverlays(void); /* file operation */ #define ASK_DELETE_FILE 1