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
9c30f3d9
Commit
9c30f3d9
authored
Jun 29, 2022
by
Hugh McMaster
Committed by
Alexandre Julliard
Jun 29, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
regedit: Pass correct data size when adding a new value via the GUI.
This bug was exposed by
3b1faf59
Signed-off-by:
Hugh McMaster
<
hugh.mcmaster@outlook.com
>
parent
bb52ed35
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
3 deletions
+23
-3
edit.c
programs/regedit/edit.c
+23
-3
No files found.
programs/regedit/edit.c
View file @
9c30f3d9
...
...
@@ -443,6 +443,7 @@ BOOL CreateValue(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath, DWORD valueType, LPW
LONG
lRet
=
ERROR_SUCCESS
;
WCHAR
newValue
[
256
];
UINT64
value
=
0
;
DWORD
size_bytes
;
BOOL
result
=
FALSE
;
int
valueNum
,
index
;
HKEY
hKey
;
...
...
@@ -466,15 +467,34 @@ BOOL CreateValue(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath, DWORD valueType, LPW
error_code_messagebox
(
hwnd
,
IDS_CREATE_VALUE_FAILED
);
goto
done
;
}
lRet
=
RegSetValueExW
(
hKey
,
valueName
,
0
,
valueType
,
(
BYTE
*
)
&
value
,
sizeof
(
value
));
switch
(
valueType
)
{
case
REG_DWORD
:
case
REG_DWORD_BIG_ENDIAN
:
size_bytes
=
sizeof
(
DWORD
);
break
;
case
REG_QWORD
:
size_bytes
=
sizeof
(
UINT64
);
break
;
case
REG_BINARY
:
size_bytes
=
0
;
break
;
case
REG_MULTI_SZ
:
size_bytes
=
2
*
sizeof
(
WCHAR
);
break
;
default:
/* REG_NONE, REG_SZ, REG_EXPAND_SZ */
size_bytes
=
sizeof
(
WCHAR
);
}
lRet
=
RegSetValueExW
(
hKey
,
valueName
,
0
,
valueType
,
(
BYTE
*
)
&
value
,
size_bytes
);
if
(
lRet
)
{
error_code_messagebox
(
hwnd
,
IDS_CREATE_VALUE_FAILED
);
goto
done
;
}
/* Add the new item to the listview */
index
=
AddEntryToList
(
g_pChildWnd
->
hListWnd
,
valueName
,
valueType
,
(
BYTE
*
)
&
value
,
size
of
(
value
)
,
-
1
);
index
=
AddEntryToList
(
g_pChildWnd
->
hListWnd
,
valueName
,
valueType
,
(
BYTE
*
)
&
value
,
size
_bytes
,
-
1
);
item
.
state
=
LVIS_FOCUSED
|
LVIS_SELECTED
;
item
.
stateMask
=
LVIS_FOCUSED
|
LVIS_SELECTED
;
SendMessageW
(
g_pChildWnd
->
hListWnd
,
LVM_SETITEMSTATE
,
index
,
(
LPARAM
)
&
item
);
...
...
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