Added some rtl functions

svn path=/trunk/; revision=1122
This commit is contained in:
Eric Kohl 2000-04-15 23:14:32 +00:00
parent 86a1100180
commit 8b7920f796
14 changed files with 543 additions and 32 deletions

View file

@ -1,4 +1,4 @@
/* $Id: rtl.h,v 1.31 2000/04/14 01:42:07 ekohl Exp $
/* $Id: rtl.h,v 1.32 2000/04/15 23:12:26 ekohl Exp $
*
*/
@ -992,6 +992,22 @@ RtlOemToUnicodeN (
ULONG OemSize
);
BOOLEAN
STDCALL
RtlPrefixString (
PANSI_STRING String1,
PANSI_STRING String2,
BOOLEAN CaseInsensitive
);
BOOLEAN
STDCALL
RtlPrefixUnicodeString (
PUNICODE_STRING String1,
PUNICODE_STRING String2,
BOOLEAN CaseInsensitive
);
NTSTATUS
STDCALL
RtlQueryRegistryValues (

View file

@ -1,6 +1,6 @@
#ifndef _INCLUDE_DDK_SEFUNCS_H
#define _INCLUDE_DDK_SEFUNCS_H
/* $Id: sefuncs.h,v 1.9 2000/04/06 02:27:17 ekohl Exp $ */
/* $Id: sefuncs.h,v 1.10 2000/04/15 23:12:26 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);
@ -63,6 +63,7 @@ ULONG STDCALL RtlLengthSid (PSID Sid);
PULONG STDCALL RtlSubAuthoritySid (PSID Sid, ULONG SubAuthority);
PUCHAR STDCALL RtlSubAuthorityCountSid (PSID Sid);
BOOLEAN STDCALL RtlValidSid (PSID Sid);
NTSTATUS STDCALL RtlConvertSidToUnicodeString (PUNICODE_STRING String, PSID Sid, BOOLEAN AllocateBuffer);
BOOLEAN STDCALL RtlAreAllAccessesGranted (ACCESS_MASK GrantedAccess, ACCESS_MASK DesiredAccess);
BOOLEAN STDCALL RtlAreAnyAccessesGranted (ACCESS_MASK GrantedAccess, ACCESS_MASK DesiredAccess);

View file

@ -1,4 +1,4 @@
/* $Id: rtl.h,v 1.14 2000/04/07 12:45:02 ekohl Exp $
/* $Id: rtl.h,v 1.15 2000/04/15 23:11:42 ekohl Exp $
*
*/
@ -65,12 +65,35 @@ RtlCompactHeap (
DWORD flags
);
BOOLEAN
STDCALL
RtlEqualComputerName (
IN PUNICODE_STRING ComputerName1,
IN PUNICODE_STRING ComputerName2
);
BOOLEAN
STDCALL
RtlEqualDomainName (
IN PUNICODE_STRING DomainName1,
IN PUNICODE_STRING DomainName2
);
VOID
STDCALL
RtlEraseUnicodeString (
IN PUNICODE_STRING String
);
NTSTATUS
STDCALL
RtlLargeIntegerToChar (
IN PLARGE_INTEGER Value,
IN ULONG Base,
IN ULONG Length,
IN OUT PCHAR String
);
/* Path functions */
ULONG

View file

@ -1,4 +1,4 @@
; $Id: ntdll.def,v 1.51 2000/04/14 01:43:20 ekohl Exp $
; $Id: ntdll.def,v 1.52 2000/04/15 23:10:02 ekohl Exp $
;
; ReactOS Operating System
;
@ -280,10 +280,10 @@ RtlCompareUnicodeString@12
;RtlConvertExclusiveToShared
RtlConvertLongToLargeInteger@4
;RtlConvertSharedToExclusive
;RtlConvertSidToUnicodeString
RtlConvertSidToUnicodeString@12
;RtlConvertUiListToApiList
RtlConvertUlongToLargeInteger@4
;RtlCopyLuid
RtlCopyLuid@8
;RtlCopyLuidAndAttributesArray
;RtlCopySecurityDescriptor
RtlCopySid@12
@ -341,9 +341,9 @@ RtlEnterCriticalSection@4
;RtlEnumerateGenericTable
;RtlEnumerateGenericTableWithoutSplaying
;RtlEnumerateProperties
;RtlEqualComputerName
;RtlEqualDomainName
;RtlEqualLuid
RtlEqualComputerName@8
RtlEqualDomainName@8
RtlEqualLuid@8
RtlEqualPrefixSid@8
RtlEqualSid@8
RtlEqualString@12
@ -429,7 +429,7 @@ RtlLargeIntegerNegate@8
RtlLargeIntegerShiftLeft@12
RtlLargeIntegerShiftRight@12
RtlLargeIntegerSubtract@16
;RtlLargeIntegerToChar
RtlLargeIntegerToChar@16
RtlLeaveCriticalSection@4
RtlLengthRequiredSid@4
RtlLengthSecurityDescriptor@4
@ -458,8 +458,8 @@ RtlOemToUnicodeN@20
;RtlOpenCurrentUser
;RtlPcToFileHeader
;RtlPinAtomInAtomTable
;RtlPrefixString
;RtlPrefixUnicodeString
RtlPrefixString@12
RtlPrefixUnicodeString@12
;RtlPropertySetNameToGuid
;RtlProtectHeap
;RtlQueryAtomInAtomTable

View file

@ -1,4 +1,4 @@
; $Id: ntdll.edf,v 1.40 2000/04/14 01:43:20 ekohl Exp $
; $Id: ntdll.edf,v 1.41 2000/04/15 23:10:02 ekohl Exp $
;
; ReactOS Operating System
;
@ -256,7 +256,9 @@ RtlCompareMemoryUlong=RtlCompareMemoryUlong@12
RtlCompareString=RtlCompareString@12
RtlCompareUnicodeString=RtlCompareUnicodeString@12
RtlConvertLongToLargeInteger=RtlConvertLongToLargeInteger@4
RtlConvertSidToUnicodeString=RtlConvertSidToUnicodeString@12
RtlConvertUlongToLargeInteger=RtlConvertUlongToLargeInteger@4
RtlCopyLuid=RtlCopyLuid@8
RtlCopySid=RtlCopySid@12
RtlCopyString=RtlCopyString@8
RtlCopyUnicodeString=RtlCopyUnicodeString@8
@ -284,6 +286,9 @@ RtlEnlargedIntegerMultiply=RtlEnlargedIntegerMultiply@8
RtlEnlargedUnsignedDivide=RtlEnlargedUnsignedDivide@16
RtlEnlargedUnsignedMultiply=RtlEnlargedUnsignedMultiply@8
RtlEnterCriticalSection=RtlEnterCriticalSection@4
RtlEqualComputerName=RtlEqualComputerName@8
RtlEqualDomainName=RtlEqualDomainName@8
RtlEqualLuid=RtlEqualLuid@8
RtlEqualPrefixSid=RtlEqualPrefixSid@8
RtlEqualSid=RtlEqualSid@8
RtlEqualString=RtlEqualString@12
@ -339,6 +344,7 @@ RtlLargeIntegerNegate=RtlLargeIntegerNegate@8
RtlLargeIntegerShiftLeft=RtlLargeIntegerShiftLeft@12
RtlLargeIntegerShiftRight=RtlLargeIntegerShiftRight@12
RtlLargeIntegerSubtract=RtlLargeIntegerSubtract@16
RtlLargeIntegerToChar=RtlLargeIntegerToChar@16
RtlLeaveCriticalSection=RtlLeaveCriticalSection@4
RtlLengthRequiredSid=RtlLengthRequiredSid@4
RtlLengthSecurityDescriptor=RtlLengthSecurityDescriptor@4
@ -358,6 +364,8 @@ RtlNumberOfSetBits=RtlNumberOfSetBits@4
RtlOemStringToUnicodeSize=RtlOemStringToUnicodeSize@4
RtlOemStringToUnicodeString=RtlOemStringToUnicodeString@12
RtlOemToUnicodeN=RtlOemToUnicodeN@20
RtlPrefixString=RtlPrefixString@12
RtlPrefixUnicodeString=RtlPrefixUnicodeString@12
RtlQueryEnvironmentVariable_U=RtlQueryEnvironmentVariable_U@12
RtlQueryInformationAcl=RtlQueryInformationAcl@16
RtlReAllocateHeap=RtlReAllocateHeap@16

View file

@ -1,4 +1,4 @@
# $Id: makefile,v 1.44 2000/04/14 01:45:17 ekohl Exp $
# $Id: makefile,v 1.45 2000/04/15 23:09:39 ekohl Exp $
#
# ReactOS Operating System
#
@ -31,7 +31,7 @@ RTL_OBJECTS = rtl/critical.o rtl/error.o rtl/heap.o rtl/largeint.o \
rtl/math.o rtl/mem.o rtl/nls.o rtl/process.o rtl/sd.o \
rtl/thread.o rtl/unicode.o rtl/env.o rtl/path.o rtl/ppb.o \
rtl/bitmap.o rtl/time.o rtl/acl.o rtl/sid.o rtl/image.o \
rtl/access.o
rtl/access.o rtl/luid.o
STDIO_OBJECTS = stdio/sprintf.o stdio/swprintf.o

View file

@ -0,0 +1,48 @@
/* $Id: luid.c,v 1.1 2000/04/15 23:10:41 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* PURPOSE: Locally unique identifier (LUID) helper functions
* FILE: lib/ntdll/rtl/luid.c
* PROGRAMER: Eric Kohl <ekohl@zr-online.de>
* REVISION HISTORY:
* 15/04/2000: Created
*/
/* INCLUDES *****************************************************************/
#include <ddk/ntddk.h>
#include <internal/debug.h>
/* FUNCTIONS *****************************************************************/
VOID
STDCALL
RtlCopyLuid (
PLUID LuidDest,
PLUID LuidSrc
)
{
LuidDest->QuadPart = LuidSrc->QuadPart;
}
#if 0
RtlCopyLuidAndAttributesArray (
)
{
}
#endif
BOOLEAN
STDCALL
RtlEqualLuid (
PLUID Luid1,
PLUID Luid2
)
{
return ((Luid1->QuadPart == Luid2->QuadPart) ? TRUE : FALSE);
}
/* EOF */

View file

@ -1,9 +1,9 @@
/* $Id: sid.c,v 1.1 2000/03/12 01:17:59 ekohl Exp $
/* $Id: sid.c,v 1.2 2000/04/15 23:10:41 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* PURPOSE: Security manager
* FILE: kernel/se/sid.c
* FILE: lib/ntdll/rtl/sid.c
* PROGRAMER: David Welch <welch@cwcom.net>
* REVISION HISTORY:
* 26/07/98: Added stubs for security functions
@ -186,5 +186,77 @@ RtlEqualPrefixSid (
}
NTSTATUS
STDCALL
RtlConvertSidToUnicodeString (
PUNICODE_STRING String,
PSID Sid,
BOOLEAN AllocateBuffer
)
{
WCHAR Buffer[256];
PWSTR wcs;
ULONG Length;
BYTE i;
if (RtlValidSid (Sid) == FALSE)
return STATUS_INVALID_SID;
wcs = Buffer;
wcs += swprintf (wcs, L"S-%u-", Sid->Revision);
if (!Sid->IdentifierAuthority.Value[0] &&
!Sid->IdentifierAuthority.Value[1])
{
wcs += swprintf (wcs,
L"%u",
(DWORD)Sid->IdentifierAuthority.Value[2] << 24 |
(DWORD)Sid->IdentifierAuthority.Value[3] << 16 |
(DWORD)Sid->IdentifierAuthority.Value[4] << 8 |
(DWORD)Sid->IdentifierAuthority.Value[5]);
}
else
{
wcs += swprintf (wcs,
L"0x%02hx%02hx%02hx%02hx%02hx%02hx",
Sid->IdentifierAuthority.Value[0],
Sid->IdentifierAuthority.Value[1],
Sid->IdentifierAuthority.Value[2],
Sid->IdentifierAuthority.Value[3],
Sid->IdentifierAuthority.Value[4],
Sid->IdentifierAuthority.Value[5]);
}
for (i = 0; i < Sid->SubAuthorityCount; i++)
{
wcs += swprintf (wcs,
L"-%u",
Sid->SubAuthority[0]);
}
Length = (wcs - Buffer) * sizeof(WCHAR);
if(AllocateBuffer)
{
String->Buffer = RtlAllocateHeap (RtlGetProcessHeap (),
0,
Length + sizeof(WCHAR));
if (String->Buffer == NULL)
return STATUS_NO_MEMORY;
String->MaximumLength = Length + sizeof(WCHAR);
}
else
{
if (Length > String->MaximumLength)
return STATUS_BUFFER_TOO_SMALL;
}
String->Length = Length;
memmove (String->Buffer,
Buffer,
Length);
if (Length < String->MaximumLength)
String->Buffer[Length] = 0;
return STATUS_SUCCESS;
}
/* EOF */

View file

@ -1,4 +1,4 @@
/* $Id: unicode.c,v 1.14 2000/02/19 19:31:41 ekohl Exp $
/* $Id: unicode.c,v 1.15 2000/04/15 23:10:41 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -10,6 +10,7 @@
*/
#include <ddk/ntddk.h>
#include <ntdll/rtl.h>
//#include <internal/nls.h>
#include <ctype.h>
@ -546,6 +547,47 @@ RtlDowncaseUnicodeString (
}
BOOLEAN
STDCALL
RtlEqualComputerName (
IN PUNICODE_STRING ComputerName1,
IN PUNICODE_STRING ComputerName2
)
{
return RtlEqualDomainName (ComputerName1,
ComputerName2);
}
BOOLEAN
STDCALL
RtlEqualDomainName (
IN PUNICODE_STRING DomainName1,
IN PUNICODE_STRING DomainName2
)
{
OEM_STRING OemString1;
OEM_STRING OemString2;
BOOLEAN Result;
RtlUpcaseUnicodeStringToOemString (&OemString1,
DomainName1,
TRUE);
RtlUpcaseUnicodeStringToOemString (&OemString2,
DomainName2,
TRUE);
Result = RtlEqualString (&OemString1,
&OemString2,
FALSE);
RtlFreeOemString (&OemString1);
RtlFreeOemString (&OemString2);
return Result;
}
BOOLEAN
STDCALL
RtlEqualString (
@ -789,7 +831,7 @@ RtlIntegerToChar (
{
ULONG Radix;
CHAR temp[33];
ULONG v = 0;
ULONG v = Value;
ULONG i;
PCHAR tp;
PCHAR sp;
@ -857,6 +899,54 @@ RtlIntegerToUnicodeString (
}
NTSTATUS
STDCALL
RtlLargeIntegerToChar (
IN PLARGE_INTEGER Value,
IN ULONG Base,
IN ULONG Length,
IN OUT PCHAR String
)
{
ULONG Radix;
CHAR temp[65];
ULONGLONG v = Value->QuadPart;
ULONG i;
PCHAR tp;
PCHAR sp;
Radix = Base;
if (Radix == 0)
Radix = 10;
if ((Radix != 2) && (Radix != 8) &&
(Radix != 10) && (Radix != 16))
return STATUS_INVALID_PARAMETER;
tp = temp;
while (v || tp == temp)
{
i = v % Radix;
v = v / Radix;
if (i < 10)
*tp = i + '0';
else
*tp = i + 'a' - 10;
tp++;
}
if (tp - temp >= Length)
return STATUS_BUFFER_TOO_SMALL;
sp = String;
while (tp > temp)
*sp++ = *--tp;
*sp = 0;
return STATUS_SUCCESS;
}
ULONG
STDCALL
RtlOemStringToUnicodeSize (
@ -934,6 +1024,93 @@ RtlOemStringToUnicodeString (
}
BOOLEAN
STDCALL
RtlPrefixString (
PANSI_STRING String1,
PANSI_STRING String2,
BOOLEAN CaseInsensitive
)
{
PCHAR pc1;
PCHAR pc2;
ULONG Length;
if (String2->Length < String1->Length)
return FALSE;
Length = String1->Length;
pc1 = String1->Buffer;
pc2 = String2->Buffer;
if (pc1 && pc2)
{
if (CaseInsensitive)
{
while (Length--)
{
if (RtlUpperChar (*pc1++) != RtlUpperChar (*pc2++))
return FALSE;
}
}
else
{
while (Length--)
{
if (*pc1++ != *pc2++)
return FALSE;
}
}
return TRUE;
}
return FALSE;
}
BOOLEAN
STDCALL
RtlPrefixUnicodeString (
PUNICODE_STRING String1,
PUNICODE_STRING String2,
BOOLEAN CaseInsensitive
)
{
PWCHAR pc1;
PWCHAR pc2;
ULONG Length;
if (String2->Length < String1->Length)
return FALSE;
Length = String1->Length / 2;
pc1 = String1->Buffer;
pc2 = String2->Buffer;
if (pc1 && pc2)
{
if (CaseInsensitive)
{
while (Length--)
{
if (RtlUpcaseUnicodeChar (*pc1++)
!= RtlUpcaseUnicodeChar (*pc2++))
return FALSE;
}
}
else
{
while (Length--)
{
if( *pc1++ != *pc2++ )
return FALSE;
}
}
return TRUE;
}
return FALSE;
}
ULONG
STDCALL
RtlUnicodeStringToAnsiSize (

View file

@ -1,4 +1,4 @@
; $Id: ntoskrnl.def,v 1.67 2000/04/08 19:08:05 ekohl Exp $
; $Id: ntoskrnl.def,v 1.68 2000/04/15 23:13:17 ekohl Exp $
;
; reactos/ntoskrnl/ntoskrnl.def
;
@ -444,7 +444,7 @@ RtlCopyLuid@8
RtlCopySid@12
RtlCopyString@8
RtlCopyUnicodeString@8
;RtlCreateAcl
RtlCreateAcl@12
;RtlCreateAtomTable
;RtlCreateHeap
;RtlCreateRegistryKey
@ -514,7 +514,7 @@ RtlInitializeSid@12
;RtlInsertUnicodePrefix
RtlIntegerToChar@16
RtlIntegerToUnicodeString@12
;RtlIsNamelegalDOS8Dot3
;RtlIsNameLegalDOS8Dot3
RtlLargeIntegerAdd@16
RtlLargeIntegerArithmeticShift@12
RtlLargeIntegerDivide@20
@ -542,8 +542,8 @@ RtlOemStringToUnicodeSize@4
RtlOemStringToUnicodeString@12
RtlOemToUnicodeN@20
;RtlPinAtomInAtomTable
;RtlPrefixString
;RtlPrefixUnicodeString
RtlPrefixString@12
RtlPrefixUnicodeString@12
;RtlQueryAtomInAtomTable
;RtlQueryRegistryValues
;RtlQueryTimeZoneInformation
@ -558,7 +558,7 @@ RtlSetBits@12
RtlSetDaclSecurityDescriptor@16
RtlSetGroupSecurityDescriptor@12
RtlSetOwnerSecurityDescriptor@12
;RtlSetSaclSecurityDescriptor
RtlSetSaclSecurityDescriptor@16
;RtlSetTimeZoneInformation
;RtlSplay
RtlSubAuthorityCountSid@4

View file

@ -1,4 +1,4 @@
; $Id: ntoskrnl.edf,v 1.54 2000/04/08 19:08:05 ekohl Exp $
; $Id: ntoskrnl.edf,v 1.55 2000/04/15 23:13:17 ekohl Exp $
;
; reactos/ntoskrnl/ntoskrnl.def
;
@ -434,6 +434,7 @@ RtlCopyLuid=RtlCopyLuid@8
RtlCopySid=RtlCopySid@12
RtlCopyString=RtlCopyString@8
RtlCopyUnicodeString=RtlCopyUnicodeString@8
RtlCreateAcl=RtlCreateAcl@12
RtlCreateSecurityDescriptor=RtlCreateSecurityDescriptor@8
RtlCreateUnicodeString=RtlCreateUnicodeString@8
RtlDowncaseUnicodeString=RtlDowncaseUnicodeString@12
@ -491,6 +492,8 @@ RtlNumberOfSetBits=RtlNumberOfSetBits@4
RtlOemStringToCountedUnicodeString=RtlOemStringToCountedUnicodeString@12
RtlOemStringToUnicodeSize=RtlOemStringToUnicodeSize@4
RtlOemStringToUnicodeString=RtlOemStringToUnicodeString@12
RtlPrefixString=RtlPrefixString@12
RtlPrefixUnicodeString=RtlPrefixUnicodeString@12
RtlSecondsSince1970ToTime=RtlSecondsSince1970ToTime@8
RtlSecondsSince1980ToTime=RtlSecondsSince1980ToTime@8
RtlSetAllBits=RtlSetAllBits@4
@ -498,6 +501,7 @@ RtlSetBits=RtlSetBits@12
RtlSetDaclSecurityDescriptor=RtlSetDaclSecurityDescriptor@16
RtlSetGroupSecurityDescriptor=RtlSetGroupSecurityDescriptor@12
RtlSetOwnerSecurityDescriptor=RtlSetOwnerSecurityDescriptor@12
RtlSetSaclSecurityDescriptor=RtlSetSaclSecurityDescriptor@16
RtlSubAuthorityCountSid=RtlSubAuthorityCountSid@4
RtlSubAuthoritySid=RtlSubAuthoritySid@8
RtlTimeFieldsToTime=RtlTimeFieldsToTime@8

View file

@ -1,4 +1,4 @@
/* $Id: unicode.c,v 1.14 2000/03/03 00:48:50 ekohl Exp $
/* $Id: unicode.c,v 1.15 2000/04/15 23:13:48 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -957,6 +957,93 @@ RtlOemStringToUnicodeString (
}
BOOLEAN
STDCALL
RtlPrefixString (
PANSI_STRING String1,
PANSI_STRING String2,
BOOLEAN CaseInsensitive
)
{
PCHAR pc1;
PCHAR pc2;
ULONG Length;
if (String2->Length < String1->Length)
return FALSE;
Length = String1->Length;
pc1 = String1->Buffer;
pc2 = String2->Buffer;
if (pc1 && pc2)
{
if (CaseInsensitive)
{
while (Length--)
{
if (RtlUpperChar (*pc1++) != RtlUpperChar (*pc2++))
return FALSE;
}
}
else
{
while (Length--)
{
if (*pc1++ != *pc2++)
return FALSE;
}
}
return TRUE;
}
return FALSE;
}
BOOLEAN
STDCALL
RtlPrefixUnicodeString (
PUNICODE_STRING String1,
PUNICODE_STRING String2,
BOOLEAN CaseInsensitive
)
{
PWCHAR pc1;
PWCHAR pc2;
ULONG Length;
if (String2->Length < String1->Length)
return FALSE;
Length = String1->Length / 2;
pc1 = String1->Buffer;
pc2 = String2->Buffer;
if (pc1 && pc2)
{
if (CaseInsensitive)
{
while (Length--)
{
if (RtlUpcaseUnicodeChar (*pc1++)
!= RtlUpcaseUnicodeChar (*pc2++))
return FALSE;
}
}
else
{
while (Length--)
{
if( *pc1++ != *pc2++ )
return FALSE;
}
}
return TRUE;
}
return FALSE;
}
ULONG
STDCALL
RtlUnicodeStringToAnsiSize(IN PUNICODE_STRING UnicodeString)

View file

@ -1,4 +1,4 @@
/* $Id: sd.c,v 1.2 1999/12/26 17:22:19 ea Exp $
/* $Id: sd.c,v 1.3 2000/04/15 23:14:32 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -275,6 +275,83 @@ NTSTATUS STDCALL RtlGetGroupSecurityDescriptor (PSECURITY_DESCRIPTOR SecurityDes
return(STATUS_SUCCESS);
}
NTSTATUS
STDCALL
RtlGetSaclSecurityDescriptor (
PSECURITY_DESCRIPTOR SecurityDescriptor,
PBOOLEAN SaclPresent,
PACL *Sacl,
PBOOLEAN SaclDefaulted)
{
if (SecurityDescriptor->Revision != 1)
{
return(STATUS_UNSUCCESSFUL);
}
if (!(SecurityDescriptor->Control & SE_SACL_PRESENT))
{
*SaclPresent = 0;
return(STATUS_SUCCESS);
}
*SaclPresent = 1;
if (SecurityDescriptor->Sacl == NULL)
{
*Sacl = NULL;
}
else
{
if (SecurityDescriptor->Control & SE_SELF_RELATIVE)
{
*Sacl = (PACL)((ULONG)SecurityDescriptor->Sacl +
(PVOID)SecurityDescriptor);
}
else
{
*Sacl = SecurityDescriptor->Sacl;
}
}
if (SecurityDescriptor->Control & SE_SACL_DEFAULTED)
{
*SaclDefaulted = 1;
}
else
{
*SaclDefaulted = 0;
}
return(STATUS_SUCCESS);
}
NTSTATUS
STDCALL
RtlSetSaclSecurityDescriptor (
PSECURITY_DESCRIPTOR SecurityDescriptor,
BOOLEAN SaclPresent,
PACL Sacl,
BOOLEAN SaclDefaulted
)
{
if (SecurityDescriptor->Revision != 1)
{
return(STATUS_UNSUCCESSFUL);
}
if (SecurityDescriptor->Control & SE_SELF_RELATIVE)
{
return(STATUS_UNSUCCESSFUL);
}
if (!SaclPresent)
{
SecurityDescriptor->Control = SecurityDescriptor->Control & ~(SE_SACL_PRESENT);
return(STATUS_SUCCESS);
}
SecurityDescriptor->Control = SecurityDescriptor->Control | SE_SACL_PRESENT;
SecurityDescriptor->Sacl = Sacl;
SecurityDescriptor->Control = SecurityDescriptor->Control & ~(SE_SACL_DEFAULTED);
if (SaclDefaulted)
{
SecurityDescriptor->Control = SecurityDescriptor->Control | SE_SACL_DEFAULTED;
}
return(STATUS_SUCCESS);
}
NTSTATUS STDCALL RtlAbsoluteToSelfRelativeSD (PSECURITY_DESCRIPTOR AbsSD,
PSECURITY_DESCRIPTOR RelSD,
PULONG BufferLength)
@ -286,5 +363,4 @@ NTSTATUS STDCALL RtlAbsoluteToSelfRelativeSD (PSECURITY_DESCRIPTOR AbsSD,
UNIMPLEMENTED;
}
/* EOF */

View file

@ -1,9 +1,9 @@
/* $Id: sid.c,v 1.3 2000/01/05 21:57:00 dwelch Exp $
/* $Id: sid.c,v 1.4 2000/04/15 23:14:32 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* PURPOSE: Security manager
* FILE: kernel/se/sid.c
* FILE: ntoskrnl/se/sid.c
* PROGRAMER: David Welch <welch@cwcom.net>
* REVISION HISTORY:
* 26/07/98: Added stubs for security functions
@ -89,5 +89,4 @@ NTSTATUS STDCALL RtlCopySid (ULONG BufferLength, PSID Dest, PSID Src)
return(STATUS_SUCCESS);
}
/* EOF */