From 05bf1339f91ebecbcc0db394e3ceb91cdd8c2918 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Wed, 5 Apr 2000 01:41:01 +0000 Subject: [PATCH] Added ace, acl and sid functions svn path=/trunk/; revision=1104 --- reactos/include/ddk/sefuncs.h | 29 ++++- reactos/lib/advapi32/advapi32.edf | 30 ++--- reactos/lib/advapi32/makefile | 4 +- reactos/lib/advapi32/sec/ac.c | 151 ++++++++++++++++++++----- reactos/lib/advapi32/sec/sid.c | 181 ++++++++++++++++++++++++++++++ reactos/lib/ntdll/def/ntdll.def | 16 +-- reactos/lib/ntdll/def/ntdll.edf | 9 +- reactos/lib/ntdll/rtl/acl.c | 79 ++++++++++++- 8 files changed, 442 insertions(+), 57 deletions(-) create mode 100644 reactos/lib/advapi32/sec/sid.c diff --git a/reactos/include/ddk/sefuncs.h b/reactos/include/ddk/sefuncs.h index c4c387663b8..b8088e11275 100644 --- a/reactos/include/ddk/sefuncs.h +++ b/reactos/include/ddk/sefuncs.h @@ -1,6 +1,17 @@ #ifndef _INCLUDE_DDK_SEFUNCS_H #define _INCLUDE_DDK_SEFUNCS_H -/* $Id: sefuncs.h,v 1.6 2000/03/12 01:18:18 ekohl Exp $ */ +/* $Id: sefuncs.h,v 1.7 2000/04/05 01:38:05 ekohl Exp $ */ +NTSTATUS STDCALL RtlCreateAcl(PACL Acl, ULONG AclSize, ULONG AclRevision); +NTSTATUS STDCALL RtlQueryInformationAcl (PACL Acl, PVOID Information, ULONG InformationLength, ACL_INFORMATION_CLASS InformationClass); +NTSTATUS STDCALL RtlSetInformationAcl (PACL Acl, PVOID Information, ULONG InformationLength, ACL_INFORMATION_CLASS InformationClass); +BOOLEAN STDCALL RtlValidAcl (PACL Acl); +NTSTATUS STDCALL RtlAddAccessAllowedAce(PACL Acl, ULONG Revision, ACCESS_MASK AccessMask, PSID Sid); +NTSTATUS STDCALL RtlAddAccessDeniedAce(PACL Acl, ULONG Revision, ACCESS_MASK AccessMask, PSID Sid); +NTSTATUS STDCALL RtlAddAce(PACL Acl, ULONG Revision, ULONG StartingIndex, PACE AceList, ULONG AceListLength); +NTSTATUS STDCALL RtlAddAuditAccessAce (PACL Acl, ULONG Revision, ACCESS_MASK AccessMask, PSID Sid, BOOLEAN Success, BOOLEAN Failure); +NTSTATUS STDCALL RtlDeleteAce(PACL Acl, ULONG AceIndex); +BOOLEAN STDCALL RtlFirstFreeAce(PACL Acl, PACE* Ace); +NTSTATUS STDCALL RtlGetAce(PACL Acl, ULONG AceIndex, PACE *Ace); NTSTATUS STDCALL RtlCreateSecurityDescriptor (PSECURITY_DESCRIPTOR SecurityDescriptor, ULONG Revision); BOOLEAN STDCALL RtlValidSecurityDescriptor (PSECURITY_DESCRIPTOR SecurityDescriptor); ULONG STDCALL RtlLengthSecurityDescriptor (PSECURITY_DESCRIPTOR SecurityDescriptor); @@ -10,12 +21,28 @@ NTSTATUS STDCALL RtlSetOwnerSecurityDescriptor (PSECURITY_DESCRIPTOR SecurityDes NTSTATUS STDCALL RtlGetOwnerSecurityDescriptor (PSECURITY_DESCRIPTOR SecurityDescriptor, PSID* Owner, PBOOLEAN OwnerDefaulted); NTSTATUS STDCALL RtlSetGroupSecurityDescriptor (PSECURITY_DESCRIPTOR SecurityDescriptor, PSID Group, BOOLEAN GroupDefaulted); NTSTATUS STDCALL RtlGetGroupSecurityDescriptor (PSECURITY_DESCRIPTOR SecurityDescriptor, PSID* Group, PBOOLEAN GroupDefaulted); +NTSTATUS STDCALL RtlAllocateAndInitializeSid (PSID_IDENTIFIER_AUTHORITY IdentifierAuthority, + UCHAR SubAuthorityCount, + ULONG SubAuthority0, + ULONG SubAuthority1, + ULONG SubAuthority2, + ULONG SubAuthority3, + ULONG SubAuthority4, + ULONG SubAuthority5, + ULONG SubAuthority6, + ULONG SubAuthority7, + PSID *Sid); ULONG STDCALL RtlLengthRequiredSid (UCHAR SubAuthorityCount); +PSID_IDENTIFIER_AUTHORITY STDCALL RtlIdentifierAuthoritySid (PSID Sid); NTSTATUS STDCALL RtlInitializeSid (PSID Sid, PSID_IDENTIFIER_AUTHORITY IdentifierAuthority, UCHAR SubAuthorityCount); PULONG STDCALL RtlSubAuthoritySid (PSID Sid, ULONG SubAuthority); NTSTATUS STDCALL RtlCopySid (ULONG BufferLength, PSID Dest, PSID Src); +BOOLEAN STDCALL RtlEqualPrefixSid (PSID Sid1, PSID Sid2); BOOLEAN STDCALL RtlEqualSid(PSID Sid1, PSID Sid2); +PSID STDCALL RtlFreeSid (PSID Sid); ULONG STDCALL RtlLengthSid (PSID Sid); +PULONG STDCALL RtlSubAuthoritySid (PSID Sid, ULONG SubAuthority); +PUCHAR STDCALL RtlSubAuthorityCountSid (PSID Sid); BOOLEAN STDCALL RtlValidSid (PSID Sid); NTSTATUS STDCALL RtlAbsoluteToSelfRelativeSD (PSECURITY_DESCRIPTOR AbsSD, PSECURITY_DESCRIPTOR RelSD, PULONG BufferLength); BOOLEAN STDCALL SeAccessCheck (IN PSECURITY_DESCRIPTOR SecurityDescriptor, diff --git a/reactos/lib/advapi32/advapi32.edf b/reactos/lib/advapi32/advapi32.edf index e728fbd58b3..71533a2a3e5 100644 --- a/reactos/lib/advapi32/advapi32.edf +++ b/reactos/lib/advapi32/advapi32.edf @@ -1,4 +1,4 @@ -; $Id: advapi32.edf,v 1.6 2000/03/18 13:48:24 ekohl Exp $ +; $Id: advapi32.edf,v 1.7 2000/04/05 01:40:35 ekohl Exp $ ; ; advapi32.def ; @@ -13,13 +13,13 @@ AbortSystemShutdownW=AbortSystemShutdownW@4 AccessCheck=AccessCheck@32 ;AccessCheckAndAuditAlarmA=AccessCheckAndAuditAlarmA@44 ;AccessCheckAndAuditAlarmW=AccessCheckAndAuditAlarmW@44 -;AddAccessAllowedAce=AddAccessAllowedAce@16 -;AddAccessDeniedAce=AddAccessDeniedAce@16 +AddAccessAllowedAce=AddAccessAllowedAce@16 +AddAccessDeniedAce=AddAccessDeniedAce@16 AddAce=AddAce@20 AddAuditAccessAce=AddAuditAccessAce@24 AdjustTokenGroups=AdjustTokenGroups@24 AdjustTokenPrivileges=AdjustTokenPrivileges@24 -;AllocateAndInitializeSid=AllocateAndInitializeSid@44 +AllocateAndInitializeSid=AllocateAndInitializeSid@44 ;AllocateLocallyUniqueId=AllocateLocallyUniqueId@4 ;AreAllAccessesGranted=AreAllAccessesGranted@8 ;AreAnyAccessesGranted=AreAnyAccessesGranted@8 @@ -45,7 +45,7 @@ ChangeServiceConfigW=ChangeServiceConfigW@44 ;ClearEventLogW=ClearEventLogW@8 CloseServiceHandle=CloseServiceHandle@4 ControlService=ControlService@12 -;CopySid=CopySid@12 +CopySid=CopySid@12 ;CreatePrivateObjectSecurity=CreatePrivateObjectSecurity@24 ;CreateProcessAsUserA=CreateProcessAsUserA@44 ;CreateProcessAsUserW=CreateProcessAsUserW@44 @@ -111,10 +111,10 @@ EnumDependentServicesW=EnumDependentServicesW@24 EnumServiceGroupW=EnumServiceGroupW@36 EnumServicesStatusA=EnumServicesStatusA@32 EnumServicesStatusW=EnumServicesStatusW@32 -;EqualPrefixSid=EqualPrefixSid@8 -;EqualSid=EqualSid@8 +EqualPrefixSid=EqualPrefixSid@8 +EqualSid=EqualSid@8 FindFirstFreeAce=FindFirstFreeAce@8 -;FreeSid=FreeSid@4 +FreeSid=FreeSid@4 GetAce=GetAce@12 GetAclInformation=GetAclInformation@16 ;GetAuditedPermissionsFromAclA=GetAuditedPermissionsFromAclA@16 @@ -136,7 +136,7 @@ GetAclInformation=GetAclInformation@16 ;GetFileSecurityA=GetFileSecurityA@20 ;GetFileSecurityW=GetFileSecurityW@20 ;GetKernelObjectSecurity=GetKernelObjectSecurity@20 -;GetLengthSid=GetLengthSid@4 +GetLengthSid=GetLengthSid@4 ;GetMultipleTrusteeA=GetMultipleTrusteeA@4 ;GetMultipleTrusteeOperationA=GetMultipleTrusteeOperationA@4 ;GetMultipleTrusteeOperationW=GetMultipleTrusteeOperationW@4 @@ -157,10 +157,10 @@ GetServiceDisplayNameA=GetServiceDisplayNameA@16 GetServiceDisplayNameW=GetServiceDisplayNameW@16 GetServiceKeyNameA=GetServiceKeyNameA@16 GetServiceKeyNameW=GetServiceKeyNameW@16 -;GetSidIdentifierAuthority=GetSidIdentifierAuthority@4 -;GetSidLengthRequired=GetSidLengthRequired@4 -;GetSidSubAuthority=GetSidSubAuthority@8 -;GetSidSubAuthorityCount=GetSidSubAuthorityCount@4 +GetSidIdentifierAuthority=GetSidIdentifierAuthority@4 +GetSidLengthRequired=GetSidLengthRequired@4 +GetSidSubAuthority=GetSidSubAuthority@8 +GetSidSubAuthorityCount=GetSidSubAuthorityCount@4 GetTokenInformation=GetTokenInformation@20 ;GetTrusteeForm=GetTrusteeForm@4 ;GetTrusteeNameA=GetTrusteeNameA@4 @@ -179,7 +179,7 @@ GetTokenInformation=GetTokenInformation@20 ;ImpersonateSelf=ImpersonateSelf@4 InitializeAcl=InitializeAcl@12 InitializeSecurityDescriptor=InitializeSecurityDescriptor@8 -;InitializeSid=InitializeSid@12 +InitializeSid=InitializeSid@12 InitiateSystemShutdownA=InitiateSystemShutdownA@20 InitiateSystemShutdownW=InitiateSystemShutdownW@20 ;IsAccessPermittedA=IsAccessPermittedA@20 @@ -187,7 +187,7 @@ InitiateSystemShutdownW=InitiateSystemShutdownW@20 ;IsTextUnicode=IsTextUnicode@12 IsValidAcl=IsValidAcl@4 IsValidSecurityDescriptor=IsValidSecurityDescriptor@4 -;IsValidSid=IsValidSid@4 +IsValidSid=IsValidSid@4 LockServiceDatabase=LockServiceDatabase@4 ;LogonUserA=LogonUserA@24 ;LogonUserW=LogonUserW@24 diff --git a/reactos/lib/advapi32/makefile b/reactos/lib/advapi32/makefile index 9ae8090566f..dc0963855b1 100644 --- a/reactos/lib/advapi32/makefile +++ b/reactos/lib/advapi32/makefile @@ -1,4 +1,4 @@ -# $Id: makefile,v 1.11 2000/03/26 22:00:07 dwelch Exp $ +# $Id: makefile,v 1.12 2000/04/05 01:40:35 ekohl Exp $ # # Makefile for ReactOS advapi32.dll # @@ -23,7 +23,7 @@ MISC_OBJECTS = misc/dllmain.o misc/shutdown.o \ REGISTRY_OBJECTS = reg/reg.o -SECURITY_OBJECTS = sec/lsa.o sec/sec.o sec/ac.o +SECURITY_OBJECTS = sec/lsa.o sec/sec.o sec/ac.o sec/sid.o SERVICE_OBJECTS = service/scm.o service/sctrl.o service/undoc.o diff --git a/reactos/lib/advapi32/sec/ac.c b/reactos/lib/advapi32/sec/ac.c index 8f219091b14..3cba5142d2d 100644 --- a/reactos/lib/advapi32/sec/ac.c +++ b/reactos/lib/advapi32/sec/ac.c @@ -1,10 +1,13 @@ -/* $Id: ac.c,v 1.1 1999/11/07 08:04:55 ea Exp $ +/* $Id: ac.c,v 1.2 2000/04/05 01:41:01 ekohl Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries * FILE: lib/advapi32/sec/ac.c * PURPOSE: ACL/ACE functions */ + +#include +#include #include @@ -19,8 +22,19 @@ GetAclInformation ( ACL_INFORMATION_CLASS dwAclInformationClass ) { - SetLastError (ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + NTSTATUS Status; + + Status = RtlQueryInformationAcl (pAcl, + pAclInformation, + nAclInformationLength, + dwAclInformationClass); + if (!NT_SUCCESS(Status)) + { + SetLastError (RtlNtStatusToDosError (Status)); + return FALSE; + } + + return TRUE; } @@ -114,8 +128,18 @@ InitializeAcl ( DWORD dwAclRevision ) { - SetLastError (ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + NTSTATUS Status; + + Status = RtlCreateAcl (pAcl, + nAclLength, + dwAclRevision); + if (!NT_SUCCESS(Status)) + { + SetLastError (RtlNtStatusToDosError (Status)); + return FALSE; + } + + return TRUE; } @@ -125,8 +149,7 @@ IsValidAcl ( PACL pAcl ) { - SetLastError (ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + return RtlValidAcl (pAcl); } @@ -139,8 +162,19 @@ SetAclInformation ( ACL_INFORMATION_CLASS dwAclInformationClass ) { - SetLastError (ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + NTSTATUS Status; + + Status = RtlSetInformationAcl (pAcl, + pAclInformation, + nAclInformationLength, + dwAclInformationClass); + if (!NT_SUCCESS(Status)) + { + SetLastError (RtlNtStatusToDosError (Status)); + return FALSE; + } + + return TRUE; } @@ -177,8 +211,6 @@ SetEntriesInAclW ( /* --- ACE --- */ - - WINBOOL STDCALL AddAccessAllowedAce ( @@ -188,10 +220,20 @@ AddAccessAllowedAce ( PSID pSid ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; -} + NTSTATUS Status; + Status = RtlAddAccessAllowedAce (pAcl, + dwAceRevision, + AccessMask, + pSid); + if (!NT_SUCCESS(Status)) + { + SetLastError (RtlNtStatusToDosError (Status)); + return FALSE; + } + + return TRUE; +} WINBOOL @@ -203,8 +245,19 @@ AddAccessDeniedAce ( PSID pSid ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + NTSTATUS Status; + + Status = RtlAddAccessDeniedAce (pAcl, + dwAceRevision, + AccessMask, + pSid); + if (!NT_SUCCESS(Status)) + { + SetLastError (RtlNtStatusToDosError (Status)); + return FALSE; + } + + return TRUE; } @@ -218,10 +271,21 @@ AddAce ( DWORD nAceListLength ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; -} + NTSTATUS Status; + Status = RtlAddAce (pAcl, + dwAceRevision, + dwStartingAceIndex, + pAceList, + nAceListLength); + if (!NT_SUCCESS(Status)) + { + SetLastError (RtlNtStatusToDosError (Status)); + return FALSE; + } + + return TRUE; +} WINBOOL @@ -235,8 +299,21 @@ AddAuditAccessAce ( WINBOOL bAuditFailure ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + NTSTATUS Status; + + Status = RtlAddAuditAccessAce (pAcl, + dwAceRevision, + dwAccessMask, + pSid, + bAuditSuccess, + bAuditFailure); + if (!NT_SUCCESS(Status)) + { + SetLastError (RtlNtStatusToDosError (Status)); + return FALSE; + } + + return TRUE; } @@ -247,8 +324,17 @@ DeleteAce ( DWORD dwAceIndex ) { - SetLastError (ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + NTSTATUS Status; + + Status = RtlDeleteAce (pAcl, + dwAceIndex); + if (!NT_SUCCESS(Status)) + { + SetLastError (RtlNtStatusToDosError (Status)); + return FALSE; + } + + return TRUE; } @@ -259,8 +345,8 @@ FindFirstFreeAce ( LPVOID * pAce ) { - SetLastError (ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + return RtlFirstFreeAce (pAcl, + (PACE*)pAce); } @@ -272,9 +358,18 @@ GetAce ( LPVOID * pAce ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + NTSTATUS Status; + + Status = RtlGetAce (pAcl, + dwAceIndex, + (PACE*)pAce); + if (!NT_SUCCESS(Status)) + { + SetLastError (RtlNtStatusToDosError (Status)); + return FALSE; + } + + return TRUE; } - /* EOF */ diff --git a/reactos/lib/advapi32/sec/sid.c b/reactos/lib/advapi32/sec/sid.c new file mode 100644 index 00000000000..b8bc4601ccd --- /dev/null +++ b/reactos/lib/advapi32/sec/sid.c @@ -0,0 +1,181 @@ +/* $Id: sid.c,v 1.1 2000/04/05 01:41:01 ekohl Exp $ + * + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * FILE: lib/advapi32/sec/sid.c + * PURPOSE: Security ID functions + */ + +#include +#include +#include + + +BOOL +STDCALL +AllocateAndInitializeSid ( + PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority, + BYTE nSubAuthorityCount, + DWORD dwSubAuthority0, + DWORD dwSubAuthority1, + DWORD dwSubAuthority2, + DWORD dwSubAuthority3, + DWORD dwSubAuthority4, + DWORD dwSubAuthority5, + DWORD dwSubAuthority6, + DWORD dwSubAuthority7, + PSID *pSid +) +{ + NTSTATUS Status; + + Status = RtlAllocateAndInitializeSid (pIdentifierAuthority, + nSubAuthorityCount, + dwSubAuthority0, + dwSubAuthority1, + dwSubAuthority2, + dwSubAuthority3, + dwSubAuthority4, + dwSubAuthority5, + dwSubAuthority6, + dwSubAuthority7, + pSid); + if (!NT_SUCCESS(Status)) + { + SetLastError (RtlNtStatusToDosError (Status)); + return FALSE; + } + + return TRUE; + +} + +BOOL +STDCALL +CopySid ( + DWORD nDestinationSidLength, + PSID pDestinationSid, + PSID pSourceSid +) +{ + NTSTATUS Status; + + Status = RtlCopySid (nDestinationSidLength, + pDestinationSid, + pSourceSid); + if (!NT_SUCCESS(Status)) + { + SetLastError (RtlNtStatusToDosError (Status)); + return FALSE; + } + + return TRUE; +} + +WINBOOL +STDCALL +EqualPrefixSid ( + PSID pSid1, + PSID pSid2 + ) +{ + return RtlEqualPrefixSid (pSid1, pSid2); +} + +WINBOOL +STDCALL +EqualSid ( + PSID pSid1, + PSID pSid2 + ) +{ + return RtlEqualSid (pSid1, pSid2); +} + +PVOID +STDCALL +FreeSid ( + PSID pSid + ) +{ + return RtlFreeSid (pSid); +} + +DWORD +STDCALL +GetLengthSid ( + PSID pSid + ) +{ + return (DWORD)RtlLengthSid (pSid); +} + +PSID_IDENTIFIER_AUTHORITY +STDCALL +GetSidIdentifierAuthority ( + PSID pSid + ) +{ + return RtlIdentifierAuthoritySid (pSid); +} + +DWORD +STDCALL +GetSidLengthRequired ( + UCHAR nSubAuthorityCount + ) +{ + return (DWORD)RtlLengthRequiredSid (nSubAuthorityCount); +} + +PDWORD +STDCALL +GetSidSubAuthority ( + PSID pSid, + DWORD nSubAuthority + ) +{ + return (PDWORD)RtlSubAuthoritySid (pSid, nSubAuthority); +} + +PUCHAR +STDCALL +GetSidSubAuthorityCount ( + PSID pSid + ) +{ + return RtlSubAuthorityCountSid (pSid); +} + +WINBOOL +STDCALL +InitializeSid ( + PSID Sid, + PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority, + BYTE nSubAuthorityCount + ) +{ + NTSTATUS Status; + + Status = RtlInitializeSid (Sid, + pIdentifierAuthority, + nSubAuthorityCount); + if (!NT_SUCCESS(Status)) + { + SetLastError (RtlNtStatusToDosError (Status)); + return FALSE; + } + + return TRUE; +} + +WINBOOL +STDCALL +IsValidSid ( + PSID pSid + ) +{ + return (WINBOOL)RtlValidSid (pSid); +} + +/* EOF */ diff --git a/reactos/lib/ntdll/def/ntdll.def b/reactos/lib/ntdll/def/ntdll.def index 8aba51ce8c3..30cf53f94e7 100644 --- a/reactos/lib/ntdll/def/ntdll.def +++ b/reactos/lib/ntdll/def/ntdll.def @@ -1,4 +1,4 @@ -; $Id: ntdll.def,v 1.48 2000/03/22 18:35:50 dwelch Exp $ +; $Id: ntdll.def,v 1.49 2000/04/05 01:38:50 ekohl Exp $ ; ; ReactOS Operating System ; @@ -233,12 +233,12 @@ RtlAcquirePebLock@0 ;RtlAcqureResourceExclusive ;RtlAcqureResourceShared RtlAddAccessAllowedAce@16 -;RtlAddAccessDeniedAce +RtlAddAccessDeniedAce@16 RtlAddAce@20 ;RtlAddActionToRXact ;RtlAtomToAtomTable ;RtlAddAttributeActionToRXact -;RtlAddAuditAccessToAce +RtlAddAuditAccessAce@24 ;RtlAddCompoundAce ;RtlAdjustPrivilege RtlAllocateAndInitializeSid@44 @@ -306,7 +306,7 @@ RtlDeNormalizeProcessParams@4 ;RtlDecompressBuffer ;RtlDecompressFragment ;RtlDelete -;RtlDeleteAce +RtlDeleteAce@8 ;RtlDeleteAtomFromAtomTable RtlDeleteCriticalSection@4 ;RtlDeleteElementGenericTable @@ -369,7 +369,7 @@ RtlFreeSid@4 RtlFreeUnicodeString@4 ;RtlFreeUserThreadStack ;RtlGenerate8dot3Name -;RtlGetAce +RtlGetAce@12 ;RtlGetCallersAddress ;RtlGetCompressionWorkSpaceSize RtlGetControlSecurityDescriptor@12 @@ -458,7 +458,7 @@ RtlOemToUnicodeN@20 ;RtlProtectHeap ;RtlQueryAtomInAtomTable RtlQueryEnvironmentVariable_U@12 -;RtlQueryInformationAcl +RtlQueryInformationAcl@16 ;RtlQueryProcessBackTraceInformation ;RtlQueryProcessDebugInformation ;RtlQueryProcessHeapInformation @@ -493,7 +493,7 @@ RtlSetCurrentEnvironment@8 RtlSetDaclSecurityDescriptor@16 RtlSetEnvironmentVariable@12 RtlSetGroupSecurityDescriptor@12 -;RtlSetInformationAcl +RtlSetInformationAcl@16 RtlSetOwnerSecurityDescriptor@12 ;RtlSetProperties ;RtlSetPropertyNames @@ -542,7 +542,7 @@ RtlUpcaseUnicodeToOemN@20 RtlUpperChar@4 RtlUpperString@8 ;RtlUsageHeap -;RtlValidAcl +RtlValidAcl@4 RtlValidSecurityDescriptor@4 RtlValidSid@4 RtlValidateHeap@12 diff --git a/reactos/lib/ntdll/def/ntdll.edf b/reactos/lib/ntdll/def/ntdll.edf index 43fc1fa7f5d..3be10f0a7a5 100644 --- a/reactos/lib/ntdll/def/ntdll.edf +++ b/reactos/lib/ntdll/def/ntdll.edf @@ -1,4 +1,4 @@ -; $Id: ntdll.edf,v 1.37 2000/03/22 18:35:51 dwelch Exp $ +; $Id: ntdll.edf,v 1.38 2000/04/05 01:38:50 ekohl Exp $ ; ; ReactOS Operating System ; @@ -226,7 +226,9 @@ NtYieldExecution=NtYieldExecution@0 RtlAbsoluteToSelfRelativeSD=RtlAbsoluteToSelfRelativeSD@12 RtlAcquirePebLock=RtlAcquirePebLock@0 RtlAddAccessAllowedAce=RtlAddAccessAllowedAce@16 +RtlAddAccessDeniedAce=RtlAddAccessDeniedAce@16 RtlAddAce=RtlAddAce@20 +RtlAddAuditAccessAce=RtlAddAuditAccessAce@24 RtlAllocateAndInitializeSid=RtlAllocateAndInitializeSid@44 RtlAllocateHeap=RtlAllocateHeap@12 RtlAnsiCharToUnicodeChar=RtlAnsiCharToUnicodeChar@4 @@ -259,6 +261,7 @@ RtlCreateUnicodeStringFromAsciiz=RtlCreateUnicodeStringFromAsciiz@8 RtlCreateUserProcess=RtlCreateUserProcess@40 RtlCreateUserThread=RtlCreateUserThread@40 RtlDeNormalizeProcessParams=RtlDeNormalizeProcessParams@4 +RtlDeleteAce=RtlDeleteAce@8 RtlDeleteCriticalSection=RtlDeleteCriticalSection@4 RtlDestroyEnvironment=RtlDestroyEnvironment@4 RtlDestroyHeap=RtlDestroyHeap@4 @@ -294,6 +297,7 @@ RtlFreeAnsiString=RtlFreeAnsiString@4 RtlFreeHeap=RtlFreeHeap@12 RtlFreeSid=RtlFreeSid@4 RtlFreeUnicodeString=RtlFreeUnicodeString@4 +RtlGetAce=RtlGetAce@12 RtlGetControlSecurityDescriptor=RtlGetControlSecurityDescriptor@12 RtlGetCurrentDirectory_U=RtlGetCurrentDirectory_U@8 RtlGetDaclSecurityDescriptor=RtlGetDaclSecurityDescriptor@16 @@ -342,6 +346,7 @@ RtlOemStringToUnicodeSize=RtlOemStringToUnicodeSize@4 RtlOemStringToUnicodeString=RtlOemStringToUnicodeString@12 RtlOemToUnicodeN=RtlOemToUnicodeN@20 RtlQueryEnvironmentVariable_U=RtlQueryEnvironmentVariable_U@12 +RtlQueryInformationAcl=RtlQueryInformationAcl@16 RtlReAllocateHeap=RtlReAllocateHeap@16 RtlReleasePebLock=RtlReleasePebLock@0 RtlSecondsSince1970ToTime=RtlSecondsSince1970ToTime@8 @@ -353,6 +358,7 @@ RtlSetCurrentEnvironment=RtlSetCurrentEnvironment@8 RtlSetDaclSecurityDescriptor=RtlSetDaclSecurityDescriptor@16 RtlSetEnvironmentVariable=RtlSetEnvironmentVariable@12 RtlSetGroupSecurityDescriptor=RtlSetGroupSecurityDescriptor@12 +RtlSetInformationAcl=RtlSetInformationAcl@16 RtlSetOwnerSecurityDescriptor=RtlSetOwnerSecurityDescriptor@12 RtlSizeHeap=RtlSizeHeap@12 RtlSubAuthorityCountSid=RtlSubAuthorityCountSid@4 @@ -382,6 +388,7 @@ RtlUpcaseUnicodeToMultiByteN=RtlUpcaseUnicodeToMultiByteN@20 RtlUpcaseUnicodeToOemN=RtlUpcaseUnicodeToOemN@20 RtlUpperChar=RtlUpperChar@4 RtlUpperString=RtlUpperString@8 +RtlValidAcl=RtlValidAcl@4 RtlValidSecurityDescriptor=RtlValidSecurityDescriptor@4 RtlValidSid=RtlValidSid@4 RtlValidateHeap=RtlValidateHeap@12 diff --git a/reactos/lib/ntdll/rtl/acl.c b/reactos/lib/ntdll/rtl/acl.c index bbfedb7fedd..c64591ed553 100644 --- a/reactos/lib/ntdll/rtl/acl.c +++ b/reactos/lib/ntdll/rtl/acl.c @@ -1,4 +1,4 @@ -/* $Id: acl.c,v 1.1 2000/03/12 01:17:59 ekohl Exp $ +/* $Id: acl.c,v 1.2 2000/04/05 01:39:41 ekohl Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -24,7 +24,7 @@ RtlFirstFreeAce(PACL Acl, PACE* Ace) PACE Current; PVOID AclEnd; ULONG i; - + Current = (PACE)(Acl + 1); *Ace = NULL; i = 0; @@ -58,6 +58,14 @@ RtlFirstFreeAce(PACL Acl, PACE* Ace) return(TRUE); } +NTSTATUS +STDCALL +RtlGetAce(PACL Acl, ULONG AceIndex, PACE *Ace) +{ + UNIMPLEMENTED; + return STATUS_UNSUCCESSFUL; +} + NTSTATUS RtlpAddKnownAce(PACL Acl, ULONG Revision, @@ -115,6 +123,18 @@ RtlAddAccessAllowedAce ( return(RtlpAddKnownAce(Acl, Revision, AccessMask, Sid, 0)); } +NTSTATUS +STDCALL +RtlAddAccessDeniedAce ( + PACL Acl, + ULONG Revision, + ACCESS_MASK AccessMask, + PSID Sid + ) +{ + return(RtlpAddKnownAce(Acl, Revision, AccessMask, Sid, 1)); +} + NTSTATUS STDCALL RtlAddAce ( @@ -184,6 +204,28 @@ RtlAddAce ( return(TRUE); } +NTSTATUS +STDCALL +RtlAddAuditAccessAce ( + PACL Acl, + ULONG Revision, + ACCESS_MASK AccessMask, + PSID Sid, + BOOLEAN Success, + BOOLEAN Failure + ) +{ + UNIMPLEMENTED; + return STATUS_UNSUCCESSFUL; +} + +NTSTATUS +STDCALL +RtlDeleteAce(PACL Acl, ULONG AceIndex) +{ + UNIMPLEMENTED; + return STATUS_UNSUCCESSFUL; +} NTSTATUS STDCALL @@ -211,5 +253,38 @@ RtlCreateAcl(PACL Acl, ULONG AclSize, ULONG AclRevision) return(STATUS_SUCCESS); } +NTSTATUS +STDCALL +RtlQueryInformationAcl ( + PACL Acl, + PVOID Information, + ULONG InformationLength, + ACL_INFORMATION_CLASS InformationClass + ) +{ + UNIMPLEMENTED; + return STATUS_UNSUCCESSFUL; +} + +NTSTATUS +STDCALL +RtlSetInformationAcl ( + PACL Acl, + PVOID Information, + ULONG InformationLength, + ACL_INFORMATION_CLASS InformationClass + ) +{ + UNIMPLEMENTED; + return STATUS_UNSUCCESSFUL; +} + +BOOLEAN +STDCALL +RtlValidAcl (PACL Acl) +{ + UNIMPLEMENTED; + return FALSE; +} /* EOF */