mirror of
https://github.com/reactos/reactos.git
synced 2024-07-09 06:05:11 +00:00
[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:
parent
fb2bbc5649
commit
9828509db3
|
@ -1696,6 +1696,7 @@ BOOL WINAPI SetupFindNextMatchLineW( PINFCONTEXT context_in, PCWSTR key,
|
||||||
PINFCONTEXT context_out )
|
PINFCONTEXT context_out )
|
||||||
{
|
{
|
||||||
struct inf_file *file = context_in->CurrentInf;
|
struct inf_file *file = context_in->CurrentInf;
|
||||||
|
WCHAR buffer[MAX_STRING_LEN + 1];
|
||||||
struct section *section;
|
struct section *section;
|
||||||
struct line *line;
|
struct line *line;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
@ -1709,7 +1710,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++)
|
for (i = context_in->Line+1, line = §ion->lines[i]; i < section->nb_lines; i++, line++)
|
||||||
{
|
{
|
||||||
if (line->key_field == -1) continue;
|
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;
|
if (context_out != context_in) *context_out = *context_in;
|
||||||
context_out->Line = i;
|
context_out->Line = i;
|
||||||
|
|
|
@ -428,6 +428,16 @@ static void test_key_names(void)
|
||||||
ok( hinf != INVALID_HANDLE_VALUE, "line %u: open failed err %u\n", i, GetLastError() );
|
ok( hinf != INVALID_HANDLE_VALUE, "line %u: open failed err %u\n", i, GetLastError() );
|
||||||
if (hinf == INVALID_HANDLE_VALUE) continue;
|
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 );
|
ret = SetupFindFirstLineA( hinf, "Test", 0, &context );
|
||||||
ok(ret, "SetupFindFirstLineA failed: le=%u\n", GetLastError());
|
ok(ret, "SetupFindFirstLineA failed: le=%u\n", GetLastError());
|
||||||
if (!ret)
|
if (!ret)
|
||||||
|
|
|
@ -8,4 +8,4 @@ files:
|
||||||
dlls/setupapi/setupcab.c: dll/win32/setupapi/setupcab.c
|
dlls/setupapi/setupcab.c: dll/win32/setupapi/setupcab.c
|
||||||
dlls/setupapi/stringtable.c: dll/win32/setupapi/stringtable_wine.c
|
dlls/setupapi/stringtable.c: dll/win32/setupapi/stringtable_wine.c
|
||||||
tags:
|
tags:
|
||||||
wine: f703c7f22d5da5596c9abc91400191d3e12c3cbc
|
wine: bb4a6da373d7fdb4a61743ee0632298f6a2f333f
|
||||||
|
|
Loading…
Reference in a new issue