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
6f485a36
Commit
6f485a36
authored
Jun 07, 2022
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
atl: Support escaped quotes in registrar scripts.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1e52895e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
7 deletions
+31
-7
registrar.c
dlls/atl/registrar.c
+12
-6
registrar.c
dlls/atl/tests/registrar.c
+19
-1
No files found.
dlls/atl/registrar.c
View file @
6f485a36
...
...
@@ -118,12 +118,18 @@ static HRESULT get_word(LPCOLESTR *str, strbuf *buf)
if
(
*
iter
==
'}'
||
*
iter
==
'='
)
{
strbuf_write
(
iter
++
,
buf
,
1
);
}
else
if
(
*
iter
==
'\''
)
{
iter2
=
++
iter
;
iter
=
wcschr
(
iter
,
'\''
);
if
(
!
iter
)
{
WARN
(
"Unexpected end of script
\n
"
);
*
str
=
iter
;
return
DISP_E_EXCEPTION
;
for
(;;)
{
iter2
=
++
iter
;
iter
=
wcschr
(
iter
,
'\''
);
if
(
!
iter
)
{
WARN
(
"Unexpected end of script
\n
"
);
*
str
=
iter
;
return
DISP_E_EXCEPTION
;
}
if
(
iter
[
1
]
!=
'\''
)
break
;
iter
++
;
strbuf_write
(
iter2
,
buf
,
iter
-
iter2
);
}
strbuf_write
(
iter2
,
buf
,
iter
-
iter2
);
iter
++
;
...
...
dlls/atl/tests/registrar.c
View file @
6f485a36
...
...
@@ -42,7 +42,9 @@ static const char textA[] =
"{
\n
"
" ForceRemove eebf73c4-50fd-478f-bbcf-db212221227a
\n
"
" {
\n
"
" val 'string' = s 'string'
\n
"
" val 'str1' = s 'string'
\n
"
" val 'str2' = s 'str
\\\"
ing'
\n
"
" val 'str3' = s 'str''ing'
\n
"
" val 'dword_quoted_dec' = d '1'
\n
"
" val 'dword_unquoted_dec' = d 1
\n
"
" val 'dword_quoted_hex' = d '0xA'
\n
"
...
...
@@ -81,6 +83,7 @@ static void test_registrar(void)
LONG
lret
;
HKEY
key
;
BYTE
bytes
[
4
];
char
buffer
[
16
];
MultiByteToWideChar
(
CP_ACP
,
0
,
textA
,
-
1
,
textW
,
count
);
hr
=
IRegistrar_StringRegister
(
registrar
,
textW
);
...
...
@@ -94,6 +97,21 @@ static void test_registrar(void)
lret
=
RegOpenKeyA
(
HKEY_CURRENT_USER
,
"eebf73c4-50fd-478f-bbcf-db212221227a"
,
&
key
);
ok
(
lret
==
ERROR_SUCCESS
,
"error %ld opening registry key
\n
"
,
lret
);
size
=
sizeof
(
buffer
);
lret
=
RegQueryValueExA
(
key
,
"str1"
,
NULL
,
NULL
,
(
BYTE
*
)
buffer
,
&
size
);
ok
(
lret
==
ERROR_SUCCESS
,
"RegQueryValueExA failed, error %ld
\n
"
,
lret
);
ok
(
!
strcmp
(
buffer
,
"string"
),
"wrong data %s
\n
"
,
debugstr_a
(
buffer
));
size
=
sizeof
(
buffer
);
lret
=
RegQueryValueExA
(
key
,
"str2"
,
NULL
,
NULL
,
(
BYTE
*
)
buffer
,
&
size
);
ok
(
lret
==
ERROR_SUCCESS
,
"RegQueryValueExA failed, error %ld
\n
"
,
lret
);
ok
(
!
strcmp
(
buffer
,
"str
\\\"
ing"
),
"wrong data %s
\n
"
,
debugstr_a
(
buffer
));
size
=
sizeof
(
buffer
);
lret
=
RegQueryValueExA
(
key
,
"str3"
,
NULL
,
NULL
,
(
BYTE
*
)
buffer
,
&
size
);
ok
(
lret
==
ERROR_SUCCESS
,
"RegQueryValueExA failed, error %ld
\n
"
,
lret
);
ok
(
!
strcmp
(
buffer
,
"str'ing"
),
"wrong data %s
\n
"
,
debugstr_a
(
buffer
));
size
=
sizeof
(
dword
);
lret
=
RegQueryValueExA
(
key
,
"dword_unquoted_hex"
,
NULL
,
NULL
,
(
BYTE
*
)
&
dword
,
&
size
);
ok
(
lret
==
ERROR_SUCCESS
,
"RegQueryValueExA failed, error %ld
\n
"
,
lret
);
...
...
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