[NTOS:SE] Implement SepDumpAccessAndStatusList

This function will dump all the access status and granted access rights
of each object list of a list whenever an access check by type (or by type
result list) fails. This is for debugging purposes.
This commit is contained in:
George Bișoc 2023-06-21 17:44:34 +02:00 committed by unknown
parent 5654ce7b9a
commit 5f3fab72a9
No known key found for this signature in database
GPG key ID: 688C4FBE25D7DEF6

View file

@ -2,7 +2,7 @@
* PROJECT: ReactOS Kernel
* LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
* PURPOSE: Security subsystem debug routines support
* COPYRIGHT: Copyright 2022 George Bișoc <george.bisoc@reactos.org>
* COPYRIGHT: Copyright 2022-2023 George Bișoc <george.bisoc@reactos.org>
*/
/* INCLUDES *******************************************************************/
@ -344,4 +344,40 @@ SepDumpAccessRightsStats(
#endif
}
/**
* @brief
* Dumps access and status values of each object type
* in the result list.
*/
VOID
SepDumpAccessAndStatusList(
_In_ PACCESS_MASK GrantedAccessList,
_In_ PNTSTATUS AccessStatusList,
_In_ BOOLEAN IsResultList,
_In_ POBJECT_TYPE_LIST_INTERNAL ObjectTypeList,
_In_ ULONG ObjectTypeListLength)
{
#ifndef NDEBUG
ULONG ResultListIndex;
ULONG ObjectTypeIndex;
ULONG ResultListLength;
DbgPrint("================== ACCESS & STATUS OBJECT TYPE LIST STATISTICS ==================\n");
ResultListLength = IsResultList ? ObjectTypeListLength : 1;
for (ResultListIndex = 0; ResultListIndex < ResultListLength; ResultListIndex++)
{
DbgPrint("Result Index #%lu, Granted access rights -> 0x%08lx, Access status -> 0x%08lx\n",
ResultListIndex, GrantedAccessList[ResultListIndex], AccessStatusList[ResultListIndex]);
}
for (ObjectTypeIndex = 0; ObjectTypeIndex < ObjectTypeListLength; ObjectTypeIndex++)
{
DbgPrint("================== #%lu OBJECT ACCESS RIGHTS ==================\n", ObjectTypeIndex);
DbgPrint("Remaining access rights -> 0x%08lx\n", ObjectTypeList[ObjectTypeIndex].ObjectAccessRights.RemainingAccessRights);
DbgPrint("Granted access rights -> 0x%08lx\n", ObjectTypeList[ObjectTypeIndex].ObjectAccessRights.GrantedAccessRights);
DbgPrint("Denied access rights -> 0x%08lx\n", ObjectTypeList[ObjectTypeIndex].ObjectAccessRights.DeniedAccessRights);
}
#endif
}
/* EOF */