mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 21:42:57 +00:00
[FORMATTING]
Fix indentation and coding style. No code changes! svn path=/trunk/; revision=57334
This commit is contained in:
parent
c31b441d5c
commit
c2ab3689b3
8 changed files with 1381 additions and 1349 deletions
|
@ -31,28 +31,20 @@
|
||||||
*
|
*
|
||||||
* @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)
|
||||||
{
|
{
|
||||||
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 */
|
||||||
|
|
|
@ -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,
|
||||||
|
@ -26,20 +26,21 @@ RtlpQuerySecurityDescriptorPointers(IN PISECURITY_DESCRIPTOR SecurityDescriptor,
|
||||||
if (SecurityDescriptor->Control & SE_SELF_RELATIVE)
|
if (SecurityDescriptor->Control & SE_SELF_RELATIVE)
|
||||||
{
|
{
|
||||||
PISECURITY_DESCRIPTOR_RELATIVE RelSD = (PISECURITY_DESCRIPTOR_RELATIVE)SecurityDescriptor;
|
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);
|
*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);
|
||||||
}
|
}
|
||||||
if(Sacl != NULL)
|
if (Sacl != NULL)
|
||||||
{
|
{
|
||||||
*Sacl = (((RelSD->Control & SE_SACL_PRESENT) && (RelSD->Sacl != 0)) ?
|
*Sacl = (((RelSD->Control & SE_SACL_PRESENT) && (RelSD->Sacl != 0)) ?
|
||||||
(PSID)((ULONG_PTR)RelSD + RelSD->Sacl) : NULL);
|
(PSID)((ULONG_PTR)RelSD + RelSD->Sacl) : NULL);
|
||||||
}
|
}
|
||||||
if(Dacl != NULL)
|
if (Dacl != NULL)
|
||||||
{
|
{
|
||||||
*Dacl = (((RelSD->Control & SE_DACL_PRESENT) && (RelSD->Dacl != 0)) ?
|
*Dacl = (((RelSD->Control & SE_DACL_PRESENT) && (RelSD->Dacl != 0)) ?
|
||||||
(PSID)((ULONG_PTR)RelSD + RelSD->Dacl) : NULL);
|
(PSID)((ULONG_PTR)RelSD + RelSD->Dacl) : NULL);
|
||||||
|
@ -47,19 +48,19 @@ RtlpQuerySecurityDescriptorPointers(IN PISECURITY_DESCRIPTOR SecurityDescriptor,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(Owner != NULL)
|
if (Owner != NULL)
|
||||||
{
|
{
|
||||||
*Owner = SecurityDescriptor->Owner;
|
*Owner = SecurityDescriptor->Owner;
|
||||||
}
|
}
|
||||||
if(Group != NULL)
|
if (Group != NULL)
|
||||||
{
|
{
|
||||||
*Group = SecurityDescriptor->Group;
|
*Group = SecurityDescriptor->Group;
|
||||||
}
|
}
|
||||||
if(Sacl != NULL)
|
if (Sacl != NULL)
|
||||||
{
|
{
|
||||||
*Sacl = ((SecurityDescriptor->Control & SE_SACL_PRESENT) ? SecurityDescriptor->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);
|
*Dacl = ((SecurityDescriptor->Control & SE_DACL_PRESENT) ? SecurityDescriptor->Dacl : 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)
|
||||||
{
|
{
|
||||||
|
@ -173,7 +178,7 @@ RtlCopySecurityDescriptor(IN PSECURITY_DESCRIPTOR pSourceSecurityDescriptor,
|
||||||
{
|
{
|
||||||
destSD->Dacl = srcSD->Dacl;
|
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);
|
RtlCopyMemory(((LPBYTE)destSD + (DWORD_PTR)destSD->Dacl), Dacl, Dacl->AclSize);
|
||||||
}
|
}
|
||||||
|
@ -183,7 +188,7 @@ RtlCopySecurityDescriptor(IN PSECURITY_DESCRIPTOR pSourceSecurityDescriptor,
|
||||||
{
|
{
|
||||||
destSD->Sacl = srcSD->Sacl;
|
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);
|
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);
|
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);
|
RtlCopyMemory(destSD->Dacl, Dacl, Dacl->AclSize);
|
||||||
}
|
}
|
||||||
|
@ -208,7 +213,7 @@ RtlCopySecurityDescriptor(IN PSECURITY_DESCRIPTOR pSourceSecurityDescriptor,
|
||||||
{
|
{
|
||||||
destSD->Sacl = RtlAllocateHeap(RtlGetProcessHeap(), 0, Sacl->AclSize);
|
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);
|
RtlCopyMemory(destSD->Sacl, Sacl, Sacl->AclSize);
|
||||||
}
|
}
|
||||||
|
@ -219,8 +224,9 @@ RtlCopySecurityDescriptor(IN PSECURITY_DESCRIPTOR pSourceSecurityDescriptor,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
NTSTATUS NTAPI
|
NTSTATUS
|
||||||
RtlCreateSecurityDescriptorRelative (OUT PISECURITY_DESCRIPTOR_RELATIVE SecurityDescriptor,
|
NTAPI
|
||||||
|
RtlCreateSecurityDescriptorRelative(OUT PISECURITY_DESCRIPTOR_RELATIVE SecurityDescriptor,
|
||||||
IN ULONG Revision)
|
IN ULONG Revision)
|
||||||
{
|
{
|
||||||
PAGED_CODE_RTL();
|
PAGED_CODE_RTL();
|
||||||
|
@ -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,
|
||||||
|
@ -819,7 +840,7 @@ RtlSelfRelativeToAbsoluteSD(IN PSECURITY_DESCRIPTOR SelfRelativeSD,
|
||||||
return STATUS_BAD_DESCRIPTOR_FORMAT;
|
return STATUS_BAD_DESCRIPTOR_FORMAT;
|
||||||
}
|
}
|
||||||
|
|
||||||
RtlpQuerySecurityDescriptor (pRelSD,
|
RtlpQuerySecurityDescriptor(pRelSD,
|
||||||
&pOwner,
|
&pOwner,
|
||||||
&OwnerLength,
|
&OwnerLength,
|
||||||
&pGroup,
|
&pGroup,
|
||||||
|
@ -841,10 +862,10 @@ RtlSelfRelativeToAbsoluteSD(IN PSECURITY_DESCRIPTOR SelfRelativeSD,
|
||||||
return STATUS_BUFFER_TOO_SMALL;
|
return STATUS_BUFFER_TOO_SMALL;
|
||||||
}
|
}
|
||||||
|
|
||||||
RtlCopyMemory (Owner, pOwner, OwnerLength);
|
RtlCopyMemory(Owner, pOwner, OwnerLength);
|
||||||
RtlCopyMemory (PrimaryGroup, pGroup, GroupLength);
|
RtlCopyMemory(PrimaryGroup, pGroup, GroupLength);
|
||||||
RtlCopyMemory (Dacl, pDacl, DaclLength);
|
RtlCopyMemory(Dacl, pDacl, DaclLength);
|
||||||
RtlCopyMemory (Sacl, pSacl, SaclLength);
|
RtlCopyMemory(Sacl, pSacl, SaclLength);
|
||||||
|
|
||||||
pAbsSD->Revision = pRelSD->Revision;
|
pAbsSD->Revision = pRelSD->Revision;
|
||||||
pAbsSD->Sbz1 = pRelSD->Sbz1;
|
pAbsSD->Sbz1 = pRelSD->Sbz1;
|
||||||
|
@ -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)
|
||||||
|
|
|
@ -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,
|
||||||
|
@ -122,25 +122,25 @@ RtlAdjustPrivilege(IN ULONG Privilege,
|
||||||
|
|
||||||
PAGED_CODE_RTL();
|
PAGED_CODE_RTL();
|
||||||
|
|
||||||
DPRINT ("RtlAdjustPrivilege() called\n");
|
DPRINT("RtlAdjustPrivilege() called\n");
|
||||||
|
|
||||||
if (CurrentThread)
|
if (CurrentThread)
|
||||||
{
|
{
|
||||||
Status = ZwOpenThreadToken (NtCurrentThread (),
|
Status = ZwOpenThreadToken(NtCurrentThread(),
|
||||||
TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY,
|
TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY,
|
||||||
FALSE,
|
FALSE,
|
||||||
&TokenHandle);
|
&TokenHandle);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Status = ZwOpenProcessToken (NtCurrentProcess (),
|
Status = ZwOpenProcessToken(NtCurrentProcess(),
|
||||||
TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY,
|
TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY,
|
||||||
&TokenHandle);
|
&TokenHandle);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!NT_SUCCESS (Status))
|
if (!NT_SUCCESS (Status))
|
||||||
{
|
{
|
||||||
DPRINT1 ("Retrieving token handle failed (Status %lx)\n", Status);
|
DPRINT1("Retrieving token handle failed (Status %lx)\n", Status);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -151,7 +151,7 @@ RtlAdjustPrivilege(IN ULONG Privilege,
|
||||||
NewState.Privileges[0].Luid.HighPart = 0;
|
NewState.Privileges[0].Luid.HighPart = 0;
|
||||||
NewState.Privileges[0].Attributes = (Enable) ? SE_PRIVILEGE_ENABLED : 0;
|
NewState.Privileges[0].Attributes = (Enable) ? SE_PRIVILEGE_ENABLED : 0;
|
||||||
|
|
||||||
Status = ZwAdjustPrivilegesToken (TokenHandle,
|
Status = ZwAdjustPrivilegesToken(TokenHandle,
|
||||||
FALSE,
|
FALSE,
|
||||||
&NewState,
|
&NewState,
|
||||||
sizeof(TOKEN_PRIVILEGES),
|
sizeof(TOKEN_PRIVILEGES),
|
||||||
|
@ -160,12 +160,13 @@ RtlAdjustPrivilege(IN ULONG Privilege,
|
||||||
ZwClose (TokenHandle);
|
ZwClose (TokenHandle);
|
||||||
if (Status == STATUS_NOT_ALL_ASSIGNED)
|
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;
|
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);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -178,7 +179,7 @@ RtlAdjustPrivilege(IN ULONG Privilege,
|
||||||
*Enabled = (OldState.Privileges[0].Attributes & SE_PRIVILEGE_ENABLED);
|
*Enabled = (OldState.Privileges[0].Attributes & SE_PRIVILEGE_ENABLED);
|
||||||
}
|
}
|
||||||
|
|
||||||
DPRINT ("RtlAdjustPrivilege() done\n");
|
DPRINT("RtlAdjustPrivilege() done\n");
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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,
|
||||||
|
@ -180,12 +189,13 @@ RtlCopySidAndAttributesArray(ULONG Count,
|
||||||
|
|
||||||
Length = SidAreaSize;
|
Length = SidAreaSize;
|
||||||
|
|
||||||
for (i=0; i<Count; i++)
|
for (i = 0; i < Count; i++)
|
||||||
{
|
{
|
||||||
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)
|
||||||
|
@ -342,11 +359,12 @@ RtlConvertSidToUnicodeString(PUNICODE_STRING String,
|
||||||
return STATUS_INVALID_SID;
|
return STATUS_INVALID_SID;
|
||||||
|
|
||||||
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)
|
||||||
{
|
{
|
||||||
wcs += swprintf (wcs,
|
wcs += swprintf(wcs,
|
||||||
L"%lu",
|
L"%lu",
|
||||||
(ULONG)Sid->IdentifierAuthority.Value[2] << 24 |
|
(ULONG)Sid->IdentifierAuthority.Value[2] << 24 |
|
||||||
(ULONG)Sid->IdentifierAuthority.Value[3] << 16 |
|
(ULONG)Sid->IdentifierAuthority.Value[3] << 16 |
|
||||||
|
@ -355,7 +373,7 @@ RtlConvertSidToUnicodeString(PUNICODE_STRING String,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
wcs += swprintf (wcs,
|
wcs += swprintf(wcs,
|
||||||
L"0x%02hx%02hx%02hx%02hx%02hx%02hx",
|
L"0x%02hx%02hx%02hx%02hx%02hx%02hx",
|
||||||
Sid->IdentifierAuthority.Value[0],
|
Sid->IdentifierAuthority.Value[0],
|
||||||
Sid->IdentifierAuthority.Value[1],
|
Sid->IdentifierAuthority.Value[1],
|
||||||
|
@ -367,7 +385,7 @@ RtlConvertSidToUnicodeString(PUNICODE_STRING String,
|
||||||
|
|
||||||
for (i = 0; i < Sid->SubAuthorityCount; i++)
|
for (i = 0; i < Sid->SubAuthorityCount; i++)
|
||||||
{
|
{
|
||||||
wcs += swprintf (wcs,
|
wcs += swprintf(wcs,
|
||||||
L"-%u",
|
L"-%u",
|
||||||
Sid->SubAuthority[i]);
|
Sid->SubAuthority[i]);
|
||||||
}
|
}
|
||||||
|
@ -388,7 +406,7 @@ RtlConvertSidToUnicodeString(PUNICODE_STRING String,
|
||||||
return STATUS_BUFFER_TOO_SMALL;
|
return STATUS_BUFFER_TOO_SMALL;
|
||||||
|
|
||||||
String->Length = (USHORT)Length;
|
String->Length = (USHORT)Length;
|
||||||
RtlCopyMemory (String->Buffer,
|
RtlCopyMemory(String->Buffer,
|
||||||
Buffer,
|
Buffer,
|
||||||
Length);
|
Length);
|
||||||
if (Length < String->MaximumLength)
|
if (Length < String->MaximumLength)
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -154,34 +154,35 @@ 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)
|
||||||
{
|
{
|
||||||
if(dwTypeBitMask == 0)
|
if (dwTypeBitMask == 0)
|
||||||
return dwlConditionMask;
|
return dwlConditionMask;
|
||||||
|
|
||||||
dwConditionMask &= VER_CONDITION_MASK;
|
dwConditionMask &= VER_CONDITION_MASK;
|
||||||
|
|
||||||
if(dwConditionMask == 0)
|
if (dwConditionMask == 0)
|
||||||
return dwlConditionMask;
|
return dwlConditionMask;
|
||||||
|
|
||||||
if(dwTypeBitMask & VER_PRODUCT_TYPE)
|
if (dwTypeBitMask & VER_PRODUCT_TYPE)
|
||||||
dwlConditionMask |= dwConditionMask << 7 * VER_NUM_BITS_PER_CONDITION_MASK;
|
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;
|
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;
|
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;
|
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;
|
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;
|
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;
|
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;
|
dwlConditionMask |= dwConditionMask << 0 * VER_NUM_BITS_PER_CONDITION_MASK;
|
||||||
|
|
||||||
return dwlConditionMask;
|
return dwlConditionMask;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue