From 6b081232b97c80d08cfec467ef0ca05e41b2a614 Mon Sep 17 00:00:00 2001 From: Rob Shearman Date: Tue, 23 Oct 2007 15:19:00 +0100 Subject: [PATCH] ntdll: Add a stub for RtlSetControlSecurityDescriptor. Implement SetSecurityDescriptorControl on top of RtlSetControlSecurityDescriptor. --- dlls/advapi32/security.c | 21 +++++++++++---------- dlls/ntdll/ntdll.spec | 2 +- dlls/ntdll/sec.c | 13 +++++++++++++ include/winternl.h | 1 + 4 files changed, 26 insertions(+), 11 deletions(-) diff --git a/dlls/advapi32/security.c b/dlls/advapi32/security.c index 4cab225e487..82de97b2c17 100644 --- a/dlls/advapi32/security.c +++ b/dlls/advapi32/security.c @@ -1363,6 +1363,17 @@ BOOL WINAPI GetSecurityDescriptorControl ( PSECURITY_DESCRIPTOR pSecurityDescri return set_ntstatus( RtlGetControlSecurityDescriptor(pSecurityDescriptor,pControl,lpdwRevision)); } +/****************************************************************************** + * SetSecurityDescriptorControl [ADVAPI32.@] + */ +BOOL WINAPI SetSecurityDescriptorControl( PSECURITY_DESCRIPTOR pSecurityDescriptor, + SECURITY_DESCRIPTOR_CONTROL ControlBitsOfInterest, + SECURITY_DESCRIPTOR_CONTROL ControlBitsToSet ) +{ + return set_ntstatus( RtlSetControlSecurityDescriptor( + pSecurityDescriptor, ControlBitsOfInterest, ControlBitsToSet ) ); +} + /* ############################## ###### ACL FUNCTIONS ###### ############################## @@ -3077,16 +3088,6 @@ BOOL WINAPI SetPrivateObjectSecurity( SECURITY_INFORMATION SecurityInformation, return TRUE; } -BOOL WINAPI SetSecurityDescriptorControl( PSECURITY_DESCRIPTOR pSecurityDescriptor, - SECURITY_DESCRIPTOR_CONTROL ControlBitsOfInterest, - SECURITY_DESCRIPTOR_CONTROL ControlBitsToSet ) -{ - FIXME("%p 0x%08x 0x%08x - stub\n", pSecurityDescriptor, ControlBitsOfInterest, - ControlBitsToSet); - - return TRUE; -} - BOOL WINAPI AreAllAccessesGranted( DWORD GrantedAccess, DWORD DesiredAccess ) { return RtlAreAllAccessesGranted( GrantedAccess, DesiredAccess ); diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index 30c6ab3b5eb..fc1a6c8070e 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -813,7 +813,7 @@ @ stdcall RtlSetAllBits(ptr) # @ stub RtlSetAttributesSecurityDescriptor @ stdcall RtlSetBits(ptr long long) -# @ stub RtlSetControlSecurityDescriptor +@ stdcall RtlSetControlSecurityDescriptor(ptr long long) @ stdcall RtlSetCriticalSectionSpinCount(ptr long) @ stdcall RtlSetCurrentDirectory_U(ptr) @ stdcall RtlSetCurrentEnvironment(wstr ptr) diff --git a/dlls/ntdll/sec.c b/dlls/ntdll/sec.c index a1c839dca2b..0a9fa5c500b 100644 --- a/dlls/ntdll/sec.c +++ b/dlls/ntdll/sec.c @@ -1030,6 +1030,19 @@ NTSTATUS WINAPI RtlGetControlSecurityDescriptor( return STATUS_SUCCESS; } +/****************************************************************************** + * RtlSetControlSecurityDescriptor (NTDLL.@) + */ +NTSTATUS WINAPI RtlSetControlSecurityDescriptor( + PSECURITY_DESCRIPTOR SecurityDescriptor, + SECURITY_DESCRIPTOR_CONTROL ControlBitsOfInterest, + SECURITY_DESCRIPTOR_CONTROL ControlBitsToSet) +{ + FIXME("(%p 0x%08x 0x%08x): stub\n", SecurityDescriptor, ControlBitsOfInterest, + ControlBitsToSet); + return STATUS_SUCCESS; +} + /************************************************************************** * RtlAbsoluteToSelfRelativeSD [NTDLL.@] diff --git a/include/winternl.h b/include/winternl.h index df3a48962e7..7ed801a4ced 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -2221,6 +2221,7 @@ NTSTATUS WINAPI RtlSelfRelativeToAbsoluteSD(PSECURITY_DESCRIPTOR,PSECURITY_DESC void WINAPI RtlSetAllBits(PRTL_BITMAP); void WINAPI RtlSetBits(PRTL_BITMAP,ULONG,ULONG); ULONG WINAPI RtlSetCriticalSectionSpinCount(RTL_CRITICAL_SECTION*,ULONG); +NTSTATUS WINAPI RtlSetControlSecurityDescriptor(PSECURITY_DESCRIPTOR,SECURITY_DESCRIPTOR_CONTROL,SECURITY_DESCRIPTOR_CONTROL); NTSTATUS WINAPI RtlSetCurrentDirectory_U(const UNICODE_STRING*); void WINAPI RtlSetCurrentEnvironment(PWSTR, PWSTR*); NTSTATUS WINAPI RtlSetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR,BOOLEAN,PACL,BOOLEAN);