[WIN32K:NTUSER]
authorThomas Faber <thomas.faber@reactos.org>
Tue, 13 Jun 2017 14:11:26 +0000 (14:11 +0000)
committerThomas Faber <thomas.faber@reactos.org>
Tue, 13 Jun 2017 14:11:26 +0000 (14:11 +0000)
- Fail UserSetClipboardData in case of 0 format, as shown by user32:clipboard test

svn path=/trunk/; revision=75024

reactos/win32ss/user/ntuser/clipboard.c

index 068dc5d..672631c 100644 (file)
@@ -993,7 +993,8 @@ UserSetClipboardData(UINT fmt, HANDLE hData, PSETCLIPBDATA scd)
      * - in case of delayed rendering, the clipboard must be already opened
      *   by another application, but we need to be the clipboard owner.
      */
      * - 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())))
     {
         (pWinStaObj->fInDelayedRendering && !(pWinStaObj->ptiClipLock &&
          pWinStaObj->spwndClipOwner->head.pti == PsGetCurrentThreadWin32Thread())))
     {