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
b00a4b66
Commit
b00a4b66
authored
Jul 08, 2022
by
Hugh McMaster
Committed by
Alexandre Julliard
Jul 21, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
regedit: Use a separate dialog proc function for string data types.
Signed-off-by:
Hugh McMaster
<
hugh.mcmaster@outlook.com
>
parent
88462d91
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
1 deletion
+30
-1
edit.c
programs/regedit/edit.c
+30
-1
No files found.
programs/regedit/edit.c
View file @
b00a4b66
...
...
@@ -81,6 +81,35 @@ static void WINAPIV error_code_messagebox(HWND hwnd, unsigned int msg_id, ...)
va_end
(
ap
);
}
static
INT_PTR
CALLBACK
modify_string_dlgproc
(
HWND
hwndDlg
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
)
{
HWND
hwndValue
;
unsigned
int
len
;
switch
(
msg
)
{
case
WM_INITDIALOG
:
SetDlgItemTextW
(
hwndDlg
,
IDC_VALUE_NAME
,
editValueName
);
SetDlgItemTextW
(
hwndDlg
,
IDC_VALUE_DATA
,
stringValueData
);
return
TRUE
;
case
WM_COMMAND
:
switch
(
LOWORD
(
wparam
))
{
case
IDOK
:
hwndValue
=
GetDlgItem
(
hwndDlg
,
IDC_VALUE_DATA
);
len
=
GetWindowTextLengthW
(
hwndValue
);
stringValueData
=
realloc
(
stringValueData
,
(
len
+
1
)
*
sizeof
(
WCHAR
));
if
(
!
GetWindowTextW
(
hwndValue
,
stringValueData
,
len
+
1
))
*
stringValueData
=
0
;
/* fall through */
case
IDCANCEL
:
EndDialog
(
hwndDlg
,
wparam
);
return
TRUE
;
}
}
return
FALSE
;
}
static
BOOL
change_dword_base
(
HWND
hwndDlg
,
BOOL
toHex
)
{
WCHAR
buf
[
128
];
...
...
@@ -268,7 +297,7 @@ BOOL ModifyValue(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath, LPCWSTR valueName)
if
(
!
(
stringValueData
=
read_value
(
hwnd
,
hKey
,
valueName
,
&
type
,
&
len
)))
goto
done
;
if
(
(
type
==
REG_SZ
)
||
(
type
==
REG_EXPAND_SZ
)
)
{
if
(
DialogBoxW
(
0
,
MAKEINTRESOURCEW
(
IDD_EDIT_STRING
),
hwnd
,
modify_dlgproc
)
==
IDOK
)
{
if
(
DialogBoxW
(
0
,
MAKEINTRESOURCEW
(
IDD_EDIT_STRING
),
hwnd
,
modify_
string_
dlgproc
)
==
IDOK
)
{
lRet
=
RegSetValueExW
(
hKey
,
valueName
,
0
,
type
,
(
LPBYTE
)
stringValueData
,
(
lstrlenW
(
stringValueData
)
+
1
)
*
sizeof
(
WCHAR
));
if
(
lRet
==
ERROR_SUCCESS
)
result
=
TRUE
;
else
error_code_messagebox
(
hwnd
,
IDS_SET_VALUE_FAILED
);
...
...
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