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
f43fc512
Commit
f43fc512
authored
Nov 19, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Nov 22, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernelbase: Avoid moving locked HLOCAL pointer without LMEM_MOVEABLE.
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=53474
parent
c2c65369
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
heap.c
dlls/kernel32/tests/heap.c
+3
-3
memory.c
dlls/kernelbase/memory.c
+1
-0
No files found.
dlls/kernel32/tests/heap.c
View file @
f43fc512
...
...
@@ -2451,17 +2451,17 @@ static void test_LocalAlloc(void)
tmp_mem
=
LocalReAlloc
(
mem
,
512
,
flags
);
if
(
!
(
flags
&
LMEM_MODIFY
)
&&
((
flags
&
LMEM_DISCARDABLE
)
||
!
(
flags
&
LMEM_MOVEABLE
)))
todo_wine_if
(
flags
==
LMEM_FIXED
)
ok
(
!
tmp_mem
,
"LocalReAlloc succeeded
\n
"
);
ok
(
!
tmp_mem
,
"LocalReAlloc succeeded
\n
"
);
else
ok
(
tmp_mem
==
mem
,
"LocalReAlloc returned %p, error %lu
\n
"
,
tmp_mem
,
GetLastError
()
);
entry
=
*
mem_entry_from_HANDLE
(
mem
);
if
((
flags
&
LMEM_DISCARDABLE
)
&&
(
flags
&
LMEM_MODIFY
))
expect_entry
.
flags
|=
4
;
if
(
flags
==
LMEM_MOVEABLE
)
ok
(
entry
.
ptr
!=
expect_entry
.
ptr
,
"got unexpected ptr %p
\n
"
,
entry
.
ptr
);
else
todo_wine_if
(
flags
==
LMEM_FIXED
)
ok
(
entry
.
ptr
==
expect_entry
.
ptr
,
"got ptr %p
\n
"
,
entry
.
ptr
);
else
ok
(
entry
.
ptr
==
expect_entry
.
ptr
,
"got ptr %p
\n
"
,
entry
.
ptr
);
ok
(
entry
.
flags
==
expect_entry
.
flags
,
"got flags %#Ix was %#Ix
\n
"
,
entry
.
flags
,
expect_entry
.
flags
);
size
=
LocalSize
(
mem
);
if
(
flags
==
LMEM_MOVEABLE
)
ok
(
size
==
512
,
"LocalSize returned %Iu
\n
"
,
size
);
else
todo_wine_if
(
flags
==
LMEM_FIXED
)
ok
(
size
==
10
,
"LocalSize returned %Iu
\n
"
,
size
);
else
ok
(
size
==
10
,
"LocalSize returned %Iu
\n
"
,
size
);
ret
=
LocalUnlock
(
mem
);
ok
(
!
ret
,
"LocalUnlock succeeded
\n
"
);
...
...
dlls/kernelbase/memory.c
View file @
f43fc512
...
...
@@ -1011,6 +1011,7 @@ HLOCAL WINAPI DECLSPEC_HOTPATCH LocalReAlloc( HLOCAL handle, SIZE_T size, UINT f
{
if
(
size
)
{
if
(
mem
->
lock
&&
!
(
flags
&
LMEM_MOVEABLE
))
heap_flags
|=
HEAP_REALLOC_IN_PLACE_ONLY
;
if
(
!
mem
->
ptr
)
ptr
=
HeapAlloc
(
heap
,
heap_flags
,
size
);
else
ptr
=
HeapReAlloc
(
heap
,
heap_flags
,
mem
->
ptr
,
size
);
...
...
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