- 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.

svn path=/trunk/; revision=39737
This commit is contained in:
Aleksey Bragin 2009-02-24 11:34:08 +00:00
parent d06192c7c9
commit 98d1576628

View file

@ -753,7 +753,7 @@ QSI_DEF(SystemProcessInformation)
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 @@ QSI_DEF(SystemProcessInformation)
}
/* 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;