Author: hbelusca
Date: Wed Dec 16 00:26:27 2015
New Revision: 70355
URL: http://svn.reactos.org/svn/reactos?rev=70355&view=rev
Log:
[WIN32K:CLIPBOARD]
- When cleaning the clipboard, cancel any pending delayed rendering and increment all the sequence&serial numbers.
- Fix the clipboard access check when performing a delay rendering. This fixes VBox host <-> guest copy/paste amongst others...
CORE-5512 CORE-9620
CORE-8367 CORE-8627 #comment Please retest with revision >= 70355.
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] Wed Dec 16 00:26:27 2015
@@ -628,10 +628,12 @@
co_IntSendMessageNoWait(pWinStaObj->spwndClipOwner->head.h, WM_DESTROYCLIPBOARD, 0, 0);
}
- pWinStaObj->spwndClipOwner = pWinStaObj->spwndClipOpen;
-
- pWinStaObj->iClipSequenceNumber++;
- pWinStaObj->fClipboardChanged = TRUE;
+ pWinStaObj->spwndClipOwner = pWinStaObj->spwndClipOpen;
+
+ pWinStaObj->iClipSerialNumber++;
+ pWinStaObj->iClipSequenceNumber++;
+ pWinStaObj->fClipboardChanged = TRUE;
+ pWinStaObj->fInDelayedRendering = FALSE;
bRet = TRUE;
@@ -930,10 +932,15 @@
if (!pWinStaObj)
goto cleanup;
- /* If it's delayed rendering we don't have to open clipboard */
- if ((pWinStaObj->fInDelayedRendering &&
- pWinStaObj->spwndClipOwner->head.pti != PsGetCurrentThreadWin32Thread()) ||
- !IntIsClipboardOpenByMe(pWinStaObj))
+ /*
+ * Check if the clipboard is correctly opened:
+ * - in case of normal rendering, we must have opened the clipboard;
+ * - 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)) ||
+ (pWinStaObj->fInDelayedRendering && !(pWinStaObj->ptiClipLock &&
+ pWinStaObj->spwndClipOwner->head.pti == PsGetCurrentThreadWin32Thread())))
{
ERR("Access denied!\n");
EngSetLastError(ERROR_CLIPBOARD_NOT_OPEN);
@@ -957,7 +964,10 @@
IntAddFormatedData(pWinStaObj, fmt, hData, scd->fGlobalHandle, FALSE);
TRACE("hData stored\n");
- pWinStaObj->iClipSequenceNumber++;
+ /* If the serial number was increased, increase also the sequence number */
+ if (scd->fIncSerialNumber)
+ pWinStaObj->iClipSequenceNumber++;
+
pWinStaObj->fClipboardChanged = TRUE;
/* Note: Synthesized formats are added in NtUserCloseClipboard */
Author: ekohl
Date: Tue Dec 15 21:38:36 2015
New Revision: 70350
URL: http://svn.reactos.org/svn/reactos?rev=70350&view=rev
Log:
[WINSRV]
Do not kill system processes when a user is logging off. Fixes user logoff.
#CORE-2391 #resolve
Modified:
trunk/reactos/win32ss/user/winsrv/usersrv/shutdown.c
Modified: trunk/reactos/win32ss/user/winsrv/usersrv/shutdown.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/usersr…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/usersrv/shutdown.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/winsrv/usersrv/shutdown.c [iso-8859-1] Tue Dec 15 21:38:36 2015
@@ -763,6 +763,14 @@
* Check for process validity
*/
+ /* Do not kill system processes when a user is logging off */
+ if ((Flags & EWX_SHUTDOWN) == EWX_LOGOFF &&
+ (CsrProcess->ShutdownFlags & (SHUTDOWN_OTHERCONTEXT | SHUTDOWN_SYSTEMCONTEXT)))
+ {
+ DPRINT1("Do not kill a system process in a logoff request!\n");
+ return CsrShutdownNonCsrProcess;
+ }
+
/* Do not kill Winlogon or CSRSS */
if (CsrProcess->ClientId.UniqueProcess == NtCurrentProcess() ||
CsrProcess->ClientId.UniqueProcess == UlongToHandle(LogonProcessId))