Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
b8b87e55
Commit
b8b87e55
authored
Jul 28, 2022
by
Hugh McMaster
Committed by
Alexandre Julliard
Jul 28, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
regedit: Limit REG_DWORD/REG_QWORD input length by value type and format.
parent
e604f3e2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
+15
-4
edit.c
programs/regedit/edit.c
+15
-4
No files found.
programs/regedit/edit.c
View file @
b8b87e55
...
...
@@ -184,7 +184,15 @@ static INT_PTR CALLBACK modify_string_dlgproc(HWND hwndDlg, UINT msg, WPARAM wpa
return
FALSE
;
}
static
void
change_dword_base
(
HWND
hwndDlg
,
BOOL
toHex
)
static
void
set_dword_edit_limit
(
HWND
hwndDlg
,
DWORD
type
)
{
if
(
isDecimal
)
SendDlgItemMessageW
(
hwndDlg
,
IDC_VALUE_DATA
,
EM_SETLIMITTEXT
,
type
==
REG_DWORD
?
10
:
20
,
0
);
else
SendDlgItemMessageW
(
hwndDlg
,
IDC_VALUE_DATA
,
EM_SETLIMITTEXT
,
type
==
REG_DWORD
?
8
:
16
,
0
);
}
static
void
change_dword_base
(
HWND
hwndDlg
,
BOOL
toHex
,
DWORD
type
)
{
WCHAR
buf
[
64
];
unsigned
int
len
;
...
...
@@ -204,11 +212,13 @@ static void change_dword_base(HWND hwndDlg, BOOL toHex)
}
isDecimal
=
!
toHex
;
set_dword_edit_limit
(
hwndDlg
,
type
);
}
static
INT_PTR
CALLBACK
modify_dword_dlgproc
(
HWND
hwndDlg
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
)
{
struct
edit_params
*
params
;
st
atic
st
ruct
edit_params
*
params
;
WCHAR
buf
[
64
];
int
ret
=
0
;
...
...
@@ -223,15 +233,16 @@ static INT_PTR CALLBACK modify_dword_dlgproc(HWND hwndDlg, UINT msg, WPARAM wpar
isDecimal
=
FALSE
;
if
(
params
->
type
==
REG_QWORD
&&
LoadStringW
(
GetModuleHandleW
(
0
),
IDS_EDIT_QWORD
,
buf
,
ARRAY_SIZE
(
buf
)))
SetWindowTextW
(
hwndDlg
,
buf
);
set_dword_edit_limit
(
hwndDlg
,
params
->
type
);
return
TRUE
;
case
WM_COMMAND
:
switch
(
LOWORD
(
wparam
))
{
case
IDC_DWORD_HEX
:
change_dword_base
(
hwndDlg
,
TRUE
);
change_dword_base
(
hwndDlg
,
TRUE
,
params
->
type
);
break
;
case
IDC_DWORD_DEC
:
change_dword_base
(
hwndDlg
,
FALSE
);
change_dword_base
(
hwndDlg
,
FALSE
,
params
->
type
);
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