[ros-diffs] [weiden] 20288: make functions match their declarations

weiden at svn.reactos.com weiden at svn.reactos.com
Wed Dec 21 20:07:52 CET 2005


make functions match their declarations
Modified: trunk/reactos/include/ndk/rtlfuncs.h
Modified: trunk/reactos/lib/rtl/sd.c
  _____  

Modified: trunk/reactos/include/ndk/rtlfuncs.h
--- trunk/reactos/include/ndk/rtlfuncs.h	2005-12-21 19:07:47 UTC
(rev 20287)
+++ trunk/reactos/include/ndk/rtlfuncs.h	2005-12-21 19:07:47 UTC
(rev 20288)
@@ -591,16 +591,16 @@

 NTSTATUS
 NTAPI
 RtlCreateSecurityDescriptor(
-    PSECURITY_DESCRIPTOR SecurityDescriptor,
-    ULONG Revision
+    OUT PSECURITY_DESCRIPTOR SecurityDescriptor,
+    IN ULONG Revision
 );
 
 NTSYSAPI
 NTSTATUS
 NTAPI
 RtlCreateSecurityDescriptorRelative(
-    PISECURITY_DESCRIPTOR_RELATIVE SecurityDescriptor,
-    ULONG Revision
+    OUT PISECURITY_DESCRIPTOR_RELATIVE SecurityDescriptor,
+    IN ULONG Revision
 );
 
 NTSYSAPI
@@ -653,9 +653,9 @@
 NTSTATUS
 NTAPI
 RtlGetControlSecurityDescriptor(
-    PSECURITY_DESCRIPTOR SecurityDescriptor,
-    PSECURITY_DESCRIPTOR_CONTROL Control,
-    PULONG Revision
+    IN PSECURITY_DESCRIPTOR SecurityDescriptor,
+    OUT PSECURITY_DESCRIPTOR_CONTROL Control,
+    OUT PULONG Revision
 );
 
 NTSYSAPI
@@ -672,10 +672,10 @@
 NTSTATUS
 NTAPI
 RtlGetSaclSecurityDescriptor(
-    PSECURITY_DESCRIPTOR SecurityDescriptor,
-    PBOOLEAN SaclPresent,
-    PACL* Sacl,
-    PBOOLEAN SaclDefaulted
+    IN PSECURITY_DESCRIPTOR SecurityDescriptor,
+    OUT PBOOLEAN SaclPresent,
+    OUT PACL* Sacl,
+    OUT PBOOLEAN SaclDefaulted
 );
 
 NTSYSAPI
@@ -700,8 +700,8 @@
 BOOLEAN
 NTAPI
 RtlGetSecurityDescriptorRMControl(
-    PSECURITY_DESCRIPTOR SecurityDescriptor,
-    PUCHAR RMControl
+    IN PSECURITY_DESCRIPTOR SecurityDescriptor,
+    OUT PUCHAR RMControl
 );
 
 NTSYSAPI
@@ -787,6 +787,15 @@
 NTSYSAPI
 NTSTATUS
 NTAPI
+RtlSetAttributesSecurityDescriptor(
+    IN OUT PSECURITY_DESCRIPTOR SecurityDescriptor,
+    IN SECURITY_DESCRIPTOR_CONTROL Control,
+    OUT PULONG Revision
+);
+
+NTSYSAPI
+NTSTATUS
+NTAPI
 RtlSetControlSecurityDescriptor(
     IN PSECURITY_DESCRIPTOR SecurityDescriptor,
     IN SECURITY_DESCRIPTOR_CONTROL ControlBitsOfInterest,
@@ -797,10 +806,10 @@
 NTSTATUS
 NTAPI
 RtlSetDaclSecurityDescriptor (
-    PSECURITY_DESCRIPTOR SecurityDescriptor,
-    BOOLEAN DaclPresent,
-    PACL Dacl,
-    BOOLEAN DaclDefaulted
+    IN OUT PSECURITY_DESCRIPTOR SecurityDescriptor,
+    IN BOOLEAN DaclPresent,
+    IN PACL Dacl,
+    IN BOOLEAN DaclDefaulted
 );
 
 NTSYSAPI
@@ -845,8 +854,8 @@
 VOID
 NTAPI
 RtlSetSecurityDescriptorRMControl(
-    PSECURITY_DESCRIPTOR SecurityDescriptor,
-    PUCHAR RMControl
+    IN OUT PSECURITY_DESCRIPTOR SecurityDescriptor,
+    IN PUCHAR RMControl
 );
 
 NTSYSAPI
  _____  

Modified: trunk/reactos/lib/rtl/sd.c
--- trunk/reactos/lib/rtl/sd.c	2005-12-21 19:07:47 UTC (rev 20287)
+++ trunk/reactos/lib/rtl/sd.c	2005-12-21 19:07:47 UTC (rev 20288)
@@ -67,7 +67,7 @@

 }
 
 static VOID
-RtlpQuerySecurityDescriptor(PSECURITY_DESCRIPTOR SecurityDescriptor,
+RtlpQuerySecurityDescriptor(PISECURITY_DESCRIPTOR SecurityDescriptor,
                             PSID* Owner,
                             PULONG OwnerLength,
                             PSID* Group,
@@ -108,9 +108,11 @@
  * @implemented
  */
 NTSTATUS NTAPI
-RtlCreateSecurityDescriptor(PISECURITY_DESCRIPTOR SecurityDescriptor,
-                            ULONG Revision)
+RtlCreateSecurityDescriptor(OUT PSECURITY_DESCRIPTOR
SecurityDescriptor,
+                            IN ULONG Revision)
 {
+   PISECURITY_DESCRIPTOR pSD =
(PISECURITY_DESCRIPTOR)SecurityDescriptor;
+
    PAGED_CODE_RTL();
 
    if (Revision != SECURITY_DESCRIPTOR_REVISION1)
@@ -118,21 +120,21 @@
       return STATUS_UNKNOWN_REVISION;
    }
 
-   SecurityDescriptor->Revision = Revision;
-   SecurityDescriptor->Sbz1 = 0;
-   SecurityDescriptor->Control = 0;
-   SecurityDescriptor->Owner = NULL;
-   SecurityDescriptor->Group = NULL;
-   SecurityDescriptor->Sacl = NULL;
-   SecurityDescriptor->Dacl = NULL;
+   pSD->Revision = Revision;
+   pSD->Sbz1 = 0;
+   pSD->Control = 0;
+   pSD->Owner = NULL;
+   pSD->Group = NULL;
+   pSD->Sacl = NULL;
+   pSD->Dacl = NULL;
 
    return STATUS_SUCCESS;
 }
 
 
 NTSTATUS NTAPI
-RtlCreateSecurityDescriptorRelative (PISECURITY_DESCRIPTOR_RELATIVE
SecurityDescriptor,
-			             ULONG Revision)
+RtlCreateSecurityDescriptorRelative (OUT PISECURITY_DESCRIPTOR_RELATIVE
SecurityDescriptor,
+			             IN ULONG Revision)
 {
    PAGED_CODE_RTL();
 
@@ -157,7 +159,7 @@
  * @implemented
  */
 ULONG NTAPI
-RtlLengthSecurityDescriptor(PSECURITY_DESCRIPTOR SecurityDescriptor)
+RtlLengthSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptor)
 {
    PSID Owner, Group;
    PACL Sacl, Dacl;
@@ -165,7 +167,7 @@
 
    PAGED_CODE_RTL();
 
-   RtlpQuerySecurityDescriptorPointers(SecurityDescriptor,
+
RtlpQuerySecurityDescriptorPointers((PISECURITY_DESCRIPTOR)SecurityDescr
iptor,
                                        &Owner,
                                        &Group,
                                        &Sacl,
@@ -199,32 +201,34 @@
  * @implemented
  */
 NTSTATUS NTAPI
-RtlGetDaclSecurityDescriptor(PISECURITY_DESCRIPTOR SecurityDescriptor,
-                             PBOOLEAN DaclPresent,
-                             PACL* Dacl,
-                             PBOOLEAN DaclDefaulted)
+RtlGetDaclSecurityDescriptor(IN PSECURITY_DESCRIPTOR
SecurityDescriptor,
+                             OUT PBOOLEAN DaclPresent,
+                             OUT PACL* Dacl,
+                             OUT PBOOLEAN DaclDefaulted)
 {
+   PISECURITY_DESCRIPTOR pSD =
(PISECURITY_DESCRIPTOR)SecurityDescriptor;
+
    PAGED_CODE_RTL();
 
-   if (SecurityDescriptor->Revision != SECURITY_DESCRIPTOR_REVISION1)
+   if (pSD->Revision != SECURITY_DESCRIPTOR_REVISION1)
    {
       return STATUS_UNKNOWN_REVISION;
    }
 
-   if (!(SecurityDescriptor->Control & SE_DACL_PRESENT))
+   if (!(pSD->Control & SE_DACL_PRESENT))
    {
       *DaclPresent = FALSE;
       return STATUS_SUCCESS;
    }
    *DaclPresent = TRUE;
 
-   RtlpQuerySecurityDescriptorPointers(SecurityDescriptor,
+   RtlpQuerySecurityDescriptorPointers(pSD,
                                        NULL,
                                        NULL,
                                        NULL,
                                        Dacl);
 
-   *DaclDefaulted = ((SecurityDescriptor->Control & SE_DACL_DEFAULTED)
? TRUE : FALSE);
+   *DaclDefaulted = ((pSD->Control & SE_DACL_DEFAULTED) ? TRUE :
FALSE);
 
    return STATUS_SUCCESS;
 }
@@ -234,36 +238,38 @@
  * @implemented
  */
 NTSTATUS NTAPI
-RtlSetDaclSecurityDescriptor(PISECURITY_DESCRIPTOR SecurityDescriptor,
-                             BOOLEAN DaclPresent,
-                             PACL Dacl,
-                             BOOLEAN DaclDefaulted)
+RtlSetDaclSecurityDescriptor(IN OUT PSECURITY_DESCRIPTOR
SecurityDescriptor,
+                             IN BOOLEAN DaclPresent,
+                             IN PACL Dacl,
+                             IN BOOLEAN DaclDefaulted)
 {
+   PISECURITY_DESCRIPTOR pSD =
(PISECURITY_DESCRIPTOR)SecurityDescriptor;
+
    PAGED_CODE_RTL();
 
-   if (SecurityDescriptor->Revision != SECURITY_DESCRIPTOR_REVISION1)
+   if (pSD->Revision != SECURITY_DESCRIPTOR_REVISION1)
    {
       return STATUS_UNKNOWN_REVISION;
    }
 
-   if (SecurityDescriptor->Control & SE_SELF_RELATIVE)
+   if (pSD->Control & SE_SELF_RELATIVE)
    {
       return STATUS_BAD_DESCRIPTOR_FORMAT;
    }
 
    if (!DaclPresent)
    {
-      SecurityDescriptor->Control = SecurityDescriptor->Control &
~(SE_DACL_PRESENT);
+      pSD->Control = pSD->Control & ~(SE_DACL_PRESENT);
       return STATUS_SUCCESS;
    }
 
-   SecurityDescriptor->Control = SecurityDescriptor->Control |
SE_DACL_PRESENT;
-   SecurityDescriptor->Dacl = Dacl;
-   SecurityDescriptor->Control = SecurityDescriptor->Control &
~(SE_DACL_DEFAULTED);
+   pSD->Dacl = Dacl;
+   pSD->Control |= SE_DACL_PRESENT;
+   pSD->Control &= ~(SE_DACL_DEFAULTED);
 
    if (DaclDefaulted)
    {
-      SecurityDescriptor->Control = SecurityDescriptor->Control |
SE_DACL_DEFAULTED;
+      pSD->Control |= SE_DACL_DEFAULTED;
    }
 
    return STATUS_SUCCESS;
@@ -274,19 +280,20 @@
  * @implemented
  */
 BOOLEAN NTAPI
-RtlValidSecurityDescriptor(PISECURITY_DESCRIPTOR SecurityDescriptor)
+RtlValidSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptor)
 {
+   PISECURITY_DESCRIPTOR pSD =
(PISECURITY_DESCRIPTOR)SecurityDescriptor;
    PSID Owner, Group;
    PACL Sacl, Dacl;
 
    PAGED_CODE_RTL();
 
-   if (SecurityDescriptor->Revision != SECURITY_DESCRIPTOR_REVISION1)
+   if (pSD->Revision != SECURITY_DESCRIPTOR_REVISION1)
    {
       return FALSE;
    }
 
-   RtlpQuerySecurityDescriptorPointers(SecurityDescriptor,
+   RtlpQuerySecurityDescriptorPointers(pSD,
                                        &Owner,
                                        &Group,
                                        &Sacl,
@@ -308,28 +315,30 @@
  * @implemented
  */
 NTSTATUS NTAPI
-RtlSetOwnerSecurityDescriptor(PISECURITY_DESCRIPTOR SecurityDescriptor,
-                              PSID Owner,
-                              BOOLEAN OwnerDefaulted)
+RtlSetOwnerSecurityDescriptor(IN OUT PSECURITY_DESCRIPTOR
SecurityDescriptor,
+                              IN PSID Owner,
+                              IN BOOLEAN OwnerDefaulted)
 {
+   PISECURITY_DESCRIPTOR pSD =
(PISECURITY_DESCRIPTOR)SecurityDescriptor;
+
    PAGED_CODE_RTL();
 
-   if (SecurityDescriptor->Revision != SECURITY_DESCRIPTOR_REVISION1)
+   if (pSD->Revision != SECURITY_DESCRIPTOR_REVISION1)
    {
       return STATUS_UNKNOWN_REVISION;
    }
 
-   if (SecurityDescriptor->Control & SE_SELF_RELATIVE)
+   if (pSD->Control & SE_SELF_RELATIVE)
    {
       return STATUS_BAD_DESCRIPTOR_FORMAT;
    }
 
-   SecurityDescriptor->Owner = Owner;
-   SecurityDescriptor->Control = SecurityDescriptor->Control &
~(SE_OWNER_DEFAULTED);
+   pSD->Owner = Owner;
+   pSD->Control &= ~(SE_OWNER_DEFAULTED);
 
    if (OwnerDefaulted)
    {
-      SecurityDescriptor->Control = SecurityDescriptor->Control |
SE_OWNER_DEFAULTED;
+      pSD->Control |= SE_OWNER_DEFAULTED;
    }
 
    return STATUS_SUCCESS;
@@ -340,24 +349,26 @@
  * @implemented
  */
 NTSTATUS NTAPI
-RtlGetOwnerSecurityDescriptor(PISECURITY_DESCRIPTOR SecurityDescriptor,
-                              PSID* Owner,
-                              PBOOLEAN OwnerDefaulted)
+RtlGetOwnerSecurityDescriptor(IN PSECURITY_DESCRIPTOR
SecurityDescriptor,
+                              OUT PSID* Owner,
+                              OUT PBOOLEAN OwnerDefaulted)
 {
+   PISECURITY_DESCRIPTOR pSD =
(PISECURITY_DESCRIPTOR)SecurityDescriptor;
+
    PAGED_CODE_RTL();
 
-   if (SecurityDescriptor->Revision != SECURITY_DESCRIPTOR_REVISION1)
+   if (pSD->Revision != SECURITY_DESCRIPTOR_REVISION1)
    {
       return STATUS_UNKNOWN_REVISION;
    }
 
-   RtlpQuerySecurityDescriptorPointers(SecurityDescriptor,
+   RtlpQuerySecurityDescriptorPointers(pSD,
                                        Owner,
                                        NULL,
                                        NULL,
                                        NULL);
 
-   *OwnerDefaulted = ((SecurityDescriptor->Control &
SE_OWNER_DEFAULTED) ? TRUE : FALSE);
+   *OwnerDefaulted = ((pSD->Control & SE_OWNER_DEFAULTED) ? TRUE :
FALSE);
 
    return STATUS_SUCCESS;
 }
@@ -367,27 +378,29 @@
  * @implemented
  */
 NTSTATUS NTAPI
-RtlSetGroupSecurityDescriptor(PISECURITY_DESCRIPTOR SecurityDescriptor,
-                              PSID Group,
-                              BOOLEAN GroupDefaulted)
+RtlSetGroupSecurityDescriptor(IN OUT PSECURITY_DESCRIPTOR
SecurityDescriptor,
+                              IN PSID Group,
+                              IN BOOLEAN GroupDefaulted)
 {
+   PISECURITY_DESCRIPTOR pSD =
(PISECURITY_DESCRIPTOR)SecurityDescriptor;
+
    PAGED_CODE_RTL();
 
-   if (SecurityDescriptor->Revision != SECURITY_DESCRIPTOR_REVISION1)
+   if (pSD->Revision != SECURITY_DESCRIPTOR_REVISION1)
    {
       return STATUS_UNKNOWN_REVISION;
    }
 
-   if (SecurityDescriptor->Control & SE_SELF_RELATIVE)
+   if (pSD->Control & SE_SELF_RELATIVE)
    {
       return STATUS_BAD_DESCRIPTOR_FORMAT;
    }
 
-   SecurityDescriptor->Group = Group;
-   SecurityDescriptor->Control = SecurityDescriptor->Control &
~(SE_GROUP_DEFAULTED);
+   pSD->Group = Group;
+   pSD->Control &= ~(SE_GROUP_DEFAULTED);
    if (GroupDefaulted)
    {
-      SecurityDescriptor->Control = SecurityDescriptor->Control |
SE_GROUP_DEFAULTED;
+      pSD->Control |= SE_GROUP_DEFAULTED;
    }
 
    return STATUS_SUCCESS;
@@ -398,24 +411,26 @@
  * @implemented
  */
 NTSTATUS NTAPI
-RtlGetGroupSecurityDescriptor(PISECURITY_DESCRIPTOR SecurityDescriptor,
-                              PSID* Group,
-                              PBOOLEAN GroupDefaulted)
+RtlGetGroupSecurityDescriptor(IN PSECURITY_DESCRIPTOR
SecurityDescriptor,
+                              OUT PSID* Group,
+                              OUT PBOOLEAN GroupDefaulted)
 {
+   PISECURITY_DESCRIPTOR pSD =
(PISECURITY_DESCRIPTOR)SecurityDescriptor;
+
    PAGED_CODE_RTL();
 
-   if (SecurityDescriptor->Revision != SECURITY_DESCRIPTOR_REVISION1)
+   if (pSD->Revision != SECURITY_DESCRIPTOR_REVISION1)
    {
       return STATUS_UNKNOWN_REVISION;
    }
 
-   RtlpQuerySecurityDescriptorPointers(SecurityDescriptor,
+   RtlpQuerySecurityDescriptorPointers(pSD,
                                        NULL,
                                        Group,
                                        NULL,
                                        NULL);
 
-   *GroupDefaulted = ((SecurityDescriptor->Control &
SE_GROUP_DEFAULTED) ? TRUE : FALSE);
+   *GroupDefaulted = ((pSD->Control & SE_GROUP_DEFAULTED) ? TRUE :
FALSE);
 
    return STATUS_SUCCESS;
 }
@@ -425,9 +440,9 @@
  * @implemented
  */
 NTSTATUS NTAPI
-RtlMakeSelfRelativeSD(PSECURITY_DESCRIPTOR _AbsSD,
-		      PSECURITY_DESCRIPTOR _RelSD,
-		      PULONG BufferLength)
+RtlMakeSelfRelativeSD(IN PSECURITY_DESCRIPTOR AbsoluteSD,
+		      OUT PSECURITY_DESCRIPTOR SelfRelativeSD,
+		      IN OUT PULONG BufferLength)
 {
    PSID Owner;
    PSID Group;
@@ -439,12 +454,12 @@
    ULONG DaclLength;
    ULONG TotalLength;
    ULONG_PTR Current;
-   PISECURITY_DESCRIPTOR AbsSD = (PISECURITY_DESCRIPTOR)_AbsSD;
-   PISECURITY_DESCRIPTOR_RELATIVE RelSD =
(PISECURITY_DESCRIPTOR_RELATIVE)_RelSD;
+   PISECURITY_DESCRIPTOR pAbsSD = (PISECURITY_DESCRIPTOR)AbsoluteSD;
+   PISECURITY_DESCRIPTOR_RELATIVE pRelSD =
(PISECURITY_DESCRIPTOR_RELATIVE)SelfRelativeSD;
  
    PAGED_CODE_RTL();
 
-   RtlpQuerySecurityDescriptor(AbsSD,
+   RtlpQuerySecurityDescriptor(pAbsSD,
                                &Owner,
                                &OwnerLength,
                                &Group,
@@ -461,21 +476,21 @@
       return STATUS_BUFFER_TOO_SMALL;
    }
 
-   RtlZeroMemory(RelSD,
+   RtlZeroMemory(pRelSD,
                  TotalLength);
 
-   RelSD->Revision = AbsSD->Revision;
-   RelSD->Sbz1 = AbsSD->Sbz1;
-   RelSD->Control = AbsSD->Control | SE_SELF_RELATIVE;
+   pRelSD->Revision = pAbsSD->Revision;
+   pRelSD->Sbz1 = pAbsSD->Sbz1;
+   pRelSD->Control = pAbsSD->Control | SE_SELF_RELATIVE;
 
-   Current = (ULONG_PTR)(RelSD + 1);
+   Current = (ULONG_PTR)(pRelSD + 1);
 
    if (SaclLength != 0)
    {
       RtlCopyMemory((PVOID)Current,
                     Sacl,
                     SaclLength);
-      RelSD->Sacl = (ULONG)((ULONG_PTR)Current - (ULONG_PTR)RelSD);
+      pRelSD->Sacl = (ULONG)((ULONG_PTR)Current - (ULONG_PTR)pRelSD);
       Current += SaclLength;
    }
 
@@ -484,7 +499,7 @@
       RtlCopyMemory((PVOID)Current,
                     Dacl,
                     DaclLength);
-      RelSD->Dacl = (ULONG)((ULONG_PTR)Current - (ULONG_PTR)RelSD);
+      pRelSD->Dacl = (ULONG)((ULONG_PTR)Current - (ULONG_PTR)pRelSD);
       Current += DaclLength;
    }
 
@@ -493,7 +508,7 @@
       RtlCopyMemory((PVOID)Current,
                     Owner,
                     OwnerLength);
-      RelSD->Owner = (ULONG)((ULONG_PTR)Current - (ULONG_PTR)RelSD);
+      pRelSD->Owner = (ULONG)((ULONG_PTR)Current - (ULONG_PTR)pRelSD);
       Current += OwnerLength;
    }
 
@@ -502,7 +517,7 @@
       RtlCopyMemory((PVOID)Current,
                     Group,
                     GroupLength);
-      RelSD->Group = (ULONG)((ULONG_PTR)Current - (ULONG_PTR)RelSD);
+      pRelSD->Group = (ULONG)((ULONG_PTR)Current - (ULONG_PTR)pRelSD);
    }
 
    return STATUS_SUCCESS;
@@ -513,18 +528,22 @@
  * @implemented
  */
 NTSTATUS NTAPI
-RtlAbsoluteToSelfRelativeSD(PISECURITY_DESCRIPTOR AbsSD,
-                            PISECURITY_DESCRIPTOR RelSD,
-                            PULONG BufferLength)
+RtlAbsoluteToSelfRelativeSD(IN PSECURITY_DESCRIPTOR
AbsoluteSecurityDescriptor,
+                            IN OUT PSECURITY_DESCRIPTOR
SelfRelativeSecurityDescriptor,
+                            IN PULONG BufferLength)
 {
+   PISECURITY_DESCRIPTOR pAbsSD =
(PISECURITY_DESCRIPTOR)AbsoluteSecurityDescriptor;
+
    PAGED_CODE_RTL();
 
-   if (AbsSD->Control & SE_SELF_RELATIVE)
+   if (pAbsSD->Control & SE_SELF_RELATIVE)
    {
       return STATUS_BAD_DESCRIPTOR_FORMAT;
    }
 
-   return RtlMakeSelfRelativeSD(AbsSD, (PSECURITY_DESCRIPTOR)RelSD,
BufferLength);
+   return RtlMakeSelfRelativeSD(AbsoluteSecurityDescriptor,
+                                SelfRelativeSecurityDescriptor,
+                                BufferLength);
 }
 
 
@@ -532,20 +551,22 @@
  * @implemented
  */
 NTSTATUS NTAPI
-RtlGetControlSecurityDescriptor(PISECURITY_DESCRIPTOR
SecurityDescriptor,
-                                PSECURITY_DESCRIPTOR_CONTROL Control,
-                                PULONG Revision)
+RtlGetControlSecurityDescriptor(IN PSECURITY_DESCRIPTOR
SecurityDescriptor,
+                                OUT PSECURITY_DESCRIPTOR_CONTROL
Control,
+                                OUT PULONG Revision)
 {
+   PISECURITY_DESCRIPTOR pSD =
(PISECURITY_DESCRIPTOR)SecurityDescriptor;
+
    PAGED_CODE_RTL();
 
-   *Revision = SecurityDescriptor->Revision;
+   *Revision = pSD->Revision;
 
-   if (SecurityDescriptor->Revision != SECURITY_DESCRIPTOR_REVISION1)
+   if (pSD->Revision != SECURITY_DESCRIPTOR_REVISION1)
    {
       return STATUS_UNKNOWN_REVISION;
    }
 
-   *Control = SecurityDescriptor->Control;
+   *Control = pSD->Control;
 
    return STATUS_SUCCESS;
 }
@@ -555,24 +576,26 @@
  * @implemented
  */
 NTSTATUS NTAPI
-RtlSetControlSecurityDescriptor(IN PISECURITY_DESCRIPTOR
SecurityDescriptor,
+RtlSetControlSecurityDescriptor(IN PSECURITY_DESCRIPTOR
SecurityDescriptor,
                                 IN SECURITY_DESCRIPTOR_CONTROL
ControlBitsOfInterest,
                                 IN SECURITY_DESCRIPTOR_CONTROL
ControlBitsToSet)
 {
-  PAGED_CODE_RTL();
+   PISECURITY_DESCRIPTOR pSD =
(PISECURITY_DESCRIPTOR)SecurityDescriptor;
 
-  if (SecurityDescriptor->Revision != SECURITY_DESCRIPTOR_REVISION1)
-  {
-    return STATUS_UNKNOWN_REVISION;
-  }
+   PAGED_CODE_RTL();
 
-  /* Zero the 'bits of interest' */
-  SecurityDescriptor->Control &= ~ControlBitsOfInterest;
+   if (pSD->Revision != SECURITY_DESCRIPTOR_REVISION1)
+   {
+      return STATUS_UNKNOWN_REVISION;
+   }
 
-  /* Set the 'bits to set' */
-  SecurityDescriptor->Control |= (ControlBitsToSet &
ControlBitsOfInterest);
+   /* Zero the 'bits of interest' */
+   pSD->Control &= ~ControlBitsOfInterest;
 
-  return STATUS_SUCCESS;
+   /* Set the 'bits to set' */
+   pSD->Control |= (ControlBitsToSet & ControlBitsOfInterest);
+
+   return STATUS_SUCCESS;
 }
 
 
@@ -580,32 +603,34 @@
  * @implemented
  */
 NTSTATUS NTAPI
-RtlGetSaclSecurityDescriptor(PISECURITY_DESCRIPTOR SecurityDescriptor,
-                             PBOOLEAN SaclPresent,
-                             PACL *Sacl,
-                             PBOOLEAN SaclDefaulted)
+RtlGetSaclSecurityDescriptor(IN PSECURITY_DESCRIPTOR
SecurityDescriptor,
+                             OUT PBOOLEAN SaclPresent,
+                             OUT PACL *Sacl,
+                             OUT PBOOLEAN SaclDefaulted)
 {
+   PISECURITY_DESCRIPTOR pSD =
(PISECURITY_DESCRIPTOR)SecurityDescriptor;
+
    PAGED_CODE_RTL();
 
-   if (SecurityDescriptor->Revision != SECURITY_DESCRIPTOR_REVISION1)
+   if (pSD->Revision != SECURITY_DESCRIPTOR_REVISION1)
    {
       return STATUS_UNKNOWN_REVISION;
    }
 
-   if (!(SecurityDescriptor->Control & SE_SACL_PRESENT))
+   if (!(pSD->Control & SE_SACL_PRESENT))
    {
       *SaclPresent = FALSE;
       return STATUS_SUCCESS;
    }
    *SaclPresent = TRUE;
 
-   RtlpQuerySecurityDescriptorPointers(SecurityDescriptor,
+   RtlpQuerySecurityDescriptorPointers(pSD,
                                        NULL,
                                        NULL,
                                        Sacl,
                                        NULL);
 
-   *SaclDefaulted = ((SecurityDescriptor->Control & SE_SACL_DEFAULTED)
? TRUE : FALSE);
+   *SaclDefaulted = ((pSD->Control & SE_SACL_DEFAULTED) ? TRUE :
FALSE);
 
    return STATUS_SUCCESS;
 }
@@ -615,36 +640,38 @@
  * @implemented
  */
 NTSTATUS NTAPI
-RtlSetSaclSecurityDescriptor(PISECURITY_DESCRIPTOR SecurityDescriptor,
-                             BOOLEAN SaclPresent,
-                             PACL Sacl,
-                             BOOLEAN SaclDefaulted)
+RtlSetSaclSecurityDescriptor(IN OUT PSECURITY_DESCRIPTOR
SecurityDescriptor,
+                             IN BOOLEAN SaclPresent,
+                             IN PACL Sacl,
+                             IN BOOLEAN SaclDefaulted)
 {
+   PISECURITY_DESCRIPTOR pSD =
(PISECURITY_DESCRIPTOR)SecurityDescriptor;
+
    PAGED_CODE_RTL();
 
-   if (SecurityDescriptor->Revision != SECURITY_DESCRIPTOR_REVISION1)
+   if (pSD->Revision != SECURITY_DESCRIPTOR_REVISION1)
    {
       return STATUS_UNKNOWN_REVISION;
    }
 
-   if (SecurityDescriptor->Control & SE_SELF_RELATIVE)
+   if (pSD->Control & SE_SELF_RELATIVE)
    {
       return STATUS_BAD_DESCRIPTOR_FORMAT;
    }
 
    if (!SaclPresent)
    {
-      SecurityDescriptor->Control = SecurityDescriptor->Control &
~(SE_SACL_PRESENT);
+      pSD->Control &= ~(SE_SACL_PRESENT);
       return STATUS_SUCCESS;
    }
 
-   SecurityDescriptor->Control = SecurityDescriptor->Control |
SE_SACL_PRESENT;
-   SecurityDescriptor->Sacl = Sacl;
-   SecurityDescriptor->Control = SecurityDescriptor->Control &
~(SE_SACL_DEFAULTED);
+   pSD->Sacl = Sacl;
+   pSD->Control |= SE_SACL_PRESENT;
+   pSD->Control &= ~(SE_SACL_DEFAULTED);
 
    if (SaclDefaulted)
    {
-      SecurityDescriptor->Control = SecurityDescriptor->Control |
SE_SACL_DEFAULTED;
+      pSD->Control |= SE_SACL_DEFAULTED;
    }
 
    return STATUS_SUCCESS;
@@ -655,18 +682,20 @@
  * @implemented
  */
 NTSTATUS NTAPI
-RtlSelfRelativeToAbsoluteSD(PISECURITY_DESCRIPTOR RelSD,
-                            PISECURITY_DESCRIPTOR AbsSD,
-                            PDWORD AbsSDSize,
-                            PACL Dacl,
-                            PDWORD DaclSize,
-                            PACL Sacl,
-                            PDWORD SaclSize,
-                            PSID Owner,
-                            PDWORD OwnerSize,
-                            PSID Group,
-                            PDWORD GroupSize)
+RtlSelfRelativeToAbsoluteSD(IN PSECURITY_DESCRIPTOR SelfRelativeSD,
+                            OUT PSECURITY_DESCRIPTOR AbsoluteSD,
+                            IN PULONG AbsoluteSDSize,
+                            IN PACL Dacl,
+                            IN PULONG DaclSize,
+                            IN PACL Sacl,
+                            IN PULONG SaclSize,
+                            IN PSID Owner,
+                            IN PULONG OwnerSize,
+                            IN PSID PrimaryGroup,
+                            IN PULONG PrimaryGroupSize)
 {
+   PISECURITY_DESCRIPTOR pAbsSD = (PISECURITY_DESCRIPTOR)AbsoluteSD;
+   PISECURITY_DESCRIPTOR pRelSD =
(PISECURITY_DESCRIPTOR)SelfRelativeSD;
    ULONG OwnerLength;
    ULONG GroupLength;
    ULONG DaclLength;
@@ -678,17 +707,17 @@
 
    PAGED_CODE_RTL();
 
-   if (RelSD->Revision != SECURITY_DESCRIPTOR_REVISION1)
+   if (pRelSD->Revision != SECURITY_DESCRIPTOR_REVISION1)
    {
       return STATUS_UNKNOWN_REVISION;
    }
 
-   if (!(RelSD->Control & SE_SELF_RELATIVE))
+   if (!(pRelSD->Control & SE_SELF_RELATIVE))
    {
       return STATUS_BAD_DESCRIPTOR_FORMAT;
    }
 
-   RtlpQuerySecurityDescriptor (RelSD,
+   RtlpQuerySecurityDescriptor (pRelSD,
                                 &pOwner,
                                 &OwnerLength,
                                 &pGroup,
@@ -699,7 +728,7 @@
                                 &SaclLength);
 
    if (OwnerLength > *OwnerSize ||
-       GroupLength > *GroupSize ||
+       GroupLength > *PrimaryGroupSize ||
        DaclLength > *DaclSize ||
        SaclLength > *SaclSize)
    {
@@ -707,20 +736,20 @@
    }
 
    RtlCopyMemory (Owner, pOwner, OwnerLength);
-   RtlCopyMemory (Group, pGroup, GroupLength);
+   RtlCopyMemory (PrimaryGroup, pGroup, GroupLength);
    RtlCopyMemory (Dacl, pDacl, DaclLength);
    RtlCopyMemory (Sacl, pSacl, SaclLength);
 
-   AbsSD->Revision = RelSD->Revision;
-   AbsSD->Sbz1 = RelSD->Sbz1;
-   AbsSD->Control = RelSD->Control & ~SE_SELF_RELATIVE;
-   AbsSD->Owner = Owner;
-   AbsSD->Group = Group;
-   AbsSD->Dacl = Dacl;
-   AbsSD->Sacl = Sacl;
+   pAbsSD->Revision = pRelSD->Revision;
+   pAbsSD->Sbz1 = pRelSD->Sbz1;
+   pAbsSD->Control = pRelSD->Control & ~SE_SELF_RELATIVE;
+   pAbsSD->Owner = Owner;
+   pAbsSD->Group = PrimaryGroup;
+   pAbsSD->Dacl = Dacl;
+   pAbsSD->Sacl = Sacl;
 
    *OwnerSize = OwnerLength;
-   *GroupSize = GroupLength;
+   *PrimaryGroupSize = GroupLength;
    *DaclSize = DaclLength;
    *SaclSize = SaclLength;
 
@@ -732,11 +761,11 @@
  * @implemented
  */
 NTSTATUS NTAPI
-RtlSelfRelativeToAbsoluteSD2(PISECURITY_DESCRIPTOR
SelfRelativeSecurityDescriptor,
-                             PULONG BufferSize)
+RtlSelfRelativeToAbsoluteSD2(IN OUT PSECURITY_DESCRIPTOR
SelfRelativeSD,
+                             OUT PULONG BufferSize)
 {
-    PISECURITY_DESCRIPTOR AbsSD = SelfRelativeSecurityDescriptor;
-    PISECURITY_DESCRIPTOR_RELATIVE RelSD =
(PISECURITY_DESCRIPTOR_RELATIVE)SelfRelativeSecurityDescriptor;
+    PISECURITY_DESCRIPTOR pAbsSD =
(PISECURITY_DESCRIPTOR)SelfRelativeSD;
+    PISECURITY_DESCRIPTOR_RELATIVE pRelSD =
(PISECURITY_DESCRIPTOR_RELATIVE)SelfRelativeSD;
 #ifdef _WIN64
     PVOID DataStart, DataEnd;
     ULONG DataSize;
@@ -753,7 +782,7 @@
 
     PAGED_CODE_RTL();
 
-    if (SelfRelativeSecurityDescriptor == NULL)
+    if (SelfRelativeSD == NULL)
     {
         return STATUS_INVALID_PARAMETER_1;
     }
@@ -762,11 +791,11 @@
         return STATUS_INVALID_PARAMETER_2;
     }
 
-    if (RelSD->Revision != SECURITY_DESCRIPTOR_REVISION1)
+    if (pRelSD->Revision != SECURITY_DESCRIPTOR_REVISION1)
     {
         return STATUS_UNKNOWN_REVISION;
     }
-    if (!(RelSD->Control & SE_SELF_RELATIVE))
+    if (!(pRelSD->Control & SE_SELF_RELATIVE))
     {
         return STATUS_BAD_DESCRIPTOR_FORMAT;
     }
@@ -776,7 +805,7 @@
 
 #ifdef _WIN64
 
-    RtlpQuerySecurityDescriptor(SelfRelativeSecurityDescriptor,
+    RtlpQuerySecurityDescriptor((PISECURITY_DESCRIPTOR)pRelSD,
                                 &pOwner,
                                 &OwnerLength,
                                 &pGroup,
@@ -831,35 +860,35 @@
            descriptor! Also the data area must be located somewhere
after the
            end of the SECURITY_DESCRIPTOR_RELATIVE structure */
         ASSERT(DataStart != NULL);
-        ASSERT((ULONG_PTR)DataStart >= (ULONG_PTR)(RelSD + 1));
+        ASSERT((ULONG_PTR)DataStart >= (ULONG_PTR)(pRelSD + 1));
 
         /* it's time to move the data */
-        RtlMoveMemory((PVOID)(AbsSD + 1),
+        RtlMoveMemory((PVOID)(pAbsSD + 1),
                       DataStart,
                       DataSize);
 
-        MoveDelta = (LONG)((LONG_PTR)(AbsSD + 1) -
(LONG_PTR)DataStart);
+        MoveDelta = (LONG)((LONG_PTR)(pAbsSD + 1) -
(LONG_PTR)DataStart);
 
         /* adjust the pointers if neccessary */
         if (pOwner != NULL)
-            AbsSD->Owner = (PSID)((LONG_PTR)pOwner + MoveDelta);
+            pAbsSD->Owner = (PSID)((LONG_PTR)pOwner + MoveDelta);
         else
-            AbsSD->Owner = NULL;
+            pAbsSD->Owner = NULL;
 
         if (pGroup != NULL)
-            AbsSD->Group = (PSID)((LONG_PTR)pGroup + MoveDelta);
+            pAbsSD->Group = (PSID)((LONG_PTR)pGroup + MoveDelta);
         else
-            AbsSD->Group = NULL;
+            pAbsSD->Group = NULL;
 
         if (pSacl != NULL)
-            AbsSD->Sacl = (PACL)((LONG_PTR)pSacl + MoveDelta);
+            pAbsSD->Sacl = (PACL)((LONG_PTR)pSacl + MoveDelta);
         else
-            AbsSD->Sacl = NULL;
+            pAbsSD->Sacl = NULL;
 
         if (pDacl != NULL)
-            AbsSD->Dacl = (PACL)((LONG_PTR)pDacl + MoveDelta);
+            pAbsSD->Dacl = (PACL)((LONG_PTR)pDacl + MoveDelta);
         else
-            AbsSD->Dacl = NULL;
+            pAbsSD->Dacl = NULL;
     }
     else
     {
@@ -869,18 +898,18 @@
         ASSERT(pSacl == NULL);
         ASSERT(pDacl == NULL);
 
-        AbsSD->Owner = NULL;
-        AbsSD->Group = NULL;
-        AbsSD->Sacl = NULL;
-        AbsSD->Dacl = NULL;
+        pAbsSD->Owner = NULL;
+        pAbsSD->Group = NULL;
+        pAbsSD->Sacl = NULL;
+        pAbsSD->Dacl = NULL;
     }
 
     /* clear the self-relative flag */
-    AbsSD->Control &= ~SE_SELF_RELATIVE;
+    pAbsSD->Control &= ~SE_SELF_RELATIVE;
 
 #else
 
-    RtlpQuerySecurityDescriptorPointers(SelfRelativeSecurityDescriptor,
+    RtlpQuerySecurityDescriptorPointers((PISECURITY_DESCRIPTOR)pRelSD,
                                         &pOwner,
                                         &pGroup,
                                         &pSacl,
@@ -889,11 +918,11 @@
     ASSERT(sizeof(SECURITY_DESCRIPTOR) ==
sizeof(SECURITY_DESCRIPTOR_RELATIVE));
 
     /* clear the self-relative flag and simply convert the offsets to
pointers */
-    AbsSD->Control &= ~SE_SELF_RELATIVE;
-    AbsSD->Owner = pOwner;
-    AbsSD->Group = pGroup;
-    AbsSD->Sacl = pSacl;
-    AbsSD->Dacl = pDacl;
+    pAbsSD->Control &= ~SE_SELF_RELATIVE;
+    pAbsSD->Owner = pOwner;
+    pAbsSD->Group = pGroup;
+    pAbsSD->Sacl = pSacl;
+    pAbsSD->Dacl = pDacl;
 
 #endif
 
@@ -905,22 +934,24 @@
  * @implemented
  */
 BOOLEAN NTAPI
-RtlValidRelativeSecurityDescriptor(IN PISECURITY_DESCRIPTOR
SecurityDescriptorInput,
+RtlValidRelativeSecurityDescriptor(IN PSECURITY_DESCRIPTOR
SecurityDescriptorInput,
                                    IN ULONG SecurityDescriptorLength,
                                    IN SECURITY_INFORMATION
RequiredInformation)
 {
+   PISECURITY_DESCRIPTOR pSD =
(PISECURITY_DESCRIPTOR)SecurityDescriptorInput;
+
    PAGED_CODE_RTL();
 
    if (SecurityDescriptorLength < sizeof(SECURITY_DESCRIPTOR_RELATIVE)
||
        SecurityDescriptorInput->Revision !=
SECURITY_DESCRIPTOR_REVISION1 ||
-       !(SecurityDescriptorInput->Control & SE_SELF_RELATIVE))
+       !(pSD->Control & SE_SELF_RELATIVE))
    {
       return FALSE;
    }
 
-   if (SecurityDescriptorInput->Owner != 0)
+   if (pSD->Owner != 0)
    {
-      PSID Owner = (PSID)((ULONG_PTR)SecurityDescriptorInput->Owner +
(ULONG_PTR)SecurityDescriptorInput);
+      PSID Owner = (PSID)((ULONG_PTR)pSD->Owner + (ULONG_PTR)pSD);
       if (!RtlValidSid(Owner))
       {
          return FALSE;
@@ -931,9 +962,9 @@
       return FALSE;
    }
 
-   if (SecurityDescriptorInput->Group != 0)
+   if (pSD->Group != 0)
    {
-      PSID Group = (PSID)((ULONG_PTR)SecurityDescriptorInput->Group +
(ULONG_PTR)SecurityDescriptorInput);
+      PSID Group = (PSID)((ULONG_PTR)pSD->Group + (ULONG_PTR)pSD);
       if (!RtlValidSid(Group))
       {
          return FALSE;
@@ -944,10 +975,10 @@
       return FALSE;
    }
 
-   if (SecurityDescriptorInput->Control & SE_DACL_PRESENT)
+   if (pSD->Control & SE_DACL_PRESENT)
    {
-      if (SecurityDescriptorInput->Dacl != 0 &&
-          !RtlValidAcl((PACL)((ULONG_PTR)SecurityDescriptorInput->Dacl
+ (ULONG_PTR)SecurityDescriptorInput)))
+      if (pSD->Dacl != 0 &&
+          !RtlValidAcl((PACL)((ULONG_PTR)pSD->Dacl + (ULONG_PTR)pSD)))
       {
          return FALSE;
       }
@@ -957,10 +988,10 @@
       return FALSE;
[truncated at 1000 lines; 122 more skipped] 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.reactos.org/pipermail/ros-diffs/attachments/20051221/997ed4ed/attachment-0001.html


More information about the Ros-diffs mailing list