diff --git a/reactos/lib/ntdll/def/ntdll.def b/reactos/lib/ntdll/def/ntdll.def index e1d6af97011..5a1bd2a8778 100644 --- a/reactos/lib/ntdll/def/ntdll.def +++ b/reactos/lib/ntdll/def/ntdll.def @@ -586,7 +586,7 @@ RtlSecondsSince1970ToTime@8 RtlSecondsSince1980ToTime@8 RtlSelfRelativeToAbsoluteSD@44 RtlSetAllBits@4 -;RtlSetAttributesSecurityDescriptor +RtlSetAttributesSecurityDescriptor@12 RtlSetBits@12 RtlSetControlSecurityDescriptor@12 RtlSetCriticalSectionSpinCount@8 diff --git a/reactos/lib/rtl/generictable.c b/reactos/lib/rtl/generictable.c index 3ac6d804202..c38c416d077 100644 --- a/reactos/lib/rtl/generictable.c +++ b/reactos/lib/rtl/generictable.c @@ -28,6 +28,7 @@ #define NDEBUG #include + /* FUNCTIONS *****************************************************************/ /* @@ -177,22 +178,28 @@ RtlInitializeGenericTable ( UNIMPLEMENTED; } + /* -* @unimplemented -*/ -VOID -STDCALL -RtlInitializeGenericTableAvl ( - PRTL_AVL_TABLE Table, - PRTL_AVL_COMPARE_ROUTINE CompareRoutine, - PRTL_AVL_ALLOCATE_ROUTINE AllocateRoutine, - PRTL_AVL_FREE_ROUTINE FreeRoutine, - PVOID TableContext - ) + * @implemented + */ +VOID STDCALL +RtlInitializeGenericTableAvl(IN OUT PRTL_AVL_TABLE Table, + IN PRTL_AVL_COMPARE_ROUTINE CompareRoutine, + IN PRTL_AVL_ALLOCATE_ROUTINE AllocateRoutine, + IN PRTL_AVL_FREE_ROUTINE FreeRoutine, + IN PVOID TableContext) { - UNIMPLEMENTED; + RtlZeroMemory(Table, + sizeof(RTL_AVL_TABLE)); + Table->BalancedRoot.Parent = &Table->BalancedRoot; + + Table->CompareRoutine = CompareRoutine; + Table->AllocateRoutine = AllocateRoutine; + Table->FreeRoutine = FreeRoutine; + Table->TableContext = TableContext; } + /* * @unimplemented */ @@ -351,29 +358,22 @@ RtlLookupElementGenericTableFullAvl ( /* -* @unimplemented -*/ -ULONG -STDCALL -RtlNumberGenericTableElements( - PRTL_GENERIC_TABLE Table - ) + * @implemented + */ +ULONG STDCALL +RtlNumberGenericTableElements(IN PRTL_GENERIC_TABLE Table) { - UNIMPLEMENTED; - return 0; + return Table->NumberGenericTableElements; } + /* -* @unimplemented -*/ -ULONG -STDCALL -RtlNumberGenericTableElementsAvl ( - PRTL_AVL_TABLE Table - ) + * @implemented + */ +ULONG STDCALL +RtlNumberGenericTableElementsAvl(IN PRTL_AVL_TABLE Table) { - UNIMPLEMENTED; - return 0; + return Table->NumberGenericTableElements; } /* EOF */ diff --git a/reactos/lib/rtl/sd.c b/reactos/lib/rtl/sd.c index a27f2e5e458..f8c60102d01 100644 --- a/reactos/lib/rtl/sd.c +++ b/reactos/lib/rtl/sd.c @@ -107,8 +107,8 @@ RtlpQuerySecurityDescriptor(PSECURITY_DESCRIPTOR SecurityDescriptor, } /* -* @implemented -*/ + * @implemented + */ NTSTATUS STDCALL RtlCreateSecurityDescriptor(PSECURITY_DESCRIPTOR SecurityDescriptor, ULONG Revision) @@ -814,4 +814,28 @@ RtlSetSecurityDescriptorRMControl(PSECURITY_DESCRIPTOR SecurityDescriptor, } } + +/* + * @implemented + */ +NTSTATUS STDCALL +RtlSetAttributesSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptor, + IN SECURITY_DESCRIPTOR_CONTROL Control, + OUT PULONG Revision) +{ + *Revision = SecurityDescriptor->Revision; + + if (SecurityDescriptor->Revision != SECURITY_DESCRIPTOR_REVISION1) + return STATUS_UNKNOWN_REVISION; + + Control &= + ~(SE_OWNER_DEFAULTED | SE_GROUP_DEFAULTED | SE_DACL_PRESENT | + SE_DACL_DEFAULTED | SE_SACL_PRESENT | SE_SACL_DEFAULTED | + SE_RM_CONTROL_VALID | SE_SELF_RELATIVE); + + return RtlSetControlSecurityDescriptor(SecurityDescriptor, + Control, + Control); +} + /* EOF */