From 2e2957d9288f2f727d527670a2bc81c27582fcdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gardou?= Date: Tue, 21 Oct 2014 10:45:55 +0000 Subject: [PATCH] [WIN32K] - reference the current process info structure while we're leaving win32k. The process can die anytime while we're not looking. CORE-8663 #resolve svn path=/trunk/; revision=64863 --- reactos/win32ss/user/ntuser/message.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/reactos/win32ss/user/ntuser/message.c b/reactos/win32ss/user/ntuser/message.c index 4dbe59f307c..8d6a76cab2d 100644 --- a/reactos/win32ss/user/ntuser/message.c +++ b/reactos/win32ss/user/ntuser/message.c @@ -2882,6 +2882,13 @@ NtUserWaitForInputIdle( IN HANDLE hProcess, TRACE("WFII: ppi %p\n", W32Process); TRACE("WFII: waiting for %p\n", Handles[1] ); + + /* + * We must add a refcount to our current PROCESSINFO, + * because anything could happen (including process death) we're leaving win32k + */ + IntReferenceProcessInfo(W32Process); + do { UserLeave(); @@ -2935,6 +2942,7 @@ WaitExit: pti->pClientInfo->dwTIFlags = pti->TIF_flags; } W32Process->W32PF_flags &= ~W32PF_WAITFORINPUTIDLE; + IntDereferenceProcessInfo(W32Process); ObDereferenceObject(Process); UserLeave(); return Status;