Add extra token access mask
* Authors:
*
* wj32 2009-2016
- * dmex 2018
+ * dmex 2018-2022
*
*/
@@ -34,7 +34,13 @@ NTSTATUS NTAPI PhpOpenProcessTokenForPage(
if (!NT_SUCCESS(status = PhOpenProcessToken(
processHandle,
- DesiredAccess | TOKEN_READ | TOKEN_ADJUST_DEFAULT | READ_CONTROL, // HACK: Add extra access_masks for querying default token. (dmex)
+ DesiredAccess | TOKEN_READ | TOKEN_ADJUST_DEFAULT | READ_CONTROL,
+ Handle
+ )))
+ {
+ if (!NT_SUCCESS(status = PhOpenProcessToken(
+ processHandle,
+ DesiredAccess | TOKEN_READ | TOKEN_ADJUST_DEFAULT,
Handle
)))
{
@@ -44,6 +50,7 @@ NTSTATUS NTAPI PhpOpenProcessTokenForPage(
Handle
);
}
+ }
NtClose(processHandle);
