Details
-
Bug
-
Resolution: Fixed
-
Major
-
None
-
None
-
Operating System: ReactOS
Platform: x86 Hardware
Description
Created an attachment (id=3488)
Patch file for return size and structure NtQuerySystemInformation
1.
const
SystemProcessesAndThreadsInformation = 5;
STATUS_INFO_LENGTH_MISMATCH = $C0000004;
If you call the procedure in Windows as follows:
Status := NtQuerySystemInformation(SystemProcessesAndThreadsInformation,
nil, 0, ReturnLength);
or:
Status := NtQuerySystemInformation(SystemProcessesAndThreadsInformation,
nil, 200, ReturnLength);
or:
Status := NtQuerySystemInformation(SystemProcessesAndThreadsInformation,
SystemInformation, ReturnLength*0+100, ReturnLength);
Windows return status STATUS_INFO_LENGTH_MISMATCH and size into ReturnLength necessary buffer
if Status <> STATUS_INFO_LENGTH_MISMATCH then Exit;
2.
Debug trace value Windows.
In any event, returns the desired size into ReturnLength.
And never writes in the buffer until you determine the size into ReturnLength
See attach ProcessDebug.jpg
3.
The amount depends on the size of the buffer allocated by ProcessName/SpiCurrent-> ImageName.Buffer
In a detailed review found that the multiplicity of 8 bytes, and calculate:
ImageNameLength = strlen(Process->ImageFileName) * sizeof(WCHAR);
ImageNameMaximumLength = (ImageNameLength > 0
? (ImageNameLength / 8 * 8 + ((ImageNameLength % 8) >= 0 ? 1 : 0)*8)
: 0);
See Process.jpg
4.And finally the most important thing is the result of my patches.
See sysinfo.patch and execute file ProcessInfo.zip
Attachments
Issue Links
- is duplicated by
-
CORE-3647 Kernel32, only 15 bytes for the processes-names
- Resolved