Author: tfaber
Date: Sun Nov 2 15:41:20 2014
New Revision: 65183
URL:
http://svn.reactos.org/svn/reactos?rev=65183&view=rev
Log:
[NTOS:SE]
- Call SeAssignSecurityEx from SeAssignSecurity
- Fix a FIXME
Modified:
trunk/reactos/ntoskrnl/se/sd.c
Modified: trunk/reactos/ntoskrnl/se/sd.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/se/sd.c?rev=65183…
==============================================================================
--- trunk/reactos/ntoskrnl/se/sd.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/se/sd.c [iso-8859-1] Sun Nov 2 15:41:20 2014
@@ -1134,8 +1134,11 @@
/*
* @implemented
*/
-NTSTATUS NTAPI
-SeDeassignSecurity(PSECURITY_DESCRIPTOR *SecurityDescriptor)
+_IRQL_requires_max_(PASSIVE_LEVEL)
+NTSTATUS
+NTAPI
+SeDeassignSecurity(
+ _Inout_ PSECURITY_DESCRIPTOR *SecurityDescriptor)
{
PAGED_CODE();
@@ -1148,37 +1151,23 @@
return STATUS_SUCCESS;
}
-
-
-/*
- * @unimplemented
- */
-NTSTATUS NTAPI
-SeAssignSecurityEx(IN PSECURITY_DESCRIPTOR ParentDescriptor OPTIONAL,
- IN PSECURITY_DESCRIPTOR ExplicitDescriptor OPTIONAL,
- OUT PSECURITY_DESCRIPTOR *NewDescriptor,
- IN GUID *ObjectType OPTIONAL,
- IN BOOLEAN IsDirectoryObject,
- IN ULONG AutoInheritFlags,
- IN PSECURITY_SUBJECT_CONTEXT SubjectContext,
- IN PGENERIC_MAPPING GenericMapping,
- IN POOL_TYPE PoolType)
-{
- UNIMPLEMENTED;
- return STATUS_NOT_IMPLEMENTED;
-}
/*
* @implemented
*/
-NTSTATUS NTAPI
-SeAssignSecurity(PSECURITY_DESCRIPTOR _ParentDescriptor OPTIONAL,
- PSECURITY_DESCRIPTOR _ExplicitDescriptor OPTIONAL,
- PSECURITY_DESCRIPTOR *NewDescriptor,
- BOOLEAN IsDirectoryObject,
- PSECURITY_SUBJECT_CONTEXT SubjectContext,
- PGENERIC_MAPPING GenericMapping,
- POOL_TYPE PoolType)
+_IRQL_requires_max_(PASSIVE_LEVEL)
+NTSTATUS
+NTAPI
+SeAssignSecurityEx(
+ _In_opt_ PSECURITY_DESCRIPTOR _ParentDescriptor,
+ _In_opt_ PSECURITY_DESCRIPTOR _ExplicitDescriptor,
+ _Out_ PSECURITY_DESCRIPTOR *NewDescriptor,
+ _In_opt_ GUID *ObjectType,
+ _In_ BOOLEAN IsDirectoryObject,
+ _In_ ULONG AutoInheritFlags,
+ _In_ PSECURITY_SUBJECT_CONTEXT SubjectContext,
+ _In_ PGENERIC_MAPPING GenericMapping,
+ _In_ POOL_TYPE PoolType)
{
PISECURITY_DESCRIPTOR ParentDescriptor = _ParentDescriptor;
PISECURITY_DESCRIPTOR ExplicitDescriptor = _ExplicitDescriptor;
@@ -1196,6 +1185,11 @@
PACL Dacl = NULL;
PACL Sacl = NULL;
+ DBG_UNREFERENCED_PARAMETER(ObjectType);
+ DBG_UNREFERENCED_PARAMETER(AutoInheritFlags);
+ DBG_UNREFERENCED_PARAMETER(GenericMapping);
+ UNREFERENCED_PARAMETER(PoolType);
+
PAGED_CODE();
/* Lock subject context */
@@ -1327,7 +1321,7 @@
if (Descriptor == NULL)
{
DPRINT1("ExAlloctePool() failed\n");
- /* FIXME: Unlock subject context */
+ SeUnlockSubjectContext(SubjectContext);
return STATUS_INSUFFICIENT_RESOURCES;
}
@@ -1375,10 +1369,38 @@
*NewDescriptor = Descriptor;
- DPRINT("Descrptor %p\n", Descriptor);
+ DPRINT("Descriptor %p\n", Descriptor);
ASSERT(RtlLengthSecurityDescriptor(Descriptor));
return STATUS_SUCCESS;
}
+/*
+ * @implemented
+ */
+_IRQL_requires_max_(PASSIVE_LEVEL)
+NTSTATUS
+NTAPI
+SeAssignSecurity(
+ _In_opt_ PSECURITY_DESCRIPTOR ParentDescriptor,
+ _In_opt_ PSECURITY_DESCRIPTOR ExplicitDescriptor,
+ _Out_ PSECURITY_DESCRIPTOR *NewDescriptor,
+ _In_ BOOLEAN IsDirectoryObject,
+ _In_ PSECURITY_SUBJECT_CONTEXT SubjectContext,
+ _In_ PGENERIC_MAPPING GenericMapping,
+ _In_ POOL_TYPE PoolType)
+{
+ PAGED_CODE();
+
+ return SeAssignSecurityEx(ParentDescriptor,
+ ExplicitDescriptor,
+ NewDescriptor,
+ NULL,
+ IsDirectoryObject,
+ 0,
+ SubjectContext,
+ GenericMapping,
+ PoolType);
+}
+
/* EOF */