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
93199da8
Commit
93199da8
authored
Jul 27, 2022
by
Hugh McMaster
Committed by
Alexandre Julliard
Jul 27, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
regedit: Use zero as a default for REG_DWORD and REG_QWORD values.
parent
89bbd132
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
8 deletions
+19
-8
edit.c
programs/regedit/edit.c
+19
-8
No files found.
programs/regedit/edit.c
View file @
93199da8
...
...
@@ -184,15 +184,26 @@ static INT_PTR CALLBACK modify_string_dlgproc(HWND hwndDlg, UINT msg, WPARAM wpa
return
FALSE
;
}
static
BOOL
change_dword_base
(
HWND
hwndDlg
,
BOOL
toHex
)
static
void
change_dword_base
(
HWND
hwndDlg
,
BOOL
toHex
)
{
WCHAR
buf
[
128
];
WCHAR
buf
[
64
];
unsigned
int
len
;
UINT64
val
;
if
(
!
GetDlgItemTextW
(
hwndDlg
,
IDC_VALUE_DATA
,
buf
,
ARRAY_SIZE
(
buf
)))
return
FALSE
;
if
(
!
swscanf
(
buf
,
toHex
?
L"%I64u"
:
L"%I64x"
,
&
val
))
return
FALSE
;
wsprintfW
(
buf
,
toHex
?
L"%I64x"
:
L"%I64u"
,
val
);
return
SetDlgItemTextW
(
hwndDlg
,
IDC_VALUE_DATA
,
buf
);
len
=
GetDlgItemTextW
(
hwndDlg
,
IDC_VALUE_DATA
,
buf
,
ARRAY_SIZE
(
buf
));
if
(
!
len
)
SetDlgItemTextW
(
hwndDlg
,
IDC_VALUE_DATA
,
L"0"
);
if
((
isDecimal
&&
!
toHex
)
||
(
!
isDecimal
&&
toHex
))
return
;
if
(
len
)
{
swscanf
(
buf
,
toHex
?
L"%I64u"
:
L"%I64x"
,
&
val
);
swprintf
(
buf
,
ARRAY_SIZE
(
buf
),
toHex
?
L"%I64x"
:
L"%I64u"
,
val
);
SetDlgItemTextW
(
hwndDlg
,
IDC_VALUE_DATA
,
buf
);
}
isDecimal
=
!
toHex
;
}
static
INT_PTR
CALLBACK
modify_dword_dlgproc
(
HWND
hwndDlg
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
)
...
...
@@ -217,10 +228,10 @@ static INT_PTR CALLBACK modify_dword_dlgproc(HWND hwndDlg, UINT msg, WPARAM wpar
switch
(
LOWORD
(
wparam
))
{
case
IDC_DWORD_HEX
:
if
(
isDecimal
&&
change_dword_base
(
hwndDlg
,
TRUE
))
isDecimal
=
FALSE
;
change_dword_base
(
hwndDlg
,
TRUE
)
;
break
;
case
IDC_DWORD_DEC
:
if
(
!
isDecimal
&&
change_dword_base
(
hwndDlg
,
FALSE
))
isDecimal
=
TRUE
;
change_dword_base
(
hwndDlg
,
FALSE
)
;
break
;
case
IDOK
:
params
=
(
struct
edit_params
*
)
GetWindowLongPtrW
(
hwndDlg
,
DWLP_USER
);
...
...
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