per_user.bRollback = FALSE;
per_user.dwIsInstalled = 0;
- SetupGetLineTextW(NULL, hinf, field, disp_name, per_user.szDispName,
- sizeof(per_user.szDispName) / sizeof(WCHAR), &size);
+ SetupGetLineTextW(NULL, hinf, field, disp_name, per_user.szDispName, ARRAY_SIZE(per_user.szDispName), &size);
- SetupGetLineTextW(NULL, hinf, field, version, per_user.szVersion,
- sizeof(per_user.szVersion) / sizeof(WCHAR), &size);
+ SetupGetLineTextW(NULL, hinf, field, version, per_user.szVersion, ARRAY_SIZE(per_user.szVersion), &size);
if (SetupFindFirstLineW(hinf, field, is_installed, &context))
{
SetupGetIntField(&context, 1, (PINT)&per_user.dwIsInstalled);
}
- SetupGetLineTextW(NULL, hinf, field, comp_id, per_user.szCompID,
- sizeof(per_user.szCompID) / sizeof(WCHAR), &size);
+ SetupGetLineTextW(NULL, hinf, field, comp_id, per_user.szCompID, ARRAY_SIZE(per_user.szCompID), &size);
- SetupGetLineTextW(NULL, hinf, field, guid, per_user.szGUID,
- sizeof(per_user.szGUID) / sizeof(WCHAR), &size);
+ SetupGetLineTextW(NULL, hinf, field, guid, per_user.szGUID, ARRAY_SIZE(per_user.szGUID), &size);
- SetupGetLineTextW(NULL, hinf, field, locale, per_user.szLocale,
- sizeof(per_user.szLocale) / sizeof(WCHAR), &size);
+ SetupGetLineTextW(NULL, hinf, field, locale, per_user.szLocale, ARRAY_SIZE(per_user.szLocale), &size);
- SetupGetLineTextW(NULL, hinf, field, stub_path, per_user.szStub,
- sizeof(per_user.szStub) / sizeof(WCHAR), &size);
+ SetupGetLineTextW(NULL, hinf, field, stub_path, per_user.szStub, ARRAY_SIZE(per_user.szStub), &size);
return SetPerUserSecValuesW(&per_user);
}
WCHAR buffer[MAX_INF_STRING_LENGTH];
/* get OCX filename */
- if (!SetupGetStringFieldW(&context, 1, buffer,
- sizeof(buffer) / sizeof(WCHAR), NULL))
+ if (!SetupGetStringFieldW(&context, 1, buffer, ARRAY_SIZE(buffer), NULL))
continue;
hm = LoadLibraryExW(buffer, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
/* sequentially returns pointers to parameters in a parameter list
* returns NULL if the parameter is empty, e.g. one,,three */
-LPWSTR get_parameter(LPWSTR *params, WCHAR separator)
+LPWSTR get_parameter(LPWSTR *params, WCHAR separator, BOOL quoted)
{
LPWSTR token = *params;
if (!*params)
return NULL;
+ if (quoted && *token == '"')
+ {
+ WCHAR *end = strchrW(token + 1, '"');
+ if (end)
+ {
+ *end = 0;
+ *params = end + 1;
+ token = token + 1;
+ }
+ }
+
*params = strchrW(*params, separator);
if (*params)
*(*params)++ = '\0';
{
WCHAR static_buffer[200];
WCHAR *buffer = static_buffer;
- DWORD size = sizeof(static_buffer) / sizeof(WCHAR);
+ DWORD size = ARRAY_SIZE(static_buffer);
INFCONTEXT context;
HRESULT hr = E_FAIL;
RtlCreateUnicodeStringFromAsciiz(&inf, pCab->pszInf);
RtlCreateUnicodeStringFromAsciiz(§ion, pCab->pszSection);
- MultiByteToWideChar(CP_ACP, 0, pCab->szSrcPath, -1, cabinfo.szSrcPath,
- sizeof(cabinfo.szSrcPath) / sizeof(WCHAR));
+ MultiByteToWideChar(CP_ACP, 0, pCab->szSrcPath, -1, cabinfo.szSrcPath, ARRAY_SIZE(cabinfo.szSrcPath));
cabinfo.pszInf = inf.Buffer;
cabinfo.pszSection = section.Buffer;
cmdline_ptr = cmdline_copy;
lstrcpyW(cmdline_copy, cmdline);
- inf_filename = get_parameter(&cmdline_ptr, ',');
- install_sec = get_parameter(&cmdline_ptr, ',');
+ inf_filename = get_parameter(&cmdline_ptr, ',', TRUE);
+ install_sec = get_parameter(&cmdline_ptr, ',', TRUE);
- str_flags = get_parameter(&cmdline_ptr, ',');
+ str_flags = get_parameter(&cmdline_ptr, ',', TRUE);
if (str_flags)
- flags = atolW(str_flags);
+ {
+ DWORD inf_flags = atolW(str_flags);
+ if (inf_flags & LIS_QUIET) flags |= RSC_FLAG_QUIET;
+ if (inf_flags & LIS_NOGRPCONV) flags |= RSC_FLAG_NGCONV;
+ }
ZeroMemory(&info, sizeof(ADVInfo));
cmdline_ptr = cmdline_copy;
lstrcpyW(cmdline_copy, cmdline);
- cabinfo.pszInf = get_parameter(&cmdline_ptr, ',');
- cabinfo.pszSection = get_parameter(&cmdline_ptr, ',');
- cabinfo.pszCab = get_parameter(&cmdline_ptr, ',');
+ cabinfo.pszInf = get_parameter(&cmdline_ptr, ',', TRUE);
+ cabinfo.pszSection = get_parameter(&cmdline_ptr, ',', TRUE);
+ cabinfo.pszCab = get_parameter(&cmdline_ptr, ',', TRUE);
*cabinfo.szSrcPath = '\0';
- flags = get_parameter(&cmdline_ptr, ',');
+ flags = get_parameter(&cmdline_ptr, ',', TRUE);
if (flags)
cabinfo.dwFlags = atolW(flags);