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
47b2238b
Commit
47b2238b
authored
Feb 24, 2016
by
Hugh McMaster
Committed by
Alexandre Julliard
Feb 25, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reg: Add support for REG_MULTI_SZ.
Signed-off-by:
Hugh McMaster
<
hugh.mcmaster@outlook.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
786eb1a7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
22 deletions
+43
-22
reg.c
programs/reg/reg.c
+22
-1
reg.c
programs/reg/tests/reg.c
+21
-21
No files found.
programs/reg/reg.c
View file @
47b2238b
...
...
@@ -284,7 +284,28 @@ static LPBYTE get_regdata(LPWSTR data, DWORD reg_type, WCHAR separator, DWORD *r
break
;
}
case
REG_MULTI_SZ
:
/* FIXME: Needs handling */
{
int
i
,
destindex
,
len
=
strlenW
(
data
);
WCHAR
*
buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
len
+
2
)
*
sizeof
(
WCHAR
));
for
(
i
=
0
,
destindex
=
0
;
i
<
len
;
i
++
,
destindex
++
)
{
if
(
data
[
i
]
==
'\\'
&&
data
[
i
+
1
]
==
'0'
)
{
buffer
[
destindex
]
=
0
;
i
++
;
}
else
if
(
data
[
i
]
==
separator
)
buffer
[
destindex
]
=
0
;
else
buffer
[
destindex
]
=
data
[
i
];
}
buffer
[
destindex
]
=
0
;
if
(
destindex
&&
buffer
[
destindex
-
1
])
buffer
[
++
destindex
]
=
0
;
*
reg_count
=
(
destindex
+
1
)
*
sizeof
(
WCHAR
);
return
(
BYTE
*
)
buffer
;
}
default:
output_message
(
STRING_UNHANDLED_TYPE
,
reg_type
,
data
);
}
...
...
programs/reg/tests/reg.c
View file @
47b2238b
...
...
@@ -326,25 +326,25 @@ static void test_add(void)
/* REG_MULTI_SZ */
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
" /v multi0 /t REG_MULTI_SZ /d
\"
three
\\
0little
\\
0strings
\"
/f"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %u
\n
"
,
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %u, expected 0
\n
"
,
r
);
memcpy
(
buffer
,
"three
\0
little
\0
strings
\0
"
,
22
);
todo_wine
verify_reg
(
hkey
,
"multi0"
,
REG_MULTI_SZ
,
buffer
,
22
,
TODO_REG_SIZE
);
verify_reg
(
hkey
,
"multi0"
,
REG_MULTI_SZ
,
buffer
,
22
,
0
);
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
" /t REG_MULTI_SZ /v multi1 /s
\"
#
\"
/d
\"
three#little#strings
\"
/f"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %u
\n
"
,
r
);
todo_wine
verify_reg
(
hkey
,
"multi1"
,
REG_MULTI_SZ
,
buffer
,
22
,
TODO_REG_SIZE
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %u, expected 0
\n
"
,
r
);
verify_reg
(
hkey
,
"multi1"
,
REG_MULTI_SZ
,
buffer
,
22
,
0
);
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
" /t REG_MULTI_SZ /v multi2 /d
\"\"
/f"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %u
\n
"
,
r
);
todo_wine
verify_reg
(
hkey
,
"multi2"
,
REG_MULTI_SZ
,
&
buffer
[
21
],
1
,
TODO_REG_SIZE
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %u, expected 0
\n
"
,
r
);
verify_reg
(
hkey
,
"multi2"
,
REG_MULTI_SZ
,
&
buffer
[
21
],
1
,
0
);
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
" /t REG_MULTI_SZ /v multi3 /f"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %u
\n
"
,
r
);
verify_reg
(
hkey
,
"multi3"
,
REG_MULTI_SZ
,
&
buffer
[
21
],
1
,
TODO_REG_SIZE
);
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
" /t REG_MULTI_SZ /v multi4 /s
\"
#
\"
/d
\"
threelittlestrings
\"
/f"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %u
\n
"
,
r
);
todo_wine
verify_reg
(
hkey
,
"multi4"
,
REG_MULTI_SZ
,
"threelittlestrings
\0
"
,
20
,
TODO_REG_SIZE
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %u, expected 0
\n
"
,
r
);
verify_reg
(
hkey
,
"multi4"
,
REG_MULTI_SZ
,
"threelittlestrings
\0
"
,
20
,
0
);
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
" /t REG_MULTI_SZ /v multi5 /s
\"
#randomgibberish
\"
/d
\"
three#little#strings
\"
/f"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %u
\n
"
,
r
);
...
...
@@ -353,16 +353,16 @@ static void test_add(void)
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
" /t REG_MULTI_SZ /v multi7 /s
\"\"
/d
\"
three#little#strings
\"
/f"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %u
\n
"
,
r
);
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
" /t REG_MULTI_SZ /v multi8 /s
\"
#
\"
/d
\"
##
\"
/f"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %u
\n
"
,
r
);
todo_wine
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %u
\n
"
,
r
);
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
" /t REG_MULTI_SZ /v multi9 /s
\"
#
\"
/d
\"
two##strings
\"
/f"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %u
\n
"
,
r
);
todo_wine
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %u
\n
"
,
r
);
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
" /t REG_MULTI_SZ /v multi10 /s
\"
#
\"
/d
\"
#a
\"
/f"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %u
\n
"
,
r
);
todo_wine
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %u
\n
"
,
r
);
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
" /t REG_MULTI_SZ /v multi11 /s
\"
#
\"
/d
\"
a#
\"
/f"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %u
\n
"
,
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %u, expected 0
\n
"
,
r
);
buffer
[
0
]
=
'a'
;
buffer
[
1
]
=
0
;
buffer
[
2
]
=
0
;
todo_wine
verify_reg
(
hkey
,
"multi11"
,
REG_MULTI_SZ
,
buffer
,
3
,
TODO_REG_SIZE
);
verify_reg
(
hkey
,
"multi11"
,
REG_MULTI_SZ
,
buffer
,
3
,
0
);
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
" /v multi12 /t REG_MULTI_SZ /f /d"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
...
...
@@ -371,23 +371,23 @@ static void test_add(void)
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
" /v multi14 /t REG_MULTI_SZ /d
\"\\
0a
\"
/f"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %u, expected 1
\n
"
,
r
);
todo_wine
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %u, expected 1
\n
"
,
r
);
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
" /v multi15 /t REG_MULTI_SZ /d
\"
a
\\
0
\"
/f"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %u, expected 0
\n
"
,
r
);
todo_wine
verify_reg
(
hkey
,
"multi15"
,
REG_MULTI_SZ
,
buffer
,
3
,
TODO_REG_SIZE
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %u, expected 0
\n
"
,
r
);
verify_reg
(
hkey
,
"multi15"
,
REG_MULTI_SZ
,
buffer
,
3
,
0
);
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
" /t REG_MULTI_SZ /v multi16 /d
\"
two
\\
0
\\
0strings
\"
/f"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %u, expected 1
\n
"
,
r
);
todo_wine
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %u, expected 1
\n
"
,
r
);
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
" /v multi17 /t REG_MULTI_SZ /s
\"
#
\"
/d
\"
#
\"
/f"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %u, expected 0
\n
"
,
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %u, expected 0
\n
"
,
r
);
buffer
[
0
]
=
0
;
buffer
[
1
]
=
0
;
todo_wine
verify_reg
(
hkey
,
"multi17"
,
REG_MULTI_SZ
,
buffer
,
2
,
0
);
verify_reg
(
hkey
,
"multi17"
,
REG_MULTI_SZ
,
buffer
,
2
,
0
);
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
" /v multi18 /t REG_MULTI_SZ /d
\"\\
0
\"
/f"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %u, expected 0
\n
"
,
r
);
todo_wine
verify_reg
(
hkey
,
"multi18"
,
REG_MULTI_SZ
,
buffer
,
2
,
0
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %u, expected 0
\n
"
,
r
);
verify_reg
(
hkey
,
"multi18"
,
REG_MULTI_SZ
,
buffer
,
2
,
0
);
RegCloseKey
(
hkey
);
...
...
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