* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#include <stdarg.h>
+#include <stdlib.h>
+
+#include "windef.h"
+#include "winbase.h"
+#include "winuser.h"
+#include "winreg.h"
+#include "winternl.h"
+#include "winnls.h"
+#include "setupapi.h"
+#include "advpub.h"
+#include "ole2.h"
+#include "wine/debug.h"
+#include "wine/unicode.h"
#include "advpack_private.h"
-#include <ole2.h>
+WINE_DEFAULT_DEBUG_CHANNEL(advpack);
#define SPAPI_ERROR 0xE0000000L
#define SPAPI_PREFIX 0x800F0000L
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);
{
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;
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));