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
5d9a4c4d
Commit
5d9a4c4d
authored
Jul 28, 2017
by
Hugh McMaster
Committed by
Alexandre Julliard
Jul 28, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
regedit: Store the data from a listview subitem in a valid memory address.
Signed-off-by:
Hugh McMaster
<
hugh.mcmaster@outlook.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
793ddc99
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
childwnd.c
programs/regedit/childwnd.c
+1
-0
listview.c
programs/regedit/listview.c
+10
-6
No files found.
programs/regedit/childwnd.c
View file @
5d9a4c4d
...
...
@@ -397,6 +397,7 @@ static int listview_notify(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam
LINE_INFO
*
info
=
(
LINE_INFO
*
)
nmlv
->
lParam
;
heap_free
(
info
->
name
);
heap_free
(
info
->
val
);
heap_free
(
info
);
break
;
}
...
...
programs/regedit/listview.c
View file @
5d9a4c4d
...
...
@@ -152,23 +152,27 @@ void format_value_data(HWND hwndLV, int index, DWORD type, void *data, DWORD siz
int
AddEntryToList
(
HWND
hwndLV
,
WCHAR
*
Name
,
DWORD
dwValType
,
void
*
ValBuf
,
DWORD
dwCount
,
int
pos
)
{
LINE_INFO
*
linfo
;
LVITEMW
item
=
{
0
};
LINE_INFO
*
linfo
;
int
index
;
linfo
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
LINE_INFO
)
+
dwCount
);
linfo
=
heap_xalloc
(
sizeof
(
LINE_INFO
)
);
linfo
->
dwValType
=
dwValType
;
linfo
->
val_len
=
dwCount
;
CopyMemory
(
&
linfo
[
1
],
ValBuf
,
dwCount
);
if
(
Name
)
{
linfo
->
name
=
heap_xalloc
((
lstrlenW
(
Name
)
+
1
)
*
sizeof
(
WCHAR
));
lstrcpyW
(
linfo
->
name
,
Name
);
}
else
}
else
linfo
->
name
=
NULL
;
if
(
ValBuf
&&
dwCount
)
{
linfo
->
name
=
NULL
;
linfo
->
val
=
heap_xalloc
(
dwCount
);
memcpy
(
&
linfo
->
val
,
ValBuf
,
dwCount
);
}
else
linfo
->
val
=
NULL
;
item
.
mask
=
LVIF_TEXT
|
LVIF_PARAM
|
LVIF_STATE
|
LVIF_IMAGE
;
item
.
iItem
=
(
pos
==
-
1
)
?
SendMessageW
(
hwndLV
,
LVM_GETITEMCOUNT
,
0
,
0
)
:
pos
;
...
...
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