memcpy(buf+len, prev_ptr, ptr-prev_ptr);
len += ptr-prev_ptr;
- if(!strncmpiW(ptr, expand_dirW, sizeof(expand_dirW)/sizeof(WCHAR))) {
+ if(!strncmpiW(ptr, expand_dirW, ARRAY_SIZE(expand_dirW))) {
len2 = strlenW(ctx->tmp_dir);
if(buf)
memcpy(buf+len, ctx->tmp_dir, len2*sizeof(WCHAR));
len += len2;
- ptr += sizeof(expand_dirW)/sizeof(WCHAR);
+ ptr += ARRAY_SIZE(expand_dirW);
}else {
FIXME("Can't expand %s\n", debugstr_w(ptr));
if(buf)
static const WCHAR runW[] = {'r','u','n',0};
- len = GetPrivateProfileStringW(sect_name, NULL, NULL, buf, sizeof(buf)/sizeof(*buf), ctx->install_file);
+ len = GetPrivateProfileStringW(sect_name, NULL, NULL, buf, ARRAY_SIZE(buf), ctx->install_file);
if(!len)
return S_OK;
WCHAR *cmd;
size_t size;
- len = GetPrivateProfileStringW(sect_name, runW, NULL, val, sizeof(val)/sizeof(*val), ctx->install_file);
+ len = GetPrivateProfileStringW(sect_name, runW, NULL, val, ARRAY_SIZE(val), ctx->install_file);
TRACE("Run %s\n", debugstr_w(val));
static const WCHAR setup_hooksW[] = {'S','e','t','u','p',' ','H','o','o','k','s',0};
static const WCHAR add_codeW[] = {'A','d','d','.','C','o','d','e',0};
- len = GetPrivateProfileStringW(setup_hooksW, NULL, NULL, buf, sizeof(buf)/sizeof(*buf), ctx->install_file);
+ len = GetPrivateProfileStringW(setup_hooksW, NULL, NULL, buf, ARRAY_SIZE(buf), ctx->install_file);
if(len) {
default_install = FALSE;
for(key = buf; *key; key += strlenW(key)+1) {
TRACE("[Setup Hooks] key: %s\n", debugstr_w(key));
- len = GetPrivateProfileStringW(setup_hooksW, key, NULL, sect_name, sizeof(sect_name)/sizeof(*sect_name),
+ len = GetPrivateProfileStringW(setup_hooksW, key, NULL, sect_name, ARRAY_SIZE(sect_name),
ctx->install_file);
if(!len) {
WARN("Could not get key value\n");
}
}
- len = GetPrivateProfileStringW(add_codeW, NULL, NULL, buf, sizeof(buf)/sizeof(*buf), ctx->install_file);
+ len = GetPrivateProfileStringW(add_codeW, NULL, NULL, buf, ARRAY_SIZE(buf), ctx->install_file);
if(len) {
default_install = FALSE;
for(key = buf; *key; key += strlenW(key)+1) {
TRACE("[Add.Code] key: %s\n", debugstr_w(key));
- len = GetPrivateProfileStringW(add_codeW, key, NULL, sect_name, sizeof(sect_name)/sizeof(*sect_name),
+ len = GetPrivateProfileStringW(add_codeW, key, NULL, sect_name, ARRAY_SIZE(sect_name),
ctx->install_file);
if(!len) {
WARN("Could not get key value\n");
DWORD i;
HRESULT hres;
- GetTempPathW(sizeof(tmp_path)/sizeof(WCHAR), tmp_path);
+ GetTempPathW(ARRAY_SIZE(tmp_path), tmp_path);
for(i=0; !res && i < 100; i++) {
GetTempFileNameW(tmp_path, NULL, GetTickCount() + i*17037, tmp_dir);
HWND button_hwnd;
KillTimer(hwnd, ctx->timer);
- LoadStringW(urlmon_instance, IDS_AXINSTALL_INSTALL, text, sizeof(text)/sizeof(WCHAR));
+ LoadStringW(urlmon_instance, IDS_AXINSTALL_INSTALL, text, ARRAY_SIZE(text));
button_hwnd = GetDlgItem(hwnd, ID_AXINSTALL_INSTALL_BTN);
EnableWindow(button_hwnd, TRUE);
}else {
WCHAR buf[100];
- LoadStringW(urlmon_instance, IDS_AXINSTALL_INSTALLN, buf, sizeof(buf)/sizeof(WCHAR));
+ LoadStringW(urlmon_instance, IDS_AXINSTALL_INSTALLN, buf, ARRAY_SIZE(buf));
sprintfW(text, buf, ctx->counter);
}
{
WCHAR buf[1024], fmt[1024];
- LoadStringW(urlmon_instance, IDS_AXINSTALL_FAILURE, fmt, sizeof(fmt)/sizeof(WCHAR));
+ LoadStringW(urlmon_instance, IDS_AXINSTALL_FAILURE, fmt, ARRAY_SIZE(fmt));
sprintfW(buf, fmt, hres);
MessageBoxW(ctx->hwnd, buf, NULL, MB_OK);
}