[NTOS:SE] Minor refactor on NtOpenThreadTokenEx
authorGeorge Bișoc <george.bisoc@reactos.org>
Fri, 18 Jun 2021 16:38:12 +0000 (18:38 +0200)
committerGeorge Bișoc <george.bisoc@reactos.org>
Fri, 18 Jun 2021 16:38:12 +0000 (18:38 +0200)
commit5912c1165073b8d1015ad1e0f0d229a7c50a181d
tree4a870e11dbd4f49a077684f8bd36b53f98cac11f
parent5ee09256de7ff0f57d19f704e10b49e1485e2580
[NTOS:SE] Minor refactor on NtOpenThreadTokenEx

- Remove a redundant call of ObReferenceObjectByHandle. Not only it didn't make much sense (we reference the object from thread handle and the new thread object referencing the same handle!), specifying a request access of THREAD_ALL_ACCESS for the thread object is kind of suspicious and all of these access rights are unwanted.
- Add some failure checks involving the CopyOnOpen code paths
- Add some DPRINT1 debug prints (concerning the CopyOnOpen code paths as usual)
ntoskrnl/se/token.c