[FORMATTING]

Fix indentation and coding style. No code changes!

svn path=/trunk/; revision=57334
This commit is contained in:
Eric Kohl 2012-09-19 12:20:39 +00:00
parent c31b441d5c
commit c2ab3689b3
8 changed files with 1381 additions and 1349 deletions

View file

@ -31,28 +31,20 @@
*
* @implemented
*/
SIZE_T NTAPI
SIZE_T
NTAPI
RtlCompareMemory(IN const VOID *Source1,
IN const VOID *Source2,
IN SIZE_T Length)
{
SIZE_T i;
for(i=0; (i<Length) && (((PUCHAR)Source1)[i]==((PUCHAR)Source2)[i]); i++)
for (i = 0; (i < Length) && (((PUCHAR)Source1)[i] == ((PUCHAR)Source2)[i]); i++)
;
return i;
}
/*
* @implemented
*/
SIZE_T
NTAPI
RtlCompareMemoryUlong (
PVOID Source,
SIZE_T Length,
ULONG Value
)
/*
* FUNCTION: Compares a block of ULONGs with an ULONG and returns the number of equal bytes
* ARGUMENTS:
@ -60,7 +52,14 @@ RtlCompareMemoryUlong (
* Length = Number of bytes to compare
* Value = Value to compare
* RETURNS: Number of equal bytes
*
* @implemented
*/
SIZE_T
NTAPI
RtlCompareMemoryUlong(IN PVOID Source,
IN SIZE_T Length,
IN ULONG Value)
{
PULONG ptr = (PULONG)Source;
ULONG_PTR len = Length / sizeof(ULONG);
@ -70,6 +69,7 @@ RtlCompareMemoryUlong (
{
if (*ptr != Value)
break;
ptr++;
}
@ -83,11 +83,9 @@ RtlCompareMemoryUlong (
*/
VOID
NTAPI
RtlFillMemory (
PVOID Destination,
RtlFillMemory(PVOID Destination,
SIZE_T Length,
UCHAR Fill
)
UCHAR Fill)
{
memset(Destination, Fill, Length);
}
@ -99,11 +97,9 @@ RtlFillMemory (
*/
VOID
NTAPI
RtlFillMemoryUlong (
PVOID Destination,
RtlFillMemoryUlong(PVOID Destination,
SIZE_T Length,
ULONG Fill
)
ULONG Fill)
{
PULONG Dest = Destination;
SIZE_T Count = Length / sizeof(ULONG);
@ -123,28 +119,21 @@ RtlFillMemoryUlong (
*/
VOID
NTAPI
RtlMoveMemory (
PVOID Destination,
CONST VOID * Source,
SIZE_T Length
)
RtlMoveMemory(PVOID Destination,
CONST VOID *Source,
SIZE_T Length)
{
memmove (
Destination,
Source,
Length
);
memmove(Destination, Source, Length);
}
/*
* @implemented
*/
VOID
FASTCALL
RtlPrefetchMemoryNonTemporal(
IN PVOID Source,
IN SIZE_T Length
)
RtlPrefetchMemoryNonTemporal(IN PVOID Source,
IN SIZE_T Length)
{
/* By nature of prefetch, this is non-portable. */
(void)Source;
@ -158,16 +147,10 @@ RtlPrefetchMemoryNonTemporal(
*/
VOID
NTAPI
RtlZeroMemory (
PVOID Destination,
SIZE_T Length
)
RtlZeroMemory(PVOID Destination,
SIZE_T Length)
{
RtlFillMemory (
Destination,
Length,
0
);
RtlFillMemory(Destination, Length, 0);
}
/* EOF */

View file

@ -13,8 +13,8 @@
#define NDEBUG
#include <debug.h>
/* FUNCTIONS ***************************************************************/
/* FUNCTIONS ***************************************************************/
static VOID
RtlpQuerySecurityDescriptorPointers(IN PISECURITY_DESCRIPTOR SecurityDescriptor,
@ -26,20 +26,21 @@ RtlpQuerySecurityDescriptorPointers(IN PISECURITY_DESCRIPTOR SecurityDescriptor,
if (SecurityDescriptor->Control & SE_SELF_RELATIVE)
{
PISECURITY_DESCRIPTOR_RELATIVE RelSD = (PISECURITY_DESCRIPTOR_RELATIVE)SecurityDescriptor;
if(Owner != NULL)
if (Owner != NULL)
{
*Owner = ((RelSD->Owner != 0) ? (PSID)((ULONG_PTR)RelSD + RelSD->Owner) : NULL);
}
if(Group != NULL)
if (Group != NULL)
{
*Group = ((RelSD->Group != 0) ? (PSID)((ULONG_PTR)RelSD + RelSD->Group) : NULL);
}
if(Sacl != NULL)
if (Sacl != NULL)
{
*Sacl = (((RelSD->Control & SE_SACL_PRESENT) && (RelSD->Sacl != 0)) ?
(PSID)((ULONG_PTR)RelSD + RelSD->Sacl) : NULL);
}
if(Dacl != NULL)
if (Dacl != NULL)
{
*Dacl = (((RelSD->Control & SE_DACL_PRESENT) && (RelSD->Dacl != 0)) ?
(PSID)((ULONG_PTR)RelSD + RelSD->Dacl) : NULL);
@ -47,19 +48,19 @@ RtlpQuerySecurityDescriptorPointers(IN PISECURITY_DESCRIPTOR SecurityDescriptor,
}
else
{
if(Owner != NULL)
if (Owner != NULL)
{
*Owner = SecurityDescriptor->Owner;
}
if(Group != NULL)
if (Group != NULL)
{
*Group = SecurityDescriptor->Group;
}
if(Sacl != NULL)
if (Sacl != NULL)
{
*Sacl = ((SecurityDescriptor->Control & SE_SACL_PRESENT) ? SecurityDescriptor->Sacl : NULL);
}
if(Dacl != NULL)
if (Dacl != NULL)
{
*Dacl = ((SecurityDescriptor->Control & SE_DACL_PRESENT) ? SecurityDescriptor->Dacl : NULL);
}
@ -104,10 +105,12 @@ RtlpQuerySecurityDescriptor(PISECURITY_DESCRIPTOR SecurityDescriptor,
}
}
/*
* @implemented
*/
NTSTATUS NTAPI
NTSTATUS
NTAPI
RtlCreateSecurityDescriptor(OUT PSECURITY_DESCRIPTOR SecurityDescriptor,
IN ULONG Revision)
{
@ -131,10 +134,12 @@ RtlCreateSecurityDescriptor(OUT PSECURITY_DESCRIPTOR SecurityDescriptor,
return STATUS_SUCCESS;
}
/*
* @implemented
*/
NTSTATUS NTAPI
NTSTATUS
NTAPI
RtlCopySecurityDescriptor(IN PSECURITY_DESCRIPTOR pSourceSecurityDescriptor,
OUT PSECURITY_DESCRIPTOR pDestinationSecurityDescriptor)
{
@ -173,7 +178,7 @@ RtlCopySecurityDescriptor(IN PSECURITY_DESCRIPTOR pSourceSecurityDescriptor,
{
destSD->Dacl = srcSD->Dacl;
if(srcSD->Dacl != NULL && RtlValidAcl(srcSD->Dacl))
if (srcSD->Dacl != NULL && RtlValidAcl(srcSD->Dacl))
{
RtlCopyMemory(((LPBYTE)destSD + (DWORD_PTR)destSD->Dacl), Dacl, Dacl->AclSize);
}
@ -183,7 +188,7 @@ RtlCopySecurityDescriptor(IN PSECURITY_DESCRIPTOR pSourceSecurityDescriptor,
{
destSD->Sacl = srcSD->Sacl;
if(srcSD->Sacl != NULL && RtlValidAcl(srcSD->Sacl))
if (srcSD->Sacl != NULL && RtlValidAcl(srcSD->Sacl))
{
RtlCopyMemory(((LPBYTE)destSD + (DWORD_PTR)destSD->Sacl), Sacl, Sacl->AclSize);
}
@ -198,7 +203,7 @@ RtlCopySecurityDescriptor(IN PSECURITY_DESCRIPTOR pSourceSecurityDescriptor,
{
destSD->Dacl = RtlAllocateHeap(RtlGetProcessHeap(), 0, Dacl->AclSize);
if(srcSD->Dacl != NULL && RtlValidAcl(srcSD->Dacl))
if (srcSD->Dacl != NULL && RtlValidAcl(srcSD->Dacl))
{
RtlCopyMemory(destSD->Dacl, Dacl, Dacl->AclSize);
}
@ -208,7 +213,7 @@ RtlCopySecurityDescriptor(IN PSECURITY_DESCRIPTOR pSourceSecurityDescriptor,
{
destSD->Sacl = RtlAllocateHeap(RtlGetProcessHeap(), 0, Sacl->AclSize);
if(srcSD->Sacl != NULL && RtlValidAcl(srcSD->Sacl))
if (srcSD->Sacl != NULL && RtlValidAcl(srcSD->Sacl))
{
RtlCopyMemory(destSD->Sacl, Sacl, Sacl->AclSize);
}
@ -219,8 +224,9 @@ RtlCopySecurityDescriptor(IN PSECURITY_DESCRIPTOR pSourceSecurityDescriptor,
}
NTSTATUS NTAPI
RtlCreateSecurityDescriptorRelative (OUT PISECURITY_DESCRIPTOR_RELATIVE SecurityDescriptor,
NTSTATUS
NTAPI
RtlCreateSecurityDescriptorRelative(OUT PISECURITY_DESCRIPTOR_RELATIVE SecurityDescriptor,
IN ULONG Revision)
{
PAGED_CODE_RTL();
@ -245,7 +251,8 @@ RtlCreateSecurityDescriptorRelative (OUT PISECURITY_DESCRIPTOR_RELATIVE Security
/*
* @implemented
*/
ULONG NTAPI
ULONG
NTAPI
RtlLengthSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptor)
{
PSID Owner, Group;
@ -292,7 +299,8 @@ RtlLengthSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptor)
/*
* @implemented
*/
NTSTATUS NTAPI
NTSTATUS
NTAPI
RtlGetDaclSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
OUT PBOOLEAN DaclPresent,
OUT PACL* Dacl,
@ -312,6 +320,7 @@ RtlGetDaclSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
*DaclPresent = FALSE;
return STATUS_SUCCESS;
}
*DaclPresent = TRUE;
RtlpQuerySecurityDescriptorPointers(pSD,
@ -320,7 +329,7 @@ RtlGetDaclSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
NULL,
Dacl);
*DaclDefaulted = ((pSD->Control & SE_DACL_DEFAULTED) ? TRUE : FALSE);
*DaclDefaulted = ((pSD->Control & SE_DACL_DEFAULTED) != 0);
return STATUS_SUCCESS;
}
@ -329,7 +338,8 @@ RtlGetDaclSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
/*
* @implemented
*/
NTSTATUS NTAPI
NTSTATUS
NTAPI
RtlSetDaclSecurityDescriptor(IN OUT PSECURITY_DESCRIPTOR SecurityDescriptor,
IN BOOLEAN DaclPresent,
IN PACL Dacl,
@ -371,7 +381,8 @@ RtlSetDaclSecurityDescriptor(IN OUT PSECURITY_DESCRIPTOR SecurityDescriptor,
/*
* @implemented
*/
BOOLEAN NTAPI
BOOLEAN
NTAPI
RtlValidSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptor)
{
PISECURITY_DESCRIPTOR pSD = (PISECURITY_DESCRIPTOR)SecurityDescriptor;
@ -406,7 +417,8 @@ RtlValidSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptor)
/*
* @implemented
*/
NTSTATUS NTAPI
NTSTATUS
NTAPI
RtlSetOwnerSecurityDescriptor(IN OUT PSECURITY_DESCRIPTOR SecurityDescriptor,
IN PSID Owner,
IN BOOLEAN OwnerDefaulted)
@ -440,7 +452,8 @@ RtlSetOwnerSecurityDescriptor(IN OUT PSECURITY_DESCRIPTOR SecurityDescriptor,
/*
* @implemented
*/
NTSTATUS NTAPI
NTSTATUS
NTAPI
RtlGetOwnerSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
OUT PSID* Owner,
OUT PBOOLEAN OwnerDefaulted)
@ -460,7 +473,7 @@ RtlGetOwnerSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
NULL,
NULL);
*OwnerDefaulted = ((pSD->Control & SE_OWNER_DEFAULTED) ? TRUE : FALSE);
*OwnerDefaulted = ((pSD->Control & SE_OWNER_DEFAULTED) != 0);
return STATUS_SUCCESS;
}
@ -469,7 +482,8 @@ RtlGetOwnerSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
/*
* @implemented
*/
NTSTATUS NTAPI
NTSTATUS
NTAPI
RtlSetGroupSecurityDescriptor(IN OUT PSECURITY_DESCRIPTOR SecurityDescriptor,
IN PSID Group,
IN BOOLEAN GroupDefaulted)
@ -502,7 +516,8 @@ RtlSetGroupSecurityDescriptor(IN OUT PSECURITY_DESCRIPTOR SecurityDescriptor,
/*
* @implemented
*/
NTSTATUS NTAPI
NTSTATUS
NTAPI
RtlGetGroupSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
OUT PSID* Group,
OUT PBOOLEAN GroupDefaulted)
@ -531,7 +546,8 @@ RtlGetGroupSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
/*
* @implemented
*/
NTSTATUS NTAPI
NTSTATUS
NTAPI
RtlMakeSelfRelativeSD(IN PSECURITY_DESCRIPTOR AbsoluteSD,
OUT PSECURITY_DESCRIPTOR SelfRelativeSD,
IN OUT PULONG BufferLength)
@ -619,7 +635,8 @@ RtlMakeSelfRelativeSD(IN PSECURITY_DESCRIPTOR AbsoluteSD,
/*
* @implemented
*/
NTSTATUS NTAPI
NTSTATUS
NTAPI
RtlAbsoluteToSelfRelativeSD(IN PSECURITY_DESCRIPTOR AbsoluteSecurityDescriptor,
IN OUT PSECURITY_DESCRIPTOR SelfRelativeSecurityDescriptor,
IN PULONG BufferLength)
@ -642,7 +659,8 @@ RtlAbsoluteToSelfRelativeSD(IN PSECURITY_DESCRIPTOR AbsoluteSecurityDescriptor,
/*
* @implemented
*/
NTSTATUS NTAPI
NTSTATUS
NTAPI
RtlGetControlSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
OUT PSECURITY_DESCRIPTOR_CONTROL Control,
OUT PULONG Revision)
@ -667,7 +685,8 @@ RtlGetControlSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
/*
* @implemented
*/
NTSTATUS NTAPI
NTSTATUS
NTAPI
RtlSetControlSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
IN SECURITY_DESCRIPTOR_CONTROL ControlBitsOfInterest,
IN SECURITY_DESCRIPTOR_CONTROL ControlBitsToSet)
@ -676,9 +695,7 @@ RtlSetControlSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
= SE_OWNER_DEFAULTED | SE_GROUP_DEFAULTED
| SE_DACL_PRESENT | SE_DACL_DEFAULTED
| SE_SACL_PRESENT | SE_SACL_DEFAULTED
| SE_RM_CONTROL_VALID | SE_SELF_RELATIVE
;
| SE_RM_CONTROL_VALID | SE_SELF_RELATIVE;
PISECURITY_DESCRIPTOR pSD = (PISECURITY_DESCRIPTOR)SecurityDescriptor;
PAGED_CODE_RTL();
@ -704,7 +721,8 @@ RtlSetControlSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
/*
* @implemented
*/
NTSTATUS NTAPI
NTSTATUS
NTAPI
RtlGetSaclSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
OUT PBOOLEAN SaclPresent,
OUT PACL *Sacl,
@ -724,6 +742,7 @@ RtlGetSaclSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
*SaclPresent = FALSE;
return STATUS_SUCCESS;
}
*SaclPresent = TRUE;
RtlpQuerySecurityDescriptorPointers(pSD,
@ -741,7 +760,8 @@ RtlGetSaclSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
/*
* @implemented
*/
NTSTATUS NTAPI
NTSTATUS
NTAPI
RtlSetSaclSecurityDescriptor(IN OUT PSECURITY_DESCRIPTOR SecurityDescriptor,
IN BOOLEAN SaclPresent,
IN PACL Sacl,
@ -783,7 +803,8 @@ RtlSetSaclSecurityDescriptor(IN OUT PSECURITY_DESCRIPTOR SecurityDescriptor,
/*
* @implemented
*/
NTSTATUS NTAPI
NTSTATUS
NTAPI
RtlSelfRelativeToAbsoluteSD(IN PSECURITY_DESCRIPTOR SelfRelativeSD,
OUT PSECURITY_DESCRIPTOR AbsoluteSD,
IN PULONG AbsoluteSDSize,
@ -819,7 +840,7 @@ RtlSelfRelativeToAbsoluteSD(IN PSECURITY_DESCRIPTOR SelfRelativeSD,
return STATUS_BAD_DESCRIPTOR_FORMAT;
}
RtlpQuerySecurityDescriptor (pRelSD,
RtlpQuerySecurityDescriptor(pRelSD,
&pOwner,
&OwnerLength,
&pGroup,
@ -841,10 +862,10 @@ RtlSelfRelativeToAbsoluteSD(IN PSECURITY_DESCRIPTOR SelfRelativeSD,
return STATUS_BUFFER_TOO_SMALL;
}
RtlCopyMemory (Owner, pOwner, OwnerLength);
RtlCopyMemory (PrimaryGroup, pGroup, GroupLength);
RtlCopyMemory (Dacl, pDacl, DaclLength);
RtlCopyMemory (Sacl, pSacl, SaclLength);
RtlCopyMemory(Owner, pOwner, OwnerLength);
RtlCopyMemory(PrimaryGroup, pGroup, GroupLength);
RtlCopyMemory(Dacl, pDacl, DaclLength);
RtlCopyMemory(Sacl, pSacl, SaclLength);
pAbsSD->Revision = pRelSD->Revision;
pAbsSD->Sbz1 = pRelSD->Sbz1;
@ -866,7 +887,8 @@ RtlSelfRelativeToAbsoluteSD(IN PSECURITY_DESCRIPTOR SelfRelativeSD,
/*
* @implemented
*/
NTSTATUS NTAPI
NTSTATUS
NTAPI
RtlSelfRelativeToAbsoluteSD2(IN OUT PSECURITY_DESCRIPTOR SelfRelativeSD,
OUT PULONG BufferSize)
{
@ -892,6 +914,7 @@ RtlSelfRelativeToAbsoluteSD2(IN OUT PSECURITY_DESCRIPTOR SelfRelativeSD,
{
return STATUS_INVALID_PARAMETER_1;
}
if (BufferSize == NULL)
{
return STATUS_INVALID_PARAMETER_2;
@ -901,6 +924,7 @@ RtlSelfRelativeToAbsoluteSD2(IN OUT PSECURITY_DESCRIPTOR SelfRelativeSD,
{
return STATUS_UNKNOWN_REVISION;
}
if (!(pRelSD->Control & SE_SELF_RELATIVE))
{
return STATUS_BAD_DESCRIPTOR_FORMAT;
@ -927,6 +951,7 @@ RtlSelfRelativeToAbsoluteSD2(IN OUT PSECURITY_DESCRIPTOR SelfRelativeSD,
{
if (((ULONG_PTR)pGroup < (ULONG_PTR)DataStart) || DataStart == NULL)
DataStart = pGroup;
if (((ULONG_PTR)pGroup + GroupLength > (ULONG_PTR)DataEnd) || DataEnd == NULL)
DataEnd = (PVOID)((ULONG_PTR)pGroup + GroupLength);
}
@ -934,6 +959,7 @@ RtlSelfRelativeToAbsoluteSD2(IN OUT PSECURITY_DESCRIPTOR SelfRelativeSD,
{
if (((ULONG_PTR)pDacl < (ULONG_PTR)DataStart) || DataStart == NULL)
DataStart = pDacl;
if (((ULONG_PTR)pDacl + DaclLength > (ULONG_PTR)DataEnd) || DataEnd == NULL)
DataEnd = (PVOID)((ULONG_PTR)pDacl + DaclLength);
}
@ -941,6 +967,7 @@ RtlSelfRelativeToAbsoluteSD2(IN OUT PSECURITY_DESCRIPTOR SelfRelativeSD,
{
if (((ULONG_PTR)pSacl < (ULONG_PTR)DataStart) || DataStart == NULL)
DataStart = pSacl;
if (((ULONG_PTR)pSacl + SaclLength > (ULONG_PTR)DataEnd) || DataEnd == NULL)
DataEnd = (PVOID)((ULONG_PTR)pSacl + SaclLength);
}
@ -1038,6 +1065,8 @@ RtlValidRelativeSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptorInp
IN SECURITY_INFORMATION RequiredInformation)
{
PISECURITY_DESCRIPTOR pSD = (PISECURITY_DESCRIPTOR)SecurityDescriptorInput;
PSID Owner;
PSID Group;
PAGED_CODE_RTL();
@ -1050,7 +1079,7 @@ RtlValidRelativeSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptorInp
if (pSD->Owner != 0)
{
PSID Owner = (PSID)((ULONG_PTR)pSD->Owner + (ULONG_PTR)pSD);
Owner = (PSID)((ULONG_PTR)pSD->Owner + (ULONG_PTR)pSD);
if (!RtlValidSid(Owner))
{
return FALSE;
@ -1063,7 +1092,7 @@ RtlValidRelativeSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptorInp
if (pSD->Group != 0)
{
PSID Group = (PSID)((ULONG_PTR)pSD->Group + (ULONG_PTR)pSD);
Group = (PSID)((ULONG_PTR)pSD->Group + (ULONG_PTR)pSD);
if (!RtlValidSid(Group))
{
return FALSE;
@ -1107,7 +1136,8 @@ RtlValidRelativeSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptorInp
/*
* @implemented
*/
BOOLEAN NTAPI
BOOLEAN
NTAPI
RtlGetSecurityDescriptorRMControl(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
OUT PUCHAR RMControl)
{
@ -1130,7 +1160,8 @@ RtlGetSecurityDescriptorRMControl(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
/*
* @implemented
*/
VOID NTAPI
VOID
NTAPI
RtlSetSecurityDescriptorRMControl(IN OUT PSECURITY_DESCRIPTOR SecurityDescriptor,
IN PUCHAR RMControl)
{
@ -1154,7 +1185,8 @@ RtlSetSecurityDescriptorRMControl(IN OUT PSECURITY_DESCRIPTOR SecurityDescriptor
/*
* @implemented
*/
NTSTATUS NTAPI
NTSTATUS
NTAPI
RtlSetAttributesSecurityDescriptor(IN OUT PSECURITY_DESCRIPTOR SecurityDescriptor,
IN SECURITY_DESCRIPTOR_CONTROL Control,
OUT PULONG Revision)

View file

@ -18,7 +18,8 @@
/*
* @implemented
*/
NTSTATUS NTAPI
NTSTATUS
NTAPI
RtlImpersonateSelf(IN SECURITY_IMPERSONATION_LEVEL ImpersonationLevel)
{
HANDLE ProcessToken;
@ -35,7 +36,7 @@ RtlImpersonateSelf(IN SECURITY_IMPERSONATION_LEVEL ImpersonationLevel)
if (!NT_SUCCESS(Status))
{
DPRINT1("NtOpenProcessToken() failed (Status %lx)\n", Status);
return(Status);
return Status;
}
Sqos.Length = sizeof(SECURITY_QUALITY_OF_SERVICE);
@ -43,13 +44,11 @@ RtlImpersonateSelf(IN SECURITY_IMPERSONATION_LEVEL ImpersonationLevel)
Sqos.ContextTrackingMode = 0;
Sqos.EffectiveOnly = FALSE;
InitializeObjectAttributes(
&ObjAttr,
InitializeObjectAttributes(&ObjAttr,
NULL,
0,
NULL,
NULL
);
NULL);
ObjAttr.SecurityQualityOfService = &Sqos;
@ -63,7 +62,7 @@ RtlImpersonateSelf(IN SECURITY_IMPERSONATION_LEVEL ImpersonationLevel)
{
DPRINT1("NtDuplicateToken() failed (Status %lx)\n", Status);
NtClose(ProcessToken);
return(Status);
return Status;
}
Status = ZwSetInformationThread(NtCurrentThread(),
@ -78,7 +77,7 @@ RtlImpersonateSelf(IN SECURITY_IMPERSONATION_LEVEL ImpersonationLevel)
ZwClose(ImpersonationToken);
ZwClose(ProcessToken);
return(Status);
return Status;
}
/*
@ -108,7 +107,8 @@ RtlReleasePrivilege(IN PVOID ReturnedState)
/*
* @implemented
*/
NTSTATUS NTAPI
NTSTATUS
NTAPI
RtlAdjustPrivilege(IN ULONG Privilege,
IN BOOLEAN Enable,
IN BOOLEAN CurrentThread,
@ -122,25 +122,25 @@ RtlAdjustPrivilege(IN ULONG Privilege,
PAGED_CODE_RTL();
DPRINT ("RtlAdjustPrivilege() called\n");
DPRINT("RtlAdjustPrivilege() called\n");
if (CurrentThread)
{
Status = ZwOpenThreadToken (NtCurrentThread (),
Status = ZwOpenThreadToken(NtCurrentThread(),
TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY,
FALSE,
&TokenHandle);
}
else
{
Status = ZwOpenProcessToken (NtCurrentProcess (),
Status = ZwOpenProcessToken(NtCurrentProcess(),
TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY,
&TokenHandle);
}
if (!NT_SUCCESS (Status))
{
DPRINT1 ("Retrieving token handle failed (Status %lx)\n", Status);
DPRINT1("Retrieving token handle failed (Status %lx)\n", Status);
return Status;
}
@ -151,7 +151,7 @@ RtlAdjustPrivilege(IN ULONG Privilege,
NewState.Privileges[0].Luid.HighPart = 0;
NewState.Privileges[0].Attributes = (Enable) ? SE_PRIVILEGE_ENABLED : 0;
Status = ZwAdjustPrivilegesToken (TokenHandle,
Status = ZwAdjustPrivilegesToken(TokenHandle,
FALSE,
&NewState,
sizeof(TOKEN_PRIVILEGES),
@ -160,12 +160,13 @@ RtlAdjustPrivilege(IN ULONG Privilege,
ZwClose (TokenHandle);
if (Status == STATUS_NOT_ALL_ASSIGNED)
{
DPRINT1 ("Failed to assign all privileges\n");
DPRINT1("Failed to assign all privileges\n");
return STATUS_PRIVILEGE_NOT_HELD;
}
if (!NT_SUCCESS(Status))
{
DPRINT1 ("NtAdjustPrivilegesToken() failed (Status %lx)\n", Status);
DPRINT1("NtAdjustPrivilegesToken() failed (Status %lx)\n", Status);
return Status;
}
@ -178,7 +179,7 @@ RtlAdjustPrivilege(IN ULONG Privilege,
*Enabled = (OldState.Privileges[0].Attributes & SE_PRIVILEGE_ENABLED);
}
DPRINT ("RtlAdjustPrivilege() done\n");
DPRINT("RtlAdjustPrivilege() done\n");
return STATUS_SUCCESS;
}

View file

@ -17,7 +17,8 @@
/* FUNCTIONS ***************************************************************/
BOOLEAN NTAPI
BOOLEAN
NTAPI
RtlValidSid(IN PSID Sid_)
{
PISID Sid = Sid_;
@ -37,7 +38,8 @@ RtlValidSid(IN PSID Sid_)
/*
* @implemented
*/
ULONG NTAPI
ULONG
NTAPI
RtlLengthRequiredSid(IN ULONG SubAuthorityCount)
{
PAGED_CODE_RTL();
@ -50,7 +52,8 @@ RtlLengthRequiredSid(IN ULONG SubAuthorityCount)
/*
* @implemented
*/
NTSTATUS NTAPI
NTSTATUS
NTAPI
RtlInitializeSid(IN PSID Sid_,
IN PSID_IDENTIFIER_AUTHORITY IdentifierAuthority,
IN UCHAR SubAuthorityCount)
@ -72,7 +75,8 @@ RtlInitializeSid(IN PSID Sid_,
/*
* @implemented
*/
PULONG NTAPI
PULONG
NTAPI
RtlSubAuthoritySid(IN PSID Sid_,
IN ULONG SubAuthority)
{
@ -87,7 +91,8 @@ RtlSubAuthoritySid(IN PSID Sid_,
/*
* @implemented
*/
PUCHAR NTAPI
PUCHAR
NTAPI
RtlSubAuthorityCountSid(IN PSID Sid_)
{
PISID Sid = Sid_;
@ -101,7 +106,8 @@ RtlSubAuthorityCountSid(IN PSID Sid_)
/*
* @implemented
*/
BOOLEAN NTAPI
BOOLEAN
NTAPI
RtlEqualSid(IN PSID Sid1_,
IN PSID Sid2_)
{
@ -114,7 +120,7 @@ RtlEqualSid(IN PSID Sid1_,
if (Sid1->Revision != Sid2->Revision ||
(*RtlSubAuthorityCountSid(Sid1)) != (*RtlSubAuthorityCountSid(Sid2)))
{
return(FALSE);
return FALSE;
}
SidLen = RtlLengthSid(Sid1);
@ -125,7 +131,8 @@ RtlEqualSid(IN PSID Sid1_,
/*
* @implemented
*/
ULONG NTAPI
ULONG
NTAPI
RtlLengthSid(IN PSID Sid_)
{
PISID Sid = Sid_;
@ -140,7 +147,8 @@ RtlLengthSid(IN PSID Sid_)
/*
* @implemented
*/
NTSTATUS NTAPI
NTSTATUS
NTAPI
RtlCopySid(ULONG BufferLength,
PSID Dest,
PSID Src)
@ -163,7 +171,8 @@ RtlCopySid(ULONG BufferLength,
/*
* @implemented
*/
NTSTATUS NTAPI
NTSTATUS
NTAPI
RtlCopySidAndAttributesArray(ULONG Count,
PSID_AND_ATTRIBUTES Src,
ULONG SidAreaSize,
@ -180,12 +189,13 @@ RtlCopySidAndAttributesArray(ULONG Count,
Length = SidAreaSize;
for (i=0; i<Count; i++)
for (i = 0; i < Count; i++)
{
if (RtlLengthSid(Src[i].Sid) > Length)
{
return(STATUS_BUFFER_TOO_SMALL);
return STATUS_BUFFER_TOO_SMALL;
}
SidLength = RtlLengthSid(Src[i].Sid);
Length = Length - SidLength;
Dest[i].Sid = SidArea;
@ -195,16 +205,19 @@ RtlCopySidAndAttributesArray(ULONG Count,
Src[i].Sid);
SidArea = (PVOID)((ULONG_PTR)SidArea + SidLength);
}
*RemainingSidArea = SidArea;
*RemainingSidAreaSize = Length;
return(STATUS_SUCCESS);
return STATUS_SUCCESS;
}
/*
* @implemented
*/
PSID_IDENTIFIER_AUTHORITY NTAPI
PSID_IDENTIFIER_AUTHORITY
NTAPI
RtlIdentifierAuthoritySid(IN PSID Sid_)
{
PISID Sid = Sid_;
@ -218,7 +231,8 @@ RtlIdentifierAuthoritySid(IN PSID Sid_)
/*
* @implemented
*/
NTSTATUS NTAPI
NTSTATUS
NTAPI
RtlAllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY IdentifierAuthority,
UCHAR SubAuthorityCount,
ULONG SubAuthority0,
@ -286,7 +300,8 @@ RtlAllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY IdentifierAuthority,
* Docs says FreeSid does NOT return a value
* even thou it's defined to return a PVOID...
*/
PVOID NTAPI
PVOID
NTAPI
RtlFreeSid(IN PSID Sid)
{
PAGED_CODE_RTL();
@ -299,7 +314,8 @@ RtlFreeSid(IN PSID Sid)
/*
* @implemented
*/
BOOLEAN NTAPI
BOOLEAN
NTAPI
RtlEqualPrefixSid(IN PSID Sid1_,
IN PSID Sid2_)
{
@ -325,7 +341,8 @@ RtlEqualPrefixSid(IN PSID Sid1_,
/*
* @implemented
*/
NTSTATUS NTAPI
NTSTATUS
NTAPI
RtlConvertSidToUnicodeString(PUNICODE_STRING String,
PSID Sid_,
BOOLEAN AllocateBuffer)
@ -342,11 +359,12 @@ RtlConvertSidToUnicodeString(PUNICODE_STRING String,
return STATUS_INVALID_SID;
wcs = Buffer;
wcs += swprintf (wcs, L"S-%u-", Sid->Revision);
wcs += swprintf(wcs, L"S-%u-", Sid->Revision);
if (Sid->IdentifierAuthority.Value[0] == 0 &&
Sid->IdentifierAuthority.Value[1] == 0)
{
wcs += swprintf (wcs,
wcs += swprintf(wcs,
L"%lu",
(ULONG)Sid->IdentifierAuthority.Value[2] << 24 |
(ULONG)Sid->IdentifierAuthority.Value[3] << 16 |
@ -355,7 +373,7 @@ RtlConvertSidToUnicodeString(PUNICODE_STRING String,
}
else
{
wcs += swprintf (wcs,
wcs += swprintf(wcs,
L"0x%02hx%02hx%02hx%02hx%02hx%02hx",
Sid->IdentifierAuthority.Value[0],
Sid->IdentifierAuthority.Value[1],
@ -367,7 +385,7 @@ RtlConvertSidToUnicodeString(PUNICODE_STRING String,
for (i = 0; i < Sid->SubAuthorityCount; i++)
{
wcs += swprintf (wcs,
wcs += swprintf(wcs,
L"-%u",
Sid->SubAuthority[i]);
}
@ -388,7 +406,7 @@ RtlConvertSidToUnicodeString(PUNICODE_STRING String,
return STATUS_BUFFER_TOO_SMALL;
String->Length = (USHORT)Length;
RtlCopyMemory (String->Buffer,
RtlCopyMemory(String->Buffer,
Buffer,
Length);
if (Length < String->MaximumLength)

View file

@ -167,8 +167,7 @@ RtlCutoverTimeToSystemTime(IN PTIME_FIELDS CutoverTimeFields,
*/
BOOLEAN
NTAPI
RtlTimeFieldsToTime(
IN PTIME_FIELDS TimeFields,
RtlTimeFieldsToTime(IN PTIME_FIELDS TimeFields,
OUT PLARGE_INTEGER Time)
{
int CurMonth;
@ -251,8 +250,7 @@ RtlTimeToElapsedTimeFields(IN PLARGE_INTEGER Time,
*/
VOID
NTAPI
RtlTimeToTimeFields(
IN PLARGE_INTEGER Time,
RtlTimeToTimeFields(IN PLARGE_INTEGER Time,
OUT PTIME_FIELDS TimeFields)
{
const UCHAR *Months;
@ -309,8 +307,7 @@ RtlTimeToTimeFields(
*/
BOOLEAN
NTAPI
RtlTimeToSecondsSince1970(
IN PLARGE_INTEGER Time,
RtlTimeToSecondsSince1970(IN PLARGE_INTEGER Time,
OUT PULONG SecondsSince1970)
{
LARGE_INTEGER IntTime;
@ -332,8 +329,7 @@ RtlTimeToSecondsSince1970(
*/
BOOLEAN
NTAPI
RtlTimeToSecondsSince1980(
IN PLARGE_INTEGER Time,
RtlTimeToSecondsSince1980(IN PLARGE_INTEGER Time,
OUT PULONG SecondsSince1980)
{
LARGE_INTEGER IntTime;
@ -403,9 +399,9 @@ RtlSystemTimeToLocalTime(IN PLARGE_INTEGER SystemTime,
/*
* @implemented
*/
VOID NTAPI
RtlSecondsSince1970ToTime(
IN ULONG SecondsSince1970,
VOID
NTAPI
RtlSecondsSince1970ToTime(IN ULONG SecondsSince1970,
OUT PLARGE_INTEGER Time)
{
Time->QuadPart = ((LONGLONG)SecondsSince1970 * TICKSPERSEC) + TICKSTO1970;
@ -416,8 +412,7 @@ RtlSecondsSince1970ToTime(
* @implemented
*/
VOID NTAPI
RtlSecondsSince1980ToTime(
IN ULONG SecondsSince1980,
RtlSecondsSince1980ToTime(IN ULONG SecondsSince1980,
OUT PLARGE_INTEGER Time)
{
Time->QuadPart = ((LONGLONG)SecondsSince1980 * TICKSPERSEC) + TICKSTO1980;

View file

@ -18,7 +18,8 @@
/*
* @implemented
*/
NTSTATUS NTAPI
NTSTATUS
NTAPI
RtlQueryTimeZoneInformation(PRTL_TIME_ZONE_INFORMATION TimeZoneInformation)
{
RTL_QUERY_REGISTRY_TABLE QueryTable[8];
@ -82,7 +83,8 @@ RtlQueryTimeZoneInformation(PRTL_TIME_ZONE_INFORMATION TimeZoneInformation)
/*
* @implemented
*/
NTSTATUS NTAPI
NTSTATUS
NTAPI
RtlSetTimeZoneInformation(PRTL_TIME_ZONE_INFORMATION TimeZoneInformation)
{
SIZE_T Length;

View file

@ -154,34 +154,35 @@ RtlVerifyVersionInfo(
/*
* @implemented
*/
ULONGLONG NTAPI
ULONGLONG
NTAPI
VerSetConditionMask(IN ULONGLONG dwlConditionMask,
IN DWORD dwTypeBitMask,
IN BYTE dwConditionMask)
{
if(dwTypeBitMask == 0)
if (dwTypeBitMask == 0)
return dwlConditionMask;
dwConditionMask &= VER_CONDITION_MASK;
if(dwConditionMask == 0)
if (dwConditionMask == 0)
return dwlConditionMask;
if(dwTypeBitMask & VER_PRODUCT_TYPE)
if (dwTypeBitMask & VER_PRODUCT_TYPE)
dwlConditionMask |= dwConditionMask << 7 * VER_NUM_BITS_PER_CONDITION_MASK;
else if(dwTypeBitMask & VER_SUITENAME)
else if (dwTypeBitMask & VER_SUITENAME)
dwlConditionMask |= dwConditionMask << 6 * VER_NUM_BITS_PER_CONDITION_MASK;
else if(dwTypeBitMask & VER_SERVICEPACKMAJOR)
else if (dwTypeBitMask & VER_SERVICEPACKMAJOR)
dwlConditionMask |= dwConditionMask << 5 * VER_NUM_BITS_PER_CONDITION_MASK;
else if(dwTypeBitMask & VER_SERVICEPACKMINOR)
else if (dwTypeBitMask & VER_SERVICEPACKMINOR)
dwlConditionMask |= dwConditionMask << 4 * VER_NUM_BITS_PER_CONDITION_MASK;
else if(dwTypeBitMask & VER_PLATFORMID)
else if (dwTypeBitMask & VER_PLATFORMID)
dwlConditionMask |= dwConditionMask << 3 * VER_NUM_BITS_PER_CONDITION_MASK;
else if(dwTypeBitMask & VER_BUILDNUMBER)
else if (dwTypeBitMask & VER_BUILDNUMBER)
dwlConditionMask |= dwConditionMask << 2 * VER_NUM_BITS_PER_CONDITION_MASK;
else if(dwTypeBitMask & VER_MAJORVERSION)
else if (dwTypeBitMask & VER_MAJORVERSION)
dwlConditionMask |= dwConditionMask << 1 * VER_NUM_BITS_PER_CONDITION_MASK;
else if(dwTypeBitMask & VER_MINORVERSION)
else if (dwTypeBitMask & VER_MINORVERSION)
dwlConditionMask |= dwConditionMask << 0 * VER_NUM_BITS_PER_CONDITION_MASK;
return dwlConditionMask;