advapi32: Use the ARRAY_SIZE() macro.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
ed712a96a4
commit
dc235ab4a7
|
@ -108,7 +108,7 @@ static BOOL is_wow6432node( const UNICODE_STRING *name )
|
||||||
static const WCHAR wow6432nodeW[] = {'W','o','w','6','4','3','2','N','o','d','e'};
|
static const WCHAR wow6432nodeW[] = {'W','o','w','6','4','3','2','N','o','d','e'};
|
||||||
|
|
||||||
return (name->Length == sizeof(wow6432nodeW) &&
|
return (name->Length == sizeof(wow6432nodeW) &&
|
||||||
!memicmpW( name->Buffer, wow6432nodeW, sizeof(wow6432nodeW)/sizeof(WCHAR) ));
|
!memicmpW( name->Buffer, wow6432nodeW, ARRAY_SIZE( wow6432nodeW )));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* open the Wow6432Node subkey of the specified key */
|
/* open the Wow6432Node subkey of the specified key */
|
||||||
|
@ -148,9 +148,9 @@ static NTSTATUS create_key( HKEY *retkey, ACCESS_MASK access, OBJECT_ATTRIBUTES
|
||||||
UNICODE_STRING str;
|
UNICODE_STRING str;
|
||||||
|
|
||||||
/* don't try to create registry root */
|
/* don't try to create registry root */
|
||||||
if (!attr->RootDirectory && len > sizeof(registry_root)/sizeof(WCHAR) &&
|
if (!attr->RootDirectory && len > ARRAY_SIZE( registry_root ) &&
|
||||||
!memicmpW( buffer, registry_root, sizeof(registry_root)/sizeof(WCHAR)))
|
!memicmpW( buffer, registry_root, ARRAY_SIZE( registry_root )))
|
||||||
i += sizeof(registry_root)/sizeof(WCHAR);
|
i += ARRAY_SIZE( registry_root );
|
||||||
|
|
||||||
while (i < len && buffer[i] != '\\') i++;
|
while (i < len && buffer[i] != '\\') i++;
|
||||||
if (i == len && !force_wow32) return status;
|
if (i == len && !force_wow32) return status;
|
||||||
|
|
|
@ -299,7 +299,7 @@ static LPWSTR service_get_pipe_name(void)
|
||||||
RegCloseKey(service_current_key);
|
RegCloseKey(service_current_key);
|
||||||
if (ret != ERROR_SUCCESS || type != REG_DWORD)
|
if (ret != ERROR_SUCCESS || type != REG_DWORD)
|
||||||
return NULL;
|
return NULL;
|
||||||
len = sizeof(format)/sizeof(WCHAR) + 10 /* strlenW("4294967295") */;
|
len = ARRAY_SIZE(format) + 10 /* strlenW("4294967295") */;
|
||||||
name = heap_alloc(len * sizeof(WCHAR));
|
name = heap_alloc(len * sizeof(WCHAR));
|
||||||
if (!name)
|
if (!name)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Reference in New Issue