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=3... ============================================================================== --- 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;