mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 02:36:13 +00:00
[LSASRV]
- Remove trailing whitespace; - Tabs --> Spaces; - Don't always hardcode parameters sizeofs; - Use ARRAYSIZE where applicable; - Use UNICODE_NULL svn path=/trunk/; revision=73232
This commit is contained in:
parent
e27a5768be
commit
076082358a
7 changed files with 28 additions and 29 deletions
|
@ -950,7 +950,7 @@ LsapAppendSidToGroups(
|
||||||
Groups->GroupCount = 1;
|
Groups->GroupCount = 1;
|
||||||
|
|
||||||
Groups->Groups[0].Sid = Sid;
|
Groups->Groups[0].Sid = Sid;
|
||||||
Groups->Groups[0].Attributes =
|
Groups->Groups[0].Attributes =
|
||||||
SE_GROUP_ENABLED | SE_GROUP_ENABLED_BY_DEFAULT | SE_GROUP_MANDATORY;
|
SE_GROUP_ENABLED | SE_GROUP_ENABLED_BY_DEFAULT | SE_GROUP_MANDATORY;
|
||||||
|
|
||||||
*TokenGroups = Groups;
|
*TokenGroups = Groups;
|
||||||
|
@ -985,7 +985,7 @@ LsapAppendSidToGroups(
|
||||||
}
|
}
|
||||||
|
|
||||||
Groups->Groups[Groups->GroupCount].Sid = Sid;
|
Groups->Groups[Groups->GroupCount].Sid = Sid;
|
||||||
Groups->Groups[Groups->GroupCount].Attributes =
|
Groups->Groups[Groups->GroupCount].Attributes =
|
||||||
SE_GROUP_ENABLED | SE_GROUP_ENABLED_BY_DEFAULT | SE_GROUP_MANDATORY;
|
SE_GROUP_ENABLED | SE_GROUP_ENABLED_BY_DEFAULT | SE_GROUP_MANDATORY;
|
||||||
|
|
||||||
Groups->GroupCount++;
|
Groups->GroupCount++;
|
||||||
|
|
|
@ -254,11 +254,11 @@ LsapCreateDatabaseObjects(VOID)
|
||||||
|
|
||||||
/* Initialize the audit log attribute */
|
/* Initialize the audit log attribute */
|
||||||
AuditLogInfo.AuditLogPercentFull = 0;
|
AuditLogInfo.AuditLogPercentFull = 0;
|
||||||
AuditLogInfo.MaximumLogSize = 0; // DWORD
|
AuditLogInfo.MaximumLogSize = 0; // DWORD
|
||||||
AuditLogInfo.AuditRetentionPeriod.QuadPart = 0; // LARGE_INTEGER
|
AuditLogInfo.AuditRetentionPeriod.QuadPart = 0; // LARGE_INTEGER
|
||||||
AuditLogInfo.AuditLogFullShutdownInProgress = 0; // BYTE
|
AuditLogInfo.AuditLogFullShutdownInProgress = 0; // BYTE
|
||||||
AuditLogInfo.TimeToShutdown.QuadPart = 0; // LARGE_INTEGER
|
AuditLogInfo.TimeToShutdown.QuadPart = 0; // LARGE_INTEGER
|
||||||
AuditLogInfo.NextAuditRecordId = 0; // DWORD
|
AuditLogInfo.NextAuditRecordId = 0; // DWORD
|
||||||
|
|
||||||
/* Initialize the Audit Events attribute */
|
/* Initialize the Audit Events attribute */
|
||||||
AuditEventsInfo = RtlAllocateHeap(RtlGetProcessHeap(),
|
AuditEventsInfo = RtlAllocateHeap(RtlGetProcessHeap(),
|
||||||
|
@ -273,7 +273,7 @@ LsapCreateDatabaseObjects(VOID)
|
||||||
AuditEventsInfo->AuditEvents[i] = 0;
|
AuditEventsInfo->AuditEvents[i] = 0;
|
||||||
|
|
||||||
/* Initialize the DNS Domain GUID attribute */
|
/* Initialize the DNS Domain GUID attribute */
|
||||||
memset(&DnsDomainGuid, 0, sizeof(GUID));
|
RtlZeroMemory(&DnsDomainGuid, sizeof(DnsDomainGuid));
|
||||||
|
|
||||||
/* Initialize the modification attribute */
|
/* Initialize the modification attribute */
|
||||||
ModificationInfo.ModifiedId.QuadPart = 0;
|
ModificationInfo.ModifiedId.QuadPart = 0;
|
||||||
|
@ -323,31 +323,31 @@ LsapCreateDatabaseObjects(VOID)
|
||||||
LsapSetObjectAttribute(PolicyObject,
|
LsapSetObjectAttribute(PolicyObject,
|
||||||
L"DefQuota",
|
L"DefQuota",
|
||||||
&QuotaInfo,
|
&QuotaInfo,
|
||||||
sizeof(POLICY_DEFAULT_QUOTA_INFO));
|
sizeof(QuotaInfo));
|
||||||
|
|
||||||
/* Set the modification attribute */
|
/* Set the modification attribute */
|
||||||
LsapSetObjectAttribute(PolicyObject,
|
LsapSetObjectAttribute(PolicyObject,
|
||||||
L"PolMod",
|
L"PolMod",
|
||||||
&ModificationInfo,
|
&ModificationInfo,
|
||||||
sizeof(POLICY_MODIFICATION_INFO));
|
sizeof(ModificationInfo));
|
||||||
|
|
||||||
/* Set the audit full attribute */
|
/* Set the audit full attribute */
|
||||||
LsapSetObjectAttribute(PolicyObject,
|
LsapSetObjectAttribute(PolicyObject,
|
||||||
L"PolAdtFl",
|
L"PolAdtFl",
|
||||||
&AuditFullInfo,
|
&AuditFullInfo,
|
||||||
sizeof(POLICY_AUDIT_FULL_QUERY_INFO));
|
sizeof(AuditFullInfo));
|
||||||
|
|
||||||
/* Set the audit log attribute */
|
/* Set the audit log attribute */
|
||||||
LsapSetObjectAttribute(PolicyObject,
|
LsapSetObjectAttribute(PolicyObject,
|
||||||
L"PolAdtLg",
|
L"PolAdtLg",
|
||||||
&AuditLogInfo,
|
&AuditLogInfo,
|
||||||
sizeof(POLICY_AUDIT_LOG_INFO));
|
sizeof(AuditLogInfo));
|
||||||
|
|
||||||
/* Set the audit events attribute */
|
/* Set the audit events attribute */
|
||||||
LsapSetObjectAttribute(PolicyObject,
|
LsapSetObjectAttribute(PolicyObject,
|
||||||
L"PolAdtEv",
|
L"PolAdtEv",
|
||||||
AuditEventsInfo,
|
AuditEventsInfo,
|
||||||
sizeof(LSAP_POLICY_AUDIT_EVENTS_DATA));
|
sizeof(*AuditEventsInfo));
|
||||||
|
|
||||||
/* Set the DNS Domain Name attribute */
|
/* Set the DNS Domain Name attribute */
|
||||||
LsapSetObjectAttribute(PolicyObject,
|
LsapSetObjectAttribute(PolicyObject,
|
||||||
|
@ -365,7 +365,7 @@ LsapCreateDatabaseObjects(VOID)
|
||||||
LsapSetObjectAttribute(PolicyObject,
|
LsapSetObjectAttribute(PolicyObject,
|
||||||
L"PolDnDmG",
|
L"PolDnDmG",
|
||||||
&DnsDomainGuid,
|
&DnsDomainGuid,
|
||||||
sizeof(GUID));
|
sizeof(DnsDomainGuid));
|
||||||
|
|
||||||
/* Set the Security Descriptor */
|
/* Set the Security Descriptor */
|
||||||
LsapSetObjectAttribute(PolicyObject,
|
LsapSetObjectAttribute(PolicyObject,
|
||||||
|
@ -912,7 +912,7 @@ LsapDeleteDbObject(IN PLSA_DB_OBJECT DbObject)
|
||||||
{
|
{
|
||||||
Status = LsapRegEnumerateSubKey(DbObject->KeyHandle,
|
Status = LsapRegEnumerateSubKey(DbObject->KeyHandle,
|
||||||
Index,
|
Index,
|
||||||
64 * sizeof(WCHAR),
|
sizeof(KeyName),
|
||||||
KeyName);
|
KeyName);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
break;
|
break;
|
||||||
|
@ -1081,4 +1081,3 @@ LsapDeleteObjectAttribute(PLSA_DB_OBJECT DbObject,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ DsRolepGetBasicInfo(
|
||||||
ULONG Size;
|
ULONG Size;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
ZeroMemory(&ObjectAttributes, sizeof(ObjectAttributes));
|
RtlZeroMemory(&ObjectAttributes, sizeof(ObjectAttributes));
|
||||||
Status = LsarOpenPolicy(NULL,
|
Status = LsarOpenPolicy(NULL,
|
||||||
&ObjectAttributes,
|
&ObjectAttributes,
|
||||||
POLICY_VIEW_LOCAL_INFORMATION,
|
POLICY_VIEW_LOCAL_INFORMATION,
|
||||||
|
@ -142,7 +142,7 @@ DsRolerGetPrimaryDomainInformation(
|
||||||
{
|
{
|
||||||
NET_API_STATUS ret;
|
NET_API_STATUS ret;
|
||||||
|
|
||||||
TRACE("DsRolerGetPrimaryDomainInformation(%p, %d, %p)\n",
|
TRACE("DsRolerGetPrimaryDomainInformation(%p, %d, %p)\n",
|
||||||
hBinding, InfoLevel, DomainInfo);
|
hBinding, InfoLevel, DomainInfo);
|
||||||
|
|
||||||
switch (InfoLevel)
|
switch (InfoLevel)
|
||||||
|
|
|
@ -88,7 +88,7 @@ LsarpLookupPrivilegeName(PLUID Value,
|
||||||
return STATUS_NO_SUCH_PRIVILEGE;
|
return STATUS_NO_SUCH_PRIVILEGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (Priv = 0; Priv < sizeof(WellKnownPrivileges) / sizeof(WellKnownPrivileges[0]); Priv++)
|
for (Priv = 0; Priv < ARRAYSIZE(WellKnownPrivileges); Priv++)
|
||||||
{
|
{
|
||||||
if (Value->LowPart == WellKnownPrivileges[Priv].Luid.LowPart &&
|
if (Value->LowPart == WellKnownPrivileges[Priv].Luid.LowPart &&
|
||||||
Value->HighPart == WellKnownPrivileges[Priv].Luid.HighPart)
|
Value->HighPart == WellKnownPrivileges[Priv].Luid.HighPart)
|
||||||
|
@ -162,7 +162,7 @@ LsarpLookupPrivilegeValue(
|
||||||
if (Name->Length == 0 || Name->Buffer == NULL)
|
if (Name->Length == 0 || Name->Buffer == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
for (Priv = 0; Priv < sizeof(WellKnownPrivileges) / sizeof(WellKnownPrivileges[0]); Priv++)
|
for (Priv = 0; Priv < ARRAYSIZE(WellKnownPrivileges); Priv++)
|
||||||
{
|
{
|
||||||
if (_wcsicmp(Name->Buffer, WellKnownPrivileges[Priv].Name) == 0)
|
if (_wcsicmp(Name->Buffer, WellKnownPrivileges[Priv].Name) == 0)
|
||||||
return (PLUID)&(WellKnownPrivileges[Priv].Luid);
|
return (PLUID)&(WellKnownPrivileges[Priv].Luid);
|
||||||
|
@ -187,7 +187,7 @@ LsarpEnumeratePrivileges(DWORD *EnumerationContext,
|
||||||
|
|
||||||
EnumIndex = *EnumerationContext;
|
EnumIndex = *EnumerationContext;
|
||||||
|
|
||||||
for (; EnumIndex < sizeof(WellKnownPrivileges) / sizeof(WellKnownPrivileges[0]); EnumIndex++)
|
for (; EnumIndex < ARRAYSIZE(WellKnownPrivileges); EnumIndex++)
|
||||||
{
|
{
|
||||||
TRACE("EnumIndex: %lu\n", EnumIndex);
|
TRACE("EnumIndex: %lu\n", EnumIndex);
|
||||||
TRACE("Privilege Name: %S\n", WellKnownPrivileges[EnumIndex].Name);
|
TRACE("Privilege Name: %S\n", WellKnownPrivileges[EnumIndex].Name);
|
||||||
|
@ -276,7 +276,7 @@ LsapLookupAccountRightName(ULONG RightValue,
|
||||||
PRPC_UNICODE_STRING NameBuffer;
|
PRPC_UNICODE_STRING NameBuffer;
|
||||||
ULONG i;
|
ULONG i;
|
||||||
|
|
||||||
for (i = 0; i < sizeof(WellKnownRights) / sizeof(WellKnownRights[0]); i++)
|
for (i = 0; i < ARRAYSIZE(WellKnownRights); i++)
|
||||||
{
|
{
|
||||||
if (WellKnownRights[i].Flag == RightValue)
|
if (WellKnownRights[i].Flag == RightValue)
|
||||||
{
|
{
|
||||||
|
@ -315,7 +315,7 @@ LsapLookupAccountRightValue(
|
||||||
if (Name->Length == 0 || Name->Buffer == NULL)
|
if (Name->Length == 0 || Name->Buffer == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
for (i = 0; i < sizeof(WellKnownRights) / sizeof(WellKnownRights[0]); i++)
|
for (i = 0; i < ARRAYSIZE(WellKnownRights); i++)
|
||||||
{
|
{
|
||||||
if (_wcsicmp(Name->Buffer, WellKnownRights[i].Name) == 0)
|
if (_wcsicmp(Name->Buffer, WellKnownRights[i].Name) == 0)
|
||||||
return WellKnownRights[i].Flag;
|
return WellKnownRights[i].Flag;
|
||||||
|
|
|
@ -132,7 +132,7 @@ LsapRegEnumerateSubKey(IN HANDLE KeyHandle,
|
||||||
KeyInfo->NameLength);
|
KeyInfo->NameLength);
|
||||||
|
|
||||||
/* Terminate the string */
|
/* Terminate the string */
|
||||||
Buffer[KeyInfo->NameLength / sizeof(WCHAR)] = 0;
|
Buffer[KeyInfo->NameLength / sizeof(WCHAR)] = UNICODE_NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -268,7 +268,7 @@ LsapRegEnumerateValue(IN HANDLE KeyHandle,
|
||||||
ValueInfo->NameLength);
|
ValueInfo->NameLength);
|
||||||
|
|
||||||
/* Terminate the string */
|
/* Terminate the string */
|
||||||
Name[ValueInfo->NameLength / sizeof(WCHAR)] = 0;
|
Name[ValueInfo->NameLength / sizeof(WCHAR)] = UNICODE_NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -295,7 +295,7 @@ LsapRegEnumerateValue(IN HANDLE KeyHandle,
|
||||||
{
|
{
|
||||||
WCHAR *ptr = (WCHAR *)((ULONG_PTR)Data + ValueInfo->DataLength);
|
WCHAR *ptr = (WCHAR *)((ULONG_PTR)Data + ValueInfo->DataLength);
|
||||||
if ((ptr > (WCHAR *)Data) && ptr[-1])
|
if ((ptr > (WCHAR *)Data) && ptr[-1])
|
||||||
*ptr = 0;
|
*ptr = UNICODE_NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -383,7 +383,7 @@ LsapRegQueryValue(IN HANDLE KeyHandle,
|
||||||
{
|
{
|
||||||
WCHAR *ptr = (WCHAR *)((ULONG_PTR)Data + ValueInfo->DataLength);
|
WCHAR *ptr = (WCHAR *)((ULONG_PTR)Data + ValueInfo->DataLength);
|
||||||
if ((ptr > (WCHAR *)Data) && ptr[-1])
|
if ((ptr > (WCHAR *)Data) && ptr[-1])
|
||||||
*ptr = 0;
|
*ptr = UNICODE_NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -125,7 +125,7 @@ LsapCreatePolicySd(PSECURITY_DESCRIPTOR *PolicySd,
|
||||||
|
|
||||||
/* Allocate and initialize the DACL */
|
/* Allocate and initialize the DACL */
|
||||||
DaclSize = sizeof(ACL) +
|
DaclSize = sizeof(ACL) +
|
||||||
sizeof(ACCESS_DENIED_ACE) - sizeof(ULONG) + RtlLengthSid(AnonymousSid) +
|
sizeof(ACCESS_DENIED_ACE) - sizeof(ULONG) + RtlLengthSid(AnonymousSid) +
|
||||||
sizeof(ACCESS_ALLOWED_ACE) - sizeof(ULONG) + RtlLengthSid(AdministratorsSid) +
|
sizeof(ACCESS_ALLOWED_ACE) - sizeof(ULONG) + RtlLengthSid(AdministratorsSid) +
|
||||||
sizeof(ACCESS_ALLOWED_ACE) - sizeof(ULONG) + RtlLengthSid(EveryoneSid) +
|
sizeof(ACCESS_ALLOWED_ACE) - sizeof(ULONG) + RtlLengthSid(EveryoneSid) +
|
||||||
sizeof(ACCESS_ALLOWED_ACE) - sizeof(ULONG) + RtlLengthSid(AnonymousSid) +
|
sizeof(ACCESS_ALLOWED_ACE) - sizeof(ULONG) + RtlLengthSid(AnonymousSid) +
|
||||||
|
|
|
@ -21,4 +21,4 @@ ServiceInit(VOID)
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue