Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/setupapi/parser.c | 4 +++- dlls/setupapi/tests/parser.c | 10 ++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/dlls/setupapi/parser.c b/dlls/setupapi/parser.c index bc5dba0454..5cde5ebcfa 100644 --- a/dlls/setupapi/parser.c +++ b/dlls/setupapi/parser.c @@ -1557,6 +1557,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; @@ -1570,7 +1571,8 @@ BOOL WINAPI SetupFindNextMatchLineW( PINFCONTEXT context_in, PCWSTR key, for (i = context_in->Line+1, line = §ion->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; diff --git a/dlls/setupapi/tests/parser.c b/dlls/setupapi/tests/parser.c index 07dcaafd55..53a497407c 100644 --- a/dlls/setupapi/tests/parser.c +++ b/dlls/setupapi/tests/parser.c @@ -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].key, "%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)
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=48254
Your paranoid android.
=== wxppro (32 bit report) ===
setupapi: 0b40:parser: unhandled exception c0000005 at 004160CD
=== w2003std (32 bit report) ===
setupapi: 06ac:parser: unhandled exception c0000005 at 004160CD
=== wvistau64 (32 bit report) ===
setupapi: 0890:parser: unhandled exception c0000005 at 004160CD
=== wvistau64_zh_CN (32 bit report) ===
setupapi: 0bb8:parser: unhandled exception c0000005 at 004160CD
=== wvistau64_fr (32 bit report) ===
setupapi: 072c:parser: unhandled exception c0000005 at 004160CD
=== wvistau64_he (32 bit report) ===
setupapi: 0bd8:parser: unhandled exception c0000005 at 004160CD
=== w2008s64 (32 bit report) ===
setupapi: 086c:parser: unhandled exception c0000005 at 004160CD
=== w7u (32 bit report) ===
setupapi: 0dfc:parser: unhandled exception c0000005 at 004160CD
=== w7pro64 (32 bit report) ===
setupapi: 0adc:parser: unhandled exception c0000005 at 004160CD
=== w8 (32 bit report) ===
setupapi: 0d40:parser: unhandled exception c0000005 at 004160CD
=== w8adm (32 bit report) ===
setupapi: 013c:parser: unhandled exception c0000005 at 004160CD
=== w864 (32 bit report) ===
setupapi: 0a24:parser: unhandled exception c0000005 at 004160CD
=== w1064 (32 bit report) ===
setupapi: 0068:parser: unhandled exception c0000005 at 004160CD
=== wvistau64 (64 bit report) ===
setupapi: 0890:parser: unhandled exception c0000005 at 0000000000411F4C
=== w2008s64 (64 bit report) ===
setupapi: 086c:parser: unhandled exception c0000005 at 0000000000411F4C
=== w7pro64 (64 bit report) ===
setupapi: 0adc:parser: unhandled exception c0000005 at 0000000000411F4C
=== w864 (64 bit report) ===
setupapi: 0a20:parser: unhandled exception c0000005 at 0000000000411F4C
=== w1064 (64 bit report) ===
setupapi: 084c:parser: unhandled exception c0000005 at 0000000000411F4C
=== debian9 (32 bit report) ===
setupapi: Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x7ed2a4db).
Report errors: setupapi:parser crashed (c0000005)
=== debian9 (32 bit French report) ===
setupapi: Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x7ed344db).
Report errors: setupapi:parser crashed (c0000005)
=== debian9 (32 bit Japanese:Japan report) ===
setupapi: Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x7ec344db).
Report errors: setupapi:parser crashed (c0000005)
=== debian9 (32 bit Chinese:China report) ===
setupapi: Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x7eb964db).
Report errors: setupapi:parser crashed (c0000005)
=== debian9 (32 bit WoW report) ===
setupapi: Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x7ed414db).
Report errors: setupapi:parser crashed (c0000005)
=== debian9 (64 bit WoW report) ===
setupapi: Unhandled exception: page fault on read access to 0x00000000 in 64-bit code (0x00007fdf21c56c17).
Report errors: setupapi:parser crashed (c0000005)