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
5d12f637
Commit
5d12f637
authored
Sep 13, 2016
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Avoid getting the heap lock inside an exception handler block.
In case of a caught exception the lock is not released. Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
cf9f1859
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
heap.c
dlls/kernel32/heap.c
+6
-6
No files found.
dlls/kernel32/heap.c
View file @
5d12f637
...
...
@@ -557,7 +557,7 @@ HGLOBAL WINAPI GlobalHandle(
/* GlobalAlloc with GMEM_MOVEABLE then magic test in HeapValidate */
/* will fail. */
if
(
ISPOINTER
(
pmem
))
{
if
(
HeapValidate
(
GetProcessHeap
(),
0
,
pmem
))
{
if
(
HeapValidate
(
GetProcessHeap
(),
HEAP_NO_SERIALIZE
,
pmem
))
{
handle
=
(
HGLOBAL
)
pmem
;
/* valid fixed block */
break
;
}
...
...
@@ -569,8 +569,8 @@ HGLOBAL WINAPI GlobalHandle(
maybe_intern
=
HANDLE_TO_INTERN
(
handle
);
if
(
maybe_intern
->
Magic
==
MAGIC_GLOBAL_USED
)
{
test
=
maybe_intern
->
Pointer
;
if
(
HeapValidate
(
GetProcessHeap
(),
0
,
(
const
char
*
)
test
-
HGLOBAL_STORAGE
)
&&
/* obj(-handle) valid arena? */
HeapValidate
(
GetProcessHeap
(),
0
,
maybe_intern
))
/* intern valid arena? */
if
(
HeapValidate
(
GetProcessHeap
(),
HEAP_NO_SERIALIZE
,
(
const
char
*
)
test
-
HGLOBAL_STORAGE
)
&&
/* obj(-handle) valid arena? */
HeapValidate
(
GetProcessHeap
(),
HEAP_NO_SERIALIZE
,
maybe_intern
))
/* intern valid arena? */
break
;
/* valid moveable block */
}
handle
=
0
;
...
...
@@ -749,7 +749,7 @@ HGLOBAL WINAPI GlobalFree(HGLOBAL hmem)
hreturned
=
0
;
if
(
ISPOINTER
(
hmem
))
/* POINTER */
{
if
(
!
HeapFree
(
GetProcessHeap
(),
0
,
hmem
))
if
(
!
HeapFree
(
GetProcessHeap
(),
HEAP_NO_SERIALIZE
,
hmem
))
{
SetLastError
(
ERROR_INVALID_HANDLE
);
hreturned
=
hmem
;
...
...
@@ -769,9 +769,9 @@ HGLOBAL WINAPI GlobalFree(HGLOBAL hmem)
/* SetLastError(ERROR_INVALID_HANDLE); */
if
(
pintern
->
Pointer
)
if
(
!
HeapFree
(
GetProcessHeap
(),
0
,
(
char
*
)(
pintern
->
Pointer
)
-
HGLOBAL_STORAGE
))
if
(
!
HeapFree
(
GetProcessHeap
(),
HEAP_NO_SERIALIZE
,
(
char
*
)(
pintern
->
Pointer
)
-
HGLOBAL_STORAGE
))
hreturned
=
hmem
;
if
(
!
HeapFree
(
GetProcessHeap
(),
0
,
pintern
))
if
(
!
HeapFree
(
GetProcessHeap
(),
HEAP_NO_SERIALIZE
,
pintern
))
hreturned
=
hmem
;
}
else
...
...
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