[PATCH v2 1/3] comdlg32: Init clipboard format only once in filedlg.
Alexandre Julliard
julliard at winehq.org
Wed Jul 6 02:12:25 CDT 2016
Lauri Kenttä <lauri.kentta at gmail.com> writes:
> @@ -3798,6 +3789,25 @@ static void COMCTL32_ReleaseStgMedium (STGMEDIUM medium)
> }
>
> /***********************************************************************
> + * GetFormatEtc
> + *
> + * Get the FORMATETC used in the shell id list
> + */
> +static FORMATETC* GetFormatEtc(void)
> +{
> + static FORMATETC formatetc;
> + if (!formatetc.cfFormat)
> + {
> + formatetc.cfFormat = RegisterClipboardFormatA(CFSTR_SHELLIDLISTA);
> + formatetc.ptd = 0;
> + formatetc.dwAspect = DVASPECT_CONTENT;
> + formatetc.lindex = -1;
> + formatetc.tymed = TYMED_HGLOBAL;
> + }
> + return &formatetc;
> +}
This looks a little risky, since the structure is passed to the
application. Caching only the clipboard format should be enough.
--
Alexandre Julliard
julliard at winehq.org
More information about the wine-devel
mailing list