[ros-diffs] [dchapyshev] 41466: - Add target process reference/dereference in ProcessWow64Information case of NtQueryInformationProcess. - Check buffer length

dchapyshev at svn.reactos.org dchapyshev at svn.reactos.org
Fri Jun 19 10:49:03 CEST 2009


Author: dchapyshev
Date: Fri Jun 19 12:49:01 2009
New Revision: 41466

URL: http://svn.reactos.org/svn/reactos?rev=41466&view=rev
Log:
- Add target process reference/dereference in ProcessWow64Information case of NtQueryInformationProcess.
- Check buffer length

Modified:
    trunk/reactos/ntoskrnl/ps/query.c

Modified: trunk/reactos/ntoskrnl/ps/query.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ps/query.c?rev=41466&r1=41465&r2=41466&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/ps/query.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ps/query.c [iso-8859-1] Fri Jun 19 12:49:01 2009
@@ -447,6 +447,29 @@
 
         /* 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;
 



More information about the Ros-diffs mailing list