[WINESYNC] setupapi: Search for substituted strings in SetupFindNextMatchLine().

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id bb4a6da373d7fdb4a61743ee0632298f6a2f333f by Zebediah Figura <z.figura12@gmail.com>
This commit is contained in:
winesync 2023-09-14 19:40:55 +02:00 committed by Hermès Bélusca-Maïto
parent fb2bbc5649
commit 9828509db3
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
3 changed files with 14 additions and 2 deletions

View file

@ -1696,6 +1696,7 @@ BOOL WINAPI SetupFindNextMatchLineW( PINFCONTEXT context_in, PCWSTR key,
PINFCONTEXT context_out )
{
struct inf_file *file = context_in->CurrentInf;
WCHAR buffer[MAX_STRING_LEN + 1];
struct section *section;
struct line *line;
unsigned int i;
@ -1709,7 +1710,8 @@ BOOL WINAPI SetupFindNextMatchLineW( PINFCONTEXT context_in, PCWSTR key,
for (i = context_in->Line+1, line = &section->lines[i]; i < section->nb_lines; i++, line++)
{
if (line->key_field == -1) continue;
if (!strcmpiW( key, file->fields[line->key_field].text ))
PARSER_string_substW( file, file->fields[line->key_field].text, buffer, ARRAY_SIZE(buffer) );
if (!strcmpiW( key, buffer ))
{
if (context_out != context_in) *context_out = *context_in;
context_out->Line = i;

View file

@ -428,6 +428,16 @@ static void test_key_names(void)
ok( hinf != INVALID_HANDLE_VALUE, "line %u: open failed err %u\n", i, GetLastError() );
if (hinf == INVALID_HANDLE_VALUE) continue;
ret = SetupFindFirstLineA( hinf, "Test", key_names[i].key, &context );
ok(ret, "Test %d: failed to find key %s\n", i, key_names[i].key);
if (!strncmp( key_names[i].data, "%foo%", strlen( "%foo%" ) ))
{
ret = SetupFindFirstLineA( hinf, "Test", "%foo%", &context );
ok(!ret, "SetupFindFirstLine() should not match unsubstituted keys\n");
ok(GetLastError() == ERROR_LINE_NOT_FOUND, "got wrong error %u\n", GetLastError());
}
ret = SetupFindFirstLineA( hinf, "Test", 0, &context );
ok(ret, "SetupFindFirstLineA failed: le=%u\n", GetLastError());
if (!ret)

View file

@ -8,4 +8,4 @@ files:
dlls/setupapi/setupcab.c: dll/win32/setupapi/setupcab.c
dlls/setupapi/stringtable.c: dll/win32/setupapi/stringtable_wine.c
tags:
wine: f703c7f22d5da5596c9abc91400191d3e12c3cbc
wine: bb4a6da373d7fdb4a61743ee0632298f6a2f333f