/* $Id$ * reactos security thin manager emulation of libcaptive * Copyright (C) 2002 Jan Kratochvil * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; exactly version 2 of June 1991 is required * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "config.h" #include "reactos/ddk/setypes.h" /* self */ #include #include "reactos/ddk/status.h" #include "reactos/ddk/exfuncs.h" /* for ExAllocatePool() */ /** * 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 */ return STATUS_SUCCESS; }