Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
223c24bd
Commit
223c24bd
authored
16 years ago
by
Alexander Nicolaysen Sørnes
Committed by
Alexandre Julliard
16 years ago
Browse files
Options
Downloads
Patches
Plain Diff
regedit: Remove unneeded character conversions.
parent
f0a507e1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
programs/regedit/treeview.c
+18
-28
18 additions, 28 deletions
programs/regedit/treeview.c
with
18 additions
and
28 deletions
programs/regedit/treeview.c
+
18
−
28
View file @
223c24bd
...
...
@@ -234,9 +234,7 @@ BOOL DeleteNode(HWND hwndTV, HTREEITEM hItem)
/* Add an entry to the tree. Only give hKey for root nodes (HKEY_ constants) */
static
HTREEITEM
AddEntryToTree
(
HWND
hwndTV
,
HTREEITEM
hParent
,
LPWSTR
label
,
HKEY
hKey
,
DWORD
dwChildren
)
{
TVINSERTSTRUCT
tvins
;
CHAR
*
labelA
=
GetMultiByteString
(
label
);
HTREEITEM
ret
;
TVINSERTSTRUCTW
tvins
;
if
(
hKey
)
{
if
(
RegQueryInfoKeyW
(
hKey
,
0
,
0
,
0
,
&
dwChildren
,
0
,
0
,
0
,
0
,
0
,
0
,
0
)
!=
ERROR_SUCCESS
)
{
...
...
@@ -245,17 +243,16 @@ static HTREEITEM AddEntryToTree(HWND hwndTV, HTREEITEM hParent, LPWSTR label, HK
}
tvins
.
u
.
item
.
mask
=
TVIF_TEXT
|
TVIF_IMAGE
|
TVIF_SELECTEDIMAGE
|
TVIF_CHILDREN
|
TVIF_PARAM
;
tvins
.
u
.
item
.
pszText
=
label
A
;
tvins
.
u
.
item
.
cchTextMax
=
lstrlen
(
label
A
);
tvins
.
u
.
item
.
pszText
=
label
;
tvins
.
u
.
item
.
cchTextMax
=
lstrlen
W
(
label
);
tvins
.
u
.
item
.
iImage
=
Image_Closed
;
tvins
.
u
.
item
.
iSelectedImage
=
Image_Open
;
tvins
.
u
.
item
.
cChildren
=
dwChildren
;
tvins
.
u
.
item
.
lParam
=
(
LPARAM
)
hKey
;
tvins
.
hInsertAfter
=
(
HTREEITEM
)(
hKey
?
TVI_LAST
:
TVI_SORT
);
tvins
.
hParent
=
hParent
;
ret
=
TreeView_InsertItem
(
hwndTV
,
&
tvins
);
HeapFree
(
GetProcessHeap
(),
0
,
labelA
);
return
ret
;
return
TreeView_InsertItemW
(
hwndTV
,
&
tvins
);
}
static
BOOL
match_string
(
LPCTSTR
sstring1
,
LPCTSTR
sstring2
,
int
mode
)
...
...
@@ -395,7 +392,7 @@ static BOOL RefreshTreeItem(HWND hwndTV, HTREEITEM hItem)
LPWSTR
KeyPath
;
DWORD
dwCount
,
dwIndex
,
dwMaxSubKeyLen
;
LPWSTR
Name
;
TVITEM
tvItem
;
TVITEM
W
tvItem
;
hRoot
=
NULL
;
KeyPath
=
GetItemPathW
(
hwndTV
,
hItem
,
&
hRoot
);
...
...
@@ -421,7 +418,7 @@ static BOOL RefreshTreeItem(HWND hwndTV, HTREEITEM hItem)
tvItem
.
mask
=
TVIF_CHILDREN
;
tvItem
.
hItem
=
hItem
;
tvItem
.
cChildren
=
dwCount
;
if
(
!
TreeView_SetItem
(
hwndTV
,
&
tvItem
))
{
if
(
!
TreeView_SetItem
W
(
hwndTV
,
&
tvItem
))
{
return
FALSE
;
}
...
...
@@ -436,7 +433,7 @@ static BOOL RefreshTreeItem(HWND hwndTV, HTREEITEM hItem)
return
FALSE
;
}
tvItem
.
cchTextMax
=
dwMaxSubKeyLen
;
if
(
!
(
tvItem
.
pszText
=
HeapAlloc
(
GetProcessHeap
(),
0
,
dwMaxSubKeyLen
*
sizeof
(
T
CHAR
))))
{
if
(
!
(
tvItem
.
pszText
=
HeapAlloc
(
GetProcessHeap
(),
0
,
dwMaxSubKeyLen
*
sizeof
(
W
CHAR
))))
{
return
FALSE
;
}
...
...
@@ -444,7 +441,6 @@ static BOOL RefreshTreeItem(HWND hwndTV, HTREEITEM hItem)
for
(
dwIndex
=
0
;
dwIndex
<
dwCount
;
dwIndex
++
)
{
DWORD
cName
=
dwMaxSubKeyLen
,
dwSubCount
;
BOOL
found
;
CHAR
*
NameA
;
found
=
FALSE
;
if
(
RegEnumKeyExW
(
hKey
,
dwIndex
,
Name
,
&
cName
,
0
,
0
,
0
,
NULL
)
!=
ERROR_SUCCESS
)
{
...
...
@@ -460,27 +456,23 @@ static BOOL RefreshTreeItem(HWND hwndTV, HTREEITEM hItem)
RegCloseKey
(
hSubKey
);
}
NameA
=
GetMultiByteString
(
Name
);
/* Check if the node is already in there. */
for
(
childItem
=
TreeView_GetChild
(
hwndTV
,
hItem
);
childItem
;
childItem
=
TreeView_GetNextSibling
(
hwndTV
,
childItem
))
{
tvItem
.
mask
=
TVIF_TEXT
;
tvItem
.
hItem
=
childItem
;
if
(
!
TreeView_GetItem
(
hwndTV
,
&
tvItem
))
{
HeapFree
(
GetProcessHeap
(),
0
,
NameA
);
if
(
!
TreeView_GetItemW
(
hwndTV
,
&
tvItem
))
{
return
FALSE
;
}
if
(
!
str
i
cmp
(
tvItem
.
pszText
,
Name
A
))
{
if
(
!
l
strcmp
iW
(
tvItem
.
pszText
,
Name
))
{
found
=
TRUE
;
HeapFree
(
GetProcessHeap
(),
0
,
NameA
);
break
;
}
}
if
(
found
==
FALSE
)
{
WINE_TRACE
(
"New subkey %s
\n
"
,
Name
A
);
WINE_TRACE
(
"New subkey %s
\n
"
,
wine_dbgstr_w
(
Name
)
);
AddEntryToTree
(
hwndTV
,
hItem
,
Name
,
NULL
,
dwSubCount
);
}
}
...
...
@@ -493,7 +485,7 @@ static BOOL RefreshTreeItem(HWND hwndTV, HTREEITEM hItem)
while
(
childItem
)
{
HTREEITEM
nextItem
=
TreeView_GetNextSibling
(
hwndTV
,
childItem
);
if
(
RefreshTreeItem
(
hwndTV
,
childItem
)
==
FALSE
)
{
SendMessage
(
hwndTV
,
TVM_DELETEITEM
,
0
,
(
LPARAM
)
childItem
);
SendMessage
W
(
hwndTV
,
TVM_DELETEITEM
,
0
,
(
LPARAM
)
childItem
);
}
childItem
=
nextItem
;
}
...
...
@@ -529,9 +521,9 @@ BOOL RefreshTreeView(HWND hwndTV)
HTREEITEM
InsertNode
(
HWND
hwndTV
,
HTREEITEM
hItem
,
LPWSTR
name
)
{
T
CHAR
buf
[
MAX_NEW_KEY_LEN
];
W
CHAR
buf
[
MAX_NEW_KEY_LEN
];
HTREEITEM
hNewItem
=
0
;
TVITEMEX
item
;
TVITEMEX
W
item
;
if
(
!
hItem
)
hItem
=
TreeView_GetSelection
(
hwndTV
);
if
(
!
hItem
)
return
FALSE
;
...
...
@@ -540,22 +532,20 @@ HTREEITEM InsertNode(HWND hwndTV, HTREEITEM hItem, LPWSTR name)
}
else
{
item
.
mask
=
TVIF_CHILDREN
|
TVIF_HANDLE
;
item
.
hItem
=
hItem
;
if
(
!
TreeView_GetItem
(
hwndTV
,
&
item
))
return
FALSE
;
if
(
!
TreeView_GetItem
W
(
hwndTV
,
&
item
))
return
FALSE
;
item
.
cChildren
=
1
;
if
(
!
TreeView_SetItem
(
hwndTV
,
&
item
))
return
FALSE
;
if
(
!
TreeView_SetItem
W
(
hwndTV
,
&
item
))
return
FALSE
;
}
SendMessageW
(
hwndTV
,
TVM_EXPAND
,
TVE_EXPAND
,
(
LPARAM
)
hItem
);
if
(
!
hNewItem
)
{
char
*
nameA
=
GetMultiByteString
(
name
);
for
(
hNewItem
=
TreeView_GetChild
(
hwndTV
,
hItem
);
hNewItem
;
hNewItem
=
TreeView_GetNextSibling
(
hwndTV
,
hNewItem
))
{
item
.
mask
=
TVIF_HANDLE
|
TVIF_TEXT
;
item
.
hItem
=
hNewItem
;
item
.
pszText
=
buf
;
item
.
cchTextMax
=
COUNT_OF
(
buf
);
if
(
!
TreeView_GetItem
(
hwndTV
,
&
item
))
continue
;
if
(
lstrcmp
(
name
A
,
item
.
pszText
)
==
0
)
break
;
if
(
!
TreeView_GetItem
W
(
hwndTV
,
&
item
))
continue
;
if
(
lstrcmp
W
(
name
,
item
.
pszText
)
==
0
)
break
;
}
HeapFree
(
GetProcessHeap
(),
0
,
nameA
);
}
if
(
hNewItem
)
SendMessageW
(
hwndTV
,
TVM_SELECTITEM
,
TVGN_CARET
,
(
LPARAM
)
hNewItem
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment