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
5e2c3dd5
Commit
5e2c3dd5
authored
Jul 24, 2022
by
Hugh McMaster
Committed by
Alexandre Julliard
Jul 25, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
regedit: Update binary data via update_registry_value().
parent
bbdab496
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
22 deletions
+14
-22
edit.c
programs/regedit/edit.c
+14
-22
No files found.
programs/regedit/edit.c
View file @
5e2c3dd5
...
...
@@ -96,6 +96,11 @@ static BOOL update_registry_value(HWND hwndDlg, struct edit_params *params)
switch
(
params
->
type
)
{
case
REG_SZ
:
case
REG_EXPAND_SZ
:
params
->
data
=
buf
;
params
->
size
=
(
len
+
1
)
*
sizeof
(
WCHAR
);
break
;
case
REG_DWORD
:
params
->
size
=
sizeof
(
DWORD
);
params
->
data
=
malloc
(
params
->
size
);
...
...
@@ -129,9 +134,11 @@ static BOOL update_registry_value(HWND hwndDlg, struct edit_params *params)
params
->
size
=
j
*
sizeof
(
WCHAR
);
break
;
}
default:
/* REG_SZ, REG_EXPAND_SZ */
params
->
data
=
buf
;
params
->
size
=
(
len
+
1
)
*
sizeof
(
WCHAR
);
default:
/* hex data types */
free
(
buf
);
params
->
size
=
SendMessageW
(
hwndValue
,
HEM_GETDATA
,
0
,
0
);
params
->
data
=
malloc
(
params
->
size
);
SendMessageW
(
hwndValue
,
HEM_GETDATA
,
(
WPARAM
)
params
->
size
,
(
LPARAM
)
params
->
data
);
}
ret
=
RegSetValueExW
(
params
->
hkey
,
params
->
value_name
,
0
,
params
->
type
,
(
BYTE
*
)
params
->
data
,
params
->
size
);
...
...
@@ -224,9 +231,7 @@ static INT_PTR CALLBACK modify_dword_dlgproc(HWND hwndDlg, UINT msg, WPARAM wpar
static
INT_PTR
CALLBACK
modify_binary_dlgproc
(
HWND
hwndDlg
,
UINT
uMsg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
struct
edit_params
*
params
;
BYTE
*
data
;
LONG
size
;
LONG
lRet
;
int
ret
=
0
;
switch
(
uMsg
)
{
case
WM_INITDIALOG
:
...
...
@@ -243,23 +248,10 @@ static INT_PTR CALLBACK modify_binary_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wP
switch
(
LOWORD
(
wParam
))
{
case
IDOK
:
params
=
(
struct
edit_params
*
)
GetWindowLongPtrW
(
hwndDlg
,
DWLP_USER
);
size
=
SendDlgItemMessageW
(
hwndDlg
,
IDC_VALUE_DATA
,
HEM_GETDATA
,
0
,
0
);
data
=
malloc
(
size
);
SendDlgItemMessageW
(
hwndDlg
,
IDC_VALUE_DATA
,
HEM_GETDATA
,
(
WPARAM
)
size
,
(
LPARAM
)
data
);
lRet
=
RegSetValueExW
(
params
->
hkey
,
params
->
value_name
,
0
,
params
->
type
,
data
,
size
);
free
(
data
);
if
(
lRet
==
ERROR_SUCCESS
)
EndDialog
(
hwndDlg
,
1
);
else
{
error_code_messagebox
(
hwndDlg
,
IDS_SET_VALUE_FAILED
);
EndDialog
(
hwndDlg
,
0
);
}
return
TRUE
;
ret
=
update_registry_value
(
hwndDlg
,
params
);
/* fall through */
case
IDCANCEL
:
EndDialog
(
hwndDlg
,
0
);
EndDialog
(
hwndDlg
,
ret
);
return
TRUE
;
}
}
...
...
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