diff --git a/dlls/advapi32/registry.c b/dlls/advapi32/registry.c index 9989097ff4d..b537f69db0e 100644 --- a/dlls/advapi32/registry.c +++ b/dlls/advapi32/registry.c @@ -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'}; 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 */ @@ -148,9 +148,9 @@ static NTSTATUS create_key( HKEY *retkey, ACCESS_MASK access, OBJECT_ATTRIBUTES UNICODE_STRING str; /* don't try to create registry root */ - if (!attr->RootDirectory && len > sizeof(registry_root)/sizeof(WCHAR) && - !memicmpW( buffer, registry_root, sizeof(registry_root)/sizeof(WCHAR))) - i += sizeof(registry_root)/sizeof(WCHAR); + if (!attr->RootDirectory && len > ARRAY_SIZE( registry_root ) && + !memicmpW( buffer, registry_root, ARRAY_SIZE( registry_root ))) + i += ARRAY_SIZE( registry_root ); while (i < len && buffer[i] != '\\') i++; if (i == len && !force_wow32) return status; diff --git a/dlls/advapi32/service.c b/dlls/advapi32/service.c index 718c964b205..231f0267e98 100644 --- a/dlls/advapi32/service.c +++ b/dlls/advapi32/service.c @@ -299,7 +299,7 @@ static LPWSTR service_get_pipe_name(void) RegCloseKey(service_current_key); if (ret != ERROR_SUCCESS || type != REG_DWORD) return NULL; - len = sizeof(format)/sizeof(WCHAR) + 10 /* strlenW("4294967295") */; + len = ARRAY_SIZE(format) + 10 /* strlenW("4294967295") */; name = heap_alloc(len * sizeof(WCHAR)); if (!name) return NULL;