https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d74037b66657d582e1e26b...
commit d74037b66657d582e1e26bb94a943e98d28f4517 Author: Timo Kreuzer timo.kreuzer@reactos.org AuthorDate: Sun Sep 27 17:32:27 2020 +0200 Commit: Timo Kreuzer timo.kreuzer@reactos.org CommitDate: Mon Sep 28 00:24:53 2020 +0200
[NTOS:PS] Fix size handling in ProcessDeviceMap
If you want to know the details, browse history or use git blame. --- ntoskrnl/ps/query.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/ntoskrnl/ps/query.c b/ntoskrnl/ps/query.c index 5e340c7ccdf..60f440ab9bc 100644 --- a/ntoskrnl/ps/query.c +++ b/ntoskrnl/ps/query.c @@ -564,12 +564,6 @@ NtQueryInformationProcess(IN HANDLE ProcessHandle, /* DOS Device Map */ case ProcessDeviceMap:
- if (ProcessInformationLength < sizeof(PROCESS_DEVICEMAP_INFORMATION)) - { - Status = STATUS_INFO_LENGTH_MISMATCH; - break; - } - if (ProcessInformationLength == sizeof(PROCESS_DEVICEMAP_INFORMATION_EX)) { /* Protect read in SEH */ @@ -601,7 +595,8 @@ NtQueryInformationProcess(IN HANDLE ProcessHandle, } else { - if (ProcessInformationLength != sizeof(PROCESS_DEVICEMAP_INFORMATION)) + /* This has to be the size of the Query union field for x64 compatibility! */ + if (ProcessInformationLength != RTL_FIELD_SIZE(PROCESS_DEVICEMAP_INFORMATION, Query)) { Status = STATUS_INFO_LENGTH_MISMATCH; break;