Commit 53a3c77c authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

userenv: Use the ARRAY_SIZE() macro.

parent b2fc5917
......@@ -106,20 +106,20 @@ static void set_registry_variables(WCHAR **env, HKEY hkey, DWORD type, BOOL set_
for (index = 0; ; index++)
{
size = sizeof(name)/sizeof(WCHAR);
size = ARRAY_SIZE(name);
ret = RegEnumValueW(hkey, index, name, &size, NULL, NULL, NULL, NULL);
if (ret != ERROR_SUCCESS)
break;
if (!memicmpW(name, SystemRootW, sizeof(SystemRootW)/sizeof(WCHAR)))
if (!memicmpW(name, SystemRootW, ARRAY_SIZE(SystemRootW)))
continue;
if (!memicmpW(name, SystemDriveW, sizeof(SystemDriveW)/sizeof(WCHAR)))
if (!memicmpW(name, SystemDriveW, ARRAY_SIZE(SystemDriveW)))
continue;
RtlInitUnicodeString(&us_name, name);
us_value.Buffer = value;
us_value.MaximumLength = sizeof(value);
if (!memicmpW(name, PATHW, sizeof(PATHW)/sizeof(WCHAR)) &&
if (!memicmpW(name, PATHW, ARRAY_SIZE(PATHW)) &&
!RtlQueryEnvironmentVariable_U(*env, &us_name, &us_value))
{
if (!set_path)
......@@ -339,7 +339,7 @@ BOOL WINAPI CreateEnvironmentBlock( LPVOID* lpEnvironment,
RegCloseKey(hkey);
}
len = sizeof(buf)/sizeof(WCHAR);
len = ARRAY_SIZE(buf);
if (GetComputerNameW(buf, &len))
{
RtlInitUnicodeString(&us_name, COMPUTERNAMEW);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment