Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
bb4a6da3
Commit
bb4a6da3
authored
Feb 25, 2019
by
Zebediah Figura
Committed by
Alexandre Julliard
Feb 26, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setupapi: Search for substituted strings in SetupFindNextMatchLine().
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
32b6ccb9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
parser.c
dlls/setupapi/parser.c
+3
-1
parser.c
dlls/setupapi/tests/parser.c
+10
-0
No files found.
dlls/setupapi/parser.c
View file @
bb4a6da3
...
...
@@ -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
=
&
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
;
...
...
dlls/setupapi/tests/parser.c
View file @
bb4a6da3
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment