Implement private object security functions.

svn path=/trunk/; revision=16309
This commit is contained in:
Eric Kohl 2005-06-27 22:42:28 +00:00
parent 53dea75f28
commit f03def7913
2 changed files with 107 additions and 6 deletions

View file

@ -98,7 +98,7 @@ ConvertSidToStringSidW@8
;ConvertToAutoInheritPrivateObjectSecurity@24 ;ConvertToAutoInheritPrivateObjectSecurity@24
CopySid@12 CopySid@12
;CreateCodeAuthzLevel@20 ;CreateCodeAuthzLevel@20
;CreatePrivateObjectSecurity@24 CreatePrivateObjectSecurity@24
;CreatePrivateObjectSecurityEx@32 ;CreatePrivateObjectSecurityEx@32
;CreatePrivateObjectSecurityWithMultipleInheritance@36 ;CreatePrivateObjectSecurityWithMultipleInheritance@36
CreateProcessAsUserA@44 CreateProcessAsUserA@44
@ -183,7 +183,7 @@ CryptVerifySignatureW@24
DeleteAce@8 DeleteAce@8
DeleteService@4 DeleteService@4
DeregisterEventSource@4 DeregisterEventSource@4
;DestroyPrivateObjectSecurity@4 DestroyPrivateObjectSecurity@4
;DuplicateEncryptionInfoFile ;DuplicateEncryptionInfoFile
DuplicateToken@12 DuplicateToken@12
DuplicateTokenEx@24 DuplicateTokenEx@24
@ -267,7 +267,7 @@ GetNamedSecurityInfoW@32
GetNumberOfEventLogRecords@8 GetNumberOfEventLogRecords@8
GetOldestEventLogRecord@8 GetOldestEventLogRecord@8
;GetOverlappedAccessResults ;GetOverlappedAccessResults
;GetPrivateObjectSecurity@20 GetPrivateObjectSecurity@20
GetSecurityDescriptorControl@12 GetSecurityDescriptorControl@12
GetSecurityDescriptorDacl@16 GetSecurityDescriptorDacl@16
GetSecurityDescriptorGroup@12 GetSecurityDescriptorGroup@12
@ -563,7 +563,7 @@ SetNamedSecurityInfoA@28
;SetNamedSecurityInfoExA ;SetNamedSecurityInfoExA
;SetNamedSecurityInfoExW ;SetNamedSecurityInfoExW
SetNamedSecurityInfoW@28 SetNamedSecurityInfoW@28
;SetPrivateObjectSecurity@20 SetPrivateObjectSecurity@20
;SetPrivateObjectSecurityEx ;SetPrivateObjectSecurityEx
SetSecurityDescriptorControl@12 SetSecurityDescriptorControl@12
SetSecurityDescriptorDacl@16 SetSecurityDescriptorDacl@16

View file

@ -1,5 +1,4 @@
/* $Id$ /*
*
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries * PROJECT: ReactOS system libraries
* FILE: lib/advapi32/sec/misc.c * FILE: lib/advapi32/sec/misc.c
@ -1264,4 +1263,106 @@ ImpersonateNamedPipeClient(HANDLE hNamedPipe)
return TRUE; return TRUE;
} }
/*
* @implemented
*/
BOOL STDCALL
CreatePrivateObjectSecurity(PSECURITY_DESCRIPTOR ParentDescriptor,
PSECURITY_DESCRIPTOR CreatorDescriptor,
PSECURITY_DESCRIPTOR *NewDescriptor,
BOOL IsDirectoryObject,
HANDLE Token,
PGENERIC_MAPPING GenericMapping)
{
NTSTATUS Status;
Status = RtlNewSecurityObject(ParentDescriptor,
CreatorDescriptor,
NewDescriptor,
IsDirectoryObject,
Token,
GenericMapping);
if (!NT_SUCCESS(Status))
{
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
return TRUE;
}
/*
* @implemented
*/
BOOL STDCALL
DestroyPrivateObjectSecurity(PSECURITY_DESCRIPTOR *ObjectDescriptor)
{
NTSTATUS Status;
Status = RtlDeleteSecurityObject(ObjectDescriptor);
if (!NT_SUCCESS(Status))
{
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
return TRUE;
}
/*
* @implemented
*/
BOOL STDCALL
GetPrivateObjectSecurity(PSECURITY_DESCRIPTOR ObjectDescriptor,
SECURITY_INFORMATION SecurityInformation,
PSECURITY_DESCRIPTOR ResultantDescriptor,
DWORD DescriptorLength,
PDWORD ReturnLength)
{
NTSTATUS Status;
Status = RtlQuerySecurityObject(ObjectDescriptor,
SecurityInformation,
ResultantDescriptor,
DescriptorLength,
ReturnLength);
if (!NT_SUCCESS(Status))
{
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
return TRUE;
}
/*
* @implemented
*/
BOOL STDCALL
SetPrivateObjectSecurity(SECURITY_INFORMATION SecurityInformation,
PSECURITY_DESCRIPTOR ModificationDescriptor,
PSECURITY_DESCRIPTOR *ObjectsSecurityDescriptor,
PGENERIC_MAPPING GenericMapping,
HANDLE Token)
{
NTSTATUS Status;
Status = RtlSetSecurityObject(SecurityInformation,
ModificationDescriptor,
ObjectsSecurityDescriptor,
GenericMapping,
Token);
if (!NT_SUCCESS(Status))
{
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
return TRUE;
}
/* EOF */ /* EOF */