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
d1bc3623
Commit
d1bc3623
authored
2 years ago
by
Hugh McMaster
Committed by
Alexandre Julliard
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
regedit: Set the dlgproc value name via a function, not a global.
parent
5e2c3dd5
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/edit.c
+11
-9
11 additions, 9 deletions
programs/regedit/edit.c
with
11 additions
and
9 deletions
programs/regedit/edit.c
+
11
−
9
View file @
d1bc3623
...
...
@@ -29,7 +29,6 @@
#include
"main.h"
static
const
WCHAR
*
editValueName
;
static
BOOL
isDecimal
;
struct
edit_params
...
...
@@ -150,6 +149,14 @@ static BOOL update_registry_value(HWND hwndDlg, struct edit_params *params)
return
!
ret
;
}
static
void
set_dlgproc_value_name
(
HWND
hwndDlg
,
struct
edit_params
*
params
)
{
if
(
params
->
value_name
)
SetDlgItemTextW
(
hwndDlg
,
IDC_VALUE_NAME
,
params
->
value_name
);
else
SetDlgItemTextW
(
hwndDlg
,
IDC_VALUE_NAME
,
g_pszDefaultValueName
);
}
static
INT_PTR
CALLBACK
modify_string_dlgproc
(
HWND
hwndDlg
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
)
{
struct
edit_params
*
params
;
...
...
@@ -160,7 +167,7 @@ static INT_PTR CALLBACK modify_string_dlgproc(HWND hwndDlg, UINT msg, WPARAM wpa
case
WM_INITDIALOG
:
params
=
(
struct
edit_params
*
)
lparam
;
SetWindowLongPtrW
(
hwndDlg
,
DWLP_USER
,
(
ULONG_PTR
)
params
);
S
et
DlgItemTextW
(
hwndDlg
,
IDC_VALUE_NAME
,
editValueN
am
e
);
s
et
_dlgproc_value_name
(
hwndDlg
,
par
am
s
);
SetDlgItemTextW
(
hwndDlg
,
IDC_VALUE_DATA
,
params
->
data
);
return
TRUE
;
case
WM_COMMAND
:
...
...
@@ -200,7 +207,7 @@ static INT_PTR CALLBACK modify_dword_dlgproc(HWND hwndDlg, UINT msg, WPARAM wpar
case
WM_INITDIALOG
:
params
=
(
struct
edit_params
*
)
lparam
;
SetWindowLongPtrW
(
hwndDlg
,
DWLP_USER
,
(
ULONG_PTR
)
params
);
S
et
DlgItemTextW
(
hwndDlg
,
IDC_VALUE_NAME
,
editValueN
am
e
);
s
et
_dlgproc_value_name
(
hwndDlg
,
par
am
s
);
SetDlgItemTextW
(
hwndDlg
,
IDC_VALUE_DATA
,
params
->
data
);
CheckRadioButton
(
hwndDlg
,
IDC_DWORD_HEX
,
IDC_DWORD_DEC
,
IDC_DWORD_HEX
);
isDecimal
=
FALSE
;
...
...
@@ -237,10 +244,7 @@ static INT_PTR CALLBACK modify_binary_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wP
case
WM_INITDIALOG
:
params
=
(
struct
edit_params
*
)
lParam
;
SetWindowLongPtrW
(
hwndDlg
,
DWLP_USER
,
(
ULONG_PTR
)
params
);
if
(
params
->
value_name
)
SetDlgItemTextW
(
hwndDlg
,
IDC_VALUE_NAME
,
params
->
value_name
);
else
SetDlgItemTextW
(
hwndDlg
,
IDC_VALUE_NAME
,
g_pszDefaultValueName
);
set_dlgproc_value_name
(
hwndDlg
,
params
);
SendDlgItemMessageW
(
hwndDlg
,
IDC_VALUE_DATA
,
HEM_SETDATA
,
(
WPARAM
)
params
->
size
,
(
LPARAM
)
params
->
data
);
SendDlgItemMessageW
(
hwndDlg
,
IDC_VALUE_DATA
,
WM_SETFONT
,
(
WPARAM
)
GetStockObject
(
ANSI_FIXED_FONT
),
TRUE
);
return
TRUE
;
...
...
@@ -380,8 +384,6 @@ BOOL ModifyValue(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath, LPCWSTR valueName)
struct
edit_params
params
;
BOOL
result
=
FALSE
;
editValueName
=
valueName
?
valueName
:
g_pszDefaultValueName
;
if
(
RegOpenKeyExW
(
hKeyRoot
,
keyPath
,
0
,
KEY_READ
|
KEY_SET_VALUE
,
&
params
.
hkey
))
{
error_code_messagebox
(
hwnd
,
IDS_SET_VALUE_FAILED
);
...
...
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