mirror of
https://github.com/reactos/reactos.git
synced 2024-10-21 21:34:17 +00:00
e1ef078741
The idea then would be to have the following behaviour (when specifying the following options in the kernel command line): /DEBUGPORT=COMi --> load KDCOM.DLL and use COMi port (i == 1,2,3,4) if possible. /DEBUGPORT=FOO --> load KDFOO.DLL (useful for KDUSB.DLL, KD1394.DLL, KDBAZIS.DLL for VirtualKD, etc...) /DEBUGPORT=ROSDBG:[COMi|SCREEN|FILE|GDB|...] --> load KDROSDBG.DLL which contains the ROS kernel debugger, and use COMi or SCREEN or... as output port. svn path=/branches/kd++/; revision=58883
65 lines
1.6 KiB
C
65 lines
1.6 KiB
C
/* COPYRIGHT: See COPYING in the top level directory
|
|
* PROJECT: ReactOS system libraries
|
|
* FILE: lib/rtl/access.c
|
|
* PURPOSE: Access rights handling functions
|
|
* PROGRAMMERS: Eric Kohl
|
|
*/
|
|
|
|
/* INCLUDES *****************************************************************/
|
|
|
|
#include <rtl.h>
|
|
#define NDEBUG
|
|
#include <debug.h>
|
|
|
|
/* FUNCTIONS ***************************************************************/
|
|
|
|
/*
|
|
* @implemented
|
|
*/
|
|
BOOLEAN
|
|
NTAPI
|
|
RtlAreAllAccessesGranted(IN ACCESS_MASK GrantedAccess,
|
|
IN ACCESS_MASK DesiredAccess)
|
|
{
|
|
PAGED_CODE_RTL();
|
|
|
|
/* Return if there's no leftover bits after granting all of them */
|
|
return !(~GrantedAccess & DesiredAccess);
|
|
}
|
|
|
|
/*
|
|
* @implemented
|
|
*/
|
|
BOOLEAN
|
|
NTAPI
|
|
RtlAreAnyAccessesGranted(IN ACCESS_MASK GrantedAccess,
|
|
IN ACCESS_MASK DesiredAccess)
|
|
{
|
|
PAGED_CODE_RTL();
|
|
|
|
/* Return if there's any leftover bits after granting all of them */
|
|
return ((GrantedAccess & DesiredAccess) != 0);
|
|
}
|
|
|
|
/*
|
|
* @implemented
|
|
*/
|
|
VOID
|
|
NTAPI
|
|
RtlMapGenericMask(IN OUT PACCESS_MASK AccessMask,
|
|
IN PGENERIC_MAPPING GenericMapping)
|
|
{
|
|
PAGED_CODE_RTL();
|
|
|
|
/* Convert mappings */
|
|
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;
|
|
|
|
/* Clear generic flags */
|
|
*AccessMask &= ~(GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE | GENERIC_ALL);
|
|
}
|
|
|
|
/* EOF */
|