https://git.reactos.org/?p=reactos.git;a=commitdiff;h=73558e94df8e76bb50fe9…
commit 73558e94df8e76bb50fe9b9b45d48d5cabf8e243
Author: jimtabor <james.tabor(a)reactos.org>
AuthorDate: Fri May 31 22:59:29 2019 -0500
Commit: jimtabor <james.tabor(a)reactos.org>
CommitDate: Fri May 31 22:59:29 2019 -0500
[User32] Fix Clipboard Meta Test Results
Fix meta data handle returns.
---
win32ss/user/user32/windows/clipboard.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/win32ss/user/user32/windows/clipboard.c
b/win32ss/user/user32/windows/clipboard.c
index 95fb87811be..bb51ce76ab1 100644
--- a/win32ss/user/user32/windows/clipboard.c
+++ b/win32ss/user/user32/windows/clipboard.c
@@ -303,7 +303,7 @@ SetClipboardData(UINT uFormat, HANDLE hMem)
DWORD dwSize;
HANDLE hGlobal;
LPVOID pMem;
- HANDLE hRet = NULL;
+ HANDLE hRet = NULL, hTemp;
SETCLIPBDATA scd = {FALSE, FALSE};
/* Check if this is a delayed rendering */
@@ -318,13 +318,15 @@ SetClipboardData(UINT uFormat, HANDLE hMem)
/* Meta files are probably checked for validity */
else if (uFormat == CF_DSPMETAFILEPICT || uFormat == CF_METAFILEPICT )
{
- hMem = GdiConvertMetaFilePict( hMem );
- hRet = NtUserSetClipboardData(uFormat, hMem, &scd);
+ hTemp = GdiConvertMetaFilePict( hMem );
+ hRet = NtUserSetClipboardData(uFormat, hTemp, &scd); // Note : LOL, it
returns a BOOL not a HANDLE!!!!
+ if (hRet == hTemp) hRet = hMem; // If successful
"TRUE", return the original handle.
}
else if (uFormat == CF_DSPENHMETAFILE || uFormat == CF_ENHMETAFILE)
{
- hMem = GdiConvertEnhMetaFile( hMem );
- hRet = NtUserSetClipboardData(uFormat, hMem, &scd);
+ hTemp = GdiConvertEnhMetaFile( hMem );
+ hRet = NtUserSetClipboardData(uFormat, hTemp, &scd);
+ if (hRet == hTemp) hRet = hMem;
}
else
{