mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 06:25:49 +00:00
[NTOSKRNL] Implement SeComputeQuotaInformationSize()
This commit is contained in:
parent
19cabfc763
commit
2ce071d19a
2 changed files with 48 additions and 0 deletions
|
@ -485,6 +485,12 @@ SeReleaseSidAndAttributesArray(
|
||||||
_In_ KPROCESSOR_MODE AccessMode,
|
_In_ KPROCESSOR_MODE AccessMode,
|
||||||
_In_ BOOLEAN CaptureIfKernel);
|
_In_ BOOLEAN CaptureIfKernel);
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
NTAPI
|
||||||
|
SeComputeQuotaInformationSize(
|
||||||
|
_In_ PSECURITY_DESCRIPTOR SecurityDescriptor,
|
||||||
|
_Out_ PULONG QuotaInfoSize);
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
SepCaptureAcl(
|
SepCaptureAcl(
|
||||||
|
|
|
@ -1429,4 +1429,46 @@ SeAssignSecurity(
|
||||||
PoolType);
|
PoolType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*/
|
||||||
|
_IRQL_requires_max_(PASSIVE_LEVEL)
|
||||||
|
NTSTATUS
|
||||||
|
NTAPI
|
||||||
|
SeComputeQuotaInformationSize(
|
||||||
|
_In_ PSECURITY_DESCRIPTOR SecurityDescriptor,
|
||||||
|
_Out_ PULONG QuotaInfoSize)
|
||||||
|
{
|
||||||
|
PSID Group;
|
||||||
|
PACL Dacl;
|
||||||
|
|
||||||
|
PAGED_CODE();
|
||||||
|
|
||||||
|
*QuotaInfoSize = 0;
|
||||||
|
|
||||||
|
/* Validate security descriptor revision */
|
||||||
|
if (((PISECURITY_DESCRIPTOR)SecurityDescriptor)->Revision != SECURITY_DESCRIPTOR_REVISION1)
|
||||||
|
{
|
||||||
|
return STATUS_UNKNOWN_REVISION;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Get group and DACL, if any */
|
||||||
|
Group = SepGetGroupFromDescriptor(SecurityDescriptor);
|
||||||
|
Dacl = SepGetDaclFromDescriptor(SecurityDescriptor);
|
||||||
|
|
||||||
|
/* Return SID length if any */
|
||||||
|
if (Group != NULL)
|
||||||
|
{
|
||||||
|
*QuotaInfoSize = ALIGN_UP_BY(RtlLengthSid(Group), sizeof(ULONG));
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Return DACL if any */
|
||||||
|
if (Dacl != NULL)
|
||||||
|
{
|
||||||
|
*QuotaInfoSize += ALIGN_UP_BY(Dacl->AclSize, sizeof(ULONG));
|
||||||
|
}
|
||||||
|
|
||||||
|
return STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue