[ros-bugs] [Bug 6188] New: taskmgr using NtQueryInformationProcess incorretly

ReactOS.Bugzilla at reactos.org ReactOS.Bugzilla at reactos.org
Mon May 2 14:58:14 UTC 2011


           Summary: taskmgr using NtQueryInformationProcess incorretly
           Product: ReactOS
           Version: TRUNK
          Platform: x86 Hardware
        OS/Version: ReactOS
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: Tools
        AssignedTo: ros-bugs at reactos.org
        ReportedBy: dmex04 at gmail.com
         QAContact: ros-bugs at reactos.org

There are various bugs while running taskmgr under Windows 7, while code from
1997 runs fine, indicating major discrepancies in the psdk and NT API defs in
comparison with Windows.

These two screen shots are from Windows 7 64bit, running taskmgr elevated:

This is a screenshot of code written in 1997 that still functions on Windows 7
without elevation. (just to show taskmgr is getting it all wrong :P)

These are two screen shots after removing the checks performed (note; its not
duplicating process entries)

commenting out the various if (status != NO_ERROR) checks allows taskmgr to
query the process list correctly, however the CPU totals and per page results
are incorrectly calculated and returned. As a side note, it should be checking
the return length and (status != NO_ERROR) is incorrect as
NtQuerySystemInformation returns NTSTATUS so it should be (status !=

    /* Get new system time */
    status = NtQuerySystemInformation(SystemTimeOfDayInformation, &SysTimeInfo,
sizeof(SysTimeInfo), 0);
    if (status != NO_ERROR)

    /* Get new CPU's idle time */
    status = NtQuerySystemInformation(SystemPerformanceInformation,
&SysPerfInfo, sizeof(SysPerfInfo), NULL);
    if (status != NO_ERROR)

    /* Get system cache information */
    status = NtQuerySystemInformation(SystemFileCacheInformation,
&SysCacheInfo, sizeof(SysCacheInfo), NULL);
    if (status != NO_ERROR)

This demonstration application (from a 1997 Microsoft Journal article) is able
to correctly query all the various details and indicates many discrepancies
between psdk defs and the use of NT api's by taskmgr:

Code linked from that article is public domain and licence free, there is a
link at the top of the article, for convenience it can be downloaded here:

Configure bugmail: http://www.reactos.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.

More information about the Ros-bugs mailing list