https://git.reactos.org/?p=reactos.git;a=commitdiff;h=931c72fde5b846bf0499a…
commit 931c72fde5b846bf0499a23351c8a535d1b13e34
Author: James Tabor <james.tabor(a)reactos.org>
AuthorDate: Sat Jun 1 07:23:58 2019 -0500
Commit: James Tabor <james.tabor(a)reactos.org>
CommitDate: Sat Jun 1 07:23:58 2019 -0500
[NtUser] Fix Clipboard Synthesized Returns
Add supported for Meta file synthesized renderings.
See CORE-12143.
---
win32ss/user/ntuser/clipboard.c | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/win32ss/user/ntuser/clipboard.c b/win32ss/user/ntuser/clipboard.c
index 28a1844dd6a..95f44894a20 100644
--- a/win32ss/user/ntuser/clipboard.c
+++ b/win32ss/user/ntuser/clipboard.c
@@ -290,7 +290,7 @@ cleanup:
static VOID NTAPI
IntAddSynthesizedFormats(PWINSTATION_OBJECT pWinStaObj)
{
- BOOL bHaveText, bHaveUniText, bHaveOemText, bHaveLocale, bHaveBm, bHaveDib;
+ BOOL bHaveText, bHaveUniText, bHaveOemText, bHaveLocale, bHaveBm, bHaveDib, bHaveMFP,
bHaveEMF;
bHaveText = IntIsFormatAvailable(pWinStaObj, CF_TEXT);
bHaveOemText = IntIsFormatAvailable(pWinStaObj, CF_OEMTEXT);
@@ -298,6 +298,8 @@ IntAddSynthesizedFormats(PWINSTATION_OBJECT pWinStaObj)
bHaveLocale = IntIsFormatAvailable(pWinStaObj, CF_LOCALE);
bHaveBm = IntIsFormatAvailable(pWinStaObj, CF_BITMAP);
bHaveDib = IntIsFormatAvailable(pWinStaObj, CF_DIB);
+ bHaveMFP = IntIsFormatAvailable(pWinStaObj, CF_METAFILEPICT);
+ bHaveEMF = IntIsFormatAvailable(pWinStaObj, CF_ENHMETAFILE);
/* Add CF_LOCALE format if we have CF_TEXT, CF_OEMTEXT or CF_UNICODETEXT */
if (!bHaveLocale && (bHaveText || bHaveOemText || bHaveUniText))
@@ -334,6 +336,14 @@ IntAddSynthesizedFormats(PWINSTATION_OBJECT pWinStaObj)
if (!bHaveBm && bHaveDib)
IntAddFormatedData(pWinStaObj, CF_BITMAP, DATA_SYNTH_KRNL, FALSE, TRUE);
+ /* Add CF_ENHMETAFILE. Note: it is synthesized in gdi32.dll */
+ if (bHaveMFP && !bHaveEMF)
+ IntAddFormatedData(pWinStaObj, CF_ENHMETAFILE, DATA_SYNTH_USER, FALSE, TRUE);
+
+ /* Add CF_METAFILEPICT. Note: it is synthesized in gdi32.dll */
+ if (bHaveEMF && !bHaveMFP)
+ IntAddFormatedData(pWinStaObj, CF_METAFILEPICT, DATA_SYNTH_USER, FALSE, TRUE);
+
/* Note: We need to render the DIB or DIBV5 format as soon as possible
because pallette information may change */
if (!bHaveDib && bHaveBm)
@@ -934,6 +944,16 @@ NtUserGetClipboardData(UINT fmt, PGETCLIPBDATA pgcd)
IntSynthesizeBitmap(pWinStaObj, pElement);
break;
+ case CF_METAFILEPICT:
+ uSourceFmt = CF_ENHMETAFILE;
+ pElement = IntGetFormatElement(pWinStaObj, uSourceFmt);
+ break;
+
+ case CF_ENHMETAFILE:
+ uSourceFmt = CF_METAFILEPICT;
+ pElement = IntGetFormatElement(pWinStaObj, uSourceFmt);
+ break;
+
default:
ASSERT(FALSE);
}