Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
0c71a987
Commit
0c71a987
authored
Jul 08, 2021
by
Hugh McMaster
Committed by
Alexandre Julliard
Jul 08, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reg: Support use of registry views in the 'import' command.
Signed-off-by:
Hugh McMaster
<
hugh.mcmaster@outlook.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c2ea032a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
26 deletions
+33
-26
import.c
programs/reg/import.c
+9
-2
import.c
programs/reg/tests/import.c
+24
-24
No files found.
programs/reg/import.c
View file @
0c71a987
...
...
@@ -83,6 +83,7 @@ struct parser
WCHAR
two_wchars
[
2
];
/* first two characters from the encoding check */
BOOL
is_unicode
;
/* parsing Unicode or ASCII data */
short
int
reg_version
;
/* registry file version */
REGSAM
sam
;
/* 32-bit or 64-bit registry view (if set) */
HKEY
hkey
;
/* current registry key */
WCHAR
*
key_name
;
/* current key name */
WCHAR
*
value_name
;
/* value name */
...
...
@@ -373,7 +374,7 @@ static LONG open_key(struct parser *parser, WCHAR *path)
return
ERROR_INVALID_PARAMETER
;
res
=
RegCreateKeyExW
(
key_class
,
key_path
,
0
,
NULL
,
REG_OPTION_NON_VOLATILE
,
KEY_ALL_ACCESS
,
NULL
,
&
parser
->
hkey
,
NULL
);
KEY_ALL_ACCESS
|
parser
->
sam
,
NULL
,
&
parser
->
hkey
,
NULL
);
if
(
res
==
ERROR_SUCCESS
)
{
...
...
@@ -980,6 +981,8 @@ int reg_import(int argc, WCHAR *argvW[])
if
(
argc
>
4
)
goto
invalid
;
parser
.
sam
=
0
;
if
(
argc
==
4
)
{
WCHAR
*
str
=
argvW
[
3
];
...
...
@@ -989,7 +992,11 @@ int reg_import(int argc, WCHAR *argvW[])
str
++
;
if
(
lstrcmpiW
(
str
,
L"reg:32"
)
&&
lstrcmpiW
(
str
,
L"reg:64"
))
if
(
!
lstrcmpiW
(
str
,
L"reg:32"
))
parser
.
sam
=
KEY_WOW64_32KEY
;
else
if
(
!
lstrcmpiW
(
str
,
L"reg:64"
))
parser
.
sam
=
KEY_WOW64_64KEY
;
else
goto
invalid
;
}
...
...
programs/reg/tests/import.c
View file @
0c71a987
...
...
@@ -3728,20 +3728,20 @@ static void test_registry_view_win64(void)
run_reg_exe
(
"reg import reg5.reg /reg:32"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
todo_wine
open_key
(
HKEY_LOCAL_MACHINE
,
KEY_BASE
,
KEY_WOW64_32KEY
,
&
hkey
);
todo_wine
verify_reg
(
hkey
,
"Wine1"
,
REG_DWORD
,
&
dword
,
sizeof
(
dword
),
0
);
todo_wine
verify_reg
(
hkey
,
"Wine2"
,
REG_SZ
,
"Test Value"
,
11
,
0
);
todo_wine
verify_reg
(
hkey
,
"Wine3"
,
REG_MULTI_SZ
,
"Line concatenation
\0
"
,
20
,
0
);
todo_wine
verify_reg
(
hkey
,
""
,
REG_SZ
,
"Test"
,
5
,
0
);
todo_wine
verify_reg
(
hkey
,
"Wine4"
,
REG_EXPAND_SZ
,
"%PATH%"
,
7
,
0
);
open_key
(
HKEY_LOCAL_MACHINE
,
KEY_BASE
,
KEY_WOW64_32KEY
,
&
hkey
);
verify_reg
(
hkey
,
"Wine1"
,
REG_DWORD
,
&
dword
,
sizeof
(
dword
),
0
);
verify_reg
(
hkey
,
"Wine2"
,
REG_SZ
,
"Test Value"
,
11
,
0
);
verify_reg
(
hkey
,
"Wine3"
,
REG_MULTI_SZ
,
"Line concatenation
\0
"
,
20
,
0
);
verify_reg
(
hkey
,
""
,
REG_SZ
,
"Test"
,
5
,
0
);
verify_reg
(
hkey
,
"Wine4"
,
REG_EXPAND_SZ
,
"%PATH%"
,
7
,
0
);
todo_wine
open_key
(
hkey
,
"subkey"
,
KEY_WOW64_32KEY
,
&
subkey
);
todo_wine
verify_reg
(
subkey
,
"Empty string"
,
REG_SZ
,
""
,
1
,
0
);
todo_wine
verify_reg
(
subkey
,
NULL
,
REG_SZ
,
"Default registry value"
,
23
,
0
);
todo_wine
close_key
(
subkey
);
todo_wine
close_key
(
hkey
);
open_key
(
hkey
,
"subkey"
,
KEY_WOW64_32KEY
,
&
subkey
);
verify_reg
(
subkey
,
"Empty string"
,
REG_SZ
,
""
,
1
,
0
);
verify_reg
(
subkey
,
NULL
,
REG_SZ
,
"Default registry value"
,
23
,
0
);
close_key
(
subkey
);
close_key
(
hkey
);
todo_wine
verify_key_nonexist
(
HKEY_LOCAL_MACHINE
,
KEY_BASE
,
KEY_WOW64_64KEY
);
verify_key_nonexist
(
HKEY_LOCAL_MACHINE
,
KEY_BASE
,
KEY_WOW64_64KEY
);
delete_tree
(
HKEY_LOCAL_MACHINE
,
KEY_BASE
,
KEY_WOW64_32KEY
);
...
...
@@ -3819,20 +3819,20 @@ static void test_registry_view_wow64(void)
run_reg_exe
(
"reg import reg5.reg /reg:64"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
todo_wine
open_key
(
HKEY_LOCAL_MACHINE
,
KEY_BASE
,
KEY_WOW64_64KEY
,
&
hkey
);
todo_wine
verify_reg
(
hkey
,
"Wine1"
,
REG_DWORD
,
&
dword
,
sizeof
(
dword
),
0
);
todo_wine
verify_reg
(
hkey
,
"Wine2"
,
REG_SZ
,
"Test Value"
,
11
,
0
);
todo_wine
verify_reg
(
hkey
,
"Wine3"
,
REG_MULTI_SZ
,
"Line concatenation
\0
"
,
20
,
0
);
todo_wine
verify_reg
(
hkey
,
""
,
REG_SZ
,
"Test"
,
5
,
0
);
todo_wine
verify_reg
(
hkey
,
"Wine4"
,
REG_EXPAND_SZ
,
"%PATH%"
,
7
,
0
);
open_key
(
HKEY_LOCAL_MACHINE
,
KEY_BASE
,
KEY_WOW64_64KEY
,
&
hkey
);
verify_reg
(
hkey
,
"Wine1"
,
REG_DWORD
,
&
dword
,
sizeof
(
dword
),
0
);
verify_reg
(
hkey
,
"Wine2"
,
REG_SZ
,
"Test Value"
,
11
,
0
);
verify_reg
(
hkey
,
"Wine3"
,
REG_MULTI_SZ
,
"Line concatenation
\0
"
,
20
,
0
);
verify_reg
(
hkey
,
""
,
REG_SZ
,
"Test"
,
5
,
0
);
verify_reg
(
hkey
,
"Wine4"
,
REG_EXPAND_SZ
,
"%PATH%"
,
7
,
0
);
todo_wine
open_key
(
hkey
,
"subkey"
,
KEY_WOW64_64KEY
,
&
subkey
);
todo_wine
verify_reg
(
subkey
,
"Empty string"
,
REG_SZ
,
""
,
1
,
0
);
todo_wine
verify_reg
(
subkey
,
NULL
,
REG_SZ
,
"Default registry value"
,
23
,
0
);
todo_wine
close_key
(
subkey
);
todo_wine
close_key
(
hkey
);
open_key
(
hkey
,
"subkey"
,
KEY_WOW64_64KEY
,
&
subkey
);
verify_reg
(
subkey
,
"Empty string"
,
REG_SZ
,
""
,
1
,
0
);
verify_reg
(
subkey
,
NULL
,
REG_SZ
,
"Default registry value"
,
23
,
0
);
close_key
(
subkey
);
close_key
(
hkey
);
todo_wine
verify_key_nonexist
(
HKEY_LOCAL_MACHINE
,
KEY_BASE
,
KEY_WOW64_32KEY
);
verify_key_nonexist
(
HKEY_LOCAL_MACHINE
,
KEY_BASE
,
KEY_WOW64_32KEY
);
delete_tree
(
HKEY_LOCAL_MACHINE
,
KEY_BASE
,
KEY_WOW64_64KEY
);
...
...
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