diff --git a/reactos/dll/win32/lsasrv/authpackage.c b/reactos/dll/win32/lsasrv/authpackage.c index c06cfe2be7a..cd150451cb9 100644 --- a/reactos/dll/win32/lsasrv/authpackage.c +++ b/reactos/dll/win32/lsasrv/authpackage.c @@ -950,7 +950,7 @@ LsapAppendSidToGroups( 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 @@ LsapAppendSidToGroups( } 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++; diff --git a/reactos/dll/win32/lsasrv/database.c b/reactos/dll/win32/lsasrv/database.c index a341167aedf..b516e7d5283 100644 --- a/reactos/dll/win32/lsasrv/database.c +++ b/reactos/dll/win32/lsasrv/database.c @@ -254,11 +254,11 @@ LsapCreateDatabaseObjects(VOID) /* 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 @@ LsapCreateDatabaseObjects(VOID) 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 @@ LsapCreateDatabaseObjects(VOID) 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 @@ LsapCreateDatabaseObjects(VOID) LsapSetObjectAttribute(PolicyObject, L"PolDnDmG", &DnsDomainGuid, - sizeof(GUID)); + sizeof(DnsDomainGuid)); /* Set the Security Descriptor */ LsapSetObjectAttribute(PolicyObject, @@ -912,7 +912,7 @@ LsapDeleteDbObject(IN PLSA_DB_OBJECT DbObject) { Status = LsapRegEnumerateSubKey(DbObject->KeyHandle, Index, - 64 * sizeof(WCHAR), + sizeof(KeyName), KeyName); if (!NT_SUCCESS(Status)) break; @@ -1081,4 +1081,3 @@ LsapDeleteObjectAttribute(PLSA_DB_OBJECT DbObject, } /* EOF */ - diff --git a/reactos/dll/win32/lsasrv/dssetup.c b/reactos/dll/win32/lsasrv/dssetup.c index 53dde2a5f41..b1f20625536 100644 --- a/reactos/dll/win32/lsasrv/dssetup.c +++ b/reactos/dll/win32/lsasrv/dssetup.c @@ -46,7 +46,7 @@ DsRolepGetBasicInfo( ULONG Size; NTSTATUS Status; - ZeroMemory(&ObjectAttributes, sizeof(ObjectAttributes)); + RtlZeroMemory(&ObjectAttributes, sizeof(ObjectAttributes)); Status = LsarOpenPolicy(NULL, &ObjectAttributes, POLICY_VIEW_LOCAL_INFORMATION, @@ -142,7 +142,7 @@ DsRolerGetPrimaryDomainInformation( { NET_API_STATUS ret; - TRACE("DsRolerGetPrimaryDomainInformation(%p, %d, %p)\n", + TRACE("DsRolerGetPrimaryDomainInformation(%p, %d, %p)\n", hBinding, InfoLevel, DomainInfo); switch (InfoLevel) diff --git a/reactos/dll/win32/lsasrv/privileges.c b/reactos/dll/win32/lsasrv/privileges.c index 9d16ce3ce84..266abe8b427 100644 --- a/reactos/dll/win32/lsasrv/privileges.c +++ b/reactos/dll/win32/lsasrv/privileges.c @@ -88,7 +88,7 @@ LsarpLookupPrivilegeName(PLUID Value, 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 @@ LsarpLookupPrivilegeValue( 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 @@ LsarpEnumeratePrivileges(DWORD *EnumerationContext, 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 @@ LsapLookupAccountRightName(ULONG RightValue, 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 @@ LsapLookupAccountRightValue( 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; diff --git a/reactos/dll/win32/lsasrv/registry.c b/reactos/dll/win32/lsasrv/registry.c index 7ab9bcb862a..6dbeb1da73f 100644 --- a/reactos/dll/win32/lsasrv/registry.c +++ b/reactos/dll/win32/lsasrv/registry.c @@ -132,7 +132,7 @@ LsapRegEnumerateSubKey(IN HANDLE KeyHandle, KeyInfo->NameLength); /* Terminate the string */ - Buffer[KeyInfo->NameLength / sizeof(WCHAR)] = 0; + Buffer[KeyInfo->NameLength / sizeof(WCHAR)] = UNICODE_NULL; } else { @@ -268,7 +268,7 @@ LsapRegEnumerateValue(IN HANDLE KeyHandle, ValueInfo->NameLength); /* Terminate the string */ - Name[ValueInfo->NameLength / sizeof(WCHAR)] = 0; + Name[ValueInfo->NameLength / sizeof(WCHAR)] = UNICODE_NULL; } else { @@ -295,7 +295,7 @@ LsapRegEnumerateValue(IN HANDLE KeyHandle, { WCHAR *ptr = (WCHAR *)((ULONG_PTR)Data + ValueInfo->DataLength); if ((ptr > (WCHAR *)Data) && ptr[-1]) - *ptr = 0; + *ptr = UNICODE_NULL; } } else @@ -383,7 +383,7 @@ LsapRegQueryValue(IN HANDLE KeyHandle, { WCHAR *ptr = (WCHAR *)((ULONG_PTR)Data + ValueInfo->DataLength); if ((ptr > (WCHAR *)Data) && ptr[-1]) - *ptr = 0; + *ptr = UNICODE_NULL; } } diff --git a/reactos/dll/win32/lsasrv/security.c b/reactos/dll/win32/lsasrv/security.c index 5ef8c8df667..10fd7352a23 100644 --- a/reactos/dll/win32/lsasrv/security.c +++ b/reactos/dll/win32/lsasrv/security.c @@ -125,7 +125,7 @@ LsapCreatePolicySd(PSECURITY_DESCRIPTOR *PolicySd, /* 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) + diff --git a/reactos/dll/win32/lsasrv/service.c b/reactos/dll/win32/lsasrv/service.c index 4a056184675..ed4b97c01b8 100644 --- a/reactos/dll/win32/lsasrv/service.c +++ b/reactos/dll/win32/lsasrv/service.c @@ -21,4 +21,4 @@ ServiceInit(VOID) return STATUS_SUCCESS; } -/* EOF */ \ No newline at end of file +/* EOF */