mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 15:36:04 +00:00
Improve NtUserWaitForInputIdle, still a work in progress.
svn path=/trunk/; revision=34419
This commit is contained in:
parent
0b35c794b5
commit
4460003077
1 changed files with 26 additions and 1 deletions
|
@ -1858,11 +1858,35 @@ NtUserWaitForInputIdle(
|
||||||
DWORD ret;
|
DWORD ret;
|
||||||
LARGE_INTEGER Timeout;
|
LARGE_INTEGER Timeout;
|
||||||
HANDLE handles[2];
|
HANDLE handles[2];
|
||||||
|
PEPROCESS Process;
|
||||||
|
PW32PROCESS W32Process;
|
||||||
|
NTSTATUS Status;
|
||||||
|
|
||||||
UserEnterExclusive();
|
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[0] = hProcess;
|
||||||
handles[1] = &PsGetCurrentProcessWin32Process()->InputIdleEvent; // Fixme!
|
handles[1] = &W32Process->InputIdleEvent; // Fixme!
|
||||||
|
|
||||||
if (!handles[1]) return 0; /* no event to wait on */
|
if (!handles[1]) return 0; /* no event to wait on */
|
||||||
|
|
||||||
|
@ -1920,6 +1944,7 @@ NtUserWaitForInputIdle(
|
||||||
}
|
}
|
||||||
while (1);
|
while (1);
|
||||||
WaitExit:
|
WaitExit:
|
||||||
|
ObDereferenceObject(Process);
|
||||||
UserLeave();
|
UserLeave();
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue