mirror of
https://github.com/reactos/reactos.git
synced 2025-06-27 23:39:42 +00:00
Added access right mapping
Fixed access rights svn path=/trunk/; revision=1593
This commit is contained in:
parent
5f529d5a90
commit
ec9ef6951c
10 changed files with 59 additions and 29 deletions
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: ntddk.h,v 1.18 2001/01/28 21:36:05 ekohl Exp $
|
/* $Id: ntddk.h,v 1.19 2001/02/02 20:45:36 ekohl Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -28,6 +28,7 @@ extern "C"
|
||||||
#include <ntos/types.h>
|
#include <ntos/types.h>
|
||||||
#include <ntos/disk.h>
|
#include <ntos/disk.h>
|
||||||
#include <ntos/registry.h>
|
#include <ntos/registry.h>
|
||||||
|
#include <ntos/port.h>
|
||||||
#include <napi/types.h>
|
#include <napi/types.h>
|
||||||
|
|
||||||
#include <pe.h>
|
#include <pe.h>
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
#ifndef _NTOS_H
|
#ifndef _NTOS_H
|
||||||
#define _NTOS_H
|
#define _NTOS_H
|
||||||
/* $Id: ntos.h,v 1.2 2000/06/29 23:35:11 dwelch Exp $ */
|
/* $Id: ntos.h,v 1.3 2001/02/02 20:44:00 ekohl Exp $ */
|
||||||
|
|
||||||
#include <ddk/ntddk.h>
|
#include <ddk/ntddk.h>
|
||||||
#include <ntos/heap.h>
|
#include <ntos/heap.h>
|
||||||
#include <ntos/synch.h>
|
#include <ntos/synch.h>
|
||||||
#include <ntos/keyboard.h>
|
#include <ntos/keyboard.h>
|
||||||
#include <ntos/console.h>
|
#include <ntos/console.h>
|
||||||
|
#include <ntos/port.h>
|
||||||
|
|
||||||
#endif /* ndef _NTOS_H */
|
#endif /* ndef _NTOS_H */
|
||||||
|
|
23
reactos/include/ntos/port.h
Normal file
23
reactos/include/ntos/port.h
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
/* $Id: port.h,v 1.1 2001/02/02 20:44:21 ekohl Exp $
|
||||||
|
*
|
||||||
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
|
* PROJECT: ReactOS kernel
|
||||||
|
* FILE: include/ntos/port.h
|
||||||
|
* PURPOSE: Port declarations used by all the parts of the
|
||||||
|
* system
|
||||||
|
* PROGRAMMER: Eric Kohl <ekokl@rz-online.de>
|
||||||
|
* UPDATE HISTORY:
|
||||||
|
* 02/02/2001: Created
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __INCLUDE_PORT_H
|
||||||
|
#define __INCLUDE_PORT_H
|
||||||
|
|
||||||
|
|
||||||
|
/* Port Object Access */
|
||||||
|
|
||||||
|
#define PORT_ALL_ACCESS (0x1)
|
||||||
|
|
||||||
|
#endif /* __INCLUDE_PORT_H */
|
||||||
|
|
||||||
|
/* EOF */
|
|
@ -39,11 +39,6 @@ LpcSendTerminationPort (PEPORT Port,
|
||||||
TIME CreationTime);
|
TIME CreationTime);
|
||||||
|
|
||||||
|
|
||||||
/* Port Object Access */
|
|
||||||
|
|
||||||
#define PORT_ALL_ACCESS (0x1)
|
|
||||||
|
|
||||||
|
|
||||||
/* EPORT.State */
|
/* EPORT.State */
|
||||||
|
|
||||||
#define EPORT_INACTIVE (0)
|
#define EPORT_INACTIVE (0)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: handle.c,v 1.26 2001/01/29 00:31:24 ekohl Exp $
|
/* $Id: handle.c,v 1.27 2001/02/02 20:46:36 ekohl Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -134,7 +134,7 @@ NTSTATUS STDCALL NtDuplicateObject (IN HANDLE SourceProcessHandle,
|
||||||
}
|
}
|
||||||
ObjectBody = SourceHandleRep->ObjectBody;
|
ObjectBody = SourceHandleRep->ObjectBody;
|
||||||
ObReferenceObjectByPointer(ObjectBody,
|
ObReferenceObjectByPointer(ObjectBody,
|
||||||
GENERIC_ALL,
|
0,
|
||||||
NULL,
|
NULL,
|
||||||
UserMode);
|
UserMode);
|
||||||
|
|
||||||
|
@ -199,7 +199,7 @@ VOID ObCloseAllHandles(PEPROCESS Process)
|
||||||
}
|
}
|
||||||
|
|
||||||
ObReferenceObjectByPointer(ObjectBody,
|
ObReferenceObjectByPointer(ObjectBody,
|
||||||
GENERIC_ALL,
|
0,
|
||||||
NULL,
|
NULL,
|
||||||
UserMode);
|
UserMode);
|
||||||
Header->HandleCount--;
|
Header->HandleCount--;
|
||||||
|
@ -347,7 +347,7 @@ PVOID ObDeleteHandle(PEPROCESS Process, HANDLE Handle)
|
||||||
Header = BODY_TO_HEADER(ObjectBody);
|
Header = BODY_TO_HEADER(ObjectBody);
|
||||||
BODY_TO_HEADER(ObjectBody)->HandleCount--;
|
BODY_TO_HEADER(ObjectBody)->HandleCount--;
|
||||||
ObReferenceObjectByPointer(ObjectBody,
|
ObReferenceObjectByPointer(ObjectBody,
|
||||||
GENERIC_ALL,
|
0,
|
||||||
NULL,
|
NULL,
|
||||||
UserMode);
|
UserMode);
|
||||||
Rep->ObjectBody = NULL;
|
Rep->ObjectBody = NULL;
|
||||||
|
@ -530,7 +530,7 @@ NTSTATUS STDCALL ObReferenceObjectByHandle(HANDLE Handle,
|
||||||
}
|
}
|
||||||
ObjectBody = HandleRep->ObjectBody;
|
ObjectBody = HandleRep->ObjectBody;
|
||||||
ObReferenceObjectByPointer(ObjectBody,
|
ObReferenceObjectByPointer(ObjectBody,
|
||||||
GENERIC_ALL,
|
0,
|
||||||
NULL,
|
NULL,
|
||||||
UserMode);
|
UserMode);
|
||||||
GrantedAccess = HandleRep->GrantedAccess;
|
GrantedAccess = HandleRep->GrantedAccess;
|
||||||
|
@ -550,12 +550,16 @@ NTSTATUS STDCALL ObReferenceObjectByHandle(HANDLE Handle,
|
||||||
DPRINT("Reference from %x\n", ((PULONG)&Handle)[-1]);
|
DPRINT("Reference from %x\n", ((PULONG)&Handle)[-1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((AccessMode == UserMode) &&
|
if (AccessMode == UserMode)
|
||||||
(!(GrantedAccess & DesiredAccess) &&
|
|
||||||
!((~GrantedAccess) & DesiredAccess)))
|
|
||||||
{
|
{
|
||||||
CHECKPOINT;
|
RtlMapGenericMask(&DesiredAccess, ObjectHeader->ObjectType->Mapping);
|
||||||
return(STATUS_ACCESS_DENIED);
|
|
||||||
|
if (!(GrantedAccess & DesiredAccess) &&
|
||||||
|
!((~GrantedAccess) & DesiredAccess))
|
||||||
|
{
|
||||||
|
CHECKPOINT;
|
||||||
|
return(STATUS_ACCESS_DENIED);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
*Object = ObjectBody;
|
*Object = ObjectBody;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: object.c,v 1.31 2001/01/29 00:31:24 ekohl Exp $
|
/* $Id: object.c,v 1.32 2001/02/02 20:46:36 ekohl Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -252,6 +252,10 @@ PVOID STDCALL ObCreateObject(PHANDLE Handle,
|
||||||
{
|
{
|
||||||
RtlInitUnicodeString (&RemainingPath, NULL);
|
RtlInitUnicodeString (&RemainingPath, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RtlMapGenericMask(&DesiredAccess,
|
||||||
|
Type->Mapping);
|
||||||
|
|
||||||
Header = (POBJECT_HEADER)ExAllocatePool(NonPagedPool,
|
Header = (POBJECT_HEADER)ExAllocatePool(NonPagedPool,
|
||||||
OBJECT_ALLOC_SIZE(Type));
|
OBJECT_ALLOC_SIZE(Type));
|
||||||
ObInitializeObject(Header,
|
ObInitializeObject(Header,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: create.c,v 1.29 2001/01/21 14:54:29 dwelch Exp $
|
/* $Id: create.c,v 1.30 2001/02/02 20:47:14 ekohl Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -250,7 +250,7 @@ PsReferenceImpersonationToken(PETHREAD Thread,
|
||||||
*Unknown1 = Thread->ImpersonationInfo->Unknown1;
|
*Unknown1 = Thread->ImpersonationInfo->Unknown1;
|
||||||
*Unknown2 = Thread->ImpersonationInfo->Unknown2;
|
*Unknown2 = Thread->ImpersonationInfo->Unknown2;
|
||||||
ObReferenceObjectByPointer(Thread->ImpersonationInfo->Token,
|
ObReferenceObjectByPointer(Thread->ImpersonationInfo->Token,
|
||||||
GENERIC_ALL,
|
TOKEN_ALL_ACCESS,
|
||||||
SeTokenType,
|
SeTokenType,
|
||||||
KernelMode);
|
KernelMode);
|
||||||
return(Thread->ImpersonationInfo->Token);
|
return(Thread->ImpersonationInfo->Token);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: process.c,v 1.56 2001/01/28 17:38:40 ekohl Exp $
|
/* $Id: process.c,v 1.57 2001/02/02 20:47:14 ekohl Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -111,7 +111,7 @@ NTSTATUS STDCALL NtOpenProcessToken(IN HANDLE ProcessHandle,
|
||||||
PACCESS_TOKEN STDCALL PsReferencePrimaryToken(PEPROCESS Process)
|
PACCESS_TOKEN STDCALL PsReferencePrimaryToken(PEPROCESS Process)
|
||||||
{
|
{
|
||||||
ObReferenceObjectByPointer(Process->Token,
|
ObReferenceObjectByPointer(Process->Token,
|
||||||
GENERIC_ALL,
|
TOKEN_ALL_ACCESS,
|
||||||
SeTokenType,
|
SeTokenType,
|
||||||
UserMode);
|
UserMode);
|
||||||
return(Process->Token);
|
return(Process->Token);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: token.c,v 1.9 2001/01/28 17:42:56 ekohl Exp $
|
/* $Id: token.c,v 1.10 2001/02/02 20:47:43 ekohl Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -56,7 +56,7 @@ NTSTATUS SeExchangePrimaryToken(PEPROCESS Process,
|
||||||
Process->Token = NewToken;
|
Process->Token = NewToken;
|
||||||
NewToken->TokenInUse = 1;
|
NewToken->TokenInUse = 1;
|
||||||
ObReferenceObjectByPointer(NewToken,
|
ObReferenceObjectByPointer(NewToken,
|
||||||
GENERIC_ALL,
|
TOKEN_ALL_ACCESS,
|
||||||
SeTokenType,
|
SeTokenType,
|
||||||
KernelMode);
|
KernelMode);
|
||||||
OldToken->TokenInUse = 0;
|
OldToken->TokenInUse = 0;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: init.c,v 1.21 2000/12/28 20:38:28 ekohl Exp $
|
/* $Id: init.c,v 1.22 2001/02/02 20:48:38 ekohl Exp $
|
||||||
*
|
*
|
||||||
* init.c - Session Manager initialization
|
* init.c - Session Manager initialization
|
||||||
*
|
*
|
||||||
|
@ -180,7 +180,7 @@ BOOL InitSessionManager (HANDLE Children[])
|
||||||
L"\\SmApiPort");
|
L"\\SmApiPort");
|
||||||
InitializeObjectAttributes (&ObjectAttributes,
|
InitializeObjectAttributes (&ObjectAttributes,
|
||||||
&UnicodeString,
|
&UnicodeString,
|
||||||
0xff,
|
PORT_ALL_ACCESS,
|
||||||
NULL,
|
NULL,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
@ -226,7 +226,9 @@ BOOL InitSessionManager (HANDLE Children[])
|
||||||
Status = RtlCreateEnvironment (FALSE,
|
Status = RtlCreateEnvironment (FALSE,
|
||||||
&SmSystemEnvironment);
|
&SmSystemEnvironment);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
return FALSE;
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
DisplayString (L"SM: System Environment created\n");
|
DisplayString (L"SM: System Environment created\n");
|
||||||
#endif
|
#endif
|
||||||
|
@ -378,7 +380,7 @@ BOOL InitSessionManager (HANDLE Children[])
|
||||||
L"\\DbgSsApiPort");
|
L"\\DbgSsApiPort");
|
||||||
InitializeObjectAttributes (&ObjectAttributes,
|
InitializeObjectAttributes (&ObjectAttributes,
|
||||||
&UnicodeString,
|
&UnicodeString,
|
||||||
0xff,
|
PORT_ALL_ACCESS,
|
||||||
NULL,
|
NULL,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
@ -401,7 +403,7 @@ BOOL InitSessionManager (HANDLE Children[])
|
||||||
L"\\DbgUiApiPort");
|
L"\\DbgUiApiPort");
|
||||||
InitializeObjectAttributes (&ObjectAttributes,
|
InitializeObjectAttributes (&ObjectAttributes,
|
||||||
&UnicodeString,
|
&UnicodeString,
|
||||||
0xff,
|
PORT_ALL_ACCESS,
|
||||||
NULL,
|
NULL,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue