wszKey = heap_alloc(sizeof(wszProtocolsKey)+(schema_len+1)*sizeof(WCHAR));
memcpy(wszKey, wszProtocolsKey, sizeof(wszProtocolsKey));
- memcpy(wszKey + sizeof(wszProtocolsKey)/sizeof(WCHAR), schema, (schema_len+1)*sizeof(WCHAR));
+ memcpy(wszKey + ARRAY_SIZE(wszProtocolsKey), schema, (schema_len+1)*sizeof(WCHAR));
res = RegOpenKeyW(HKEY_CLASSES_ROOT, wszKey, &hkey);
heap_free(wszKey);
WCHAR schema[64];
HRESULT hres;
- hres = CoInternetParseUrl(url, PARSE_SCHEMA, 0, schema, sizeof(schema)/sizeof(schema[0]),
- &schema_len, 0);
+ hres = CoInternetParseUrl(url, PARSE_SCHEMA, 0, schema, ARRAY_SIZE(schema), &schema_len, 0);
if(FAILED(hres))
return FALSE;
DWORD schema_len;
HRESULT hres;
- hres = CoInternetParseUrl(url, PARSE_SCHEMA, 0, schema, sizeof(schema)/sizeof(schema[0]),
- &schema_len, 0);
+ hres = CoInternetParseUrl(url, PARSE_SCHEMA, 0, schema, ARRAY_SIZE(schema), &schema_len, 0);
if(FAILED(hres) || !schema_len)
return NULL;
DWORD value_len;
while(1) {
- value_len = sizeof(buf)/sizeof(WCHAR);
+ value_len = ARRAY_SIZE(buf);
res = RegEnumValueW(key, idx, buf, &value_len, NULL, NULL, NULL, NULL);
if(res != ERROR_SUCCESS)
break;