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

View file

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

View file

@ -18,7 +18,8 @@
/* /*
* @implemented * @implemented
*/ */
NTSTATUS NTAPI NTSTATUS
NTAPI
RtlImpersonateSelf(IN SECURITY_IMPERSONATION_LEVEL ImpersonationLevel) RtlImpersonateSelf(IN SECURITY_IMPERSONATION_LEVEL ImpersonationLevel)
{ {
HANDLE ProcessToken; HANDLE ProcessToken;
@ -35,7 +36,7 @@ RtlImpersonateSelf(IN SECURITY_IMPERSONATION_LEVEL ImpersonationLevel)
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
DPRINT1("NtOpenProcessToken() failed (Status %lx)\n", Status); DPRINT1("NtOpenProcessToken() failed (Status %lx)\n", Status);
return(Status); return Status;
} }
Sqos.Length = sizeof(SECURITY_QUALITY_OF_SERVICE); Sqos.Length = sizeof(SECURITY_QUALITY_OF_SERVICE);
@ -43,13 +44,11 @@ RtlImpersonateSelf(IN SECURITY_IMPERSONATION_LEVEL ImpersonationLevel)
Sqos.ContextTrackingMode = 0; Sqos.ContextTrackingMode = 0;
Sqos.EffectiveOnly = FALSE; Sqos.EffectiveOnly = FALSE;
InitializeObjectAttributes( InitializeObjectAttributes(&ObjAttr,
&ObjAttr,
NULL, NULL,
0, 0,
NULL, NULL,
NULL NULL);
);
ObjAttr.SecurityQualityOfService = &Sqos; ObjAttr.SecurityQualityOfService = &Sqos;
@ -63,7 +62,7 @@ RtlImpersonateSelf(IN SECURITY_IMPERSONATION_LEVEL ImpersonationLevel)
{ {
DPRINT1("NtDuplicateToken() failed (Status %lx)\n", Status); DPRINT1("NtDuplicateToken() failed (Status %lx)\n", Status);
NtClose(ProcessToken); NtClose(ProcessToken);
return(Status); return Status;
} }
Status = ZwSetInformationThread(NtCurrentThread(), Status = ZwSetInformationThread(NtCurrentThread(),
@ -78,7 +77,7 @@ RtlImpersonateSelf(IN SECURITY_IMPERSONATION_LEVEL ImpersonationLevel)
ZwClose(ImpersonationToken); ZwClose(ImpersonationToken);
ZwClose(ProcessToken); ZwClose(ProcessToken);
return(Status); return Status;
} }
/* /*
@ -108,7 +107,8 @@ RtlReleasePrivilege(IN PVOID ReturnedState)
/* /*
* @implemented * @implemented
*/ */
NTSTATUS NTAPI NTSTATUS
NTAPI
RtlAdjustPrivilege(IN ULONG Privilege, RtlAdjustPrivilege(IN ULONG Privilege,
IN BOOLEAN Enable, IN BOOLEAN Enable,
IN BOOLEAN CurrentThread, IN BOOLEAN CurrentThread,
@ -163,6 +163,7 @@ RtlAdjustPrivilege(IN ULONG Privilege,
DPRINT1("Failed to assign all privileges\n"); DPRINT1("Failed to assign all privileges\n");
return STATUS_PRIVILEGE_NOT_HELD; return STATUS_PRIVILEGE_NOT_HELD;
} }
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
DPRINT1("NtAdjustPrivilegesToken() failed (Status %lx)\n", Status); DPRINT1("NtAdjustPrivilegesToken() failed (Status %lx)\n", Status);

View file

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

View file

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

View file

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

View file

@ -154,7 +154,8 @@ RtlVerifyVersionInfo(
/* /*
* @implemented * @implemented
*/ */
ULONGLONG NTAPI ULONGLONG
NTAPI
VerSetConditionMask(IN ULONGLONG dwlConditionMask, VerSetConditionMask(IN ULONGLONG dwlConditionMask,
IN DWORD dwTypeBitMask, IN DWORD dwTypeBitMask,
IN BYTE dwConditionMask) IN BYTE dwConditionMask)