Merge branch 'advpack-register_ocxs_callback-at' into 'master'

advpack: Ignore lines that begin with '@' in (Un)RegisterOCXs sections.

See merge request wine/wine!4878
This commit is contained in:
Alex Henrie 2024-11-19 01:34:58 +00:00
commit f004a6759c
2 changed files with 28 additions and 1 deletions

View file

@ -128,6 +128,14 @@ static HRESULT register_ocxs_callback(HINF hinf, PCWSTR field, const void *arg)
if (!SetupGetStringFieldW(&context, 1, buffer, ARRAY_SIZE(buffer), NULL))
continue;
/* RegisterOCXs and UnRegisterOCXs sections can include lines that start with an at sign and
* do not have any discernable or documented effect */
if (buffer[0] == '@')
{
FIXME("Ignoring inf line %s\n", debugstr_w(buffer));
continue;
}
hm = LoadLibraryExW(buffer, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
if (hm)
{

View file

@ -66,7 +66,12 @@ static void create_inf_file(LPCSTR filename)
"Signature=\"$Chicago$\"\n"
"AdvancedINF=2.5\n"
"[DefaultInstall]\n"
"CheckAdminRights=1\n";
"CheckAdminRights=1\n"
"[OcxInstall]\n"
"RegisterOCXs=OCXsToRegister\n"
"[OCXsToRegister]\n"
"@foobar\n"
"@foobaz\n";
WriteFile(hf, data, sizeof(data) - 1, &dwNumberOfBytesWritten, NULL);
CloseHandle(hf);
@ -262,6 +267,19 @@ static void test_LaunchINFSectionEx(void)
DeleteFileA("test.inf");
}
static void test_RegisterOCXs(void)
{
static char section[] = "test.inf,OcxInstall,4,0";
HRESULT hr;
create_inf_file("test.inf");
hr = pLaunchINFSection(NULL, NULL, section, 0);
ok(hr == S_OK, "Expected 0, got %ld\n", hr);
DeleteFileA("test.inf");
}
START_TEST(install)
{
DWORD len;
@ -289,6 +307,7 @@ START_TEST(install)
test_RunSetupCommand();
test_LaunchINFSection();
test_LaunchINFSectionEx();
test_RegisterOCXs();
FreeLibrary(hAdvPack);
SetCurrentDirectoryA(prev_path);