[ros-dev] [ros-diffs] [gadamopoulos] 73436: [SHELL32] - Initialize the shell icon cache only when needed or when FileIconInit is called (and not in the DllMain of shell32)

Thomas Faber thomas.faber at reactos.org
Wed Dec 7 08:55:35 UTC 2016


On 2016-12-07 01:10, gadamopoulos at svn.reactos.org wrote:
> [SHELL32] - Initialize the shell icon cache only when needed or when FileIconInit is called (and not in the DllMain of shell32)

> --- trunk/reactos/dll/win32/shell32/iconcache.cpp	[iso-8859-1] (original)
> +++ trunk/reactos/dll/win32/shell32/iconcache.cpp	[iso-8859-1] Wed Dec  7 00:10:43 2016
> @@ -453,6 +453,9 @@
>      sice.dwSourceIndex = dwSourceIndex;
>      sice.dwFlags = dwFlags;
>
> +    if (!sic_hdpa)
> +        SIC_Initialize();
> +
>      EnterCriticalSection(&SHELL32_SicCS);
>
>      if (NULL != DPA_GetPtr (sic_hdpa, 0))
> @@ -687,6 +690,9 @@
>          RegCloseKey(hKeyShellIcons);
>      }
>
> +    if (!sic_hdpa)
> +        SIC_Initialize();
> +
>      return SIC_LoadIcon(iconPath, iconIdx, 0);
>  }
>

This is great. Unfortunately now you have a race condition if multiple
of these functions get called concurrently.



More information about the Ros-dev mailing list