From 8a98907e4c83fac93e71f7c1e390318287fc99e4 Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Tue, 4 Nov 2014 18:40:24 +0000 Subject: [PATCH] [NTOS:SE] - Call SeSetSecurityDescriptorInfoEx from SeSetSecurityDescriptorInfo svn path=/trunk/; revision=65247 --- reactos/ntoskrnl/se/sd.c | 83 +++++++++++++++++++++++----------------- 1 file changed, 48 insertions(+), 35 deletions(-) diff --git a/reactos/ntoskrnl/se/sd.c b/reactos/ntoskrnl/se/sd.c index 983f0037730..9ae81104754 100644 --- a/reactos/ntoskrnl/se/sd.c +++ b/reactos/ntoskrnl/se/sd.c @@ -615,11 +615,14 @@ SeCaptureSecurityDescriptor( /* * @implemented */ -NTSTATUS NTAPI -SeQuerySecurityDescriptorInfo(IN PSECURITY_INFORMATION SecurityInformation, - IN OUT PSECURITY_DESCRIPTOR SecurityDescriptor, - IN OUT PULONG Length, - IN PSECURITY_DESCRIPTOR *ObjectsSecurityDescriptor OPTIONAL) +_IRQL_requires_max_(PASSIVE_LEVEL) +NTSTATUS +NTAPI +SeQuerySecurityDescriptorInfo( + _In_ PSECURITY_INFORMATION SecurityInformation, + _Out_writes_bytes_(*Length) PSECURITY_DESCRIPTOR SecurityDescriptor, + _Inout_ PULONG Length, + _Inout_ PSECURITY_DESCRIPTOR *ObjectsSecurityDescriptor) { PISECURITY_DESCRIPTOR ObjectSd; PISECURITY_DESCRIPTOR_RELATIVE RelSD; @@ -635,6 +638,8 @@ SeQuerySecurityDescriptorInfo(IN PSECURITY_INFORMATION SecurityInformation, ULONG_PTR Current; ULONG SdLength; + PAGED_CODE(); + RelSD = (PISECURITY_DESCRIPTOR_RELATIVE)SecurityDescriptor; if (*ObjectsSecurityDescriptor == NULL) @@ -781,13 +786,42 @@ SeReleaseSecurityDescriptor(IN PSECURITY_DESCRIPTOR CapturedSecurityDescriptor, /* * @implemented */ -NTSTATUS NTAPI -SeSetSecurityDescriptorInfo(IN PVOID Object OPTIONAL, - IN PSECURITY_INFORMATION _SecurityInformation, - IN PSECURITY_DESCRIPTOR _SecurityDescriptor, - IN OUT PSECURITY_DESCRIPTOR *ObjectsSecurityDescriptor, - IN POOL_TYPE PoolType, - IN PGENERIC_MAPPING GenericMapping) +_IRQL_requires_max_(PASSIVE_LEVEL) +NTSTATUS +NTAPI +SeSetSecurityDescriptorInfo( + _In_opt_ PVOID Object, + _In_ PSECURITY_INFORMATION SecurityInformation, + _In_ PSECURITY_DESCRIPTOR SecurityDescriptor, + _Inout_ PSECURITY_DESCRIPTOR *ObjectsSecurityDescriptor, + _In_ POOL_TYPE PoolType, + _In_ PGENERIC_MAPPING GenericMapping) +{ + PAGED_CODE(); + + return SeSetSecurityDescriptorInfoEx(Object, + SecurityInformation, + SecurityDescriptor, + ObjectsSecurityDescriptor, + 0, + PoolType, + GenericMapping); +} + +/* + * @implemented + */ +_IRQL_requires_max_(PASSIVE_LEVEL) +NTSTATUS +NTAPI +SeSetSecurityDescriptorInfoEx( + _In_opt_ PVOID Object, + _In_ PSECURITY_INFORMATION _SecurityInformation, + _In_ PSECURITY_DESCRIPTOR _SecurityDescriptor, + _Inout_ PSECURITY_DESCRIPTOR *ObjectsSecurityDescriptor, + _In_ ULONG AutoInheritFlags, + _In_ POOL_TYPE PoolType, + _In_ PGENERIC_MAPPING GenericMapping) { PISECURITY_DESCRIPTOR_RELATIVE ObjectSd; PISECURITY_DESCRIPTOR_RELATIVE NewSd; @@ -805,6 +839,8 @@ SeSetSecurityDescriptorInfo(IN PVOID Object OPTIONAL, ULONG Current; SECURITY_INFORMATION SecurityInformation; + PAGED_CODE(); + ObjectSd = *ObjectsSecurityDescriptor; /* The object does not have a security descriptor. */ @@ -971,29 +1007,6 @@ SeSetSecurityDescriptorInfo(IN PVOID Object OPTIONAL, return STATUS_SUCCESS; } -/* - * @unimplemented - */ -NTSTATUS -NTAPI -SeSetSecurityDescriptorInfoEx(IN PVOID Object OPTIONAL, - IN PSECURITY_INFORMATION SecurityInformation, - IN PSECURITY_DESCRIPTOR ModificationDescriptor, - IN OUT PSECURITY_DESCRIPTOR *ObjectsSecurityDescriptor, - IN ULONG AutoInheritFlags, - IN POOL_TYPE PoolType, - IN PGENERIC_MAPPING GenericMapping) -{ - PISECURITY_DESCRIPTOR ObjectSd = *ObjectsSecurityDescriptor; - - /* The object does not have a security descriptor. */ - if (!ObjectSd) - return STATUS_NO_SECURITY_ON_OBJECT; - - UNIMPLEMENTED; - return STATUS_NOT_IMPLEMENTED; -} - /* * @implemented -- 2.17.1