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
9e35dd15
Commit
9e35dd15
authored
Apr 03, 2017
by
Jakub Bartmiński
Committed by
Alexandre Julliard
Apr 11, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
regedit: Fall back to tree root on invalid path.
Signed-off-by:
Jakub Bartmiński
<
jakub.bartm@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
69608af0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
treeview.c
programs/regedit/treeview.c
+8
-4
No files found.
programs/regedit/treeview.c
View file @
9e35dd15
...
@@ -132,13 +132,16 @@ static LPWSTR get_path_component(LPCWSTR *lplpKeyName) {
...
@@ -132,13 +132,16 @@ static LPWSTR get_path_component(LPCWSTR *lplpKeyName) {
HTREEITEM
FindPathInTree
(
HWND
hwndTV
,
LPCWSTR
lpKeyName
)
{
HTREEITEM
FindPathInTree
(
HWND
hwndTV
,
LPCWSTR
lpKeyName
)
{
TVITEMEXW
tvi
;
TVITEMEXW
tvi
;
WCHAR
buf
[
261
];
/* tree view has 260 character limitation on item name */
WCHAR
buf
[
261
];
/* tree view has 260 character limitation on item name */
HTREEITEM
hItem
,
hOldItem
;
HTREEITEM
hRoot
,
hItem
,
hOldItem
;
BOOL
valid_path
;
buf
[
260
]
=
'\0'
;
buf
[
260
]
=
'\0'
;
hItem
=
(
HTREEITEM
)
SendMessageW
(
hwndTV
,
TVM_GETNEXTITEM
,
TVGN_ROOT
,
0
);
hRoot
=
(
HTREEITEM
)
SendMessageW
(
hwndTV
,
TVM_GETNEXTITEM
,
TVGN_ROOT
,
0
);
hItem
=
hRoot
;
SendMessageW
(
hwndTV
,
TVM_EXPAND
,
TVE_EXPAND
,
(
LPARAM
)
hItem
);
SendMessageW
(
hwndTV
,
TVM_EXPAND
,
TVE_EXPAND
,
(
LPARAM
)
hItem
);
hItem
=
(
HTREEITEM
)
SendMessageW
(
hwndTV
,
TVM_GETNEXTITEM
,
TVGN_CHILD
,
(
LPARAM
)
hItem
);
hItem
=
(
HTREEITEM
)
SendMessageW
(
hwndTV
,
TVM_GETNEXTITEM
,
TVGN_CHILD
,
(
LPARAM
)
hItem
);
hOldItem
=
hItem
;
hOldItem
=
hItem
;
valid_path
=
FALSE
;
while
(
1
)
{
while
(
1
)
{
LPWSTR
lpItemName
=
get_path_component
(
&
lpKeyName
);
LPWSTR
lpItemName
=
get_path_component
(
&
lpKeyName
);
...
@@ -150,6 +153,7 @@ HTREEITEM FindPathInTree(HWND hwndTV, LPCWSTR lpKeyName) {
...
@@ -150,6 +153,7 @@ HTREEITEM FindPathInTree(HWND hwndTV, LPCWSTR lpKeyName) {
tvi
.
cchTextMax
=
260
;
tvi
.
cchTextMax
=
260
;
SendMessageW
(
hwndTV
,
TVM_GETITEMW
,
0
,
(
LPARAM
)
&
tvi
);
SendMessageW
(
hwndTV
,
TVM_GETITEMW
,
0
,
(
LPARAM
)
&
tvi
);
if
(
!
lstrcmpiW
(
tvi
.
pszText
,
lpItemName
))
{
if
(
!
lstrcmpiW
(
tvi
.
pszText
,
lpItemName
))
{
valid_path
=
TRUE
;
SendMessageW
(
hwndTV
,
TVM_EXPAND
,
TVE_EXPAND
,
(
LPARAM
)
hItem
);
SendMessageW
(
hwndTV
,
TVM_EXPAND
,
TVE_EXPAND
,
(
LPARAM
)
hItem
);
if
(
!
lpKeyName
)
if
(
!
lpKeyName
)
{
{
...
@@ -164,10 +168,10 @@ HTREEITEM FindPathInTree(HWND hwndTV, LPCWSTR lpKeyName) {
...
@@ -164,10 +168,10 @@ HTREEITEM FindPathInTree(HWND hwndTV, LPCWSTR lpKeyName) {
}
}
HeapFree
(
GetProcessHeap
(),
0
,
lpItemName
);
HeapFree
(
GetProcessHeap
(),
0
,
lpItemName
);
if
(
!
hItem
)
if
(
!
hItem
)
return
hOldItem
;
return
valid_path
?
hOldItem
:
hRoot
;
}
}
else
else
return
hItem
;
return
valid_path
?
hItem
:
hRoot
;
}
}
}
}
...
...
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