-/* $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
* PROJECT: ReactOS kernel
Owner = SecurityDescriptor->Owner;
if (SecurityDescriptor->Control & SE_SELF_RELATIVE)
{
- Owner = (PSID)((ULONG)Owner +
- (ULONG)SecurityDescriptor);
+ Owner = (PSID)((ULONG_PTR)Owner +
+ (ULONG_PTR)SecurityDescriptor);
}
Length = Length + ((sizeof(SID) + (Owner->SubAuthorityCount - 1) *
sizeof(ULONG) + 3) & 0xfc);
Group = SecurityDescriptor->Group;
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) *
- sizeof(ULONG) + 3) & 0xfc);
+ sizeof(ULONG_PTR) + 3) & 0xfc);
}
if (SecurityDescriptor->Control & SE_DACL_PRESENT &&
Dacl = SecurityDescriptor->Dacl;
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);
}
Sacl = SecurityDescriptor->Sacl;
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);
}
{
if (SecurityDescriptor->Control & SE_SELF_RELATIVE)
{
- *Dacl = (PACL)((ULONG)SecurityDescriptor->Dacl +
- (PVOID)SecurityDescriptor);
+ *Dacl = (PACL)((ULONG_PTR)SecurityDescriptor->Dacl +
+ (ULONG_PTR)SecurityDescriptor);
}
else
{
Owner = SecurityDescriptor->Owner;
if (SecurityDescriptor->Control & SE_SELF_RELATIVE)
{
- Owner = (PSID)((ULONG)Owner + (ULONG)SecurityDescriptor);
+ Owner = (PSID)((ULONG_PTR)Owner + (ULONG_PTR)SecurityDescriptor);
}
if (!RtlValidSid(Owner))
Group = SecurityDescriptor->Group;
if (SecurityDescriptor->Control & SE_SELF_RELATIVE)
{
- Group = (PSID)((ULONG)Group + (ULONG)SecurityDescriptor);
+ Group = (PSID)((ULONG_PTR)Group + (ULONG_PTR)SecurityDescriptor);
}
if (!RtlValidSid(Group))
Dacl = SecurityDescriptor->Dacl;
if (SecurityDescriptor->Control & SE_SELF_RELATIVE)
{
- Dacl = (PACL)((ULONG)Dacl + (ULONG)SecurityDescriptor);
+ Dacl = (PACL)((ULONG_PTR)Dacl + (ULONG_PTR)SecurityDescriptor);
}
if (!RtlValidAcl(Dacl))
Sacl = SecurityDescriptor->Sacl;
if (SecurityDescriptor->Control & SE_SELF_RELATIVE)
{
- Sacl = (PACL)((ULONG)Sacl + (ULONG)SecurityDescriptor);
+ Sacl = (PACL)((ULONG_PTR)Sacl + (ULONG_PTR)SecurityDescriptor);
}
if (!RtlValidAcl(Sacl))
{
if (SecurityDescriptor->Control & SE_SELF_RELATIVE)
{
- *Owner = (PSID)((ULONG)SecurityDescriptor->Owner +
- (PVOID)SecurityDescriptor);
+ *Owner = (PSID)((ULONG_PTR)SecurityDescriptor->Owner +
+ (ULONG_PTR)SecurityDescriptor);
}
else
{
{
if (SecurityDescriptor->Control & SE_SELF_RELATIVE)
{
- *Group = (PSID)((ULONG)SecurityDescriptor->Group +
- (PVOID)SecurityDescriptor);
+ *Group = (PSID)((ULONG_PTR)SecurityDescriptor->Group +
+ (ULONG_PTR)SecurityDescriptor);
}
else
{
*Owner = SecurityDescriptor->Owner;
if (SecurityDescriptor->Control & SE_SELF_RELATIVE)
{
- *Owner = (PSID)((ULONG)*Owner + (ULONG)SecurityDescriptor);
+ *Owner = (PSID)((ULONG_PTR)*Owner + (ULONG_PTR)SecurityDescriptor);
}
}
else
*Dacl = SecurityDescriptor->Dacl;
if (SecurityDescriptor->Control & SE_SELF_RELATIVE)
{
- *Dacl = (PACL)((ULONG)*Dacl + (ULONG)SecurityDescriptor);
+ *Dacl = (PACL)((ULONG_PTR)*Dacl + (ULONG_PTR)SecurityDescriptor);
}
}
else
*Group = SecurityDescriptor->Group;
if (SecurityDescriptor->Control & SE_SELF_RELATIVE)
{
- *Group = (PSID)((ULONG)*Group + (ULONG)SecurityDescriptor);
+ *Group = (PSID)((ULONG_PTR)*Group + (ULONG_PTR)SecurityDescriptor);
}
}
else
*Sacl = SecurityDescriptor->Sacl;
if (SecurityDescriptor->Control & SE_SELF_RELATIVE)
{
- *Sacl = (PACL)((ULONG)*Sacl + (ULONG)SecurityDescriptor);
+ *Sacl = (PACL)((ULONG_PTR)*Sacl + (ULONG_PTR)SecurityDescriptor);
}
}
else
ULONG SaclLength;
ULONG DaclLength;
ULONG TotalLength;
- ULONG Current;
+ ULONG_PTR Current;
RtlpQuerySecurityDescriptor(AbsSD,
&Owner,
memmove(RelSD,
AbsSD,
sizeof(SECURITY_DESCRIPTOR));
- Current = (ULONG)RelSD + sizeof(SECURITY_DESCRIPTOR);
+ Current = (ULONG_PTR)RelSD + sizeof(SECURITY_DESCRIPTOR);
if (SaclLength != 0)
{
memmove((PVOID)Current,
Sacl,
SaclLength);
- RelSD->Sacl = (PACL)((ULONG)Current - (ULONG)RelSD);
+ RelSD->Sacl = (PACL)((ULONG_PTR)Current - (ULONG_PTR)RelSD);
Current += SaclLength;
}
memmove((PVOID)Current,
Dacl,
DaclLength);
- RelSD->Dacl = (PACL)((ULONG)Current - (ULONG)RelSD);
+ RelSD->Dacl = (PACL)((ULONG_PTR)Current - (ULONG_PTR)RelSD);
Current += DaclLength;
}
memmove((PVOID)Current,
Owner,
OwnerLength);
- RelSD->Owner = (PSID)((ULONG)Current - (ULONG)RelSD);
+ RelSD->Owner = (PSID)((ULONG_PTR)Current - (ULONG_PTR)RelSD);
Current += OwnerLength;
}
memmove((PVOID)Current,
Group,
GroupLength);
- RelSD->Group = (PSID)((ULONG)Current - (ULONG)RelSD);
+ RelSD->Group = (PSID)((ULONG_PTR)Current - (ULONG_PTR)RelSD);
}
RelSD->Control |= SE_SELF_RELATIVE;
{
if (SecurityDescriptor->Control & SE_SELF_RELATIVE)
{
- *Sacl = (PACL)((ULONG)SecurityDescriptor->Sacl +
- (PVOID)SecurityDescriptor);
+ *Sacl = (PACL)((ULONG_PTR)SecurityDescriptor->Sacl +
+ (ULONG_PTR)SecurityDescriptor);
}
else
{
-/* $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
* PROJECT: ReactOS kernel
/* INCLUDES *****************************************************************/
#include <ntoskrnl.h>
-#define NDEBUG
+//#define NDEBUG
#include <internal/debug.h>
#define TAG_SXPT TAG('S', 'X', 'P', 'T')
ULONG SaclLength = 0;
ULONG Length = 0;
ULONG Control = 0;
- ULONG Current;
+ ULONG_PTR Current;
PSID Owner = NULL;
PSID Group = NULL;
PACL Dacl = NULL;
Descriptor->Control = Control | SE_SELF_RELATIVE;
- Current = (ULONG)Descriptor + sizeof(SECURITY_DESCRIPTOR);
+ Current = (ULONG_PTR)Descriptor + sizeof(SECURITY_DESCRIPTOR);
if (SaclLength != 0)
{
RtlCopyMemory((PVOID)Current,
Sacl,
SaclLength);
- Descriptor->Sacl = (PACL)((ULONG)Current - (ULONG)Descriptor);
+ Descriptor->Sacl = (PACL)((ULONG_PTR)Current - (ULONG_PTR)Descriptor);
Current += SaclLength;
}
RtlCopyMemory((PVOID)Current,
Dacl,
DaclLength);
- Descriptor->Dacl = (PACL)((ULONG)Current - (ULONG)Descriptor);
+ Descriptor->Dacl = (PACL)((ULONG_PTR)Current - (ULONG_PTR)Descriptor);
Current += DaclLength;
}
RtlCopyMemory((PVOID)Current,
Owner,
OwnerLength);
- Descriptor->Owner = (PSID)((ULONG)Current - (ULONG)Descriptor);
+ Descriptor->Owner = (PSID)((ULONG_PTR)Current - (ULONG_PTR)Descriptor);
Current += OwnerLength;
}
memmove((PVOID)Current,
Group,
GroupLength);
- Descriptor->Group = (PSID)((ULONG)Current - (ULONG)Descriptor);
+ Descriptor->Group = (PSID)((ULONG_PTR)Current - (ULONG_PTR)Descriptor);
}
/* FIXME: Unlock subject context */