Author: tfaber
Date: Tue Jun 13 14:11:26 2017
New Revision: 75024
URL: http://svn.reactos.org/svn/reactos?rev=75024&view=rev
Log:
[WIN32K:NTUSER]
- Fail UserSetClipboardData in case of 0 format, as shown by user32:clipboard test
Modified:
trunk/reactos/win32ss/user/ntuser/clipboard.c
Modified: trunk/reactos/win32ss/user/ntuser/clipboard.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/clipbo…
==============================================================================
--- trunk/reactos/win32ss/user/ntuser/clipboard.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/ntuser/clipboard.c [iso-8859-1] Tue Jun 13 14:11:26 2017
@@ -993,7 +993,8 @@
* - in case of delayed rendering, the clipboard must be already opened
* by another application, but we need to be the clipboard owner.
*/
- if ((!pWinStaObj->fInDelayedRendering && !IntIsClipboardOpenByMe(pWinStaObj)) ||
+ if (!fmt ||
+ (!pWinStaObj->fInDelayedRendering && !IntIsClipboardOpenByMe(pWinStaObj)) ||
(pWinStaObj->fInDelayedRendering && !(pWinStaObj->ptiClipLock &&
pWinStaObj->spwndClipOwner->head.pti == PsGetCurrentThreadWin32Thread())))
{
Author: tfaber
Date: Tue Jun 13 13:12:55 2017
New Revision: 75020
URL: http://svn.reactos.org/svn/reactos?rev=75020&view=rev
Log:
[WIN32K:NTUSER]
- Avoid crash on invalid format in UserEnumClipboardFormats. This is covered by user32_winetest but we currently fail that call before it can crash. The next commit will change that.
CORE-13414
Modified:
trunk/reactos/win32ss/user/ntuser/clipboard.c
Modified: trunk/reactos/win32ss/user/ntuser/clipboard.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/clipbo…
==============================================================================
--- trunk/reactos/win32ss/user/ntuser/clipboard.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/ntuser/clipboard.c [iso-8859-1] Tue Jun 13 13:12:55 2017
@@ -448,9 +448,14 @@
{
/* Return next format */
pElement = IntGetFormatElement(pWinStaObj, fmt);
- ++pElement;
- if (pElement < &pWinStaObj->pClipBase[pWinStaObj->cNumClipFormats])
- Ret = pElement->fmt;
+ if (pElement != NULL)
+ {
+ ++pElement;
+ if (pElement < &pWinStaObj->pClipBase[pWinStaObj->cNumClipFormats])
+ {
+ Ret = pElement->fmt;
+ }
+ }
}
cleanup: