Dmitry Timoshkov : ole32: Allow SetSize to move a fixed memory block.

Alexandre Julliard julliard at winehq.org
Tue Aug 11 16:26:50 CDT 2020


Module: wine
Branch: master
Commit: 6faa530e1286e40b0749adbae9ab538020bc9d8f
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=6faa530e1286e40b0749adbae9ab538020bc9d8f

Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date:   Tue Aug 11 12:49:53 2020 +0100

ole32: Allow SetSize to move a fixed memory block.

Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ole32/hglobalstream.c       | 2 +-
 dlls/ole32/tests/hglobalstream.c | 4 ----
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/dlls/ole32/hglobalstream.c b/dlls/ole32/hglobalstream.c
index ee345f6293..4590bb9c43 100644
--- a/dlls/ole32/hglobalstream.c
+++ b/dlls/ole32/hglobalstream.c
@@ -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;
diff --git a/dlls/ole32/tests/hglobalstream.c b/dlls/ole32/tests/hglobalstream.c
index 87c502dc2f..2f386914af 100644
--- a/dlls/ole32/tests/hglobalstream.c
+++ b/dlls/ole32/tests/hglobalstream.c
@@ -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);
 




More information about the wine-cvs mailing list