Move RtlAreAllAccessesGranted, RtlAreAnyAccessesGranted and RtlMapGenericMask to the shared runtime library.

svn path=/trunk/; revision=14723
This commit is contained in:
Eric Kohl 2005-04-20 20:58:16 +00:00
parent 4dd2fef625
commit 37d076fdc0
5 changed files with 73 additions and 135 deletions

View file

@ -63,7 +63,6 @@ RTL_I386_OBJECTS = \
rtl/i386/ftol.o
RTL_OBJECTS = \
rtl/access.o \
rtl/apc.o \
rtl/atom.o \
rtl/callback.o \

View file

@ -1,70 +0,0 @@
/* $Id$
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* PURPOSE: Access rights handling functions
* FILE: lib/ntdll/rtl/access.c
* PROGRAMER: Eric Kohl <ekohl@rz-online.de>
* REVISION HISTORY:
* 06/04/2000: Created
*/
/* INCLUDES *****************************************************************/
#include <ddk/ntddk.h>
#include <ntdll/ntdll.h>
/* FUNCTIONS ***************************************************************/
BOOLEAN
STDCALL
RtlAreAllAccessesGranted (
ACCESS_MASK GrantedAccess,
ACCESS_MASK DesiredAccess
)
{
return ((GrantedAccess & DesiredAccess) == DesiredAccess);
}
/*
* @implemented
*/
BOOLEAN
STDCALL
RtlAreAnyAccessesGranted (
ACCESS_MASK GrantedAccess,
ACCESS_MASK DesiredAccess
)
{
return ((GrantedAccess & DesiredAccess) != 0);
}
/*
* @implemented
*/
VOID
STDCALL
RtlMapGenericMask (
PACCESS_MASK AccessMask,
PGENERIC_MAPPING GenericMapping
)
{
if (*AccessMask & GENERIC_READ)
*AccessMask |= GenericMapping->GenericRead;
if (*AccessMask & GENERIC_WRITE)
*AccessMask |= GenericMapping->GenericWrite;
if (*AccessMask & GENERIC_EXECUTE)
*AccessMask |= GenericMapping->GenericExecute;
if (*AccessMask & GENERIC_ALL)
*AccessMask |= GenericMapping->GenericAll;
*AccessMask &= 0x0FFFFFFF;
}
/* EOF */

68
reactos/lib/rtl/access.c Normal file
View file

@ -0,0 +1,68 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: lib/rtl/access.c
* PURPOSE: Access rights handling functions
*
* PROGRAMMERS: Eric Kohl
*/
/* INCLUDES *****************************************************************/
#include <ddk/ntddk.h>
#include <ntdll/rtl.h>
#define NDEBUG
#include <debug.h>
/* FUNCTIONS ***************************************************************/
/*
* @implemented
*/
BOOLEAN STDCALL
RtlAreAllAccessesGranted(ACCESS_MASK GrantedAccess,
ACCESS_MASK DesiredAccess)
{
PAGED_CODE_RTL();
return ((GrantedAccess & DesiredAccess) == DesiredAccess);
}
/*
* @implemented
*/
BOOLEAN STDCALL
RtlAreAnyAccessesGranted(ACCESS_MASK GrantedAccess,
ACCESS_MASK DesiredAccess)
{
PAGED_CODE_RTL();
return ((GrantedAccess & DesiredAccess) != 0);
}
/*
* @implemented
*/
VOID STDCALL
RtlMapGenericMask(PACCESS_MASK AccessMask,
PGENERIC_MAPPING GenericMapping)
{
PAGED_CODE_RTL();
if (*AccessMask & GENERIC_READ)
*AccessMask |= GenericMapping->GenericRead;
if (*AccessMask & GENERIC_WRITE)
*AccessMask |= GenericMapping->GenericWrite;
if (*AccessMask & GENERIC_EXECUTE)
*AccessMask |= GenericMapping->GenericExecute;
if (*AccessMask & GENERIC_ALL)
*AccessMask |= GenericMapping->GenericAll;
*AccessMask &= ~(GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE | GENERIC_ALL);
}
/* EOF */

View file

@ -17,6 +17,7 @@ TARGET_CFLAGS += -DDBG
endif
TARGET_OBJECTS = \
access.o \
acl.o \
ppb.o \
bit.o \

View file

@ -1,11 +1,10 @@
/* $Id$
*
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: ntoskrnl/se/access.c
* PURPOSE: Access rights handling functions
*
* PROGRAMMERS: Eric Kohl <eric.kohl@t-online.de>
* PURPOSE: Access state functions
*
* PROGRAMMERS: Eric Kohl
*/
/* INCLUDES *****************************************************************/
@ -16,65 +15,6 @@
/* FUNCTIONS ***************************************************************/
/*
* @implemented
*/
BOOLEAN
STDCALL
RtlAreAllAccessesGranted (
ACCESS_MASK GrantedAccess,
ACCESS_MASK DesiredAccess
)
{
PAGED_CODE_RTL();
return ((GrantedAccess & DesiredAccess) == DesiredAccess);
}
/*
* @implemented
*/
BOOLEAN
STDCALL
RtlAreAnyAccessesGranted (
ACCESS_MASK GrantedAccess,
ACCESS_MASK DesiredAccess
)
{
PAGED_CODE_RTL();
return ((GrantedAccess & DesiredAccess) != 0);
}
/*
* @implemented
*/
VOID
STDCALL
RtlMapGenericMask (
PACCESS_MASK AccessMask,
PGENERIC_MAPPING GenericMapping
)
{
PAGED_CODE_RTL();
if (*AccessMask & GENERIC_READ)
*AccessMask |= GenericMapping->GenericRead;
if (*AccessMask & GENERIC_WRITE)
*AccessMask |= GenericMapping->GenericWrite;
if (*AccessMask & GENERIC_EXECUTE)
*AccessMask |= GenericMapping->GenericExecute;
if (*AccessMask & GENERIC_ALL)
*AccessMask |= GenericMapping->GenericAll;
*AccessMask &= ~(GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE | GENERIC_ALL);
}
/*
* @unimplemented
*/