Author: hbelusca
Date: Mon Nov 14 16:17:42 2016
New Revision: 73232
URL:
http://svn.reactos.org/svn/reactos?rev=73232&view=rev
Log:
[LSASRV]
- Remove trailing whitespace;
- Tabs --> Spaces;
- Don't always hardcode parameters sizeofs;
- Use ARRAYSIZE where applicable;
- Use UNICODE_NULL
Modified:
trunk/reactos/dll/win32/lsasrv/authpackage.c
trunk/reactos/dll/win32/lsasrv/database.c
trunk/reactos/dll/win32/lsasrv/dssetup.c
trunk/reactos/dll/win32/lsasrv/privileges.c
trunk/reactos/dll/win32/lsasrv/registry.c
trunk/reactos/dll/win32/lsasrv/security.c
trunk/reactos/dll/win32/lsasrv/service.c
Modified: trunk/reactos/dll/win32/lsasrv/authpackage.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lsasrv/authpacka…
==============================================================================
--- trunk/reactos/dll/win32/lsasrv/authpackage.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/lsasrv/authpackage.c [iso-8859-1] Mon Nov 14 16:17:42 2016
@@ -950,7 +950,7 @@
Groups->GroupCount = 1;
Groups->Groups[0].Sid = Sid;
- Groups->Groups[0].Attributes =
+ Groups->Groups[0].Attributes =
SE_GROUP_ENABLED | SE_GROUP_ENABLED_BY_DEFAULT | SE_GROUP_MANDATORY;
*TokenGroups = Groups;
@@ -985,7 +985,7 @@
}
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;
Groups->GroupCount++;
Modified: trunk/reactos/dll/win32/lsasrv/database.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lsasrv/database.…
==============================================================================
--- trunk/reactos/dll/win32/lsasrv/database.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/lsasrv/database.c [iso-8859-1] Mon Nov 14 16:17:42 2016
@@ -254,11 +254,11 @@
/* Initialize the audit log attribute */
AuditLogInfo.AuditLogPercentFull = 0;
- AuditLogInfo.MaximumLogSize = 0; // DWORD
- AuditLogInfo.AuditRetentionPeriod.QuadPart = 0; // LARGE_INTEGER
- AuditLogInfo.AuditLogFullShutdownInProgress = 0; // BYTE
- AuditLogInfo.TimeToShutdown.QuadPart = 0; // LARGE_INTEGER
- AuditLogInfo.NextAuditRecordId = 0; // DWORD
+ AuditLogInfo.MaximumLogSize = 0; // DWORD
+ AuditLogInfo.AuditRetentionPeriod.QuadPart = 0; // LARGE_INTEGER
+ AuditLogInfo.AuditLogFullShutdownInProgress = 0; // BYTE
+ AuditLogInfo.TimeToShutdown.QuadPart = 0; // LARGE_INTEGER
+ AuditLogInfo.NextAuditRecordId = 0; // DWORD
/* Initialize the Audit Events attribute */
AuditEventsInfo = RtlAllocateHeap(RtlGetProcessHeap(),
@@ -273,7 +273,7 @@
AuditEventsInfo->AuditEvents[i] = 0;
/* Initialize the DNS Domain GUID attribute */
- memset(&DnsDomainGuid, 0, sizeof(GUID));
+ RtlZeroMemory(&DnsDomainGuid, sizeof(DnsDomainGuid));
/* Initialize the modification attribute */
ModificationInfo.ModifiedId.QuadPart = 0;
@@ -323,31 +323,31 @@
LsapSetObjectAttribute(PolicyObject,
L"DefQuota",
&QuotaInfo,
- sizeof(POLICY_DEFAULT_QUOTA_INFO));
+ sizeof(QuotaInfo));
/* Set the modification attribute */
LsapSetObjectAttribute(PolicyObject,
L"PolMod",
&ModificationInfo,
- sizeof(POLICY_MODIFICATION_INFO));
+ sizeof(ModificationInfo));
/* Set the audit full attribute */
LsapSetObjectAttribute(PolicyObject,
L"PolAdtFl",
&AuditFullInfo,
- sizeof(POLICY_AUDIT_FULL_QUERY_INFO));
+ sizeof(AuditFullInfo));
/* Set the audit log attribute */
LsapSetObjectAttribute(PolicyObject,
L"PolAdtLg",
&AuditLogInfo,
- sizeof(POLICY_AUDIT_LOG_INFO));
+ sizeof(AuditLogInfo));
/* Set the audit events attribute */
LsapSetObjectAttribute(PolicyObject,
L"PolAdtEv",
AuditEventsInfo,
- sizeof(LSAP_POLICY_AUDIT_EVENTS_DATA));
+ sizeof(*AuditEventsInfo));
/* Set the DNS Domain Name attribute */
LsapSetObjectAttribute(PolicyObject,
@@ -365,7 +365,7 @@
LsapSetObjectAttribute(PolicyObject,
L"PolDnDmG",
&DnsDomainGuid,
- sizeof(GUID));
+ sizeof(DnsDomainGuid));
/* Set the Security Descriptor */
LsapSetObjectAttribute(PolicyObject,
@@ -912,7 +912,7 @@
{
Status = LsapRegEnumerateSubKey(DbObject->KeyHandle,
Index,
- 64 * sizeof(WCHAR),
+ sizeof(KeyName),
KeyName);
if (!NT_SUCCESS(Status))
break;
@@ -1081,4 +1081,3 @@
}
/* EOF */
-
Modified: trunk/reactos/dll/win32/lsasrv/dssetup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lsasrv/dssetup.c…
==============================================================================
--- trunk/reactos/dll/win32/lsasrv/dssetup.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/lsasrv/dssetup.c [iso-8859-1] Mon Nov 14 16:17:42 2016
@@ -46,7 +46,7 @@
ULONG Size;
NTSTATUS Status;
- ZeroMemory(&ObjectAttributes, sizeof(ObjectAttributes));
+ RtlZeroMemory(&ObjectAttributes, sizeof(ObjectAttributes));
Status = LsarOpenPolicy(NULL,
&ObjectAttributes,
POLICY_VIEW_LOCAL_INFORMATION,
@@ -142,7 +142,7 @@
{
NET_API_STATUS ret;
- TRACE("DsRolerGetPrimaryDomainInformation(%p, %d, %p)\n",
+ TRACE("DsRolerGetPrimaryDomainInformation(%p, %d, %p)\n",
hBinding, InfoLevel, DomainInfo);
switch (InfoLevel)
Modified: trunk/reactos/dll/win32/lsasrv/privileges.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lsasrv/privilege…
==============================================================================
--- trunk/reactos/dll/win32/lsasrv/privileges.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/lsasrv/privileges.c [iso-8859-1] Mon Nov 14 16:17:42 2016
@@ -88,7 +88,7 @@
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 &&
Value->HighPart == WellKnownPrivileges[Priv].Luid.HighPart)
@@ -162,7 +162,7 @@
if (Name->Length == 0 || Name->Buffer == 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)
return (PLUID)&(WellKnownPrivileges[Priv].Luid);
@@ -187,7 +187,7 @@
EnumIndex = *EnumerationContext;
- for (; EnumIndex < sizeof(WellKnownPrivileges) / sizeof(WellKnownPrivileges[0]);
EnumIndex++)
+ for (; EnumIndex < ARRAYSIZE(WellKnownPrivileges); EnumIndex++)
{
TRACE("EnumIndex: %lu\n", EnumIndex);
TRACE("Privilege Name: %S\n", WellKnownPrivileges[EnumIndex].Name);
@@ -276,7 +276,7 @@
PRPC_UNICODE_STRING NameBuffer;
ULONG i;
- for (i = 0; i < sizeof(WellKnownRights) / sizeof(WellKnownRights[0]); i++)
+ for (i = 0; i < ARRAYSIZE(WellKnownRights); i++)
{
if (WellKnownRights[i].Flag == RightValue)
{
@@ -315,7 +315,7 @@
if (Name->Length == 0 || Name->Buffer == NULL)
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)
return WellKnownRights[i].Flag;
Modified: trunk/reactos/dll/win32/lsasrv/registry.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lsasrv/registry.…
==============================================================================
--- trunk/reactos/dll/win32/lsasrv/registry.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/lsasrv/registry.c [iso-8859-1] Mon Nov 14 16:17:42 2016
@@ -132,7 +132,7 @@
KeyInfo->NameLength);
/* Terminate the string */
- Buffer[KeyInfo->NameLength / sizeof(WCHAR)] = 0;
+ Buffer[KeyInfo->NameLength / sizeof(WCHAR)] = UNICODE_NULL;
}
else
{
@@ -268,7 +268,7 @@
ValueInfo->NameLength);
/* Terminate the string */
- Name[ValueInfo->NameLength / sizeof(WCHAR)] = 0;
+ Name[ValueInfo->NameLength / sizeof(WCHAR)] = UNICODE_NULL;
}
else
{
@@ -295,7 +295,7 @@
{
WCHAR *ptr = (WCHAR *)((ULONG_PTR)Data + ValueInfo->DataLength);
if ((ptr > (WCHAR *)Data) && ptr[-1])
- *ptr = 0;
+ *ptr = UNICODE_NULL;
}
}
else
@@ -383,7 +383,7 @@
{
WCHAR *ptr = (WCHAR *)((ULONG_PTR)Data + ValueInfo->DataLength);
if ((ptr > (WCHAR *)Data) && ptr[-1])
- *ptr = 0;
+ *ptr = UNICODE_NULL;
}
}
Modified: trunk/reactos/dll/win32/lsasrv/security.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lsasrv/security.…
==============================================================================
--- trunk/reactos/dll/win32/lsasrv/security.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/lsasrv/security.c [iso-8859-1] Mon Nov 14 16:17:42 2016
@@ -125,7 +125,7 @@
/* Allocate and initialize the DACL */
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(EveryoneSid) +
sizeof(ACCESS_ALLOWED_ACE) - sizeof(ULONG) + RtlLengthSid(AnonymousSid) +
Modified: trunk/reactos/dll/win32/lsasrv/service.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lsasrv/service.c…
==============================================================================
--- trunk/reactos/dll/win32/lsasrv/service.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/lsasrv/service.c [iso-8859-1] Mon Nov 14 16:17:42 2016
@@ -21,4 +21,4 @@
return STATUS_SUCCESS;
}
-/* EOF */
+/* EOF */