[ros-bugs] [Bug 5619] New: PsaCaptureSystemModules() noncritical incorrectness

ReactOS.Bugzilla at reactos.org ReactOS.Bugzilla at reactos.org
Sat Sep 18 11:47:35 UTC 2010


http://www.reactos.org/bugzilla/show_bug.cgi?id=5619

           Summary: PsaCaptureSystemModules() noncritical incorrectness
           Product: ReactOS
           Version: TRUNK
          Platform: x86 Hardware
        OS/Version: ReactOS
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: Win32
        AssignedTo: ros-bugs at reactos.org
        ReportedBy: dragity at mail.com


Corrected function :
lib/epsapi/enum/drivers.c   PsaCaptureSystemModules()

Requested from :
EnumDeviceDrivers
GetDeviceDriverBaseNameA
GetDeviceDriverFileNameA
GetDeviceDriverBaseNameW
GetDeviceDriverFileNameW

Current source :
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/epsapi/enum/drivers.c?view=log

The code in real isn't nonworking, but the first request to
'NtQuerySystemInformation(SystemModuleInformation)' is incorrect, and 'nSize'
value remains 0.



---
  Status = NtQuerySystemInformation(SystemModuleInformation,
                                    &nSize,
                                    sizeof(nSize),
                                    NULL);
---
+++
        Status = NtQuerySystemInformation (SystemModuleInformation, 0, 0,
&nSize);
+++



---
  /* RATIONALE: the loading of a system module is a rare occurrence. To
     minimize memory operations that could be expensive, or fragment the
     pool/heap, we try to determine the buffer size in advance, knowing that
     the number of elements is unlikely to change */
  nSize = sizeof(RTL_PROCESS_MODULES) +
          (nSize * sizeof(RTL_PROCESS_MODULES));
---
+++
// Alex_I :  the number of modules can change; we aren't in kernel mode, and
cannot lock this resource; from here we only may just do a loop of retries
+++



---
    /* double the buffer for the next loop */
    nSize *= 2;
---
+++
// Alex_I :  increase on some value to make a retry
    nSize += sizeof(RTL_PROCESS_MODULES) * 16;
+++



*nicks can be removed from the comments


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



More information about the Ros-bugs mailing list