From 53dea75f28fb2dcb1b7c70fd798dab601d1eafb3 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Mon, 27 Jun 2005 21:11:29 +0000 Subject: [PATCH] - Add Rtl*SecurityObject stubs. - Export RtlpUnWaitCriticalSection and RtlWaitForCriticalSection. - Replace DWORDs by ULONGs. svn path=/trunk/; revision=16308 --- reactos/include/ndk/rtlfuncs.h | 61 ++++++++++++++++++-- reactos/lib/ntdll/def/ntdll.def | 12 ++-- reactos/lib/ntdll/ntdll.xml | 1 + reactos/lib/ntdll/rtl/critical.c | 6 +- reactos/lib/ntdll/rtl/secobj.c | 97 ++++++++++++++++++++++++++++++++ 5 files changed, 162 insertions(+), 15 deletions(-) create mode 100644 reactos/lib/ntdll/rtl/secobj.c diff --git a/reactos/include/ndk/rtlfuncs.h b/reactos/include/ndk/rtlfuncs.h index 2a0096a960b..e36f67546c5 100644 --- a/reactos/include/ndk/rtlfuncs.h +++ b/reactos/include/ndk/rtlfuncs.h @@ -564,6 +564,43 @@ BOOLEAN STDCALL RtlValidAcl(PACL Acl); +NTSTATUS +STDCALL +RtlDeleteSecurityObject( + IN PSECURITY_DESCRIPTOR *ObjectDescriptor +); + +NTSTATUS +STDCALL +RtlNewSecurityObject( + IN PSECURITY_DESCRIPTOR ParentDescriptor, + IN PSECURITY_DESCRIPTOR CreatorDescriptor, + OUT PSECURITY_DESCRIPTOR *NewDescriptor, + IN BOOLEAN IsDirectoryObject, + IN HANDLE Token, + IN PGENERIC_MAPPING GenericMapping +); + +NTSTATUS +STDCALL +RtlQuerySecurityObject( + IN PSECURITY_DESCRIPTOR ObjectDescriptor, + IN SECURITY_INFORMATION SecurityInformation, + OUT PSECURITY_DESCRIPTOR ResultantDescriptor, + IN ULONG DescriptorLength, + OUT PULONG ReturnLength +); + +NTSTATUS +STDCALL +RtlSetSecurityObject( + IN SECURITY_INFORMATION SecurityInformation, + IN PSECURITY_DESCRIPTOR ModificationDescriptor, + OUT PSECURITY_DESCRIPTOR *ObjectsSecurityDescriptor, + IN PGENERIC_MAPPING GenericMapping, + IN HANDLE Token +); + /* * Single-Character Functions */ @@ -1147,32 +1184,44 @@ RtlSetEnvironmentVariable( NTSTATUS STDCALL RtlDeleteCriticalSection ( - PRTL_CRITICAL_SECTION CriticalSection + IN PRTL_CRITICAL_SECTION CriticalSection ); NTSTATUS STDCALL RtlEnterCriticalSection( - PRTL_CRITICAL_SECTION CriticalSection + IN PRTL_CRITICAL_SECTION CriticalSection ); NTSTATUS STDCALL RtlInitializeCriticalSection( - PRTL_CRITICAL_SECTION CriticalSection + IN PRTL_CRITICAL_SECTION CriticalSection ); NTSTATUS STDCALL RtlInitializeCriticalSectionAndSpinCount( - PRTL_CRITICAL_SECTION CriticalSection, - ULONG SpinCount + IN PRTL_CRITICAL_SECTION CriticalSection, + IN ULONG SpinCount ); NTSTATUS STDCALL RtlLeaveCriticalSection( - PRTL_CRITICAL_SECTION CriticalSection + IN PRTL_CRITICAL_SECTION CriticalSection +); + +VOID +STDCALL +RtlpUnWaitCriticalSection( + IN PRTL_CRITICAL_SECTION CriticalSection +); + +NTSTATUS +STDCALL +RtlpWaitForCriticalSection( + IN PRTL_CRITICAL_SECTION CriticalSection ); BOOLEAN diff --git a/reactos/lib/ntdll/def/ntdll.def b/reactos/lib/ntdll/def/ntdll.def index ba8329751de..af01fb1f31b 100644 --- a/reactos/lib/ntdll/def/ntdll.def +++ b/reactos/lib/ntdll/def/ntdll.def @@ -379,7 +379,7 @@ RtlDeleteOwnersRanges@8 RtlDeleteRange@24 RtlDeleteRegistryValue@12 RtlDeleteResource@4 -;RtlDeleteSecurityObject +RtlDeleteSecurityObject@4 RtlDeleteTimer@12 RtlDeleteTimerQueue@4 RtlDeleteTimerQueueEx@8 @@ -559,7 +559,7 @@ RtlMultiByteToUnicodeN@20 RtlMultiByteToUnicodeSize@12 ;RtlNewInstanceSecurityObject ;RtlNewSecurityGrantedAccess -;RtlNewSecurityObject +RtlNewSecurityObject@24 RtlNormalizeProcessParams@4 RtlNtPathNameToDosPathName@16 RtlNtStatusToDosError@4 @@ -584,7 +584,7 @@ RtlQueryProcessDebugInformation@12 ;RtlQueryProcessHeapInformation ;RtlQueryProcessLockInformation RtlQueryRegistryValues@20 -;RtlQuerySecurityObject +RtlQuerySecurityObject@20 ;RtlQueryTagHeap RtlQueryTimeZoneInformation@4 RtlRaiseException@4 @@ -621,7 +621,7 @@ RtlSetLastWin32ErrorAndNtStatusFromNtStatus@4 RtlSetOwnerSecurityDescriptor@12 RtlSetSaclSecurityDescriptor@16 RtlSetSecurityDescriptorRMControl@8 -;RtlSetSecurityObject +RtlSetSecurityObject@20 RtlSetTimeZoneInformation@4 ;RtlSetUnicodeCallouts ;RtlSetUserFlagsHeap @@ -687,8 +687,8 @@ RtlpNtMakeTemporaryKey@4 RtlpNtOpenKey@16 RtlpNtQueryValueKey@20 RtlpNtSetValueKey@16 -;RtlpUnWaitCriticalSection -;RtlpWaitForCriticalSection +RtlpUnWaitCriticalSection@4 +RtlpWaitForCriticalSection@4 RtlxAnsiStringToUnicodeSize@4 RtlxOemStringToUnicodeSize@4 RtlxUnicodeStringToAnsiSize@4 diff --git a/reactos/lib/ntdll/ntdll.xml b/reactos/lib/ntdll/ntdll.xml index 20af2990b0c..273812b6b40 100644 --- a/reactos/lib/ntdll/ntdll.xml +++ b/reactos/lib/ntdll/ntdll.xml @@ -51,6 +51,7 @@ propvar.c rangelist.c resource.c + secobj.c teb.c timerqueue.c diff --git a/reactos/lib/ntdll/rtl/critical.c b/reactos/lib/ntdll/rtl/critical.c index de865b2272d..a7b34c40374 100644 --- a/reactos/lib/ntdll/rtl/critical.c +++ b/reactos/lib/ntdll/rtl/critical.c @@ -99,10 +99,10 @@ DWORD STDCALL RtlSetCriticalSectionSpinCount( PRTL_CRITICAL_SECTION CriticalSection, - DWORD SpinCount + ULONG SpinCount ) { - DWORD OldCount = CriticalSection->SpinCount; + ULONG OldCount = CriticalSection->SpinCount; /* Set to parameter if MP, or to 0 if this is Uniprocessor */ CriticalSection->SpinCount = (NtCurrentPeb()->NumberOfProcessors > 1) ? SpinCount : 0; @@ -214,7 +214,7 @@ NTSTATUS STDCALL RtlInitializeCriticalSectionAndSpinCount ( PRTL_CRITICAL_SECTION CriticalSection, - DWORD SpinCount) + ULONG SpinCount) { PRTL_CRITICAL_SECTION_DEBUG CritcalSectionDebugData; diff --git a/reactos/lib/ntdll/rtl/secobj.c b/reactos/lib/ntdll/rtl/secobj.c new file mode 100644 index 00000000000..6cc513ba28e --- /dev/null +++ b/reactos/lib/ntdll/rtl/secobj.c @@ -0,0 +1,97 @@ +/* + * ReactOS kernel + * Copyright (C) 2005 Eric Kohl + * + * 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; either version 2 of the License, or + * (at your option) any later version. + * + * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * PURPOSE: Security object implementation + * FILE: lib/ntdll/rtl/secobj.c + */ + +/* INCLUDES ****************************************************************/ + +#include +#define NDEBUG +#include + +/* + * @implemented + */ +NTSTATUS +STDCALL +RtlDeleteSecurityObject(IN PSECURITY_DESCRIPTOR *ObjectDescriptor) +{ + DPRINT("RtlDeleteSecurityObject(%p)\n", ObjectDescriptor); + + RtlFreeHeap(RtlGetProcessHeap(), + 0, + *ObjectDescriptor); + + return STATUS_SUCCESS; +} + + +/* + * @unimplemented + */ +NTSTATUS +STDCALL +RtlNewSecurityObject(IN PSECURITY_DESCRIPTOR ParentDescriptor, + IN PSECURITY_DESCRIPTOR CreatorDescriptor, + OUT PSECURITY_DESCRIPTOR *NewDescriptor, + IN BOOLEAN IsDirectoryObject, + IN HANDLE Token, + IN PGENERIC_MAPPING GenericMapping) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + + +/* + * @unimplemented + */ +NTSTATUS +STDCALL +RtlQuerySecurityObject(IN PSECURITY_DESCRIPTOR ObjectDescriptor, + IN SECURITY_INFORMATION SecurityInformation, + OUT PSECURITY_DESCRIPTOR ResultantDescriptor, + IN ULONG DescriptorLength, + OUT PULONG ReturnLength) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + + +/* + * @unimplemented + */ +NTSTATUS +STDCALL +RtlSetSecurityObject(IN SECURITY_INFORMATION SecurityInformation, + IN PSECURITY_DESCRIPTOR ModificationDescriptor, + OUT PSECURITY_DESCRIPTOR *ObjectsSecurityDescriptor, + IN PGENERIC_MAPPING GenericMapping, + IN HANDLE Token) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* EOF */