[ros-diffs] [fireball] 39737: - If looking up a long name for a process failed, use short one. This fixes the issue with "System" not being displayed correctly. - Round up process name length more correctly, as suggested by Evgeniy Boltik. See issue #4087 for more details.

fireball at svn.reactos.org fireball at svn.reactos.org
Tue Feb 24 12:34:09 CET 2009


Author: fireball
Date: Tue Feb 24 14:34:08 2009
New Revision: 39737

URL: http://svn.reactos.org/svn/reactos?rev=39737&view=rev
Log:
- If looking up a long name for a process failed, use short one. This fixes the issue with "System" not being displayed correctly.
- Round up process name length more correctly, as suggested by Evgeniy Boltik.
See issue #4087 for more details.

Modified:
    trunk/reactos/ntoskrnl/ex/sysinfo.c

Modified: trunk/reactos/ntoskrnl/ex/sysinfo.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/sysinfo.c?rev=39737&r1=39736&r2=39737&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/ex/sysinfo.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ex/sysinfo.c [iso-8859-1] Tue Feb 24 14:34:08 2009
@@ -753,7 +753,7 @@
             ImageNameLength = 0;
             Status = SeLocateProcessImageName(Process, &ProcessImageName);
             szSrc = NULL;
-            if (NT_SUCCESS(Status))
+            if (NT_SUCCESS(Status) && (ProcessImageName->Length > 0))
             {
               szSrc = (PWCHAR)((PCHAR)ProcessImageName->Buffer + ProcessImageName->Length);
               /* Loop the file name*/
@@ -777,7 +777,10 @@
             }
 
             /* Round up the image name length as NT does */
-            ImageNameMaximumLength = ROUND_UP(ImageNameLength, 8);
+            if (ImageNameLength > 0)
+                ImageNameMaximumLength = ROUND_UP(ImageNameLength + sizeof(WCHAR), 8);
+            else
+                ImageNameMaximumLength = 0;
 
             TotalSize += CurrentSize + ImageNameMaximumLength;
 



More information about the Ros-diffs mailing list