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
9ab603b0
Commit
9ab603b0
authored
Jun 01, 2013
by
Akihiro Sagawa
Committed by
Alexandre Julliard
Jun 03, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Don't move fixed memory area in GlobalReAlloc.
parent
4874b806
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
22 deletions
+8
-22
heap.c
dlls/kernel32/heap.c
+2
-0
heap.c
dlls/kernel32/tests/heap.c
+6
-22
No files found.
dlls/kernel32/heap.c
View file @
9ab603b0
...
...
@@ -646,6 +646,8 @@ HGLOBAL WINAPI GlobalReAlloc(
if
(
ISPOINTER
(
hmem
))
{
/* reallocate fixed memory */
if
(
!
(
flags
&
GMEM_MOVEABLE
))
heap_flags
|=
HEAP_REALLOC_IN_PLACE_ONLY
;
hnew
=
HeapReAlloc
(
GetProcessHeap
(),
heap_flags
,
hmem
,
size
);
}
else
...
...
dlls/kernel32/tests/heap.c
View file @
9ab603b0
...
...
@@ -251,17 +251,9 @@ static void test_heap(void)
gbl
=
GlobalAlloc
(
GMEM_FIXED
,
init_size
);
SetLastError
(
MAGIC_DEAD
);
hsecond
=
GlobalReAlloc
(
gbl
,
size
+
init_size
,
0
);
if
(
hsecond
!=
gbl
)
{
todo_wine
ok
(
hsecond
==
gbl
||
(
hsecond
==
NULL
&&
GetLastError
()
==
ERROR_NOT_ENOUGH_MEMORY
),
"got %p with %x (expected %p or NULL) @%ld
\n
"
,
hsecond
,
GetLastError
(),
gbl
,
size
);
GlobalFree
(
hsecond
);
}
else
{
ok
(
hsecond
==
gbl
||
(
hsecond
==
NULL
&&
GetLastError
()
==
ERROR_NOT_ENOUGH_MEMORY
),
"got %p with %x (expected %p or NULL) @%ld
\n
"
,
hsecond
,
GetLastError
(),
gbl
,
size
);
GlobalFree
(
gbl
);
}
ok
(
hsecond
==
gbl
||
(
hsecond
==
NULL
&&
GetLastError
()
==
ERROR_NOT_ENOUGH_MEMORY
),
"got %p with %x (expected %p or NULL) @%ld
\n
"
,
hsecond
,
GetLastError
(),
gbl
,
size
);
GlobalFree
(
gbl
);
}
/* GMEM_FIXED block can be relocated with GMEM_MOVEABLE */
...
...
@@ -418,17 +410,9 @@ static void test_heap(void)
gbl
=
LocalAlloc
(
LMEM_FIXED
,
init_size
);
SetLastError
(
MAGIC_DEAD
);
hsecond
=
LocalReAlloc
(
gbl
,
size
+
init_size
,
0
);
if
(
hsecond
!=
gbl
)
{
todo_wine
ok
(
hsecond
==
gbl
||
(
hsecond
==
NULL
&&
GetLastError
()
==
ERROR_NOT_ENOUGH_MEMORY
),
"got %p with %x (expected %p or NULL) @%ld
\n
"
,
hsecond
,
GetLastError
(),
gbl
,
size
);
LocalFree
(
hsecond
);
}
else
{
ok
(
hsecond
==
gbl
||
(
hsecond
==
NULL
&&
GetLastError
()
==
ERROR_NOT_ENOUGH_MEMORY
),
"got %p with %x (expected %p or NULL) @%ld
\n
"
,
hsecond
,
GetLastError
(),
gbl
,
size
);
LocalFree
(
gbl
);
}
ok
(
hsecond
==
gbl
||
(
hsecond
==
NULL
&&
GetLastError
()
==
ERROR_NOT_ENOUGH_MEMORY
),
"got %p with %x (expected %p or NULL) @%ld
\n
"
,
hsecond
,
GetLastError
(),
gbl
,
size
);
LocalFree
(
gbl
);
}
/* LMEM_FIXED memory can be relocated with LMEM_MOVEABLE */
...
...
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