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
ecdd3c8e
Commit
ecdd3c8e
authored
Jun 15, 2016
by
Hugh McMaster
Committed by
Alexandre Julliard
Jun 15, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reg: Always output the long key name when printing strings.
Signed-off-by:
Hugh McMaster
<
hugh.mcmaster@outlook.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4a22ba5b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
4 deletions
+31
-4
reg.c
programs/reg/reg.c
+31
-4
No files found.
programs/reg/reg.c
View file @
ecdd3c8e
...
...
@@ -818,7 +818,34 @@ static int reg_query(HKEY root, WCHAR *path, WCHAR *key_name, WCHAR *value_name,
return
ret
;
}
static
BOOL
parse_registry_key
(
const
WCHAR
*
key
,
HKEY
*
root
,
WCHAR
**
path
)
static
WCHAR
*
get_long_key
(
HKEY
root
,
WCHAR
*
path
)
{
DWORD
i
,
array_size
=
ARRAY_SIZE
(
root_rels
),
len
;
WCHAR
*
long_key
;
WCHAR
fmt
[]
=
{
'%'
,
's'
,
'\\'
,
'%'
,
's'
,
0
};
for
(
i
=
0
;
i
<
array_size
;
i
++
)
{
if
(
root
==
root_rels
[
i
].
key
)
break
;
}
len
=
strlenW
(
root_rels
[
i
].
long_name
);
if
(
!
path
)
{
long_key
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
len
+
1
)
*
sizeof
(
WCHAR
));
strcpyW
(
long_key
,
root_rels
[
i
].
long_name
);
return
long_key
;
}
len
+=
strlenW
(
path
)
+
1
;
/* add one for the backslash */
long_key
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
len
+
1
)
*
sizeof
(
WCHAR
));
sprintfW
(
long_key
,
fmt
,
root_rels
[
i
].
long_name
,
path
);
return
long_key
;
}
static
BOOL
parse_registry_key
(
const
WCHAR
*
key
,
HKEY
*
root
,
WCHAR
**
path
,
WCHAR
**
long_key
)
{
if
(
!
sane_path
(
key
))
return
FALSE
;
...
...
@@ -833,6 +860,8 @@ static BOOL parse_registry_key(const WCHAR *key, HKEY *root, WCHAR **path)
*
path
=
strchrW
(
key
,
'\\'
);
if
(
*
path
)
(
*
path
)
++
;
*
long_key
=
get_long_key
(
*
root
,
*
path
);
return
TRUE
;
}
...
...
@@ -924,11 +953,9 @@ int wmain(int argc, WCHAR *argvW[])
return
0
;
}
if
(
!
parse_registry_key
(
argvW
[
2
],
&
root
,
&
path
))
if
(
!
parse_registry_key
(
argvW
[
2
],
&
root
,
&
path
,
&
key_name
))
return
1
;
key_name
=
argvW
[
2
];
for
(
i
=
3
;
i
<
argc
;
i
++
)
{
if
(
argvW
[
i
][
0
]
==
'/'
||
argvW
[
i
][
0
]
==
'-'
)
...
...
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