[WIN32SS:NTUSER] Use the 2nd parameter of NtUserGetThreadDesktop() as fallback. (#1065)

- The 2nd parameter is already passed in user-mode by GetThreadDesktop().
  It is then used by NtUserGetThreadDesktop() as a fallback for console
  threads.

- Lookup and validate the thread by using the IntTID2PTI() helper.
- Don't reference the desktop with too many access rights.
- Get rid of the old-school DECLARE_RETURN() & co. macros.

Co-authored-by: Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
This commit is contained in:
Andrew Boyarshin 2018-11-26 19:49:15 +07:00 committed by Hermès Bélusca-Maïto
parent 23ad2173f2
commit 458a26ab76
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
3 changed files with 76 additions and 46 deletions

View file

@ -563,7 +563,7 @@ GetThreadDesktop(
}
return NtUserGetThreadDesktop(dwThreadId,
(DWORD_PTR)GetThreadConsoleDesktopRequest->ConsoleDesktop);
GetThreadConsoleDesktopRequest->ConsoleDesktop);
}