mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 15:52:57 +00:00
- Use ULONG_PTR instead of ULONG for integer arithmetics on pointers.
svn path=/trunk/; revision=10729
This commit is contained in:
parent
28c8c91905
commit
a48983fc6d
2 changed files with 37 additions and 37 deletions
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: sd.c,v 1.3 2004/08/07 19:13:25 ion Exp $
|
/* $Id: sd.c,v 1.4 2004/08/28 22:22:39 navaraf Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -59,8 +59,8 @@ RtlLengthSecurityDescriptor(PSECURITY_DESCRIPTOR SecurityDescriptor)
|
||||||
Owner = SecurityDescriptor->Owner;
|
Owner = SecurityDescriptor->Owner;
|
||||||
if (SecurityDescriptor->Control & SE_SELF_RELATIVE)
|
if (SecurityDescriptor->Control & SE_SELF_RELATIVE)
|
||||||
{
|
{
|
||||||
Owner = (PSID)((ULONG)Owner +
|
Owner = (PSID)((ULONG_PTR)Owner +
|
||||||
(ULONG)SecurityDescriptor);
|
(ULONG_PTR)SecurityDescriptor);
|
||||||
}
|
}
|
||||||
Length = Length + ((sizeof(SID) + (Owner->SubAuthorityCount - 1) *
|
Length = Length + ((sizeof(SID) + (Owner->SubAuthorityCount - 1) *
|
||||||
sizeof(ULONG) + 3) & 0xfc);
|
sizeof(ULONG) + 3) & 0xfc);
|
||||||
|
@ -71,10 +71,10 @@ RtlLengthSecurityDescriptor(PSECURITY_DESCRIPTOR SecurityDescriptor)
|
||||||
Group = SecurityDescriptor->Group;
|
Group = SecurityDescriptor->Group;
|
||||||
if (SecurityDescriptor->Control & SE_SELF_RELATIVE)
|
if (SecurityDescriptor->Control & SE_SELF_RELATIVE)
|
||||||
{
|
{
|
||||||
Group = (PSID)((ULONG)Group + (ULONG)SecurityDescriptor);
|
Group = (PSID)((ULONG_PTR)Group + (ULONG_PTR)SecurityDescriptor);
|
||||||
}
|
}
|
||||||
Length = Length + ((sizeof(SID) + (Group->SubAuthorityCount - 1) *
|
Length = Length + ((sizeof(SID) + (Group->SubAuthorityCount - 1) *
|
||||||
sizeof(ULONG) + 3) & 0xfc);
|
sizeof(ULONG_PTR) + 3) & 0xfc);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SecurityDescriptor->Control & SE_DACL_PRESENT &&
|
if (SecurityDescriptor->Control & SE_DACL_PRESENT &&
|
||||||
|
@ -83,7 +83,7 @@ RtlLengthSecurityDescriptor(PSECURITY_DESCRIPTOR SecurityDescriptor)
|
||||||
Dacl = SecurityDescriptor->Dacl;
|
Dacl = SecurityDescriptor->Dacl;
|
||||||
if (SecurityDescriptor->Control & SE_SELF_RELATIVE)
|
if (SecurityDescriptor->Control & SE_SELF_RELATIVE)
|
||||||
{
|
{
|
||||||
Dacl = (PACL)((ULONG)Dacl + (PVOID)SecurityDescriptor);
|
Dacl = (PACL)((ULONG_PTR)Dacl + (ULONG_PTR)SecurityDescriptor);
|
||||||
}
|
}
|
||||||
Length = Length + ((Dacl->AclSize + 3) & 0xfc);
|
Length = Length + ((Dacl->AclSize + 3) & 0xfc);
|
||||||
}
|
}
|
||||||
|
@ -94,7 +94,7 @@ RtlLengthSecurityDescriptor(PSECURITY_DESCRIPTOR SecurityDescriptor)
|
||||||
Sacl = SecurityDescriptor->Sacl;
|
Sacl = SecurityDescriptor->Sacl;
|
||||||
if (SecurityDescriptor->Control & SE_SELF_RELATIVE)
|
if (SecurityDescriptor->Control & SE_SELF_RELATIVE)
|
||||||
{
|
{
|
||||||
Sacl = (PACL)((ULONG)Sacl + (PVOID)SecurityDescriptor);
|
Sacl = (PACL)((ULONG_PTR)Sacl + (ULONG_PTR)SecurityDescriptor);
|
||||||
}
|
}
|
||||||
Length = Length + ((Sacl->AclSize + 3) & 0xfc);
|
Length = Length + ((Sacl->AclSize + 3) & 0xfc);
|
||||||
}
|
}
|
||||||
|
@ -130,8 +130,8 @@ RtlGetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR SecurityDescriptor,
|
||||||
{
|
{
|
||||||
if (SecurityDescriptor->Control & SE_SELF_RELATIVE)
|
if (SecurityDescriptor->Control & SE_SELF_RELATIVE)
|
||||||
{
|
{
|
||||||
*Dacl = (PACL)((ULONG)SecurityDescriptor->Dacl +
|
*Dacl = (PACL)((ULONG_PTR)SecurityDescriptor->Dacl +
|
||||||
(PVOID)SecurityDescriptor);
|
(ULONG_PTR)SecurityDescriptor);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -202,7 +202,7 @@ RtlValidSecurityDescriptor(PSECURITY_DESCRIPTOR SecurityDescriptor)
|
||||||
Owner = SecurityDescriptor->Owner;
|
Owner = SecurityDescriptor->Owner;
|
||||||
if (SecurityDescriptor->Control & SE_SELF_RELATIVE)
|
if (SecurityDescriptor->Control & SE_SELF_RELATIVE)
|
||||||
{
|
{
|
||||||
Owner = (PSID)((ULONG)Owner + (ULONG)SecurityDescriptor);
|
Owner = (PSID)((ULONG_PTR)Owner + (ULONG_PTR)SecurityDescriptor);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!RtlValidSid(Owner))
|
if (!RtlValidSid(Owner))
|
||||||
|
@ -213,7 +213,7 @@ RtlValidSecurityDescriptor(PSECURITY_DESCRIPTOR SecurityDescriptor)
|
||||||
Group = SecurityDescriptor->Group;
|
Group = SecurityDescriptor->Group;
|
||||||
if (SecurityDescriptor->Control & SE_SELF_RELATIVE)
|
if (SecurityDescriptor->Control & SE_SELF_RELATIVE)
|
||||||
{
|
{
|
||||||
Group = (PSID)((ULONG)Group + (ULONG)SecurityDescriptor);
|
Group = (PSID)((ULONG_PTR)Group + (ULONG_PTR)SecurityDescriptor);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!RtlValidSid(Group))
|
if (!RtlValidSid(Group))
|
||||||
|
@ -227,7 +227,7 @@ RtlValidSecurityDescriptor(PSECURITY_DESCRIPTOR SecurityDescriptor)
|
||||||
Dacl = SecurityDescriptor->Dacl;
|
Dacl = SecurityDescriptor->Dacl;
|
||||||
if (SecurityDescriptor->Control & SE_SELF_RELATIVE)
|
if (SecurityDescriptor->Control & SE_SELF_RELATIVE)
|
||||||
{
|
{
|
||||||
Dacl = (PACL)((ULONG)Dacl + (ULONG)SecurityDescriptor);
|
Dacl = (PACL)((ULONG_PTR)Dacl + (ULONG_PTR)SecurityDescriptor);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!RtlValidAcl(Dacl))
|
if (!RtlValidAcl(Dacl))
|
||||||
|
@ -242,7 +242,7 @@ RtlValidSecurityDescriptor(PSECURITY_DESCRIPTOR SecurityDescriptor)
|
||||||
Sacl = SecurityDescriptor->Sacl;
|
Sacl = SecurityDescriptor->Sacl;
|
||||||
if (SecurityDescriptor->Control & SE_SELF_RELATIVE)
|
if (SecurityDescriptor->Control & SE_SELF_RELATIVE)
|
||||||
{
|
{
|
||||||
Sacl = (PACL)((ULONG)Sacl + (ULONG)SecurityDescriptor);
|
Sacl = (PACL)((ULONG_PTR)Sacl + (ULONG_PTR)SecurityDescriptor);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!RtlValidAcl(Sacl))
|
if (!RtlValidAcl(Sacl))
|
||||||
|
@ -296,8 +296,8 @@ RtlGetOwnerSecurityDescriptor(PSECURITY_DESCRIPTOR SecurityDescriptor,
|
||||||
{
|
{
|
||||||
if (SecurityDescriptor->Control & SE_SELF_RELATIVE)
|
if (SecurityDescriptor->Control & SE_SELF_RELATIVE)
|
||||||
{
|
{
|
||||||
*Owner = (PSID)((ULONG)SecurityDescriptor->Owner +
|
*Owner = (PSID)((ULONG_PTR)SecurityDescriptor->Owner +
|
||||||
(PVOID)SecurityDescriptor);
|
(ULONG_PTR)SecurityDescriptor);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -360,8 +360,8 @@ RtlGetGroupSecurityDescriptor(PSECURITY_DESCRIPTOR SecurityDescriptor,
|
||||||
{
|
{
|
||||||
if (SecurityDescriptor->Control & SE_SELF_RELATIVE)
|
if (SecurityDescriptor->Control & SE_SELF_RELATIVE)
|
||||||
{
|
{
|
||||||
*Group = (PSID)((ULONG)SecurityDescriptor->Group +
|
*Group = (PSID)((ULONG_PTR)SecurityDescriptor->Group +
|
||||||
(PVOID)SecurityDescriptor);
|
(ULONG_PTR)SecurityDescriptor);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -400,7 +400,7 @@ RtlpQuerySecurityDescriptor(PSECURITY_DESCRIPTOR SecurityDescriptor,
|
||||||
*Owner = SecurityDescriptor->Owner;
|
*Owner = SecurityDescriptor->Owner;
|
||||||
if (SecurityDescriptor->Control & SE_SELF_RELATIVE)
|
if (SecurityDescriptor->Control & SE_SELF_RELATIVE)
|
||||||
{
|
{
|
||||||
*Owner = (PSID)((ULONG)*Owner + (ULONG)SecurityDescriptor);
|
*Owner = (PSID)((ULONG_PTR)*Owner + (ULONG_PTR)SecurityDescriptor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -423,7 +423,7 @@ RtlpQuerySecurityDescriptor(PSECURITY_DESCRIPTOR SecurityDescriptor,
|
||||||
*Dacl = SecurityDescriptor->Dacl;
|
*Dacl = SecurityDescriptor->Dacl;
|
||||||
if (SecurityDescriptor->Control & SE_SELF_RELATIVE)
|
if (SecurityDescriptor->Control & SE_SELF_RELATIVE)
|
||||||
{
|
{
|
||||||
*Dacl = (PACL)((ULONG)*Dacl + (ULONG)SecurityDescriptor);
|
*Dacl = (PACL)((ULONG_PTR)*Dacl + (ULONG_PTR)SecurityDescriptor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -445,7 +445,7 @@ RtlpQuerySecurityDescriptor(PSECURITY_DESCRIPTOR SecurityDescriptor,
|
||||||
*Group = SecurityDescriptor->Group;
|
*Group = SecurityDescriptor->Group;
|
||||||
if (SecurityDescriptor->Control & SE_SELF_RELATIVE)
|
if (SecurityDescriptor->Control & SE_SELF_RELATIVE)
|
||||||
{
|
{
|
||||||
*Group = (PSID)((ULONG)*Group + (ULONG)SecurityDescriptor);
|
*Group = (PSID)((ULONG_PTR)*Group + (ULONG_PTR)SecurityDescriptor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -468,7 +468,7 @@ RtlpQuerySecurityDescriptor(PSECURITY_DESCRIPTOR SecurityDescriptor,
|
||||||
*Sacl = SecurityDescriptor->Sacl;
|
*Sacl = SecurityDescriptor->Sacl;
|
||||||
if (SecurityDescriptor->Control & SE_SELF_RELATIVE)
|
if (SecurityDescriptor->Control & SE_SELF_RELATIVE)
|
||||||
{
|
{
|
||||||
*Sacl = (PACL)((ULONG)*Sacl + (ULONG)SecurityDescriptor);
|
*Sacl = (PACL)((ULONG_PTR)*Sacl + (ULONG_PTR)SecurityDescriptor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -504,7 +504,7 @@ RtlMakeSelfRelativeSD(PSECURITY_DESCRIPTOR AbsSD,
|
||||||
ULONG SaclLength;
|
ULONG SaclLength;
|
||||||
ULONG DaclLength;
|
ULONG DaclLength;
|
||||||
ULONG TotalLength;
|
ULONG TotalLength;
|
||||||
ULONG Current;
|
ULONG_PTR Current;
|
||||||
|
|
||||||
RtlpQuerySecurityDescriptor(AbsSD,
|
RtlpQuerySecurityDescriptor(AbsSD,
|
||||||
&Owner,
|
&Owner,
|
||||||
|
@ -527,14 +527,14 @@ RtlMakeSelfRelativeSD(PSECURITY_DESCRIPTOR AbsSD,
|
||||||
memmove(RelSD,
|
memmove(RelSD,
|
||||||
AbsSD,
|
AbsSD,
|
||||||
sizeof(SECURITY_DESCRIPTOR));
|
sizeof(SECURITY_DESCRIPTOR));
|
||||||
Current = (ULONG)RelSD + sizeof(SECURITY_DESCRIPTOR);
|
Current = (ULONG_PTR)RelSD + sizeof(SECURITY_DESCRIPTOR);
|
||||||
|
|
||||||
if (SaclLength != 0)
|
if (SaclLength != 0)
|
||||||
{
|
{
|
||||||
memmove((PVOID)Current,
|
memmove((PVOID)Current,
|
||||||
Sacl,
|
Sacl,
|
||||||
SaclLength);
|
SaclLength);
|
||||||
RelSD->Sacl = (PACL)((ULONG)Current - (ULONG)RelSD);
|
RelSD->Sacl = (PACL)((ULONG_PTR)Current - (ULONG_PTR)RelSD);
|
||||||
Current += SaclLength;
|
Current += SaclLength;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -543,7 +543,7 @@ RtlMakeSelfRelativeSD(PSECURITY_DESCRIPTOR AbsSD,
|
||||||
memmove((PVOID)Current,
|
memmove((PVOID)Current,
|
||||||
Dacl,
|
Dacl,
|
||||||
DaclLength);
|
DaclLength);
|
||||||
RelSD->Dacl = (PACL)((ULONG)Current - (ULONG)RelSD);
|
RelSD->Dacl = (PACL)((ULONG_PTR)Current - (ULONG_PTR)RelSD);
|
||||||
Current += DaclLength;
|
Current += DaclLength;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -552,7 +552,7 @@ RtlMakeSelfRelativeSD(PSECURITY_DESCRIPTOR AbsSD,
|
||||||
memmove((PVOID)Current,
|
memmove((PVOID)Current,
|
||||||
Owner,
|
Owner,
|
||||||
OwnerLength);
|
OwnerLength);
|
||||||
RelSD->Owner = (PSID)((ULONG)Current - (ULONG)RelSD);
|
RelSD->Owner = (PSID)((ULONG_PTR)Current - (ULONG_PTR)RelSD);
|
||||||
Current += OwnerLength;
|
Current += OwnerLength;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -561,7 +561,7 @@ RtlMakeSelfRelativeSD(PSECURITY_DESCRIPTOR AbsSD,
|
||||||
memmove((PVOID)Current,
|
memmove((PVOID)Current,
|
||||||
Group,
|
Group,
|
||||||
GroupLength);
|
GroupLength);
|
||||||
RelSD->Group = (PSID)((ULONG)Current - (ULONG)RelSD);
|
RelSD->Group = (PSID)((ULONG_PTR)Current - (ULONG_PTR)RelSD);
|
||||||
}
|
}
|
||||||
|
|
||||||
RelSD->Control |= SE_SELF_RELATIVE;
|
RelSD->Control |= SE_SELF_RELATIVE;
|
||||||
|
@ -636,8 +636,8 @@ RtlGetSaclSecurityDescriptor(PSECURITY_DESCRIPTOR SecurityDescriptor,
|
||||||
{
|
{
|
||||||
if (SecurityDescriptor->Control & SE_SELF_RELATIVE)
|
if (SecurityDescriptor->Control & SE_SELF_RELATIVE)
|
||||||
{
|
{
|
||||||
*Sacl = (PACL)((ULONG)SecurityDescriptor->Sacl +
|
*Sacl = (PACL)((ULONG_PTR)SecurityDescriptor->Sacl +
|
||||||
(PVOID)SecurityDescriptor);
|
(ULONG_PTR)SecurityDescriptor);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: semgr.c,v 1.40 2004/08/15 16:39:12 chorns Exp $
|
/* $Id: semgr.c,v 1.41 2004/08/28 22:22:39 navaraf Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -12,7 +12,7 @@
|
||||||
/* INCLUDES *****************************************************************/
|
/* INCLUDES *****************************************************************/
|
||||||
|
|
||||||
#include <ntoskrnl.h>
|
#include <ntoskrnl.h>
|
||||||
#define NDEBUG
|
//#define NDEBUG
|
||||||
#include <internal/debug.h>
|
#include <internal/debug.h>
|
||||||
|
|
||||||
#define TAG_SXPT TAG('S', 'X', 'P', 'T')
|
#define TAG_SXPT TAG('S', 'X', 'P', 'T')
|
||||||
|
@ -335,7 +335,7 @@ SeAssignSecurity(PSECURITY_DESCRIPTOR ParentDescriptor OPTIONAL,
|
||||||
ULONG SaclLength = 0;
|
ULONG SaclLength = 0;
|
||||||
ULONG Length = 0;
|
ULONG Length = 0;
|
||||||
ULONG Control = 0;
|
ULONG Control = 0;
|
||||||
ULONG Current;
|
ULONG_PTR Current;
|
||||||
PSID Owner = NULL;
|
PSID Owner = NULL;
|
||||||
PSID Group = NULL;
|
PSID Group = NULL;
|
||||||
PACL Dacl = NULL;
|
PACL Dacl = NULL;
|
||||||
|
@ -501,14 +501,14 @@ SeAssignSecurity(PSECURITY_DESCRIPTOR ParentDescriptor OPTIONAL,
|
||||||
|
|
||||||
Descriptor->Control = Control | SE_SELF_RELATIVE;
|
Descriptor->Control = Control | SE_SELF_RELATIVE;
|
||||||
|
|
||||||
Current = (ULONG)Descriptor + sizeof(SECURITY_DESCRIPTOR);
|
Current = (ULONG_PTR)Descriptor + sizeof(SECURITY_DESCRIPTOR);
|
||||||
|
|
||||||
if (SaclLength != 0)
|
if (SaclLength != 0)
|
||||||
{
|
{
|
||||||
RtlCopyMemory((PVOID)Current,
|
RtlCopyMemory((PVOID)Current,
|
||||||
Sacl,
|
Sacl,
|
||||||
SaclLength);
|
SaclLength);
|
||||||
Descriptor->Sacl = (PACL)((ULONG)Current - (ULONG)Descriptor);
|
Descriptor->Sacl = (PACL)((ULONG_PTR)Current - (ULONG_PTR)Descriptor);
|
||||||
Current += SaclLength;
|
Current += SaclLength;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -517,7 +517,7 @@ SeAssignSecurity(PSECURITY_DESCRIPTOR ParentDescriptor OPTIONAL,
|
||||||
RtlCopyMemory((PVOID)Current,
|
RtlCopyMemory((PVOID)Current,
|
||||||
Dacl,
|
Dacl,
|
||||||
DaclLength);
|
DaclLength);
|
||||||
Descriptor->Dacl = (PACL)((ULONG)Current - (ULONG)Descriptor);
|
Descriptor->Dacl = (PACL)((ULONG_PTR)Current - (ULONG_PTR)Descriptor);
|
||||||
Current += DaclLength;
|
Current += DaclLength;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -526,7 +526,7 @@ SeAssignSecurity(PSECURITY_DESCRIPTOR ParentDescriptor OPTIONAL,
|
||||||
RtlCopyMemory((PVOID)Current,
|
RtlCopyMemory((PVOID)Current,
|
||||||
Owner,
|
Owner,
|
||||||
OwnerLength);
|
OwnerLength);
|
||||||
Descriptor->Owner = (PSID)((ULONG)Current - (ULONG)Descriptor);
|
Descriptor->Owner = (PSID)((ULONG_PTR)Current - (ULONG_PTR)Descriptor);
|
||||||
Current += OwnerLength;
|
Current += OwnerLength;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -535,7 +535,7 @@ SeAssignSecurity(PSECURITY_DESCRIPTOR ParentDescriptor OPTIONAL,
|
||||||
memmove((PVOID)Current,
|
memmove((PVOID)Current,
|
||||||
Group,
|
Group,
|
||||||
GroupLength);
|
GroupLength);
|
||||||
Descriptor->Group = (PSID)((ULONG)Current - (ULONG)Descriptor);
|
Descriptor->Group = (PSID)((ULONG_PTR)Current - (ULONG_PTR)Descriptor);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME: Unlock subject context */
|
/* FIXME: Unlock subject context */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue