Author: fireball
Date: Tue Jul 15 09:00:37 2008
New Revision: 34525
URL:
http://svn.reactos.org/svn/reactos?rev=34525&view=rev
Log:
Yuriy Sidorov <jura(a)cp-lab.com>
- Fix BSOD in NtUserWaitForInputIdle because KeWaitForMultipleObjects expects actual
pointers to objects, not handles.
- Fix failure branches to have UserLeave and/or object dereference where needed.
See issue #3522 for more details.
Modified:
trunk/reactos/subsystems/win32/win32k/ntuser/message.c
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/message.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/message.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/message.c [iso-8859-1] Tue Jul 15
09:00:37 2008
@@ -1898,6 +1898,7 @@
if (!NT_SUCCESS(Status))
{
+ UserLeave();
SetLastNtError(Status);
return WAIT_FAILED;
}
@@ -1906,16 +1907,22 @@
if (!W32Process)
{
ObDereferenceObject(Process);
+ UserLeave();
SetLastWin32Error(ERROR_INVALID_PARAMETER);
return WAIT_FAILED;
}
EngCreateEvent((PEVENT *)&W32Process->InputIdleEvent);
- Handles[0] = hProcess;
+ Handles[0] = Process;
Handles[1] = W32Process->InputIdleEvent;
- if (!Handles[1]) return STATUS_SUCCESS; /* no event to wait on */
+ if (!Handles[1])
+ {
+ ObDereferenceObject(Process);
+ UserLeave();
+ return STATUS_SUCCESS; /* no event to wait on */
+ }
StartTime = ((ULONGLONG)SharedUserData->TickCountLowDeprecated *
SharedUserData->TickCountMultiplier / 16777216);