Author: jimtabor
Date: Thu Jul 10 20:24:47 2008
New Revision: 34419
URL:
http://svn.reactos.org/svn/reactos?rev=34419&view=rev
Log:
Improve NtUserWaitForInputIdle, still a work in progress.
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] Thu Jul 10
20:24:47 2008
@@ -1858,11 +1858,35 @@
DWORD ret;
LARGE_INTEGER Timeout;
HANDLE handles[2];
+ PEPROCESS Process;
+ PW32PROCESS W32Process;
+ NTSTATUS Status;
UserEnterExclusive();
+ Status = ObReferenceObjectByHandle(hProcess,
+ PROCESS_QUERY_INFORMATION,
+ PsProcessType,
+ UserMode,
+ (PVOID*)&Process,
+ NULL);
+
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastNtError(Status);
+ return (DWORD)-1;
+ }
+
+ W32Process = (PW32PROCESS)Process->Win32Process;
+ if (!W32Process)
+ {
+ ObDereferenceObject(Process);
+ SetLastWin32Error(ERROR_INVALID_PARAMETER);
+ return (DWORD)-1;
+ }
+
handles[0] = hProcess;
- handles[1] = &PsGetCurrentProcessWin32Process()->InputIdleEvent; // Fixme!
+ handles[1] = &W32Process->InputIdleEvent; // Fixme!
if (!handles[1]) return 0; /* no event to wait on */
@@ -1920,6 +1944,7 @@
}
while (1);
WaitExit:
+ ObDereferenceObject(Process);
UserLeave();
return ret;
}