SeExports is now "pass"ed
authorshort <>
Mon, 24 Mar 2003 00:14:53 +0000 (00:14 +0000)
committershort <>
Mon, 24 Mar 2003 00:14:53 +0000 (00:14 +0000)
+SeLockSubjectContext()
+SeUnlockSubjectContext()
+SeAssignSecurity()

src/libcaptive/se/semgr.c

index adfe1f1..8970003 100644 (file)
 #include "config.h"
 
 #include "reactos/ddk/setypes.h"       /* self */
+#include <glib/gmessages.h>
+#include "reactos/ddk/status.h"
+#include "reactos/ddk/exfuncs.h"       /* for ExAllocatePool() */
 
 
-static SE_EXPORTS SeExports_static;
+/**
+ * SeLockSubjectContext:
+ * @SubjectContext: Security context to read lock.
+ * %NULL value is forbidden.
+ *
+ * Obtain read locks on the security context @SubjectContext.
+ * @SubjectContext must be already acquired by SeCaptureSubjectContext().
+ *
+ * This functions is a NOP in libcaptive as there is no threading implemented.
+ * FIXME: No sanity checks are currently done by libcaptive.
+ */
+VOID SeLockSubjectContext(IN PSECURITY_SUBJECT_CONTEXT SubjectContext)
+{
+       g_return_if_fail(SubjectContext!=NULL);
+
+       /* NOP; TODO:thread */
+}
+
+
+/**
+ * SeUnlockSubjectContext:
+ * @SubjectContext: Security context to unlock.
+ * %NULL value is forbidden.
+ *
+ * Release read locks on the security context @SubjectContext.
+ * @SubjectContext must be currently locked by SeLockSubjectContext().
+ *
+ * This functions is a NOP in libcaptive as there is no threading implemented.
+ * FIXME: No sanity checks are currently done by libcaptive.
+ */
+VOID SeUnlockSubjectContext(IN PSECURITY_SUBJECT_CONTEXT SubjectContext)
+{
+       g_return_if_fail(SubjectContext!=NULL);
+
+       /* NOP; TODO:thread */
+}
+
+
+/**
+ * SeAssignSecurity:
+ * @ParentDescriptor: Optional parent object security descriptor.
+ * %NULL value is permitted.
+ * @ExplicitDescriptor: Optional overriding descriptor for the new object.
+ * FIXME: %NULL value should be permitted but it is currently forbidden by libcaptive.
+ * @NewDescriptor: Returns the new generated descriptor.
+ * %NULL value is forbidden.
+ * @IsDirectoryObject: Will the new object contain its subobjects?
+ * @SubjectContext: Security context of the caller.
+ * %NULL value is forbidden.
+ * @GenericMapping: Rights mapping (?).
+ * %NULL value is forbidden.
+ * @PoolType: #POOL_TYPE to allocate new @NewDescriptor from.
+ *
+ * libcaptive requires @ExplicitDescriptor to be presents and it simply
+ * copies it to the target @NewDescriptor.
+ *
+ * Returns: %STATUS_SUCCESS if @NewDescriptor was successfuly filled.
+ */
+NTSTATUS SeAssignSecurity(PSECURITY_DESCRIPTOR ParentDescriptor OPTIONAL,
+               PSECURITY_DESCRIPTOR ExplicitDescriptor OPTIONAL,PSECURITY_DESCRIPTOR *NewDescriptor,
+               BOOLEAN IsDirectoryObject,PSECURITY_SUBJECT_CONTEXT SubjectContext,PGENERIC_MAPPING GenericMapping,POOL_TYPE PoolType)
+{
+       g_return_val_if_fail(NewDescriptor!=NULL,STATUS_INVALID_PARAMETER);
+       g_return_val_if_fail(SubjectContext!=NULL,STATUS_INVALID_PARAMETER);
+       g_return_val_if_fail(GenericMapping!=NULL,STATUS_INVALID_PARAMETER);
+
+       /* #2  0x40067021 in SeAssignSecurity (ParentDescriptor=0x0,
+        *     ExplicitDescriptor=0xbfffe7f4, NewDescriptor=0x40b5873c,
+        *     IsDirectoryObject=0 '\0', SubjectContext=0x409d2ff0,
+        *     GenericMapping=0x40088014, PoolType=1) at semgr.c:79
+        */
+       g_return_val_if_fail(ExplicitDescriptor!=NULL,STATUS_NOT_IMPLEMENTED);  /* NOT YET IMPLEMENTED */
+
+       /* FIXME: Copy substructure recursively? */
+       *NewDescriptor=ExAllocatePool(PagedPool,sizeof(**NewDescriptor));
+       **NewDescriptor=*ExplicitDescriptor;    /* copy the contents */
 
-SE_EXPORTS *SeExports=&SeExports_static;
+       return STATUS_SUCCESS;
+}