From 97aea8189d2f131b2e390b3688b231592f03e096 Mon Sep 17 00:00:00 2001 From: Dmitry Chapyshev Date: Fri, 19 Jun 2009 08:49:01 +0000 Subject: [PATCH] - Add target process reference/dereference in ProcessWow64Information case of NtQueryInformationProcess. - Check buffer length svn path=/trunk/; revision=41466 --- reactos/ntoskrnl/ps/query.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/reactos/ntoskrnl/ps/query.c b/reactos/ntoskrnl/ps/query.c index 4d82055ae5d..a94cc4680ab 100644 --- a/reactos/ntoskrnl/ps/query.c +++ b/reactos/ntoskrnl/ps/query.c @@ -447,6 +447,29 @@ NtQueryInformationProcess(IN HANDLE ProcessHandle, /* WOW64: Not implemented */ case ProcessWow64Information: + + /* Set the return length */ + Length = sizeof(ULONG_PTR); + + if (ProcessInformationLength != Length) + { + Status = STATUS_INFO_LENGTH_MISMATCH; + break; + } + + /* Reference the process */ + Status = ObReferenceObjectByHandle(ProcessHandle, + PROCESS_QUERY_INFORMATION, + PsProcessType, + PreviousMode, + (PVOID*)&Process, + NULL); + if (!NT_SUCCESS(Status)) break; + + DPRINT1("Not implemented: ProcessWow64Information\n"); + + /* Dereference the process */ + ObDereferenceObject(Process); Status = STATUS_NOT_IMPLEMENTED; break;