Description
Hello,
This patch fixes the rogue handle count in QSISystemHandleInformation(...). As of now the handles count is incremented even if ExpLockHandleTableEntry() returns FALSE:
/* Increase of count of handles */
|
++HandleInformation->NumberOfHandles;
|
|
/* Lock the entry */
|
if (ExpLockHandleTableEntry(HandleTable, HandleTableEntry))
|
{
|
/* Increase required buffer size */
|
*ReqSize += sizeof(SYSTEM_HANDLE_TABLE_ENTRY_INFO);
|
|
/* Check user's buffer size */
|
if (*ReqSize > Size)
|
{
|
Status = STATUS_INFO_LENGTH_MISMATCH;
|
}
|
else
|
{
|
POBJECT_HEADER ObjectHeader = ObpGetHandleObject(HandleTableEntry);
|
|
/* Filling handle information */
|
HandleInformation->Handles[Index].UniqueProcessId =
|
(USHORT)(ULONG_PTR) HandleTable->UniqueProcessId;
|
|
HandleInformation->Handles[Index].CreatorBackTraceIndex = 0;
|
|
#if 0 /* FIXME!!! Type field currupted */
|
HandleInformation->Handles[Index].ObjectTypeIndex =
|
(UCHAR) ObjectHeader->Type->Index;
|
#else
|
HandleInformation->Handles[Index].ObjectTypeIndex = 0;
|
#endif
|
|
HandleInformation->Handles[Index].HandleAttributes =
|
HandleTableEntry->ObAttributes & OBJ_HANDLE_ATTRIBUTES;
|
|
HandleInformation->Handles[Index].HandleValue =
|
(USHORT)(ULONG_PTR) Handle.GenericHandleOverlay;
|
|
HandleInformation->Handles[Index].Object = &ObjectHeader->Body;
|
|
HandleInformation->Handles[Index].GrantedAccess =
|
HandleTableEntry->GrantedAccess;
|
|
++Index;
|
}
|
This results in a mismatch between data in HandleInformation->Handles and HandleInformation->NumberOfHandles.
Attachments
Issue Links
- relates to
-
CORE-11928 ros taskmgr and Windows taskmgr do not show the same total handle count, when executed on ros
- Open