wine-staging/patches/ole32-HGLOBALStream/0005-ole32-Allow-moving-a-being-reallocated-block-of-memo.patch

73 lines
2.4 KiB
Diff

From b7849b3a81d2e55ccfc3d61a8a14bbacf878438b Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Tue, 2 Feb 2016 15:35:59 +0800
Subject: ole32: Allow moving a being reallocated block of memory managed by
HGLOBAL based IStream.
---
dlls/ole32/hglobalstream.c | 2 +-
dlls/ole32/tests/hglobalstream.c | 8 --------
2 files changed, 1 insertion(+), 9 deletions(-)
diff --git a/dlls/ole32/hglobalstream.c b/dlls/ole32/hglobalstream.c
index 8b7e960..3e7f67b 100644
--- a/dlls/ole32/hglobalstream.c
+++ b/dlls/ole32/hglobalstream.c
@@ -100,7 +100,7 @@ static HRESULT handle_setsize(struct handle_wrapper *handle, ULONG size)
if (handle->size != size)
{
- HGLOBAL hglobal = GlobalReAlloc(handle->hglobal, size, 0);
+ HGLOBAL hglobal = GlobalReAlloc(handle->hglobal, size, GMEM_MOVEABLE);
if (hglobal)
{
handle->hglobal = hglobal;
diff --git a/dlls/ole32/tests/hglobalstream.c b/dlls/ole32/tests/hglobalstream.c
index afda4e6..9aa3b6c 100644
--- a/dlls/ole32/tests/hglobalstream.c
+++ b/dlls/ole32/tests/hglobalstream.c
@@ -626,20 +626,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);
@@ -667,19 +663,15 @@ todo_wine
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);
-todo_wine
ok(hmem_clone != hmem, "handles should not match\n");
ok(size == 1, "unexpected %#x\n", size);
ok(pos == 0, "unexpected %d\n", pos);
--
2.7.0