Implement private object security functions.
Modified: trunk/reactos/lib/advapi32/advapi32.def
Modified: trunk/reactos/lib/advapi32/sec/misc.c
_____
Modified: trunk/reactos/lib/advapi32/advapi32.def
--- trunk/reactos/lib/advapi32/advapi32.def 2005-06-27 21:11:29 UTC
(rev 16308)
+++ trunk/reactos/lib/advapi32/advapi32.def 2005-06-27 22:42:28 UTC
(rev 16309)
@@ -98,7 +98,7 @@
;ConvertToAutoInheritPrivateObjectSecurity@24
CopySid@12
;CreateCodeAuthzLevel@20
-;CreatePrivateObjectSecurity@24
+CreatePrivateObjectSecurity@24
;CreatePrivateObjectSecurityEx@32
;CreatePrivateObjectSecurityWithMultipleInheritance@36
CreateProcessAsUserA@44
@@ -183,7 +183,7 @@
DeleteAce@8
DeleteService@4
DeregisterEventSource@4
-;DestroyPrivateObjectSecurity@4
+DestroyPrivateObjectSecurity@4
;DuplicateEncryptionInfoFile
DuplicateToken@12
DuplicateTokenEx@24
@@ -267,7 +267,7 @@
GetNumberOfEventLogRecords@8
GetOldestEventLogRecord@8
;GetOverlappedAccessResults
-;GetPrivateObjectSecurity@20
+GetPrivateObjectSecurity@20
GetSecurityDescriptorControl@12
GetSecurityDescriptorDacl@16
GetSecurityDescriptorGroup@12
@@ -563,7 +563,7 @@
;SetNamedSecurityInfoExA
;SetNamedSecurityInfoExW
SetNamedSecurityInfoW@28
-;SetPrivateObjectSecurity@20
+SetPrivateObjectSecurity@20
;SetPrivateObjectSecurityEx
SetSecurityDescriptorControl@12
SetSecurityDescriptorDacl@16
_____
Modified: trunk/reactos/lib/advapi32/sec/misc.c
--- trunk/reactos/lib/advapi32/sec/misc.c 2005-06-27 21:11:29 UTC
(rev 16308)
+++ trunk/reactos/lib/advapi32/sec/misc.c 2005-06-27 22:42:28 UTC
(rev 16309)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
* FILE: lib/advapi32/sec/misc.c
@@ -1264,4 +1263,106 @@
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 */
Show replies by date