unsigned int len = GetWindowsDirectoryW( path, MAX_PATH );
memcpy( path + len, winsxsW, sizeof(winsxsW) );
- return len + sizeof(winsxsW) / sizeof(winsxsW[0]) - 1;
+ return len + ARRAY_SIZE(winsxsW) - 1;
}
static WCHAR *build_assembly_name( const WCHAR *arch, const WCHAR *name, const WCHAR *token,
{
static const WCHAR fmtW[] =
{'%','s','_','%','s','_','%','s','_','%','s','_','n','o','n','e','_','d','e','a','d','b','e','e','f',0};
- unsigned int buflen = sizeof(fmtW) / sizeof(fmtW[0]);
+ unsigned int buflen = ARRAY_SIZE(fmtW);
WCHAR *ret, *p;
buflen += strlenW( arch );
unsigned int len;
if (!(path = build_assembly_name( arch, name, token, version, &len ))) return NULL;
- len += sizeof(fmtW) / sizeof(fmtW[0]);
+ len += ARRAY_SIZE(fmtW);
len += build_sxs_path( sxsdir );
if (!(ret = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) )))
{
{
static const WCHAR fmtW[] =
{'%','s','_','%','s','_','%','s','_','n','o','n','e','_','d','e','a','d','b','e','e','f',0};
- unsigned int buflen = sizeof(fmtW) / sizeof(fmtW[0]);
+ unsigned int buflen = ARRAY_SIZE(fmtW);
WCHAR *ret, *p;
buflen += strlenW( arch );
unsigned int len;
if (!(path = build_policy_name( arch, name, token, &len ))) return NULL;
- len += sizeof(fmtW) / sizeof(fmtW[0]);
+ len += ARRAY_SIZE(fmtW);
len += build_sxs_path( sxsdir );
len += strlenW( version );
if (!(ret = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) )))
if (!(fullname = build_policy_name( arch, name, token, &len ))) return NULL;
len += build_sxs_path( sxsdir );
- len += sizeof(policiesW) / sizeof(policiesW[0]) - 1;
+ len += ARRAY_SIZE(policiesW) - 1;
len += strlenW( version );
- len += sizeof(suffixW) / sizeof(suffixW[0]) - 1;
+ len += ARRAY_SIZE(suffixW) - 1;
if (!(ret = HeapAlloc( GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR) )))
{
HeapFree( GetProcessHeap(), 0, fullname );
if (!(fullname = build_assembly_name( arch, name, token, version, &len ))) return NULL;
len += build_sxs_path( sxsdir );
- len += sizeof(manifestsW) / sizeof(manifestsW[0]) - 1;
- len += sizeof(suffixW) / sizeof(suffixW[0]) - 1;
+ len += ARRAY_SIZE(manifestsW) - 1;
+ len += ARRAY_SIZE(suffixW) - 1;
if (!(ret = HeapAlloc( GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR) )))
{
HeapFree( GetProcessHeap(), 0, fullname );
while (*q && *q != '=') q++;
if (!*q) return E_INVALIDARG;
len = q - p;
- if (len == sizeof(archW)/sizeof(archW[0]) - 1 && !memcmp( p, archW, len * sizeof(WCHAR) ))
+ if (len == ARRAY_SIZE(archW) - 1 && !memcmp( p, archW, len * sizeof(WCHAR) ))
{
p = ++q;
if (!(name->arch = parse_value( p, &len ))) return E_INVALIDARG;
q += len;
}
- else if (len == sizeof(tokenW)/sizeof(tokenW[0]) - 1 && !memcmp( p, tokenW, len * sizeof(WCHAR) ))
+ else if (len == ARRAY_SIZE(tokenW) - 1 && !memcmp( p, tokenW, len * sizeof(WCHAR) ))
{
p = ++q;
if (!(name->token = parse_value( p, &len ))) return E_INVALIDARG;
q += len;
}
- else if (len == sizeof(typeW)/sizeof(typeW[0]) - 1 && !memcmp( p, typeW, len * sizeof(WCHAR) ))
+ else if (len == ARRAY_SIZE(typeW) - 1 && !memcmp( p, typeW, len * sizeof(WCHAR) ))
{
p = ++q;
if (!(name->type = parse_value( p, &len ))) return E_INVALIDARG;
q += len;
}
- else if (len == sizeof(versionW)/sizeof(versionW[0]) - 1 && !memcmp( p, versionW, len * sizeof(WCHAR) ))
+ else if (len == ARRAY_SIZE(versionW) - 1 && !memcmp( p, versionW, len * sizeof(WCHAR) ))
{
p = ++q;
if (!(name->version = parse_value( p, &len ))) return E_INVALIDARG;