mirror of
https://github.com/reactos/wine.git
synced 2025-02-18 03:48:01 +00:00
kernel32: Don't move fixed memory area in GlobalReAlloc.
This commit is contained in:
parent
4874b806f3
commit
9ab603b033
@ -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
|
||||
|
@ -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 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user