ole32: Allow SetSize to move a fixed memory block.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Dmitry Timoshkov 2020-08-11 12:49:53 +01:00 committed by Alexandre Julliard
parent 63dd874335
commit 6faa530e12
2 changed files with 1 additions and 5 deletions

View File

@ -426,7 +426,7 @@ static HRESULT WINAPI HGLOBALStreamImpl_SetSize(
/*
* Re allocate the HGlobal to fit the new size of the stream.
*/
supportHandle = GlobalReAlloc(This->handle->hglobal, libNewSize.u.LowPart, 0);
supportHandle = GlobalReAlloc(This->handle->hglobal, libNewSize.u.LowPart, GMEM_MOVEABLE);
if (supportHandle == 0)
return E_OUTOFMEMORY;

View File

@ -625,20 +625,16 @@ static void test_IStream_Clone(void)
newsize.QuadPart = 0x8000;
hr = IStream_SetSize(stream, newsize);
todo_wine
ok(hr == S_OK, "unexpected %#x\n", hr);
stream_info(stream, &hmem, &size, &pos);
ok(hmem != 0, "unexpected %p\n", hmem);
todo_wine
ok(hmem != orig_hmem, "unexpected %p\n", hmem);
todo_wine
ok(size == 0x8000, "unexpected %#x\n", size);
ok(pos == 0, "unexpected %d\n", pos);
stream_info(clone, &hmem_clone, &size, &pos);
ok(hmem_clone == hmem, "handles should match\n");
todo_wine
ok(size == 0x8000, "unexpected %#x\n", size);
ok(pos == 0, "unexpected %d\n", pos);