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
583bf6e4
Commit
583bf6e4
authored
Aug 25, 2008
by
Alexander Nicolaysen Sørnes
Committed by
Alexandre Julliard
Aug 26, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
regedit: Convert searching to Unicode.
parent
5c1fa0ee
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
23 deletions
+25
-23
framewnd.c
programs/regedit/framewnd.c
+9
-7
main.h
programs/regedit/main.h
+1
-1
treeview.c
programs/regedit/treeview.c
+15
-15
No files found.
programs/regedit/framewnd.c
View file @
583bf6e4
...
...
@@ -39,7 +39,7 @@
static
WCHAR
favoritesKey
[]
=
{
'S'
,
'o'
,
'f'
,
't'
,
'w'
,
'a'
,
'r'
,
'e'
,
'\\'
,
'M'
,
'i'
,
'c'
,
'r'
,
'o'
,
's'
,
'o'
,
'f'
,
't'
,
'\\'
,
'W'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
'\\'
,
'C'
,
'u'
,
'r'
,
'r'
,
'e'
,
'n'
,
't'
,
'V'
,
'e'
,
'r'
,
's'
,
'i'
,
'o'
,
'n'
,
'\\'
,
'A'
,
'p'
,
'p'
,
'l'
,
'e'
,
't'
,
's'
,
'\\'
,
'R'
,
'e'
,
'g'
,
'E'
,
'd'
,
'i'
,
't'
,
'\\'
,
'F'
,
'a'
,
'v'
,
'o'
,
'r'
,
'i'
,
't'
,
'e'
,
's'
,
0
};
static
BOOL
bInMenuLoop
=
FALSE
;
/* Tells us if we are in the menu loop */
static
WCHAR
favoriteName
[
128
];
static
T
CHAR
searchString
[
128
];
static
W
CHAR
searchString
[
128
];
static
int
searchMask
=
SEARCH_KEYS
|
SEARCH_VALUES
|
SEARCH_CONTENT
;
static
TCHAR
FileNameBuffer
[
_MAX_PATH
];
...
...
@@ -484,26 +484,26 @@ static INT_PTR CALLBACK find_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPA
CheckDlgButton
(
hwndDlg
,
IDC_FIND_VALUES
,
searchMask
&
SEARCH_VALUES
?
BST_CHECKED
:
BST_UNCHECKED
);
CheckDlgButton
(
hwndDlg
,
IDC_FIND_CONTENT
,
searchMask
&
SEARCH_CONTENT
?
BST_CHECKED
:
BST_UNCHECKED
);
CheckDlgButton
(
hwndDlg
,
IDC_FIND_WHOLE
,
searchMask
&
SEARCH_WHOLE
?
BST_CHECKED
:
BST_UNCHECKED
);
SendMessage
(
hwndValue
,
EM_SETLIMITTEXT
,
127
,
0
);
SetWindowText
(
hwndValue
,
searchString
);
SendMessage
W
(
hwndValue
,
EM_SETLIMITTEXT
,
127
,
0
);
SetWindowText
W
(
hwndValue
,
searchString
);
return
TRUE
;
case
WM_COMMAND
:
switch
(
LOWORD
(
wParam
))
{
case
IDC_VALUE_NAME
:
if
(
HIWORD
(
wParam
)
==
EN_UPDATE
)
{
EnableWindow
(
GetDlgItem
(
hwndDlg
,
IDOK
),
GetWindowTextLength
(
hwndValue
)
>
0
);
EnableWindow
(
GetDlgItem
(
hwndDlg
,
IDOK
),
GetWindowTextLength
W
(
hwndValue
)
>
0
);
return
TRUE
;
}
break
;
case
IDOK
:
if
(
GetWindowTextLength
(
hwndValue
)
>
0
)
{
if
(
GetWindowTextLength
W
(
hwndValue
)
>
0
)
{
int
mask
=
0
;
if
(
IsDlgButtonChecked
(
hwndDlg
,
IDC_FIND_KEYS
))
mask
|=
SEARCH_KEYS
;
if
(
IsDlgButtonChecked
(
hwndDlg
,
IDC_FIND_VALUES
))
mask
|=
SEARCH_VALUES
;
if
(
IsDlgButtonChecked
(
hwndDlg
,
IDC_FIND_CONTENT
))
mask
|=
SEARCH_CONTENT
;
if
(
IsDlgButtonChecked
(
hwndDlg
,
IDC_FIND_WHOLE
))
mask
|=
SEARCH_WHOLE
;
searchMask
=
mask
;
GetWindowText
(
hwndValue
,
searchString
,
128
);
GetWindowText
W
(
hwndValue
,
searchString
,
128
);
EndDialog
(
hwndDlg
,
IDOK
);
}
return
TRUE
;
...
...
@@ -747,7 +747,9 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
SetFocus
(
g_pChildWnd
->
hTreeWnd
);
}
}
else
{
error
(
hWnd
,
IDS_NOTFOUND
,
searchString
);
CHAR
*
searchStringA
=
GetMultiByteString
(
searchString
);
error
(
hWnd
,
IDS_NOTFOUND
,
searchStringA
);
HeapFree
(
GetProcessHeap
(),
0
,
searchStringA
);
}
}
break
;
...
...
programs/regedit/main.h
View file @
583bf6e4
...
...
@@ -137,7 +137,7 @@ extern BOOL DeleteNode(HWND hwndTV, HTREEITEM hItem);
extern
HTREEITEM
InsertNode
(
HWND
hwndTV
,
HTREEITEM
hItem
,
LPWSTR
name
);
extern
HWND
StartKeyRename
(
HWND
hwndTV
);
extern
HTREEITEM
FindPathInTree
(
HWND
hwndTV
,
LPCWSTR
lpKeyName
);
extern
HTREEITEM
FindNext
(
HWND
hwndTV
,
HTREEITEM
hItem
,
LPC
T
STR
sstring
,
int
mode
,
int
*
row
);
extern
HTREEITEM
FindNext
(
HWND
hwndTV
,
HTREEITEM
hItem
,
LPC
W
STR
sstring
,
int
mode
,
int
*
row
);
/* edit.c */
extern
BOOL
CreateKey
(
HWND
hwnd
,
HKEY
hKeyRoot
,
LPCWSTR
keyPath
,
LPWSTR
newKeyName
);
...
...
programs/regedit/treeview.c
View file @
583bf6e4
...
...
@@ -258,18 +258,18 @@ static HTREEITEM AddEntryToTree(HWND hwndTV, HTREEITEM hParent, LPWSTR label, HK
return
TreeView_InsertItemW
(
hwndTV
,
&
tvins
);
}
static
BOOL
match_string
(
LPC
TSTR
sstring1
,
LPCT
STR
sstring2
,
int
mode
)
static
BOOL
match_string
(
LPC
WSTR
sstring1
,
LPCW
STR
sstring2
,
int
mode
)
{
if
(
mode
&
SEARCH_WHOLE
)
return
!
stricmp
(
sstring1
,
sstring2
);
return
!
lstrcmpiW
(
sstring1
,
sstring2
);
else
return
NULL
!=
StrStrI
(
sstring1
,
sstring2
);
return
NULL
!=
StrStrI
W
(
sstring1
,
sstring2
);
}
static
BOOL
match_item
(
HWND
hwndTV
,
HTREEITEM
hItem
,
LPC
T
STR
sstring
,
int
mode
,
int
*
row
)
static
BOOL
match_item
(
HWND
hwndTV
,
HTREEITEM
hItem
,
LPC
W
STR
sstring
,
int
mode
,
int
*
row
)
{
TVITEM
item
;
T
CHAR
keyname
[
KEY_MAX_LEN
];
TVITEM
W
item
;
W
CHAR
keyname
[
KEY_MAX_LEN
];
item
.
mask
=
TVIF_TEXT
;
item
.
hItem
=
hItem
;
item
.
pszText
=
keyname
;
...
...
@@ -282,26 +282,26 @@ static BOOL match_item(HWND hwndTV, HTREEITEM hItem, LPCTSTR sstring, int mode,
if
(
mode
&
(
SEARCH_VALUES
|
SEARCH_CONTENT
))
{
int
i
,
adjust
;
T
CHAR
valName
[
KEY_MAX_LEN
],
*
KeyPath
;
W
CHAR
valName
[
KEY_MAX_LEN
],
*
KeyPath
;
HKEY
hKey
,
hRoot
;
DWORD
lenName
;
KeyPath
=
GetItemPath
(
hwndTV
,
hItem
,
&
hRoot
);
KeyPath
=
GetItemPath
W
(
hwndTV
,
hItem
,
&
hRoot
);
if
(
!
KeyPath
||
!
hRoot
)
return
FALSE
;
if
(
RegOpenKeyEx
(
hRoot
,
KeyPath
,
0
,
KEY_READ
,
&
hKey
)
!=
ERROR_SUCCESS
)
{
if
(
RegOpenKeyEx
W
(
hRoot
,
KeyPath
,
0
,
KEY_READ
,
&
hKey
)
!=
ERROR_SUCCESS
)
{
HeapFree
(
GetProcessHeap
(),
0
,
KeyPath
);
return
FALSE
;
}
HeapFree
(
GetProcessHeap
(),
0
,
KeyPath
);
lenName
=
KEY_MAX_LEN
;
adjust
=
0
;
/* RegEnumValue won't return empty default value, so fake it when dealing with *row,
which corresponds to list view rows, not value ids */
if
(
ERROR_SUCCESS
==
RegEnumValue
(
hKey
,
0
,
valName
,
&
lenName
,
NULL
,
NULL
,
NULL
,
NULL
)
&&
*
valName
)
if
(
ERROR_SUCCESS
==
RegEnumValue
W
(
hKey
,
0
,
valName
,
&
lenName
,
NULL
,
NULL
,
NULL
,
NULL
)
&&
*
valName
)
adjust
=
1
;
i
=
(
*
row
)
-
adjust
;
...
...
@@ -310,7 +310,7 @@ static BOOL match_item(HWND hwndTV, HTREEITEM hItem, LPCTSTR sstring, int mode,
DWORD
lenValue
=
0
,
type
=
0
;
lenName
=
KEY_MAX_LEN
;
if
(
ERROR_SUCCESS
!=
RegEnumValue
(
hKey
,
if
(
ERROR_SUCCESS
!=
RegEnumValue
W
(
hKey
,
i
,
valName
,
&
lenName
,
NULL
,
&
type
,
NULL
,
&
lenValue
))
break
;
...
...
@@ -323,9 +323,9 @@ static BOOL match_item(HWND hwndTV, HTREEITEM hItem, LPCTSTR sstring, int mode,
}
if
((
mode
&
SEARCH_CONTENT
)
&&
(
type
==
REG_EXPAND_SZ
||
type
==
REG_SZ
))
{
LP
T
STR
buffer
;
LP
W
STR
buffer
;
buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
lenValue
);
RegEnumValue
(
hKey
,
i
,
valName
,
&
lenName
,
NULL
,
&
type
,
(
LPBYTE
)
buffer
,
&
lenValue
);
RegEnumValue
W
(
hKey
,
i
,
valName
,
&
lenName
,
NULL
,
&
type
,
(
LPBYTE
)
buffer
,
&
lenValue
);
if
(
match_string
(
buffer
,
sstring
,
mode
))
{
HeapFree
(
GetProcessHeap
(),
0
,
buffer
);
RegCloseKey
(
hKey
);
...
...
@@ -342,7 +342,7 @@ static BOOL match_item(HWND hwndTV, HTREEITEM hItem, LPCTSTR sstring, int mode,
return
FALSE
;
}
HTREEITEM
FindNext
(
HWND
hwndTV
,
HTREEITEM
hItem
,
LPC
T
STR
sstring
,
int
mode
,
int
*
row
)
HTREEITEM
FindNext
(
HWND
hwndTV
,
HTREEITEM
hItem
,
LPC
W
STR
sstring
,
int
mode
,
int
*
row
)
{
HTREEITEM
hTry
,
hLast
;
...
...
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